[Bug 304583] New: mkinitrd does not work from chroot
https://bugzilla.novell.com/show_bug.cgi?id=304583 Summary: mkinitrd does not work from chroot Product: openSUSE 10.2 Version: Final Platform: All OS/Version: Linux Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: pajas@ufal.mff.cuni.cz QAContact: qa@suse.de Found By: Customer I attempted to run mkinitrd from a chrooted environment (e.g. from a rescue disk in order to repair system on a different disk or partition) and failed, getting an error regarding non-existent file /dev/fd/<number>. The reason and solution were as follows: - on several places, mkinitrd (as of mkinitrd-1.2-151 in OpenSuse 10.2) uses a feature of bash called "Process Substitution", e.g. the "prog1 <(prog2)" syntax - bash replaces the word <(...) with /dev/fd/<number> where <number> is the file descriptor open for prog2 - under chrooted environment, the real /dev is not available, so attempt to read from /dev/fd/<number> fails. To make mkinitrd chroot-compatible, I had to replace all occurences of prog1 <(prog2) with something like mkfifo /tmp/something prog2 > /tmp/something & prog1 < /tmp/something rm /tmp/something Another solution could be to fix bash so that it recognizes non-existence of a real /dev and falls back to using fifo's internally - bash already does this for systems without /dev/fd/... (In fact, it would seem natural if bash had a flag that one could use to switch to this fall-back manually). -- Petr -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=304583 Matej Horvath <mhorvath@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.provo.novell.com |hare@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=304583#c1 Hannes Reinecke <hare@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME --- Comment #1 from Hannes Reinecke <hare@novell.com> 2007-08-27 04:24:55 MST --- The one and approved sequence to call mkinitrd in a chroot()ed environment is: mount <dev> /mnt mount --bind /dev /mnt/dev cd /mnt chroot . mount /sys mount /proc mkinitrd umount /proc umount /sys exit cd / umount /mnt/dev umount /mnt <reboot> If the 'mount --bind' step is omitted, mkinitrd will fail as it won't know how to access any devices. I'm reasonably sure it's in the documentation somewhere ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com