The following changes were made:

* findutils added as dependency
  * modified cp command in mkinitramfs to prevent unnecessary errors
  * added 'all' option to mkinitramfs
This commit is contained in:
2018-09-30 16:48:04 -05:00
parent 35668887a4
commit 0b5d9e44bd
2 changed files with 23 additions and 13 deletions

View File

@@ -8,7 +8,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
DEPENDS = coreutils,cpio,dash,eudev,gzip,perl,psmisc,sed,util-linux
DEPENDS = coreutils,cpio,dash,eudev,findutils,gzip,perl,psmisc,sed,util-linux
ARCH = x86_64
URL = http://snaplinux.org
REPO = core

View File

@@ -6,7 +6,7 @@ use warnings;
use POSIX qw( uname );
use Data::Dumper;
use constant VERSION => '0.7';
use constant VERSION => '0.8';
sub build {
my $kernel = shift;
@@ -70,18 +70,17 @@ sub build {
}
}
if ( system( "cp -rp /lib/firmware $tmpdir/lib/firmware" ) ) {
if ( system( "cp -a /lib/firmware $tmpdir/lib/firmware" ) ) {
die( "Failed copying firmware\n" );
}
if ( system( "cp -p /etc/modprobe.d/* $tmpdir/etc/modprobe.d" ) ) {
if ( system( "cp -a /etc/modprobe.d $tmpdir/etc/modprobe.d" ) ) {
die( "Failed copying data from modprobe.d\n" );
}
if ( system( "cp -rp /etc/udev/rules.d /etc/udev/udev.conf"
. " $tmpdir/etc/udev" ) ) {
if ( system( "cp -a /etc/udev $tmpdir/etc/udev" ) ) {
die( "Failed copying udev data\n" );
}
if ( system( "cp -rp /lib/udev $tmpdir/lib/udev" ) ) {
if ( system( "cp -a /lib/udev $tmpdir/lib/udev" ) ) {
die( "Failed copying udev lib data\n" );
}
@@ -225,11 +224,12 @@ for ( my $i = 0; $i <= $#ARGV; $i++ ) {
}
}
my $kernver = $ARGV[0] || ( uname() )[2];
my $arg = $ARGV[0] || ( uname() )[2];
my $kernels = getkern();
my $bins = readlines( 'bins' );
my $mods = readlines( 'mods' );
my $libs = [];
my $builds = [];
foreach my $bin ( @$bins ) {
my $ldd = ldd( $bin );
@@ -241,12 +241,22 @@ foreach my $bin ( @$bins ) {
}
}
if ( ! $kernels->{$kernver} ) {
print STDERR "Unable to locate kernel version $kernver\n";
if ( $arg eq 'all' ) {
foreach my $kernver ( keys( %$kernels ) ) {
push( @$builds, $kernels->{$kernver} );
}
}
elsif ( ! $kernels->{$arg} ) {
print STDERR "Unable to locate kernel version $arg\n";
exit 1;
}
else {
push( @$builds, $kernels->{$arg} );
}
print "Generating $kernels->{$kernver}{'initrd'}\n";
build( $kernels->{$kernver}, $bins, $mods, $libs );
foreach my $kernel ( @$builds ) {
print "Generating $kernel->{'initrd'}\n";
build( $kernel, $bins, $mods, $libs );
print "Done\n";
}