aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2012-03-17 01:23:43 (GMT)
committerSebastian Pipping <sebastian@pipping.org>2012-03-17 01:23:43 (GMT)
commit8ac8de605504c830b411be0d8eaa597e49ac75b1 (patch)
tree153f0d47b4e92db762c3f9ab49e27e2121a5a166
parentDrop into debug shell when squashfs could not be mounted (diff)
downloadgenkernel-8ac8de605504c830b411be0d8eaa597e49ac75b1.zip
genkernel-8ac8de605504c830b411be0d8eaa597e49ac75b1.tar.gz
genkernel-8ac8de605504c830b411be0d8eaa597e49ac75b1.tar.bz2
Fix docache (bug #397309)
-rw-r--r--ChangeLog4
-rwxr-xr-xdefaults/initrd.scripts5
-rwxr-xr-xdefaults/linuxrc7
3 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c1f376d..f83809b 100644
--- 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)
+
16 Mar 2012; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts,
defaults/linuxrc:
Drop into debug shell when squashfs could not be mounted
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 296b150..350de4a 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -191,12 +191,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 5932024..9ac2c7c 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -627,7 +627,12 @@ 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 || \