X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=utils%2Fpb-udhcpc;h=bac16dad5dc322b8c20cd0008b9dd6fdcb7c1ebe;hp=729de080885247280aa07ee3b82b886292a5989a;hb=25e4608e9e4572b3a835f7c43a8ec9c77125f492;hpb=3b3687fc3d902adcad636fce11c9ff7216b113f9 diff --git a/utils/pb-udhcpc b/utils/pb-udhcpc index 729de08..bac16da 100644 --- a/utils/pb-udhcpc +++ b/utils/pb-udhcpc @@ -17,6 +17,7 @@ resolve_url() { if [ "$tmp" != "$file" ] then echo "$file" + return fi # Otherwise, TFTP using an appropriate host. Start with the @@ -35,11 +36,11 @@ resolve_url() { do_pxe() { basedir=$1 - params="conf@/net/${interface} method=dhcp" + params="conf@${interface} method=dhcp" # first, try by MAC - mac=$(cat /sys/class/net/$interface/address) - pb-event $params url=$basedir/$mac + mac=$(tr ':' '-' < /sys/class/$interface/address) + pb-event $params url=$basedir/01-$mac # try decreasing fragments of IP lease ip_hex=$(printf '%02X%02X%02X%02X' $(echo $ip | tr '.' ' ')) @@ -60,7 +61,7 @@ pb_add () { if [ -n "${conffile}" ] then url=$(resolve_url ${conffile}) - pb-event conf@/net/${interface} url=$url method=dhcp + pb-event conf@${interface} url=$url method=dhcp return fi @@ -95,14 +96,14 @@ pb_add () { args="root=/dev/nfs ip=any nfsroot=${k_server_ip}:${k_root_dir}" fi - pb-event add@/net/${interface} \ + pb-event add@${interface} \ name=netboot \ image=tftp://${siaddr}/${boot_file} \ args="$args" } pb_remove () { - pb-event remove@/net/${interface} name=netboot + pb-event remove@${interface} name=netboot } case "$1" in