From b7a1a38eccbad5deed35e179b371799fa6a7f19c Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 17 Mar 2012 02:23:43 +0100 Subject: [PATCH] Fix docache (bug #397309) Conflicts: ChangeLog defaults/linuxrc --- ChangeLog | 4 ++++ defaults/initrd.scripts | 5 ++--- defaults/linuxrc | 14 +++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11b18a4..2a04479 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ + 17 Mar 2012; Sebastian Pipping defaults/initrd.scripts, + defaults/linuxrc: + Fix docache (bug #397309) + 25 Feb 2012; Sebastian Pipping arch/x86/modules_load, arch/x86_64/modules_load, defaults/modules_load: Make sure the sha256 module makes it into the initramfs (bug #405495). diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 89629e9..c476d77 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -184,12 +184,11 @@ cache_cd_contents() { cp -a ${CDROOT_PATH}/${LOOP} ${NEW_ROOT}/mnt/${LOOP} if [ $? -ne 0 ] then - bad_msg "Failed to cache the loop file! Lack of space?" + warn_msg "Failed to cache the loop file! Lack of RAM?" + rm -rf ${NEW_ROOT}/mnt/${LOOP} 2>/dev/null rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null - else - LOOPEXT='../' fi fi fi diff --git a/defaults/linuxrc b/defaults/linuxrc index 6bdaea1..d3b5aa5 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -561,7 +561,19 @@ then then if [ "${USE_AUFS_NORMAL}" != '1' ]; then good_msg 'Mounting squashfs filesystem' - mount -t squashfs -o loop,ro "${CDROOT_PATH}/${LOOPEXT}${LOOP}" "${NEW_ROOT}/mnt/livecd" + _CACHED_SQUASHFS_PATH="${NEW_ROOT}/mnt/${LOOP}" + _squashfs_path="${CDROOT_PATH}/${LOOPEXT}${LOOP}" # Default to uncached + # Upgrade to cached version if possible + [ "${DO_cache}" -a -f "${_CACHED_SQUASHFS_PATH}" ] \ + && _squashfs_path=${_CACHED_SQUASHFS_PATH} + mount -t squashfs -o loop,ro "${_squashfs_path}" "${NEW_ROOT}/mnt/livecd" || { + bad_msg "Squashfs filesystem could not be mounted, dropping into shell." + if [ -e /proc/filesystems ]; then + fgrep -q squashfs /proc/filesystems || \ + bad_msg "HINT: Your kernel does not know filesystem \"squashfs\"." + fi + do_rundebugshell + } else good_msg 'Mounting squashfs & aufs filesystems' setup_squashfs_aufs -- 2.26.2