diff options
author | Simon Rettberg | 2019-03-13 15:04:02 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-03-13 15:04:02 +0100 |
commit | 519740bc2ebcc40e8e61b547b2b49e26efb53bb2 (patch) | |
tree | 2fd3204ad97e6b2fb390b49e8252aaf842c76a5b | |
parent | [hardware-stats] Show warning if using nouveau (diff) | |
download | mltk-519740bc2ebcc40e8e61b547b2b49e26efb53bb2.tar.gz mltk-519740bc2ebcc40e8e61b547b2b49e26efb53bb2.tar.xz mltk-519740bc2ebcc40e8e61b547b2b49e26efb53bb2.zip |
[rootfs-stage31/dhcpc-busybox] Back to old DHCP behavior
Since the PXE spec abolished th practive of having the PXE ROM set the
uid field of the DHCP request to the system's UUID, we also shouldn't be
doing it. Make it a KCL option called dhcpuuid.
-rwxr-xr-x | core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++ | 2 | ||||
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/parse_kcl | 4 | ||||
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/setup_network | 12 |
3 files changed, 12 insertions, 6 deletions
diff --git a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++ index 4487b2c8..7d7dfc68 100755 --- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++ +++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/systemd-udhcpc++ @@ -13,7 +13,7 @@ fi primary="br0" [ -n "$SLX_BRIDGE" ] && primary="$SLX_BRIDGE" -if [ "$primary" = "$net_if" ]; then +if [ "$primary" = "$net_if" ] && [ "$SLX_NET_DHCP_UUID" = "yes" ]; then uid=$(dmidecode -s system-uuid | sed -r 's/^(..)(..)(..)(..)-(..)(..)-(..)(..)-(....)-/00\4\3\2\1\6\5\8\7\9/') if [ "${#uid}" = 34 ]; then echo "Using SMBIOS uid for DHCP" diff --git a/core/rootfs/rootfs-stage31/data/inc/parse_kcl b/core/rootfs/rootfs-stage31/data/inc/parse_kcl index e0f5a752..95f7daf5 100644 --- a/core/rootfs/rootfs-stage31/data/inc/parse_kcl +++ b/core/rootfs/rootfs-stage31/data/inc/parse_kcl @@ -47,6 +47,10 @@ for opts in ${KCL}; do GFX=amdgpu ;; radeon) GFX=radeon ;; + dhcpuuid) + USE_DHCP_UUID=yes + echo "SLX_NET_DHCP_UUID='yes'" >> "/run/config" + ;; esac done diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_network b/core/rootfs/rootfs-stage31/data/inc/setup_network index 6787027d..1f7b2ec0 100644 --- a/core/rootfs/rootfs-stage31/data/inc/setup_network +++ b/core/rootfs/rootfs-stage31/data/inc/setup_network @@ -102,10 +102,12 @@ if [ -n "$GATEWAY" ]; then echo -n "$GATEWAY" > "/run/firstgw" fi -UID=$(dmidecode -s system-uuid | sed -r 's/^(..)(..)(..)(..)-(..)(..)-(..)(..)-(....)-/00\4\3\2\1\6\5\8\7\9/') -if [ "${#UID}" = 34 ]; then - echo "Using SMBIOS UID for DHCP" - PARAM="$PARAM -x 0x3d:$UID" +if [ "$USE_DHCP_UUID" = "yes" ]; then + UID=$(dmidecode -s system-uuid | sed -r 's/^(..)(..)(..)(..)-(..)(..)-(..)(..)-(....)-/00\4\3\2\1\6\5\8\7\9/') + if [ "${#UID}" = 34 ]; then + echo "Using SMBIOS UID for DHCP" + PARAM="$PARAM -x 0x3d:$UID" + fi fi # save our variables for retry on fail ff. @@ -114,7 +116,7 @@ echo "GATEWAY=$GATEWAY" >> /run/network.conf echo "BRIDGE=$BRIDGE" >> /run/network.conf echo "UID=$UID" >> /run/network.conf -udhcpc $PARAM -x "0x3d:$UID" -O ntpsrv -O domain -O wpad -O search -t 4 -T 3 -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE" +udhcpc $PARAM -O ntpsrv -O domain -O wpad -O search -t 4 -T 3 -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE" URET=$? # udhcpc return value will be return value of this script [ -z "$CLIENTIP" ] && CLIENTIP=$(cat /run/firstip) |