diff options
author | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2024-07-01 20:56:47 +0000 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2024-07-04 08:57:19 +0000 |
commit | 112e28698fdb41813a2a8ae70b8c3cb321ff46da (patch) | |
tree | 929fdd1029093d1940b760ec23b482a66118bdc0 | |
parent | bc3b1ba1da857bece544da53f1de3838d23ac206 (diff) |
netboot: Deploy drop-in for systemd-network-generator.service
Disable the systemd-network-generator with a drop-in when nbd.server is set
on the kernel cmdline.
Also extend options passed to connmand with known renamed interface names.
Bug-AGL: SPEC-5196
Change-Id: Ia81096262c407f48e801ec4858c4043398b67baa
Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/30056
Tested-by: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account
ci-image-build: Jenkins Job builder account
(cherry picked from commit 2621bffb0bd9f4099857630fb5ca3802d3f7748f)
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/30021
-rw-r--r-- | meta-netboot/recipes-core/initramfs-netboot/files/init.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta-netboot/recipes-core/initramfs-netboot/files/init.sh b/meta-netboot/recipes-core/initramfs-netboot/files/init.sh index 87a1acb80..4a4af3180 100644 --- a/meta-netboot/recipes-core/initramfs-netboot/files/init.sh +++ b/meta-netboot/recipes-core/initramfs-netboot/files/init.sh @@ -144,12 +144,21 @@ pivot_root . boot/initramfs || bail_out "pivot_root failed." if [[ -f /lib/systemd/system/connman.service ]]; then newopts="-r -n" iface=$(find_active_interface) - [[ -n "$iface" ]] && newopts="$newopts -I $iface" + # beside discovered iface, also ignore known renames + [[ -n "$iface" ]] && newopts="$newopts -I ${iface},enp2s0,enp3s0,end0,enp0s2,enp0s1 " log_info "Adjusting Connman command line. Will be: 'connmand $newopts'" sed -i "s|connmand -n\$|connmand $newopts|g" /lib/systemd/system/connman.service fi +# workaround for systemd-network-generator bringing the interface up/down/up +if [[ -f /usr/lib/systemd/system/systemd-network-generator.service ]] ; then + mkdir /etc/systemd/system/systemd-network-generator.service.d/ + echo "[Unit]" > /etc/systemd/system/systemd-network-generator.service.d/10_disable_nbd.conf + echo "ConditionKernelCommandLine=!nbd.server" >> /etc/systemd/system/systemd-network-generator.service.d/10_disable_nbd.conf +fi + + # also use /proc/net/pnp to generate /etc/resolv.conf rm -f /etc/resolv.conf grep -v bootserver /proc/net/pnp | sed 's/^domain/search/g' >/etc/resolv.conf |