From 54765fd2f43e43d5b2dc25e8b4cff598e9095327 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 29 May 2017 18:55:53 +0100 Subject: [PATCH] Remove dracut-network element This element has not been functioning correctly for some time due to an incorrect path to select-boot-kernel-initrd (should be /usr/local/bin). The dracut-regenerate element can be used to regenerate dracut ramdisks and is more flexible than this element. Change-Id: I33d555ffd4a92b2948b2ea4a66b151f0422ccb8c Closes-Bug: #1688546 --- .../elements/dracut-network/README.rst | 4 +++- .../dracut-network/dracut-029-netgen.patch | 19 ---------------- .../dracut-network/dracut-write-ifcfg.patch | 20 ----------------- .../elements/dracut-network/element-deps | 2 -- .../finalise.d/98-regenerate-initramfs | 13 ----------- .../dracut-network/install.d/11-patch-dracut | 22 ------------------- .../dracut-network/package-installs.yaml | 2 -- .../dracut-network-adaabf90da9f6866.yaml | 4 ++++ 8 files changed, 7 insertions(+), 79 deletions(-) delete mode 100644 diskimage_builder/elements/dracut-network/dracut-029-netgen.patch delete mode 100644 diskimage_builder/elements/dracut-network/dracut-write-ifcfg.patch delete mode 100644 diskimage_builder/elements/dracut-network/element-deps delete mode 100755 diskimage_builder/elements/dracut-network/finalise.d/98-regenerate-initramfs delete mode 100755 diskimage_builder/elements/dracut-network/install.d/11-patch-dracut delete mode 100644 diskimage_builder/elements/dracut-network/package-installs.yaml create mode 100644 releasenotes/notes/dracut-network-adaabf90da9f6866.yaml diff --git a/diskimage_builder/elements/dracut-network/README.rst b/diskimage_builder/elements/dracut-network/README.rst index a02bc677..cc83bac9 100644 --- a/diskimage_builder/elements/dracut-network/README.rst +++ b/diskimage_builder/elements/dracut-network/README.rst @@ -1,4 +1,6 @@ ============== dracut-network ============== -Extends dracut and build an initramfs with network support. + +This element was removed in the Pike cycle. Please consider using the +dracut-regenerate element instead. diff --git a/diskimage_builder/elements/dracut-network/dracut-029-netgen.patch b/diskimage_builder/elements/dracut-network/dracut-029-netgen.patch deleted file mode 100644 index dcd9a08b..00000000 --- a/diskimage_builder/elements/dracut-network/dracut-029-netgen.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh -index f6b7d9a..31cd1e6 100755 ---- a/modules.d/40network/net-genrules.sh -+++ b/modules.d/40network/net-genrules.sh -@@ -74,7 +74,13 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh - done - echo 'LABEL="net_end"' - -- for iface in $MASTER_IFACES; do -+ if [ -n "$MASTER_IFACES" ]; then -+ wait_ifaces=$MASTER_IFACES -+ else -+ wait_ifaces=$IFACES -+ fi -+ -+ for iface in $wait_ifaces; do - if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then - echo "[ -f /tmp/setup_net_${iface}.ok ]" >$hookdir/initqueue/finished/wait-$iface.sh - fi diff --git a/diskimage_builder/elements/dracut-network/dracut-write-ifcfg.patch b/diskimage_builder/elements/dracut-network/dracut-write-ifcfg.patch deleted file mode 100644 index 1baf6040..00000000 --- a/diskimage_builder/elements/dracut-network/dracut-write-ifcfg.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- usr/lib/dracut/hooks/pre-pivot/85-write-ifcfg.sh 2013-05-30 14:01:37.492519066 +0000 -+++ /85-write-ifcfg.sh 2013-05-30 14:03:09.832519065 +0000 -@@ -4,6 +4,9 @@ - - # NFS root might have reached here before /tmp/net.ifaces was written - udevadm settle --timeout=30 -+ -+command -v ip_to_var >/dev/null || . /lib/net-lib.sh -+ - # Don't write anything if we don't know our bootdev - [ -f /tmp/net.ifaces ] || return 1 - -@@ -98,6 +101,7 @@ - fi - cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr - { -+ ip_to_var $ip - echo "# Generated by dracut initrd" - echo "DEVICE=$netif" - echo "ONBOOT=yes" diff --git a/diskimage_builder/elements/dracut-network/element-deps b/diskimage_builder/elements/dracut-network/element-deps deleted file mode 100644 index 8c3ffe52..00000000 --- a/diskimage_builder/elements/dracut-network/element-deps +++ /dev/null @@ -1,2 +0,0 @@ -package-installs -select-boot-kernel-initrd diff --git a/diskimage_builder/elements/dracut-network/finalise.d/98-regenerate-initramfs b/diskimage_builder/elements/dracut-network/finalise.d/98-regenerate-initramfs deleted file mode 100755 index a227e28e..00000000 --- a/diskimage_builder/elements/dracut-network/finalise.d/98-regenerate-initramfs +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -RET=$(/bin/select-boot-kernel-initrd) -KERNEL_VERSION=`echo ${RET%:*} | sed 's/vmlinuz-//g'` -RAMDISK=/boot/${RET#*:} - -dracut --force --add "network" $RAMDISK $KERNEL_VERSION diff --git a/diskimage_builder/elements/dracut-network/install.d/11-patch-dracut b/diskimage_builder/elements/dracut-network/install.d/11-patch-dracut deleted file mode 100755 index 0576c623..00000000 --- a/diskimage_builder/elements/dracut-network/install.d/11-patch-dracut +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -# If the patch doesn't apply just do nothing. This patch fixes a small -# issue in the script that writes the network configuration files from -# the cmdline to the disk on FC18/FC19. -# -#for dracut-network 029 we need a different patch: -# http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=613ed5cd764d54cac082a1e7b7e8d1f1fed29d35 -IFCFG_FILE="/usr/lib/dracut/modules.d/45ifcfg/write-ifcfg.sh" -NETGEN_FILE="/usr/lib/dracut/modules.d/40network/net-genrules.sh" - -if patch --dry-run $NETGEN_FILE < $(dirname $0)/../dracut-029-netgen.patch > /dev/null; then - patch $NETGEN_FILE < $(dirname $0)/../dracut-029-netgen.patch || true -else - patch $IFCFG_FILE < $(dirname $0)/../dracut-write-ifcfg.patch || true -fi diff --git a/diskimage_builder/elements/dracut-network/package-installs.yaml b/diskimage_builder/elements/dracut-network/package-installs.yaml deleted file mode 100644 index 56d94ec1..00000000 --- a/diskimage_builder/elements/dracut-network/package-installs.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dracut-network: -patch: diff --git a/releasenotes/notes/dracut-network-adaabf90da9f6866.yaml b/releasenotes/notes/dracut-network-adaabf90da9f6866.yaml new file mode 100644 index 00000000..e7b2b2e2 --- /dev/null +++ b/releasenotes/notes/dracut-network-adaabf90da9f6866.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - The ``dracut-network`` element has been removed. It has not been + functioning for some time due to incorrect paths.