)]}'
{"elements/ramdisk-base/extra-data.d/scripts/d/init-func":[{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"5f9f541a69212d426c232d4dc4930af38a4e1c09","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"function find_interface() {"},{"line_number":163,"context_line":"    local mac\u003d$1"},{"line_number":164,"context_line":"    interface\u003d`ip link show | grep -B1 -i $mac | grep mtu | awk {\u0027print $2\u0027}`"},{"line_number":165,"context_line":"    interface\u003d`echo \"${interface%:}\"`"},{"line_number":166,"context_line":"    if [ -n \"$interface\" ]; then"},{"line_number":167,"context_line":"        echo \"$interface\""}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_24e39cda","line":164,"updated":"2016-02-02 02:43:30.000000000","message":"style nit; declare these as locals (and below)\n\nbest to do \n\n local interface\n interface\u003d$(...)\n\nbecause \"local\" will hide if the command fails","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"ee74b5949c91d8392b6892591c671d39850992a6","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"function find_interface() {"},{"line_number":163,"context_line":"    local mac\u003d$1"},{"line_number":164,"context_line":"    interface\u003d`ip link show | grep -B1 -i $mac | grep mtu | awk {\u0027print $2\u0027}`"},{"line_number":165,"context_line":"    interface\u003d`echo \"${interface%:}\"`"},{"line_number":166,"context_line":"    if [ -n \"$interface\" ]; then"},{"line_number":167,"context_line":"        echo \"$interface\""}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_1c76f005","line":164,"in_reply_to":"7a5de9d1_24e39cda","updated":"2016-02-02 10:20:23.000000000","message":"Done","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"5f9f541a69212d426c232d4dc4930af38a4e1c09","unresolved":false,"context_lines":[{"line_number":162,"context_line":"function find_interface() {"},{"line_number":163,"context_line":"    local mac\u003d$1"},{"line_number":164,"context_line":"    interface\u003d`ip link show | grep -B1 -i $mac | grep mtu | awk {\u0027print $2\u0027}`"},{"line_number":165,"context_line":"    interface\u003d`echo \"${interface%:}\"`"},{"line_number":166,"context_line":"    if [ -n \"$interface\" ]; then"},{"line_number":167,"context_line":"        echo \"$interface\""},{"line_number":168,"context_line":"        return 0"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_a4d9ccf4","line":165,"updated":"2016-02-02 02:43:30.000000000","message":"you can just  foo\u003d${foo%:} and avoid the subshell here","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"ee74b5949c91d8392b6892591c671d39850992a6","unresolved":false,"context_lines":[{"line_number":162,"context_line":"function find_interface() {"},{"line_number":163,"context_line":"    local mac\u003d$1"},{"line_number":164,"context_line":"    interface\u003d`ip link show | grep -B1 -i $mac | grep mtu | awk {\u0027print $2\u0027}`"},{"line_number":165,"context_line":"    interface\u003d`echo \"${interface%:}\"`"},{"line_number":166,"context_line":"    if [ -n \"$interface\" ]; then"},{"line_number":167,"context_line":"        echo \"$interface\""},{"line_number":168,"context_line":"        return 0"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_7c528468","line":165,"in_reply_to":"7a5de9d1_a4d9ccf4","updated":"2016-02-02 10:20:23.000000000","message":"Done","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"5f9f541a69212d426c232d4dc4930af38a4e1c09","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        upper_octs\u003d${mac:0:8}"},{"line_number":174,"context_line":"        lower_octs\u003d${mac:9:16}"},{"line_number":175,"context_line":"        ib_re\u003d\"${upper_octs}:[A-F0-9][A-F0-9]:[A-F0-9][A-F0-9]:${lower_octs}\""},{"line_number":176,"context_line":"        interface\u003d`ip link show | grep -B1 -i ${ib_re} | grep mtu | \\"},{"line_number":177,"context_line":"                   awk {\u0027print $2\u0027}`"},{"line_number":178,"context_line":"        if [ -n \"$interface\" ]; then"},{"line_number":179,"context_line":"            interface\u003d`echo \"${interface%:}\"`"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_04f1c06a","line":176,"updated":"2016-02-02 02:43:30.000000000","message":"style nit; for consistency use $(","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"ee74b5949c91d8392b6892591c671d39850992a6","unresolved":false,"context_lines":[{"line_number":173,"context_line":"        upper_octs\u003d${mac:0:8}"},{"line_number":174,"context_line":"        lower_octs\u003d${mac:9:16}"},{"line_number":175,"context_line":"        ib_re\u003d\"${upper_octs}:[A-F0-9][A-F0-9]:[A-F0-9][A-F0-9]:${lower_octs}\""},{"line_number":176,"context_line":"        interface\u003d`ip link show | grep -B1 -i ${ib_re} | grep mtu | \\"},{"line_number":177,"context_line":"                   awk {\u0027print $2\u0027}`"},{"line_number":178,"context_line":"        if [ -n \"$interface\" ]; then"},{"line_number":179,"context_line":"            interface\u003d`echo \"${interface%:}\"`"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_3a4ac9ad","line":176,"in_reply_to":"7a5de9d1_04f1c06a","updated":"2016-02-02 10:20:23.000000000","message":"Done","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"5f9f541a69212d426c232d4dc4930af38a4e1c09","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                   awk {\u0027print $2\u0027}`"},{"line_number":178,"context_line":"        if [ -n \"$interface\" ]; then"},{"line_number":179,"context_line":"            interface\u003d`echo \"${interface%:}\"`"},{"line_number":180,"context_line":"            echo \"$interface\""},{"line_number":181,"context_line":"            return 0"},{"line_number":182,"context_line":"        fi"},{"line_number":183,"context_line":"        return 1"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_a4f6ac8c","line":180,"updated":"2016-02-02 02:43:30.000000000","message":"why not just \"echo ${interface:%:}\"?","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"ee74b5949c91d8392b6892591c671d39850992a6","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                   awk {\u0027print $2\u0027}`"},{"line_number":178,"context_line":"        if [ -n \"$interface\" ]; then"},{"line_number":179,"context_line":"            interface\u003d`echo \"${interface%:}\"`"},{"line_number":180,"context_line":"            echo \"$interface\""},{"line_number":181,"context_line":"            return 0"},{"line_number":182,"context_line":"        fi"},{"line_number":183,"context_line":"        return 1"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"7a5de9d1_facaf119","line":180,"in_reply_to":"7a5de9d1_a4f6ac8c","updated":"2016-02-02 10:20:23.000000000","message":"Done","commit_id":"91e2275e084bc2952f57c0bb3b52fb8a061bdf02"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"18aa132dcd1a24546dfffe042207afa9b56ab1ae","unresolved":false,"context_lines":[{"line_number":162,"context_line":"function find_interface() {"},{"line_number":163,"context_line":"    local mac\u003d$1"},{"line_number":164,"context_line":"    local interface"},{"line_number":165,"context_line":"    interface\u003d$(ip link show | grep -B1 -i $mac | grep mtu | awk {\u0027print $2\u0027})"},{"line_number":166,"context_line":"    if [ -n \"$interface\" ]; then"},{"line_number":167,"context_line":"        echo \"${interface%:}\""},{"line_number":168,"context_line":"        return 0"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"7a5de9d1_e4731214","line":165,"updated":"2016-02-02 20:20:09.000000000","message":"just for future reference, You can filter things in awk, and it is often more clear when doing so:\n\n    awk \u0027/mtu/ { print $2 }\u0027\n\nNot a negative comment, just pointing it out.","commit_id":"d1e565150d97460a894f08251a9a0643f1b00c56"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"895ea645bb609f125b4c1305e390c613ca931952","unresolved":false,"context_lines":[{"line_number":162,"context_line":"function find_interface() {"},{"line_number":163,"context_line":"    local mac\u003d$1"},{"line_number":164,"context_line":"    local interface"},{"line_number":165,"context_line":"    interface\u003d$(ip link show | grep -B1 -i $mac | grep mtu | awk {\u0027print $2\u0027})"},{"line_number":166,"context_line":"    if [ -n \"$interface\" ]; then"},{"line_number":167,"context_line":"        echo \"${interface%:}\""},{"line_number":168,"context_line":"        return 0"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"5a5ae5dd_9019f98a","line":165,"in_reply_to":"7a5de9d1_e4731214","updated":"2016-02-07 09:47:32.000000000","message":"Done","commit_id":"d1e565150d97460a894f08251a9a0643f1b00c56"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"f451224b0215167342c5bab38a631a4b523b60f6","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # Note(moshele): try to find the InfinBand interface by"},{"line_number":171,"context_line":"        # matching the InfinBand MAC upper and lower"},{"line_number":172,"context_line":"        # 3 octets to the GUID lower and upper 3 octets."},{"line_number":173,"context_line":"        upper_octs\u003d${mac:0:8}"},{"line_number":174,"context_line":"        lower_octs\u003d${mac:9:16}"},{"line_number":175,"context_line":"        ib_re\u003d\"${upper_octs}:[A-F0-9][A-F0-9]:[A-F0-9][A-F0-9]:${lower_octs}\""},{"line_number":176,"context_line":"        interface\u003d$(ip link show | grep -B1 -i ${ib_re} | grep mtu | \\"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"5a5ae5dd_01808245","line":173,"updated":"2016-02-04 02:21:22.000000000","message":"these should be locals for consistency","commit_id":"d1e565150d97460a894f08251a9a0643f1b00c56"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"895ea645bb609f125b4c1305e390c613ca931952","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        # Note(moshele): try to find the InfinBand interface by"},{"line_number":171,"context_line":"        # matching the InfinBand MAC upper and lower"},{"line_number":172,"context_line":"        # 3 octets to the GUID lower and upper 3 octets."},{"line_number":173,"context_line":"        upper_octs\u003d${mac:0:8}"},{"line_number":174,"context_line":"        lower_octs\u003d${mac:9:16}"},{"line_number":175,"context_line":"        ib_re\u003d\"${upper_octs}:[A-F0-9][A-F0-9]:[A-F0-9][A-F0-9]:${lower_octs}\""},{"line_number":176,"context_line":"        interface\u003d$(ip link show | grep -B1 -i ${ib_re} | grep mtu | \\"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"5a5ae5dd_f0a62d52","line":173,"in_reply_to":"5a5ae5dd_01808245","updated":"2016-02-07 09:47:32.000000000","message":"Done","commit_id":"d1e565150d97460a894f08251a9a0643f1b00c56"}],"elements/ramdisk-base/init.d/20-init-variables":[{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"18aa132dcd1a24546dfffe042207afa9b56ab1ae","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"readonly _BOOTIF_\u003d$(get_kernel_parameter BOOTIF)"},{"line_number":18,"context_line":"readonly _IP_\u003d$(get_kernel_parameter ip)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"if [[ $_BOOTIF_ \u003d\u003d \\20* ]]; then"},{"line_number":21,"context_line":"    MAC_ADDRESS\u003d$(echo \"$_BOOTIF_\" | sed -e \"s/-/:/g\" | \\"},{"line_number":22,"context_line":"                  sed -e \"s/^20://g\" | tr \u0027a-f\u0027 \u0027A-F\u0027)"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"7a5de9d1_c4761606","line":19,"updated":"2016-02-02 20:20:09.000000000","message":"Since there are two now, it would be good to have a comment here with two intended examples. It\u0027s quite hard to follow what this is actually looking for otherwise.","commit_id":"d1e565150d97460a894f08251a9a0643f1b00c56"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"895ea645bb609f125b4c1305e390c613ca931952","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"readonly _BOOTIF_\u003d$(get_kernel_parameter BOOTIF)"},{"line_number":18,"context_line":"readonly _IP_\u003d$(get_kernel_parameter ip)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"if [[ $_BOOTIF_ \u003d\u003d \\20* ]]; then"},{"line_number":21,"context_line":"    MAC_ADDRESS\u003d$(echo \"$_BOOTIF_\" | sed -e \"s/-/:/g\" | \\"},{"line_number":22,"context_line":"                  sed -e \"s/^20://g\" | tr \u0027a-f\u0027 \u0027A-F\u0027)"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"5a5ae5dd_3780e0f4","line":19,"in_reply_to":"7a5de9d1_c4761606","updated":"2016-02-07 09:47:32.000000000","message":"Done","commit_id":"d1e565150d97460a894f08251a9a0643f1b00c56"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"c2a6d96c9395296c35e012555bea79b5d9e00774","unresolved":false,"context_lines":[{"line_number":18,"context_line":"readonly _IP_\u003d$(get_kernel_parameter ip)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"if [[ $_BOOTIF_ \u003d\u003d \\20* \u0026\u0026 ${#_BOOTIF_} \u003d\u003d 20 ]]; then"},{"line_number":22,"context_line":"    # InfiniBand BOOTIF start with 20: contains the InfiniBand MAC"},{"line_number":23,"context_line":"    # For example InfiniBand GID:"},{"line_number":24,"context_line":"    # 80:00:02:08:fe:80:00:00:00:00:00:00:f4:52:14:03:00:3a:16:b1"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"5a5ae5dd_3a1be0cb","line":21,"updated":"2016-02-08 01:13:43.000000000","message":"just want to clarify what you mean here ... so \"if _BOOTIF_ starst with 20 and is 20 chars long\"?\n\nwhy the quote there on \\20*?","commit_id":"6a660431f9dccf76f700046259344813618ca3c0"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"be9db58532b2a921d2ac8f80442d1c914edb0fc2","unresolved":false,"context_lines":[{"line_number":18,"context_line":"readonly _IP_\u003d$(get_kernel_parameter ip)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"if [[ $_BOOTIF_ \u003d\u003d \\20* \u0026\u0026 ${#_BOOTIF_} \u003d\u003d 20 ]]; then"},{"line_number":22,"context_line":"    # InfiniBand BOOTIF start with 20: contains the InfiniBand MAC"},{"line_number":23,"context_line":"    # For example InfiniBand GID:"},{"line_number":24,"context_line":"    # 80:00:02:08:fe:80:00:00:00:00:00:00:f4:52:14:03:00:3a:16:b1"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"5a5ae5dd_8e53b116","line":21,"in_reply_to":"5a5ae5dd_3a1be0cb","updated":"2016-02-08 09:43:10.000000000","message":"yes exactly if  _BOOTIF_ starts with 20 and it is 20 chars \nwe go into the the infiniband case\nI not sure Iunderstand the second question, the start with 20 taken from http://stackoverflow.com/questions/2172352/in-bash-how-can-i-check-if-a-string-begins-with-some-value","commit_id":"6a660431f9dccf76f700046259344813618ca3c0"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"c69915f5833f8164369f8143891e7c2f472a9d6f","unresolved":false,"context_lines":[{"line_number":18,"context_line":"readonly _IP_\u003d$(get_kernel_parameter ip)"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"if [[ $_BOOTIF_ \u003d\u003d \\20* \u0026\u0026 ${#_BOOTIF_} \u003d\u003d 20 ]]; then"},{"line_number":22,"context_line":"    # InfiniBand BOOTIF start with 20: contains the InfiniBand MAC"},{"line_number":23,"context_line":"    # For example InfiniBand GID:"},{"line_number":24,"context_line":"    # 80:00:02:08:fe:80:00:00:00:00:00:00:f4:52:14:03:00:3a:16:b1"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"5a5ae5dd_0e4a2f56","line":21,"in_reply_to":"5a5ae5dd_8e53b116","updated":"2016-02-08 23:19:05.000000000","message":"Ok, it\u0027s a minor nit but the \"\\20*\" is confusing because, like I did, everyone reading it will think the \"\\\" is something special and wonder what\u0027s going on.\n\nI\u0027d prefer to see a regex match, as that\u0027s totally clear\n\n  [[ $_BOOTIF_ \u003d~ ^20.* \u0026\u0026 ${#_BOOTIF_} \u003d\u003d 20 ]];\n\nshould be fine","commit_id":"6a660431f9dccf76f700046259344813618ca3c0"}]}
