Commit 08a8fa3f authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: small fixes for getting dot-config URL via DHCP

Up eth0 before trying to get URL to dot-config via DHCP (needed when switch
start without IP address)

fix missing "CONFIG_" in CONFIG_DOTCONF_SOURCE_LOCAL

run /usr/share/udhcpc/default.script when getting URL to dot-config to get
IP address to avoid another DHCP requests just to get IP.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent c268d3f0
......@@ -48,6 +48,8 @@ if [ -n "$CONFIG_DOTCONF_SOURCE_REMOTE" ] || [ -n "$CONFIG_DOTCONF_SOURCE_TRY_DH
echo "force_dhcp" > "$tmpdir"/dot-config_source
fi
# up eth0 to allow dhcp requests
ifconfig eth0 up
# let udhcpc run /wr/bin/dhcp_get_filename.sh script to get "filename"
# from DHCP (which contain url with dot-config).
/sbin/udhcpc -i eth0 -s /wr/bin/dhcp_get_filename.sh -O bootfile -o \
......@@ -112,7 +114,7 @@ if [ -n "$CONFIG_DOTCONF_SOURCE_REMOTE" ] || [ -n "$CONFIG_DOTCONF_SOURCE_TRY_DH
echo "download_error" > "$tmpdir"/dot-config_status
echo "Download error for dot-config \"$URL\", using old"
fi
elif [ -n "$DOTCONF_SOURCE_LOCAL" ]; then
elif [ -n "$CONFIG_DOTCONF_SOURCE_LOCAL" ]; then
echo "local" > "$tmpdir"/dot-config_source
echo "Using local dot-config"
else
......
......@@ -14,3 +14,6 @@ tmpdir="/tmp"
if [ -n "$boot_file" ]; then
echo $boot_file > "$tmpdir"/dot-config_source_url
fi
# run also default script
/usr/share/udhcpc/default.script $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment