From 1845cce130203508b3f05aa2e7675838c71e825e Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Tue, 19 Jul 2005 15:38:58 +0000 Subject: [PATCH] Fix exit 1 issue being always called. Add UID support for unionfs. add check for livecd.unionfs file on blockdev git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@275 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- generic/initrd.scripts | 16 +++++++++++++++- generic/linuxrc | 10 +++++++++- genkernel | 11 ++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/generic/initrd.scripts b/generic/initrd.scripts index db9b685..adac1f5 100644 --- a/generic/initrd.scripts +++ b/generic/initrd.scripts @@ -539,7 +539,13 @@ setup_unionfs(){ # Directory used for rw changes in union mount filesystem UNION=/union MEMORY=/memory - CHANGES=$MEMORY/changes + if [ -n "$UID" ] + then + CHANGES=$MEMORY/unionfs_changes/default + else + CHANGES=$MEMORY/unionfs_changes/$UID + fi + mkdir -p ${MEMORY} mkdir -p ${UNION} @@ -558,6 +564,14 @@ setup_unionfs(){ bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based unionfs" mount -t tmpfs tmpfs $MEMORY fi + if [ ! -f ${MEMORY}/livecd.unionfs ] + then + umount $CHANGESDEV + bad_msg "failed to find livecd.unionfs file on $CHANGESDEV" + bad_msg "falling back to ramdisk based unionfs for safety" + bad_msg "create a livecd.unionfs file on this device if you wish to use it for unionfs" + mount -t tmpfs tmpfs $MEMORY + fi else good_msg "Mounting ramdisk to $MEMORY for unionfs support..." mount -t tmpfs tmpfs $MEMORY diff --git a/generic/linuxrc b/generic/linuxrc index da21c2f..3092517 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -100,7 +100,15 @@ do bad_msg 'Unionctl not found: aborting use of unionfs!' else USE_UNIONFS_NORMAL=1 - UNIONFS=`parse_opt "${x}"` + CMD_UNIONFS=`parse_opt "${x}"` + echo ${CMD_UNIONFS}|grep , >/dev/null 2>&1 + if [ "$?" -eq '0' ] + then + UID=`echo ${CMD_UNIONFS#*,}` + UNIONFS=`echo ${CMD_UNIONFS%,*}` + else + UNIONFS=${CMD_UNIONFS} + fi fi ;; diff --git a/genkernel b/genkernel index 0d7e9d3..ac63430 100755 --- a/genkernel +++ b/genkernel @@ -27,6 +27,12 @@ source ${GK_BIN}/gen_bootloader.sh || gen_die "Could not read ${GK_BIN}/gen_boot TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ +trap_cleanup(){ + #Call exit code of 1 for failure + cleanup + exit 1 +} + cleanup(){ if [ -n "$TEMP" -a -d "$TEMP" ]; then rm -rf "$TEMP" @@ -47,10 +53,9 @@ cleanup(){ print_info 1 "TMPDIR: ${TMPDIR}" clear_tmpdir fi - - exit 1 } -trap cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL + +trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL BUILD_KERNEL=0 BUILD_INITRD=0 BUILD_MODULES=0 -- 2.26.2