summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Draklive/Initrd.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MDV/Draklive/Initrd.pm')
-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})),
""));
}