FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 02-17-2012, 11:23 PM
Vagrant Cascadian
 
Default Bug#660297: initramfs-tools: busybox's switch_root doesn't handle /proc or /sys moving

Package: initramfs-tools
Version: 0.100
Severity: normal
Tags: patch

Greetings.

the change to using switch_root leaves /sys and /proc in an unmounted state.
busybox's switch_root doesn't appear to handle the /sys and /proc moving the
way that util-linux's switch_root does.

either busybox's switch_root should be fixed, initramfs-tools uses util-linux's
switch_root, or manually handle mounting the dirs, just like how it's done with
run-init. the following patch implements the last approach.

live well,
vagrant


commit 705c5e3529536862135d90e1d710d02d750765d7
Author: Vagrant Cascadian <vagrant@freegeek.org>
Date: Fri Feb 17 16:11:32 2012 -0800

Work around busybox's switch_root, which doesn't handle moving /proc and /sys
into the root before switching, by moving the /proc and /sys directories
directly.

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>

diff --git a/init b/init
index 472b279..242b29d 100755
--- a/init
+++ b/init
@@ -310,13 +310,14 @@ unset readonly
unset resume
unset resume_offset

+# Move virtual filesystems over to the real filesystem
+mount -n -o move /sys ${rootmnt}/sys
+mount -n -o move /proc ${rootmnt}/proc
+
# Chain to real filesystem
if command -v switch_root >/dev/null 2>&1; then
exec switch_root ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console
elif command -v run-init >/dev/null 2>&1; then
- # Move virtual filesystems over to the real filesystem
- mount -n -o move /sys ${rootmnt}/sys
- mount -n -o move /proc ${rootmnt}/proc

exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console
fi



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120218002313.GU3372@talon.fglan">http://lists.debian.org/20120218002313.GU3372@talon.fglan
 

Thread Tools




All times are GMT. The time now is 07:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org