From: Andrew Gaffney Date: Mon, 16 Nov 2009 02:36:02 +0000 (-0600) Subject: Make sure to change back to existant directory before removing the current directory... X-Git-Tag: v3.4.10.907~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b8cbb1978e2395922af08f6f1cd2d5181d9164c;p=genkernel.git Make sure to change back to existant directory before removing the current directory for Gentoo bug #291794 --- diff --git a/ChangeLog b/ChangeLog index 756be77..83561d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ # Distributed under the GPL v2 # $Id$ + 16 Nov 2009; Andrew Gaffney gen_initramfs.sh: + Make sure to change back to existant directory before removing the current + directory for Gentoo bug #291794 + 15 Oct 2009; Changelog: added iSCSI support diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 820dc04..c924d2d 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -35,6 +35,7 @@ append_base_layout() { cd "${TEMP}/initramfs-base-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -rf "${TEMP}/initramfs-base-temp" > /dev/null } @@ -62,6 +63,7 @@ append_busybox() { cd "${TEMP}/initramfs-busybox-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -rf "${TEMP}/initramfs-busybox-temp" > /dev/null } @@ -77,6 +79,7 @@ append_blkid(){ chmod a+x "${TEMP}/initramfs-blkid-temp/bin/blkid" cd "${TEMP}/initramfs-blkid-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -rf "${TEMP}/initramfs-blkid-temp" > /dev/null } @@ -105,6 +108,7 @@ append_unionfs_fuse() { chmod a+x "${TEMP}/initramfs-unionfs-fuse-temp/sbin/unionfs" cd "${TEMP}/initramfs-unionfs-fuse-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -rf "${TEMP}/initramfs-unionfs-fuse-temp" > /dev/null } @@ -176,6 +180,7 @@ append_multipath(){ fi cd "${TEMP}/initramfs-multipath-temp" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -r "${TEMP}/initramfs-multipath-temp/" } @@ -198,6 +203,7 @@ append_dmraid(){ cd "${TEMP}/initramfs-dmraid-temp/" fi find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -r "${TEMP}/initramfs-dmraid-temp/" } @@ -215,6 +221,7 @@ append_iscsi(){ chmod a+x "${TEMP}/initramfs-iscsi-temp/bin/iscsistart" cd "${TEMP}/initramfs-iscsi-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -rf "${TEMP}/initramfs-iscsi-temp" > /dev/null } @@ -258,6 +265,7 @@ append_lvm(){ fi cd "${TEMP}/initramfs-lvm-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -r "${TEMP}/initramfs-lvm-temp/" } @@ -309,6 +317,7 @@ append_evms(){ fi cd "${TEMP}/initramfs-evms-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -r "${TEMP}/initramfs-evms-temp/" } @@ -326,6 +335,7 @@ append_mdadm(){ fi cd "${TEMP}/initramfs-mdadm-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" + cd "${TEMP}" rm -rf "${TEMP}/initramfs-mdadm-temp" > /dev/null } @@ -352,6 +362,7 @@ append_splash(){ cd "${TEMP}/initramfs-splash-temp/" find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ || gen_die "compressing splash cpio" + cd "${TEMP}" rm -r "${TEMP}/initramfs-splash-temp/" else print_warning 1 ' >> No splash detected; skipping!' @@ -423,6 +434,7 @@ append_firmware() { fi find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ || gen_die "appending firmware to cpio" + cd "${TEMP}" rm -r "${TEMP}/initramfs-firmware-temp/" }