]> git.ozlabs.org Git - petitboot/blobdiff - utils/pb-udhcpc
discover/platform-powerpc: Remove unused max_partition_size
[petitboot] / utils / pb-udhcpc
index 714d5b4c74200feebaaec4ee2076794a327b8bbf..4495266e4614ee31bd6cf3068acf15e591300b06 100644 (file)
@@ -14,7 +14,7 @@ pb_add () {
        # parameter was in the header, or specified by options
        [ -z "$bootfile" ] && bootfile=${boot_file}
 
-       mac=$(< /sys/class/net/$interface/address)
+       mac=$(cat /sys/class/net/$interface/address)
        paramstr=''
 
        # Collect relevant DHCP response parameters into $paramstr
@@ -27,19 +27,20 @@ pb_add () {
                paramstr="$paramstr $name=$value"
        done
 
-       pb-event dhcp@{interface} $paramstr
+       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