Release 0.8.1
This commit is contained in:
parent
0349a6b7ad
commit
5c9c0b463b
|
@ -3,7 +3,7 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
our $VERSION = '0.8.0';
|
our $VERSION = '0.8.1';
|
||||||
|
|
||||||
use Getopt::Long qw(:config no_ignore_case auto_version);
|
use Getopt::Long qw(:config no_ignore_case auto_version);
|
||||||
use Pod::Usage qw(pod2usage);
|
use Pod::Usage qw(pod2usage);
|
||||||
|
@ -29,13 +29,13 @@ sub safeCopy;
|
||||||
sub cleanupMount;
|
sub cleanupMount;
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
$SIG{INT} = \&cleanupMount;
|
$SIG{INT} = \&cleanupMount;
|
||||||
$SIG{TERM} = \&cleanupMount;
|
$SIG{TERM} = \&cleanupMount;
|
||||||
}
|
}
|
||||||
|
|
||||||
my ( %runConf, %config, %components );
|
my ( %runConf, %config, %components );
|
||||||
|
|
||||||
my $configfile = "/etc/zfsbootmenu/config.ini";
|
my $configfile = "/etc/zfsbootmenu/config.ini";
|
||||||
|
|
||||||
$runConf{bootdir} = "/boot";
|
$runConf{bootdir} = "/boot";
|
||||||
$runConf{confd} = "/usr/share/zfsbootmenu/dracut.conf.d";
|
$runConf{confd} = "/usr/share/zfsbootmenu/dracut.conf.d";
|
||||||
|
@ -79,7 +79,7 @@ $runConf{umount_on_exit} = 0;
|
||||||
if ( ( defined $config{Global}{BootMountPoint} ) and ( length $config{Global}{BootMountPoint} ) ) {
|
if ( ( defined $config{Global}{BootMountPoint} ) and ( length $config{Global}{BootMountPoint} ) ) {
|
||||||
my $mounted = 0;
|
my $mounted = 0;
|
||||||
|
|
||||||
my $cmd = "mount";
|
my $cmd = "mount";
|
||||||
my @output = execute($cmd);
|
my @output = execute($cmd);
|
||||||
my $status = pop(@output);
|
my $status = pop(@output);
|
||||||
foreach my $line (@output) {
|
foreach my $line (@output) {
|
||||||
|
@ -211,7 +211,7 @@ if ( defined( $config{Components}{Copies} ) and ( $config{Components}{Copies} gt
|
||||||
}
|
}
|
||||||
|
|
||||||
# Generate syslinux.cfg, requires components to be built
|
# Generate syslinux.cfg, requires components to be built
|
||||||
if ( defined( $config{syslinux}{CreateConfig} ) and ( $config{syslinux}{CreateConfig} eq 1 ) ) {
|
if ( defined( $config{syslinux}{CreateConfig} ) and ( $config{syslinux}{CreateConfig} eq 1 ) ) {
|
||||||
my $glob = sprintf( "%s/%s-*", $config{Components}{ImageDir}, $runConf{kernel_prefix} );
|
my $glob = sprintf( "%s/%s-*", $config{Components}{ImageDir}, $runConf{kernel_prefix} );
|
||||||
my @listing = sort glob($glob);
|
my @listing = sort glob($glob);
|
||||||
|
|
||||||
|
@ -224,8 +224,8 @@ if ( defined( $config{syslinux}{CreateConfig} ) and ( $config{syslinux}{CreateCo
|
||||||
push( @components, $entry );
|
push( @components, $entry );
|
||||||
}
|
}
|
||||||
|
|
||||||
$runConf{syslinux_temp} = join('/', $tempdir, 'syslinux.conf');
|
$runConf{syslinux_temp} = join( '/', $tempdir, 'syslinux.conf' );
|
||||||
open CFG, '>', $runConf{syslinux_temp};
|
open CFG, '>', $runConf{syslinux_temp};
|
||||||
|
|
||||||
my $header = <<'EOF';
|
my $header = <<'EOF';
|
||||||
UI menu.c32
|
UI menu.c32
|
||||||
|
@ -241,13 +241,14 @@ EOF
|
||||||
while (@components) {
|
while (@components) {
|
||||||
my $entry = pop(@components);
|
my $entry = pop(@components);
|
||||||
|
|
||||||
my $directory = dirname( $entry );
|
my $directory = dirname($entry);
|
||||||
|
|
||||||
# Strip the mountpoint prefix out to generate a correct path based on /
|
# Strip the mountpoint prefix out to generate a correct path based on /
|
||||||
$directory =~ s/\Q$config{Global}{BootMountPoint}//;
|
$directory =~ s/\Q$config{Global}{BootMountPoint}//;
|
||||||
|
|
||||||
my $kernel = basename( $entry );
|
my $kernel = basename($entry);
|
||||||
my (undef,$version) = split('-', $kernel );
|
my ( undef, $version ) = split( '-', $kernel );
|
||||||
my $label = "ZFSBootMenu-$version";
|
my $label = "ZFSBootMenu-$version";
|
||||||
my $menu_label = "ZFS Boot Menu v$version";
|
my $menu_label = "ZFS Boot Menu v$version";
|
||||||
|
|
||||||
if ($add_default) {
|
if ($add_default) {
|
||||||
|
@ -280,7 +281,7 @@ sub latestKernel {
|
||||||
my $glob = join( '/', ( $runConf{bootdir}, $prefix ) );
|
my $glob = join( '/', ( $runConf{bootdir}, $prefix ) );
|
||||||
my @kernels = glob($glob);
|
my @kernels = glob($glob);
|
||||||
next if !@kernels;
|
next if !@kernels;
|
||||||
for (sort { versioncmp($b, $a) } @kernels ) {
|
for ( sort { versioncmp( $b, $a ) } @kernels ) {
|
||||||
return $_;
|
return $_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -292,8 +293,8 @@ sub createInitramfs {
|
||||||
|
|
||||||
my $output_file = join( '/', $temp, "zfsbootmenu" );
|
my $output_file = join( '/', $temp, "zfsbootmenu" );
|
||||||
my @cmd = ( qw(dracut -q -f --confdir), $runConf{confd}, $output_file, qw(--kver), $kver, );
|
my @cmd = ( qw(dracut -q -f --confdir), $runConf{confd}, $output_file, qw(--kver), $kver, );
|
||||||
my @output = execute(@cmd);
|
my @output = execute(@cmd);
|
||||||
my $status = pop(@output);
|
my $status = pop(@output);
|
||||||
if ( $status eq 0 ) {
|
if ( $status eq 0 ) {
|
||||||
return $output_file;
|
return $output_file;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -18,4 +18,4 @@ Copies=0
|
||||||
|
|
||||||
[syslinux]
|
[syslinux]
|
||||||
CreateConfig=0
|
CreateConfig=0
|
||||||
Config=/boot/efi/syslinux/syslinux.cfg
|
Config=/boot/syslinux/syslinux.cfg
|
||||||
|
|
Loading…
Reference in New Issue