1 Commits

Author SHA1 Message Date
Jay Larson
0b5d9e44bd The following changes were made:
* findutils added as dependency
  * modified cp command in mkinitramfs to prevent unnecessary errors
  * added 'all' option to mkinitramfs
2018-09-30 16:48:04 -05:00
2 changed files with 23 additions and 13 deletions

View File

@@ -8,7 +8,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # 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 ARCH = x86_64
URL = http://snaplinux.org URL = http://snaplinux.org
REPO = core REPO = core

View File

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