summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-10-30 19:09:08 +0000
committerOlivier Blin <oblin@mandriva.com>2008-10-30 19:09:08 +0000
commit58056ab9e27e4bdcacbdd449e2893f8d7ed40426 (patch)
tree1bb1e3e7d1ff4979930dfa46444c20a56a1177ac
parent231bb2f0b5fc69fa313e95cf3ddd5d0e06678e07 (diff)
downloaddrakiso-58056ab9e27e4bdcacbdd449e2893f8d7ed40426.tar
drakiso-58056ab9e27e4bdcacbdd449e2893f8d7ed40426.tar.gz
drakiso-58056ab9e27e4bdcacbdd449e2893f8d7ed40426.tar.bz2
drakiso-58056ab9e27e4bdcacbdd449e2893f8d7ed40426.tar.xz
drakiso-58056ab9e27e4bdcacbdd449e2893f8d7ed40426.zip
factorize initrd root
-rw-r--r--lib/MDV/Draklive/Initrd.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm
index 0d98f74..b427270 100644
--- a/lib/MDV/Draklive/Initrd.pm
+++ b/lib/MDV/Draklive/Initrd.pm
@@ -186,6 +186,7 @@ sub create_initrd_scriptlet {
my $debug_shell = "sh -c 'if grep -q initrd_debug /proc/cmdline; then exec sh </dev/console >/dev/console 2>/dev/console; fi'";
my ($mount_first, $mount_last) = partition { !$loop_types{$_->{type}}{delay_mount} }
grep { exists $loop_types{$_->{type}}{mount} } @{$live->{mount}{dirs} || []};
+ my $initrdroot = "/initrd";
output_with_perm($live->get_builddir . $live->{prefix}{build}{initrd} . '/' . $media->{storage} . '/linuxrc', 0755,
join("\n",
@@ -214,14 +215,14 @@ sub create_initrd_scriptlet {
"umount /sys",
"sh -c 'umount /proc/bus/usb 2>/dev/null'",
"umount /proc",
- "pivot_root $target $target/initrd",
- if_($live->{mount}{root}, qq(sh -c 'rmdir /initrd$live->{prefix}{live}{mnt}$live->{mount}{root}')),
- q(sh -c 'if [ -d /initrd/live/modules ]; then cd /initrd/live/modules; for i in `ls -1`; do mkdir -p /live/modules/$i; mount -n --move $i /live/modules/$i; rmdir $i; done; rmdir /initrd/live/modules; fi'),
- (map { qq(sh -c 'mv /initrd/live/$_->{list} /live/') } grep { $_->{list} } @{$live->{mount}{dirs} || []}),
- q(sh -c 'cd /initrd/live; for i in `ls -1`; do [ -d $i ] || continue; mkdir -p /live/$i; mount -n --move $i /live/$i; rmdir $i; done'),
- q(rmdir /initrd/live),
+ "pivot_root $target $target$initrdroot",
+ if_($live->{mount}{root}, qq(sh -c 'rmdir $initrdroot$live->{prefix}{live}{mnt}$live->{mount}{root}')),
+ qq(sh -c 'if [ -d $initrdroot/live/modules ]; then cd $initrdroot/live/modules; for i in `ls -1`; do mkdir -p /live/modules/\$i; mount -n --move \$i /live/modules/\$i; rmdir \$i; done; rmdir $initrdroot/live/modules; fi'),
+ (map { qq(sh -c 'mv $initrdroot/live/$_->{list} /live/') } grep { $_->{list} } @{$live->{mount}{dirs} || []}),
+ qq(sh -c 'cd $initrdroot/live; for i in `ls -1`; do [ -d \$i ] || continue; mkdir -p /live/\$i; mount -n --move \$i /live/\$i; rmdir \$i; done'),
+ qq(rmdir $initrdroot/live),
"nash-mount -o mode=0755 -t tmpfs /dev /dev",
- q(sh -c 'mv /initrd/dev/* /dev/'),
+ qq(sh -c 'mv $initrdroot/dev/* /dev/'),
if_($live->{system}{initrd_post}, deref_array($live->{system}{initrd_post})),
""));
}