summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-18 21:23:57 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-18 21:23:57 +0000
commit996706b13c0354ae98e08f4cd54eae2a5868434c (patch)
treebabaa5bcfbc3a51d6e0849757e5b3629a48a8047
parentcd2fe6bf1129641d59614d6382c5819acd8252e4 (diff)
downloaddrakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar.gz
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar.bz2
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.tar.xz
drakiso-996706b13c0354ae98e08f4cd54eae2a5868434c.zip
Remove ability to override default directory names.
It's unlikely anyone would want to do this, and it makes the code considerably harder to read.
-rwxr-xr-xlib/MGA/DrakISO/BuildBoot.pm30
-rwxr-xr-xlib/MGA/DrakISO/BuildISO.pm27
-rwxr-xr-xlib/MGA/DrakISO/BuildLoop.pm4
-rwxr-xr-xlib/MGA/DrakISO/BuildRoot.pm19
-rw-r--r--lib/MGA/DrakISO/Config.pm28
-rw-r--r--lib/MGA/DrakISO/Live.pm10
-rw-r--r--lib/MGA/DrakISO/Loopback.pm72
7 files changed, 86 insertions, 104 deletions
diff --git a/lib/MGA/DrakISO/BuildBoot.pm b/lib/MGA/DrakISO/BuildBoot.pm
index 895f7b7..8fbc164 100755
--- a/lib/MGA/DrakISO/BuildBoot.pm
+++ b/lib/MGA/DrakISO/BuildBoot.pm
@@ -42,7 +42,7 @@ sub prepare_live_system_boot {
# Create a build directory. This will contain all the files we need to
# exist in /boot on the ISO.
- my $boot_dir = $live->get_builddir . $live->{prefix}{build}{boot};
+ my $boot_dir = $live->get_builddir('boot');
mkdir_p($boot_dir);
# Locate the kernel we want to boot.
@@ -75,7 +75,7 @@ sub prepare_iso_bootloader {
my ($live) = @_;
# Create a subdirectory to hold the grub2 bootloader.
- my $grub2_dir = $live->get_builddir . $live->{prefix}{build}{boot} . '/grub2';
+ my $grub2_dir = $live->get_builddir('boot') . '/grub2';
mkdir_p($grub2_dir);
# Locate and copy the default font for the bootloader. If we can't find a
@@ -156,7 +156,7 @@ sub prepare_iso_bootloader {
-e $eltorito_img or die "cannot find El Torito boot image $eltorito_img\n";
cp_f($eltorito_img, $grub2_dir . '/eltorito.img');
} else {
- build_grub2_eltorito_img($live, $grub2_dir . '/eltorito.img');
+ build_grub2_eltorito_img($grub2_dir . '/eltorito.img');
}
my $label = $live->{media}->get_media_label;
@@ -189,7 +189,7 @@ sub prepare_iso_bootloader {
# Create another build directory. This will contain all the files we need
# to exist in the /EFI directory on the ISO.
- my $efi_root_dir = $live->get_builddir . $live->{prefix}{build}{EFI};
+ my $efi_root_dir = $live->get_builddir('EFI');
my $efi_boot_dir = $efi_root_dir . '/BOOT';
mkdir_p($efi_boot_dir);
@@ -200,7 +200,7 @@ sub prepare_iso_bootloader {
-e $bootx64_efi or die "cannot find EFI boot image $bootx64_efi\n";
cp_f($bootx64_efi, $efi_boot_dir . '/bootx64.efi');
} else {
- build_grub2_bootx64_efi($live, $efi_boot_dir . '/bootx64.efi');
+ build_grub2_bootx64_efi($efi_boot_dir . '/bootx64.efi');
}
# Build a grub2 configuration file for UEFI boot. This just chains to the
@@ -217,7 +217,7 @@ sub prepare_iso_bootloader {
}
# Create another build directory for temporarily storing the ESP image.
- my $images_dir = $live->get_builddir . $live->{prefix}{build}{images};
+ my $images_dir = $live->get_builddir('images');
mkdir_p($images_dir);
# Construct an ESP image. This is needed for USB boot.
@@ -228,28 +228,28 @@ sub prepare_iso_bootloader {
}
sub build_grub2_eltorito_img {
- my ($live, $output) = @_;
+ my ($output) = @_;
my @modules = qw(biosdisk iso9660 fat part_msdos all_video font png gfxterm gfxmenu linux
keylayouts at_keyboard usb_keyboard configfile echo gettext ls search test);
run_('grub2-mkimage',
'--output', $output,
- '--prefix', $live->get_media_prefix('boot') . '/grub2',
+ '--prefix', '/boot/grub2',
'--format', 'i386-pc-eltorito',
@modules
);
}
sub build_grub2_bootx64_efi {
- my ($live, $output) = @_;
+ my ($output) = @_;
my @modules = qw(iso9660 fat part_msdos all_video font png gfxterm gfxmenu linux
keylayouts at_keyboard usb_keyboard configfile echo gettext ls search test);
run_('grub2-mkimage',
'--output', $output,
- '--prefix', $live->get_media_prefix('EFI') . '/BOOT',
+ '--prefix', '/EFI/BOOT',
'--format', 'x86_64-efi',
@modules
);
@@ -265,12 +265,10 @@ sub build_grub2_cfg {
my $gettext = $add_lang_menu ? '$' : '';
- my $boot_dir = $live->get_media_prefix('boot');
-
join("\n",
"if [ -z \$initialised ] ; then",
" search --no-floppy --set=root -l '" . $live->{media}->get_media_label . "'",
- " set prefix=(\$root)" . $live->get_media_prefix('boot') . "/grub2",
+ " set prefix=(\$root)/boot/grub2",
"",
" if loadfont \$prefix/fonts/unicode.pf2 ; then",
" set gfxmode=1024x768,800x600,auto",
@@ -307,8 +305,8 @@ sub build_grub2_cfg {
my ($name, $cmdline) = @$_;
join("\n",
"menuentry $gettext\"$name\" {",
- " linux $boot_dir/vmlinuz " . get_default_append($live) . if_($cmdline, " $cmdline"),
- " initrd $boot_dir/initrd.gz",
+ " linux /boot/vmlinuz " . get_default_append($live) . if_($cmdline, " $cmdline"),
+ " initrd /boot/initrd.gz",
"}"
);
} group_by2(@{$live->{media}{bootloader_entries}})),
@@ -410,7 +408,7 @@ sub build_uefi_grub2_cfg {
my ($live) = @_;
join("\n",
"search --no-floppy --set=root -l '" . $live->{media}->get_media_label . "'",
- "set prefix=(\$root)" . $live->get_media_prefix('boot') . "/grub2",
+ "set prefix=(\$root)/boot/grub2",
"",
"set uefi=true",
"export uefi",
diff --git a/lib/MGA/DrakISO/BuildISO.pm b/lib/MGA/DrakISO/BuildISO.pm
index 9b7e503..6f983ab 100755
--- a/lib/MGA/DrakISO/BuildISO.pm
+++ b/lib/MGA/DrakISO/BuildISO.pm
@@ -46,10 +46,10 @@ sub build_live_iso {
my $mbr_image = $live->get_absolute_path($live->{media}{mbr_boot_img}) // '/usr/lib/grub/i386-pc/boot_hybrid.img';
-e $mbr_image or die "cannot find MBR boot image $mbr_image\n";
- my $esp_image = $live->get_builddir . $live->{prefix}{build}{images} . '/esp.img';
+ my $esp_image = $live->get_builddir('images') . '/esp.img';
-e $esp_image or die "cannot find ESP image $esp_image\n";
- my $dest = $live->get_builddir . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.iso';
+ my $dest = $live->get_builddir('dist') . '/' . $live->get_name . '.iso';
mkdir_p(dirname($dest));
build_iso_image(
@@ -58,21 +58,19 @@ sub build_live_iso {
$label,
$mbr_image,
$esp_image,
- $live->get_media_prefix('boot') . '=' . $live->get_builddir . $live->{prefix}{build}{boot},
+ '/boot=' . $live->get_builddir('boot'),
if_($live->{settings}{arch} eq 'x86_64',
- $live->get_media_prefix('EFI') . '=' . $live->get_builddir . $live->{prefix}{build}{EFI},
+ '/EFI=' . $live->get_builddir('EFI'),
),
(
map {
- $live->get_media_prefix('loopbacks') . $_ .
- '=' .
- $live->get_builddir . $live->{prefix}{build}{loopbacks} . $_;
+ '/loopbacks' . $_ . '=' . $live->get_builddir('loopbacks') . $_;
} list_selected_loopbacks($live)
),
if_($live->{media}{files},
map {
- $_ . '=' . $live->get_builddir . $live->{prefix}{build}{files} . '/' . $_;
- } all($live->get_builddir . $live->{prefix}{build}{files})
+ $_ . '=' . $live->get_builddir('files') . '/' . $_;
+ } all($live->get_builddir('files'))
),
);
}
@@ -82,7 +80,7 @@ sub list_selected_loopbacks {
my @pack = $live->{settings}{pack} ? @{$live->{packs}{$live->{settings}{pack}} || []} : ();
my @pack_modules = grep { member($_->{name}, @pack) } list_loopback_modules($live);
(map { $loop_types{$_->{type}}{is_loopback} && $_->{path} ? $_->{path} . $loop_types{$_->{type}}{extension} : () } @{$live->{mount}{dirs} || []}),
- (map { $live->{prefix}{build}{modules} . '/' . $_->{name} . $loop_types{$_->{type}}{extension} } @pack_modules);
+ (map { '/modules/' . $_->{name} . $loop_types{$_->{type}}{extension} } @pack_modules);
}
###############################################################################
@@ -111,19 +109,16 @@ sub list_selected_loopbacks {
sub build_iso_image {
my ($live, $dest, $label, $mbr_image, $esp_image, @opts) = @_;
- my $boot = $live->get_media_prefix('boot'); # normally '/boot'
- my $EFI = $live->get_media_prefix('EFI'); # normally '/EFI'
-
run_('xorrisofs',
'-pad', '-l', '-R', '-J',
'-V', $label,
'-graft-points',
'-hide-rr-moved',
'--sort-weight', 0, '/',
- '--sort-weight', 1, $boot,
+ '--sort-weight', 1, '/boot',
# for hybrid MBR boot
'--grub2-mbr', $mbr_image,
- '-b', "$boot/grub2/eltorito.img",
+ '-b', '/boot/grub2/eltorito.img',
'-no-emul-boot',
'-boot-load-size', 4,
'-boot-info-table',
@@ -131,7 +126,7 @@ sub build_iso_image {
if_($live->{settings}{arch} eq 'x86_64',
# for DVD UEFI boot
'-eltorito-alt-boot',
- '-e', "$EFI/BOOT/bootx64.efi",
+ '-e', '/EFI/BOOT/bootx64.efi',
'-no-emul-boot',
# for USB UEFI boot
'-part_like_isohybrid',
diff --git a/lib/MGA/DrakISO/BuildLoop.pm b/lib/MGA/DrakISO/BuildLoop.pm
index 5e840d4..e1cb82d 100755
--- a/lib/MGA/DrakISO/BuildLoop.pm
+++ b/lib/MGA/DrakISO/BuildLoop.pm
@@ -52,7 +52,7 @@ sub build_live_loopback_files {
eval { rm_rf($copy_tree) };
hardlink_filtered($live->get_system_root, $copy_tree, $module->{files});
my $loop = $loop_types{$module->{type}};
- $loop->{build}->($live, { path => "$live->{prefix}{build}{modules}/$module->{name}", root => $copy_tree, exclude => \@excluded_files });
+ $loop->{build}->($live, { path => "/modules/$module->{name}", root => $copy_tree, exclude => \@excluded_files });
eval { rm_rf($copy_tree) };
}
@@ -66,7 +66,7 @@ sub build_live_loopback_files {
eval { rm_rf($copy_tree) };
hardlink_filtered($excluded_tree, $copy_tree, $module->{files});
my $loop = $loop_types{$module->{type}};
- $loop->{build}->($live, { path => "$live->{prefix}{build}{modules}/excluded-$module->{name}", root => $copy_tree });
+ $loop->{build}->($live, { path => "/modules/excluded-$module->{name}", root => $copy_tree });
eval { rm_rf($copy_tree) };
}
diff --git a/lib/MGA/DrakISO/BuildRoot.pm b/lib/MGA/DrakISO/BuildRoot.pm
index 7112cd9..20ad645 100755
--- a/lib/MGA/DrakISO/BuildRoot.pm
+++ b/lib/MGA/DrakISO/BuildRoot.pm
@@ -40,7 +40,7 @@ sub install_live_system {
my $drakx_in_chroot = $repository . '/misc/drakx-in-chroot';
my $remote_repository = $repository =~ m!^(ftp|http)://! && $1;
if ($remote_repository) {
- my $local_drakx_in_chroot = $live->get_builddir . $live->{prefix}{build}{scripts} . '/drakx-in-chroot';
+ my $local_drakx_in_chroot = $live->get_builddir('scripts') . '/drakx-in-chroot';
mkdir_p(dirname($local_drakx_in_chroot));
run_('curl', '--silent', '-o', $local_drakx_in_chroot, $drakx_in_chroot)
or die "unable to get drakx-in-chroot from remote repository\n";
@@ -162,12 +162,12 @@ sub customise_live_system {
my @no_install_files = map { $_->[1] } grep { $_->[2] && $_->[2]{no_install} } @{$live->{system}{files}};
output_p($live->get_system_root . '/etc/draklive-install.d/remove.d/draklive', map { "$_\n" } @no_install_files);
- eval { rm_rf($live->get_builddir . $live->{prefix}{build}{files}) };
- mkdir_p($live->get_builddir . $live->{prefix}{build}{files});
+ eval { rm_rf($live->get_builddir('files')) };
+ mkdir_p($live->get_builddir('files'));
if ($live->{media}{files}) {
- copy_files_to($live, $live->{media}{files}, $live->get_builddir . $live->{prefix}{build}{files});
+ copy_files_to($live, $live->{media}{files}, $live->get_builddir('files'));
}
- remove_files_from($live->{media}{remove_files}, $live->get_builddir . $live->{prefix}{build}{files});
+ remove_files_from($live->{media}{remove_files}, $live->get_builddir('files'));
run_({ targetarch => $live->{settings}{arch} },
"chroot", $live->get_system_root, "bash", "-c", $live->{system}{postInstall}) if $live->{system}{postInstall};
@@ -185,15 +185,14 @@ sub configure_draklive_resize {
my $resizable_loopback = find { $_->{min_size} } @{$live->{mount}{dirs} || []};
if ($resizable_loopback) {
- my $media_loopbacks = $live->get_media_prefix('loopbacks');
my $ext = $loop_types{$resizable_loopback->{type}}{extension};
output($live->get_system_root . '/etc/sysconfig/draklive-resize', <<EOF);
DRAKLIVE_RESIZE=yes
-LOOPBACK=$live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$resizable_loopback->{path}$ext
+LOOPBACK=/live/media/loopbacks$resizable_loopback->{path}$ext
TYPE=$resizable_loopback->{fs}
MIN_SIZE=$resizable_loopback->{min_size}
-MOUNT=$live->{prefix}{live}{mnt}$resizable_loopback->{mountpoint}_resized
-OLD_MOUNT=$live->{prefix}{live}{mnt}$resizable_loopback->{mountpoint}
+MOUNT=/live$resizable_loopback->{mountpoint}_resized
+OLD_MOUNT=/live$resizable_loopback->{mountpoint}
UNION=/
EOF
}
@@ -232,7 +231,7 @@ sub clean_system_conf_file {
sub write_dist_lists {
my ($live) = @_;
- my $lists_dir = $live->get_builddir . $live->{prefix}{build}{dist};
+ my $lists_dir = $live->get_builddir('dist');
mkdir_p($lists_dir);
run_("chroot " . $live->get_system_root . " rpm -qa | sort > " .
diff --git a/lib/MGA/DrakISO/Config.pm b/lib/MGA/DrakISO/Config.pm
index 9251699..cda9695 100644
--- a/lib/MGA/DrakISO/Config.pm
+++ b/lib/MGA/DrakISO/Config.pm
@@ -48,34 +48,6 @@ sub check_config {
sub complete_config {
my ($live) = @_;
- my $default_prefix = {
- build => {
- EFI => '/EFI',
- boot => '/boot',
- dist => '/dist',
- files => '/files',
- images => '/images',
- initrd => '/initrd',
- loopbacks => '/loopbacks',
- modules => '/modules',
- scripts => '/scripts',
- },
- media => {
- EFI => '/EFI',
- boot => '/boot',
- hidden_boot => '/.boot',
- loopbacks => '/loopbacks',
- hidden_loopbacks => '/.loopbacks',
- mnt => '/media',
- },
- live => {
- mnt => '/live',
- },
- };
-
- #- set unsupplied config dirs
- add2hash($live->{prefix}{$_} ||= {}, $default_prefix->{$_}) foreach keys %$default_prefix;
-
$live->{settings}{builddir} ||= '/var/lib/draklive/build';
$live->{settings}{chroot} ||= '/var/lib/draklive/chroot';
diff --git a/lib/MGA/DrakISO/Live.pm b/lib/MGA/DrakISO/Live.pm
index f3e6be5..654b066 100644
--- a/lib/MGA/DrakISO/Live.pm
+++ b/lib/MGA/DrakISO/Live.pm
@@ -37,8 +37,8 @@ sub get_langs {
}
sub get_builddir {
- my ($live) = @_;
- $live->{settings}{builddir} . '/' . $live->get_name . $live->get_set_suffix;
+ my ($live, $o_subdir) = @_;
+ $live->{settings}{builddir} . '/' . $live->get_name . $live->get_set_suffix . if_($o_subdir, '/' . $o_subdir);
}
sub get_system_root {
@@ -46,12 +46,6 @@ sub get_system_root {
$live->{settings}{chroot} . '/' . $live->get_name . $live->get_set_suffix;
}
-sub get_media_prefix {
- my ($live, $setting, $o_boot) = @_;
- my $hidden = $live->{system}{hide_media_dirs} && $live->{media}->get_boot_setting('can_hide', { boot => $o_boot });
- $live->{prefix}{media}{$hidden ? "hidden_$setting" : $setting};
-}
-
sub find_kernel {
my ($live) = @_;
require bootloader;
diff --git a/lib/MGA/DrakISO/Loopback.pm b/lib/MGA/DrakISO/Loopback.pm
index c48f2b6..5e8e38e 100644
--- a/lib/MGA/DrakISO/Loopback.pm
+++ b/lib/MGA/DrakISO/Loopback.pm
@@ -1,5 +1,6 @@
package MGA::DrakISO::Loopback;
+
use MDK::Common;
use File::Temp;
use MGA::DrakISO::Progress;
@@ -19,7 +20,7 @@ our %loop_types;
extension => '-lzma.sqfs',
build => sub {
my ($live, $dir) = @_;
- my $dest = $live->get_builddir . $live->{prefix}{build}{loopbacks} . $dir->{path} . $loop_types{squashfs}{extension};
+ my $dest = $live->get_builddir('loopbacks') . $dir->{path} . $loop_types{squashfs}{extension};
mkdir_p(dirname($dest));
my $root = $dir->{root} || $live->get_system_root;
my $src = $root . $dir->{build_from};
@@ -47,12 +48,13 @@ our %loop_types;
unlink $exclude_file;
},
mount => sub {
- my ($live, $dir) = @_;
+ my ($dir) = @_;
$dir->{loop} = "/dev/loop" . $loop_number++;
- my $media_loopbacks = $live->get_media_prefix('loopbacks');
+ my $extension = $dir->{path} . $loop_types{squashfs}{extension};
+ my $mountpoint = $dir->{mountpoint};
(
- "/bin/losetup $dir->{loop} $live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$dir->{path}$loop_types{squashfs}{extension}",
- "nash-mount -o ro -t squashfs $dir->{loop} $live->{prefix}{live}{mnt}$dir->{mountpoint}",
+ "/bin/losetup $dir->{loop} /live/media/loopbacks$extension",
+ "nash-mount -o ro -t squashfs $dir->{loop} /live$mountpoint",
);
},
},
@@ -60,15 +62,32 @@ our %loop_types;
read_only => 1,
delay_mount => 1,
mount => sub {
- my ($live, $dir) = @_;
- my $media_loopbacks = $live->get_media_prefix('loopbacks');
- "sh -c 'modules=; for m in $live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$dir->{path}/*; do n=\$(basename \$m); n=\${n%.sqfs}; d=$live->{prefix}{live}{mnt}$dir->{mountpoint}/\$n; mkdir -p \$d; mount -n -o loop,ro -t squashfs \$m \$d && modules=\$modules\$d=ro:; done; echo \$modules | sed -e s/:\$// > $live->{prefix}{live}{mnt}/$dir->{list}'";
+ my ($dir) = @_;
+ my $path = $dir->{path};
+ my $mountpoint = $dir->{mountpoint};
+ "sh -c 'modules=;"
+ . "for m in /live/media/loopbacks$path/*; do"
+ . "n=\$(basename \$m);"
+ . "n=\${n%.sqfs};"
+ . "d=/live$mountpoint/\$n;"
+ . "mkdir -p \$d;"
+ . "mount -n -o loop,ro -t squashfs \$m \$d && modules=\$modules\$d=ro:;"
+ . "done;"
+ . "echo \$modules | sed -e s/:\$// > /live/$dir->{list}'";
},
pivot_clean => sub {
- my ($live, $dir, $initrdroot) = @_;
+ my ($dir, $initrdroot) = @_;
+ my $list = $dir->{list};
+ my $mountpoint = $dir->{mountpoint};
(
- "sh -c 'cd $initrdroot$live->{prefix}{live}{mnt}$dir->{mountpoint}; for i in `ls -1`; do mkdir -p $live->{prefix}{live}{mnt}$dir->{mountpoint}/\$i; mount -n --move \$i $live->{prefix}{live}{mnt}$dir->{mountpoint}/\$i; rmdir \$i; done; rmdir $initrdroot$live->{prefix}{live}{mnt}$dir->{mountpoint}'",
- "sh -c 'mv $initrdroot$live->{prefix}{live}{mnt}/$dir->{list} $live->{prefix}{live}{mnt}/'",
+ "sh -c 'cd $initrdroot/live$mountpoint;"
+ . "for i in `ls -1`; do"
+ . "mkdir -p /live$mountpoint/\$i;"
+ . "mount -n --move \$i /live$mountpoint/\$i;"
+ . "rmdir \$i;"
+ . "done;"
+ . "rmdir $initrdroot/live$mountpoint'",
+ "sh -c 'mv $initrdroot/live/$list /live/'",
);
},
},
@@ -78,45 +97,50 @@ our %loop_types;
extension => '.loop',
build => sub {
my ($live, $dir) = @_;
- my $dest = $live->get_builddir . $live->{prefix}{build}{loopbacks} . $dir->{path} . $loop_types{loopfs}{extension};
+ my $dest = $live->get_builddir('loopbacks') . $dir->{path} . $loop_types{loopfs}{extension};
mkdir_p(dirname($dest));
MGA::DrakISO::Utils::device_allocate_file($dest, $dir->{pre_allocate});
MGA::DrakISO::Utils::device_mkfs($dest, $dir->{fs}) if !defined $dir->{min_size};
},
mount => sub {
- my ($live, $dir) = @_;
+ my ($dir) = @_;
$dir->{loop} = "/dev/loop" . $loop_number++;
- my $fsck = "chroot </dev/tty1 $live->{prefix}{live}{mnt}$dir_distrib_sqfs->{mountpoint} /sbin/fsck $dir->{loop}";
- my $media_loopbacks = $live->get_media_prefix('loopbacks');
+ my $sqfs = $dir_distrib_sqfs->{mountpoint};
+ my $fsck = "chroot </dev/tty1 /live/$sqfs /sbin/fsck $dir->{loop}";
+ my $extension = $dir->{path} . $loop_types{loopfs}{extension};
+ my $mountpoint = $dir->{mountpoint};
(
- "losetup $dir->{loop} $live->{prefix}{live}{mnt}$live->{prefix}{media}{mnt}${media_loopbacks}$dir->{path}$loop_types{loopfs}{extension}",
+ "losetup $dir->{loop} /live/media/loopbacks$extension",
qq(sh -c "$fsck -a || $fsck -y"),
- "nash-mount -t $dir->{fs} $dir->{loop} $live->{prefix}{live}{mnt}$dir->{mountpoint}",
+ "nash-mount -t $dir->{fs} $dir->{loop} /live$mountpoint",
);
},
},
plain => {
skip_mkdir => 1,
mount => sub {
- my ($live, $dir) = @_;
- qq(sh -c "mkdir -p $live->{prefix}{live}{mnt}$dir->{mountpoint}");
+ my ($dir) = @_;
+ my $mountpoint = $dir->{mountpoint};
+ qq(sh -c "mkdir -p /live$mountpoint");
},
},
partition => {
files => [ '/sbin/fsck', '/sbin/blkid' ],
mount => sub {
- my ($live, $dir) = @_;
+ my ($dir) = @_;
my $fsck = "/bin/fsck";
+ my $path = $dir->{path};
+ my $mountpoint = $dir->{mountpoint};
(
- qq(sh -c 'dev=`blkid -l -t $dir->{path} -o device`; [ -z "\$dev" ] || $fsck -a \$dev || $fsck -y \$dev'),
- "nash-mount -t $dir->{fs} $dir->{path} $live->{prefix}{live}{mnt}$dir->{mountpoint}",
+ qq(sh -c 'dev=`blkid -l -t $path -o device`; [ -z "\$dev" ] || $fsck -a \$dev || $fsck -y \$dev'),
+ "nash-mount -t $dir->{fs} $path /live$mountpoint",
);
},
},
tmpfs => {
mount => sub {
- my ($live, $dir) = @_;
- my $mnt = $live->{prefix}{live}{mnt} . $dir->{mountpoint};
+ my ($dir) = @_;
+ my $mnt = '/live' . $dir->{mountpoint};
my $mount_opts = $dir->{mount_opts} ? "-o $dir->{mount_opts}" : "";
my $cmd = "mount -t tmpfs $mount_opts $mnt $mnt";
$dir->{fallback} ? qq(sh -c 'if ! grep -q " $mnt " /proc/mounts; then $cmd; fi') : $cmd;