Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 297814 - 20091203 minimal install: docache fails when subdir is set
Summary: 20091203 minimal install: docache fails when subdir is set
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
Keywords: InVCS
Depends on:
Reported: 2009-12-21 18:10 UTC by rian
Modified: 2011-01-05 23:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description rian 2009-12-21 18:10:58 UTC
install-amd64-minimal-20091203.iso and install-x86-minimal-20091203.iso fail to boot when you are using both the subdir and docache options. 

Reproducible: Always

Steps to Reproduce:
1. Create a bootable flash disk with grub
2. Copy contents of amd64 minimal install cd to a subdirectory on the flash disk(ie gentoo64)
3. Add the following kernel options to boot: subdir=gentoo64 docache

Actual Results:  
I get:
!!Failed to cache the loop file! Lack of space?
and then it boots normally, mounting image.squashfs off of the flash disk

Expected Results:  
I expect it to copy the image.squashfs onto the ramdisk and use it from there

The bug is because ${LOOP} contains the subdirectory, so it executes:

cp -a /newroot/mnt/cdrom//gentoo64/image.squashfs /newroot/mnt//gentoo64/image.squashfs

but since the /newroot/mnt/gentoo64 directory does not exist, it fails, for both the x86 and amd64 scripts. The bug is fixed by executing:

mkdir -p "`dirname ${NEW_ROOT}/mnt/${LOOP}`"

before the copy operation. Here is a diff of my changes to /etc/initrd.scripts
--- /home/rian/deleteme/etc/initrd.scripts	2009-12-21 09:09:36.000000000 -0700
+++ etc/initrd.scripts	2009-12-21 10:49:34.000000000 -0700
@@ -175,6 +175,8 @@
 			# z=$(($z + $i)) ; done
 			# echo $z
 			good_msg "Copying loop file for caching..."
+			#verify that the needed directory exists
+			mkdir -p "`dirname ${NEW_ROOT}/mnt/${LOOP}`"
 			cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP}
 			if [ $? -ne 0 ]
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2009-12-22 02:42:41 UTC
I didn't even know that option existed. I bet there's lots of random code that doesn't respect it.
Comment 2 Andrew Gaffney (RETIRED) gentoo-dev 2009-12-26 22:26:40 UTC
This has been applied in git. Thanks.
Comment 3 Sebastian Pipping gentoo-dev 2011-01-05 23:35:02 UTC
Commit included in, closing.