X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=utils%2Fpb-udhcpc;h=1b705cc955baef1dbe203642f76f5b041249f711;hp=f0703ae6df75ff55ba1ac3b9bd897a92afb956ac;hb=f5fb1751ec92110669a039bb0de209bffe74538a;hpb=416647ec10a0ca505de35348620391fde80043c0 diff --git a/utils/pb-udhcpc b/utils/pb-udhcpc index f0703ae..1b705cc 100644 --- a/utils/pb-udhcpc +++ b/utils/pb-udhcpc @@ -18,8 +18,8 @@ pb_add () { paramstr='' # Collect relevant DHCP response parameters into $paramstr - for name in pxeconffile pxepathprefix bootfile mac ip siaddr \ - serverid tftp + for name in pxeconffile pxepathprefix reboottime bootfile mac ip \ + siaddr serverid tftp ipv6 bootfile_url bootfile_param do value=$(eval "echo \${$name}") [ -n "$value" ] || continue; @@ -29,17 +29,18 @@ pb_add () { pb-event dhcp@${interface} $paramstr - # Check if an explicit config file present - if [ -n "${conffile}" ] + # Check if an explicit boot file present. If there is, add it as + # an option directly. + if [ -z "${bootfile}" ] then return; fi - # Finally, add an option for the boot_file parameter - paramstr='name=netboot' + paramstr="" - # Collect relevant parameters to add an option to the boot_file parameter - for name in rootpath siaddr boot_file + # Collect relevant parameters to add an option to the bootfile + # parameter + for name in rootpath siaddr bootfile mac do value=$(eval "echo \${$name}") [ -n "$value" ] || continue; @@ -47,11 +48,13 @@ pb_add () { paramstr="$paramstr $name=$value" done - pb-event add@${interface} $paramstr + pb-event add@${interface} name="netboot $interface ($bootfile)" \ + $paramstr } pb_remove () { - pb-event remove@${interface} name=netboot + mac=$(cat /sys/class/net/$interface/address) + pb-event remove@${interface} mac=$mac } case "$1" in