summaryrefslogtreecommitdiffstats
path: root/draklive2
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-01 14:19:21 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-01 15:11:22 +0000
commitdd0e9c790d3a9ca510e2fd0e9fba572435fc0d05 (patch)
tree09eee133eecf036db94336caf7321ecbd3a95309 /draklive2
parent32ddfa110613b099099ec72e835c02e5dc5e775c (diff)
downloaddrakiso-dd0e9c790d3a9ca510e2fd0e9fba572435fc0d05.tar
drakiso-dd0e9c790d3a9ca510e2fd0e9fba572435fc0d05.tar.gz
drakiso-dd0e9c790d3a9ca510e2fd0e9fba572435fc0d05.tar.bz2
drakiso-dd0e9c790d3a9ca510e2fd0e9fba572435fc0d05.tar.xz
drakiso-dd0e9c790d3a9ca510e2fd0e9fba572435fc0d05.zip
draklive2: minor tidy ups.
Diffstat (limited to 'draklive2')
-rwxr-xr-xdraklive228
1 files changed, 15 insertions, 13 deletions
diff --git a/draklive2 b/draklive2
index 3edc391..89389a4 100755
--- a/draklive2
+++ b/draklive2
@@ -489,8 +489,10 @@ sub create_bootloader {
my $label = $live->{media}->get_media_label;
my $grub2_cfg = $grub2_dir . '/grub.cfg';
- if ($live->{media}{grub2_cfg}) {
- cp_f($live->{settings}{config_root} . '/' . $live->{media}{grub2_cfg}, $grub2_cfg);
+ if (defined $live->{media}{grub2_cfg}) {
+ my $grub_cfg_template = get_absolute_path($live, $live->{media}{grub2_cfg});
+ -e $grub_cfg_template or die "cannot find grub2 config file $grub_cfg_template\n";
+ cp_f($grub_cfg_template, $grub2_cfg);
run_("sed", "-i", "s/VOLUME_LABEL/$label/g", $grub2_cfg);
} else {
output($grub2_cfg, build_grub2_cfg($live, $theme_name, \@theme_fonts, $add_lang_menu));
@@ -586,7 +588,7 @@ sub build_grub2_cfg {
my @loadfonts;
if (defined $theme_name) {
- @loadfonts = map { "loadfont \${prefix}/themes/$theme_name/$_" } @$theme_fonts;
+ @loadfonts = map { "loadfont \$prefix/themes/$theme_name/$_" } @$theme_fonts;
}
my @langs = get_langs($live);
@@ -599,24 +601,24 @@ sub build_grub2_cfg {
"search --no-floppy --set=root -l '" . $live->{media}->get_media_label . "'",
"set prefix=(\$root)" . $live->get_media_prefix('boot') . "/grub2",
"",
- "if loadfont \${prefix}/fonts/unicode.pf2 ; then",
+ "if loadfont \$prefix/fonts/unicode.pf2 ; then",
" set gfxmode=1024x768,800x600,auto",
" set gfxpayload=keep",
" terminal_output gfxterm",
"fi",
"",
if_($theme_name,
- "if [ x\${uefi} == 'xtrue' ] ; then",
- " set theme=\${prefix}/themes/$theme_name/theme-uefi.txt",
+ "if [ x\$uefi == 'xtrue' ] ; then",
+ " set theme=\$prefix/themes/$theme_name/theme-uefi.txt",
"else",
- " set theme=\${prefix}/themes/$theme_name/theme.txt",
+ " set theme=\$prefix/themes/$theme_name/theme.txt",
"fi",
"export theme",
@loadfonts,
),
"",
- "set timeout=" . get_bootloader_timeout($live),
"set default=" . get_bootloader_default($live),
+ "set timeout=" . get_bootloader_timeout($live),
"",
if_($add_lang_menu,
"if [ -z \$lang ] ; then",
@@ -642,14 +644,14 @@ sub build_grub2_cfg {
);
}
-sub get_bootloader_timeout {
+sub get_bootloader_default {
my ($live) = @_;
- defined $live->{media}{bootloader_timeout} ? $live->{media}{bootloader_timeout} : 4;
+ defined $live->{media}{bootloader_default} ? $live->{media}{bootloader_default} : 0;
}
-sub get_bootloader_default {
+sub get_bootloader_timeout {
my ($live) = @_;
- defined $live->{media}{bootloader_default} ? $live->{media}{bootloader_default} : 0;
+ defined $live->{media}{bootloader_timeout} ? $live->{media}{bootloader_timeout} : 4;
}
sub get_default_append {
@@ -691,7 +693,7 @@ sub build_uefi_grub2_cfg {
"set uefi=true",
"export uefi",
"",
- "configfile \${prefix}/grub.cfg",
+ "configfile \$prefix/grub.cfg",
"",
);
}