From e1ee93539fb2e7651eb098d745f59ccedd11a360 Mon Sep 17 00:00:00 2001 From: Warren Togami Date: Mon, 8 Jun 2009 16:51:13 -0400 Subject: [PATCH] Copy netboot state into /dev/.initramfs/ before switch_root If cmdline "rdcopystate", then copy all of /tmp/* into /dev/.initramfs/ for later debugging examination. --- modules.d/99base/init | 10 ++++++++++ modules.d/99base/install | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules.d/99base/init b/modules.d/99base/init index b1115e1a..fb1a604b 100755 --- a/modules.d/99base/init +++ b/modules.d/99base/init @@ -134,8 +134,18 @@ for x in "$@"; do [ "${x%%=*}" = "rdudevinfo" ] && continue [ "${x%%=*}" = "rdudevdebug" ] && continue [ "${x%%=*}" = "rdnetdebug" ] && continue + [ "${x%%=*}" = "rdcopystate" ] && continue initargs="$initargs $x" done + +# Copy state +mkdir /dev/.initramfs/ +if getarg rdcopystate; then + cp /tmp/* /dev/.initramfs/ >/dev/null 2>&1 +else + cp /tmp/net.* /dev/.initramfs/ >/dev/null 2>&1 +fi + exec switch_root "$NEWROOT" "$INIT" $initargs || { # davej doesn't like initrd bugs echo "Something went very badly wrong in the initrd. Please " diff --git a/modules.d/99base/install b/modules.d/99base/install index 97dd2d32..68d40fb2 100755 --- a/modules.d/99base/install +++ b/modules.d/99base/install @@ -1,5 +1,5 @@ #!/bin/bash -dracut_install mount mknod mkdir modprobe pidof sleep chroot sed ls flock +dracut_install mount mknod mkdir modprobe pidof sleep chroot sed ls flock cp if [ ! -e "${initdir}/bin/sh" ]; then dracut_install bash (ln -s bash "${initdir}/bin/sh" || :)