Fix docache (bug #397309)
authorSebastian Pipping <sebastian@pipping.org>
Sat, 17 Mar 2012 01:23:43 +0000 (02:23 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 12 May 2012 13:45:52 +0000 (15:45 +0200)
Conflicts:

ChangeLog
defaults/linuxrc

ChangeLog
defaults/initrd.scripts
defaults/linuxrc

index 11b18a4de53520785009737820f6be762effc9c6..2a04479e5dbdc14b4d011f8899305f9d6eb6b039 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  17 Mar 2012; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts,
+  defaults/linuxrc:
+  Fix docache (bug #397309)
+
   25 Feb 2012; Sebastian Pipping <sping@gentoo.org> arch/x86/modules_load,
   arch/x86_64/modules_load, defaults/modules_load:
   Make sure the sha256 module makes it into the initramfs (bug #405495).
index 89629e9f1b631afb74f9a013006af31570db4e2c..c476d776531b250aa39bbfa238c3864b9db42bdf 100755 (executable)
@@ -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
index 6bdaea1b20c86237ce7c4150287499247fe37c33..d3b5aa57f670b5efa569b3a02316475706100bd6 100755 (executable)
@@ -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