Fix a couple of bugs in the udhcp script.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
file="$1"
# URL? use as-is.
file="$1"
# URL? use as-is.
if [ "$tmp" != "$file" ]
then
echo "$file"
if [ "$tmp" != "$file" ]
then
echo "$file"
ip_hex=$(printf '%02X%02X%02X%02X' $(echo $ip | tr '.' ' '))
for i in $(seq 8 -1 1)
do
ip_hex=$(printf '%02X%02X%02X%02X' $(echo $ip | tr '.' ' '))
for i in $(seq 8 -1 1)
do
pb-event $params url=$basedir/$frag
done
pb-event $params url=$basedir/$frag
done
# Look for an explicit config file location in the DHCP config-file
# parameter
# Look for an explicit config file location in the DHCP config-file
# parameter
+ if [ -n "${conffile}" ]
then
url=$(resolve_url ${conffile})
pb-event conf@/net/${interface} url=$url method=dhcp
then
url=$(resolve_url ${conffile})
pb-event conf@/net/${interface} url=$url method=dhcp
# Otherwise, we'll need the boot-file parameter. Looks like udhcpc
# will give us different names, depending if the parameter was in
# the header, or specified by options
# Otherwise, we'll need the boot-file parameter. Looks like udhcpc
# will give us different names, depending if the parameter was in
# the header, or specified by options
- [ -n "$bootfile" ] && bootfile=${boot_file}
+ [ -z "$bootfile" ] && bootfile=${boot_file}
if [ -z "$bootfile" ]
then
if [ -z "$bootfile" ]
then
k_root_dir=${rootpath#*:}
args=
k_root_dir=${rootpath#*:}
args=
then
[ ${k_server_ip} != ${rootpath} ] || k_server_ip=${serverid}
args="root=/dev/nfs ip=any nfsroot=${k_server_ip}:${k_root_dir}"
then
[ ${k_server_ip} != ${rootpath} ] || k_server_ip=${serverid}
args="root=/dev/nfs ip=any nfsroot=${k_server_ip}:${k_root_dir}"