The following changes were made:

* Added URL, REPO, and BRIEF to Makefile
  * usher now uses /bin/sh
  * Removed TARGET from usher
This commit is contained in:
2018-04-04 14:20:41 -05:00
parent 0a7a028b03
commit dcf90f69d6
4 changed files with 42 additions and 18 deletions

View File

@@ -10,7 +10,9 @@
DEPENDS = coreutils,cpio,eudev,gzip,perl,psmisc,sed,util-linux DEPENDS = coreutils,cpio,eudev,gzip,perl,psmisc,sed,util-linux
ARCH = x86_64 ARCH = x86_64
URL = URL = http://snaplinux.org
REPO = core
BRIEF = Scripts to build initrd image
DESC = This package includes scripts to build an initrd image DESC = This package includes scripts to build an initrd image
SNAPVER = 0 SNAPVER = 0

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
set -e set -e
@@ -7,14 +7,14 @@ case $1 in
exit 0 exit 0
;; ;;
postinst) postinst)
if [ ! -f ${TARGET}/usr/share/mkinitramfs/bins/default ]; then if [ ! -f /usr/share/mkinitramfs/bins/default ]; then
cp ${TARGET}/usr/share/mkinitramfs/default-bins \ cp /usr/share/mkinitramfs/default-bins \
${TARGET}/usr/share/mkinitramfs/bins/default /usr/share/mkinitramfs/bins/default
fi fi
if [ ! -f ${TARGET}/usr/share/mkinitramfs/mods/default ]; then if [ ! -f /usr/share/mkinitramfs/mods/default ]; then
cp ${TARGET}/usr/share/mkinitramfs/default-mods \ cp /usr/share/mkinitramfs/default-mods \
${TARGET}/usr/share/mkinitramfs/mods/default /usr/share/mkinitramfs/mods/default
fi fi
;; ;;
prerm) prerm)

View File

@@ -18,9 +18,16 @@ rorw="ro"
rootflags= rootflags=
rootdev= rootdev=
[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir -m 0700 /root
[ -d /sys ] || mkdir /sys
[ -d /proc ] || mkdir /proc
[ -d /tmp ] || mkdir /tmp
mkdir -p /var/lock
mount -n -t devtmpfs devtmpfs /dev mount -n -t devtmpfs devtmpfs /dev
mount -n -t proc proc /proc mount -t proc -o nodev,noexec,nosuid proc /proc
mount -n -t sysfs sysfs /sys mount -t sysfs -o nodev,noexec,nosuid sysfs /sys
mount -n -t tmpfs tmpfs /run mount -n -t tmpfs tmpfs /run
read -r cmdline < /proc/cmdline read -r cmdline < /proc/cmdline
@@ -71,15 +78,24 @@ case "$root" in
;; ;;
esac esac
echo > /sys/kernel/uevent_helper
/sbin/udevd --daemon --resolve-names=never /sbin/udevd --daemon --resolve-names=never
udevadm trigger udevadm trigger
udevadm settle udevadm settle
[ -n "$rootdelay" ] && sleep "$rootdelay"
[ -f /etc/mdadm.conf ] && mdadm -As [ -f /etc/mdadm.conf ] && mdadm -As
[ -x /sbin/vgchange ] && /sbin/vgchange --sysinit -a y [ -x /sbin/vgchange ] && /sbin/vgchange --sysinit -a y
[ -n "$zfs" ] && zpool import rpool -N || error "Failed importing rpool"
[ -n "$rootdelay" ] && sleep "$rootdelay" if [ -n "$zfs" ]; then
[ -n "$rootflags" ] && rootflags="$rootflags,$rorw" || rootflags="$rorw" zpool import rpool -N || error "Failed importing rpool"
fi
if [ -n "$rootflags" ]; then
rootflags="$rootflags,$rorw"
else
rootflags="$rorw"
fi
mkdir /.root mkdir /.root
@@ -87,6 +103,6 @@ if ! mount -n -t "$rootfstype" -o "$rootflags" "$rootdev" /.root ; then
error "Failed to mount root filesystem" error "Failed to mount root filesystem"
fi fi
killall -w udevd udevadm control --exit
exec switch_root /.root "$init" "$@" exec switch_root /.root "$init" "$@"

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.4'; use constant VERSION => '0.5';
sub build { sub build {
my $kernel = shift; my $kernel = shift;
@@ -22,6 +22,12 @@ sub build {
mkdir( "$tmpdir/$_", 0755 ) || die( "mkdir(): $tmpdir/$_: $!" ); mkdir( "$tmpdir/$_", 0755 ) || die( "mkdir(): $tmpdir/$_: $!" );
} }
if ( -f '/etc/hostid' ) {
if ( system( "cp -p /etc/hostid $tmpdir/etc" ) ) {
die( "Failed copying hostid" );
}
}
symlink( 'lib', "$tmpdir/lib64" ) || symlink( 'lib', "$tmpdir/lib64" ) ||
die( "symlynk(): $tmpdir/lib64: $!" ); die( "symlynk(): $tmpdir/lib64: $!" );
symlink( '/proc/mounts', "$tmpdir/etc/mtab" ) || symlink( '/proc/mounts', "$tmpdir/etc/mtab" ) ||
@@ -71,7 +77,7 @@ sub build {
if ( system( "cp -p /etc/modprobe.d/* $tmpdir/etc/modprobe.d" ) ) { if ( system( "cp -p /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,udev.conf}" if ( system( "cp -rp /etc/udev/rules.d /etc/udev/udev.conf"
. " $tmpdir/etc/udev" ) ) { . " $tmpdir/etc/udev" ) ) {
die( "Failed copying udev data\n" ); die( "Failed copying udev data\n" );
} }
@@ -87,8 +93,8 @@ sub build {
} }
if ( system( "cp /lib/modules/$kernel->{'version'}/" if ( system( "cp /lib/modules/$kernel->{'version'}/"
. "modules.{builtin,order} $tmpdir/lib/modules/" . "modules.builtin /lib/modules/$kernel->{'version'}/modules.order"
. "$kernel->{'version'}" ) ) { . " $tmpdir/lib/modules/$kernel->{'version'}" ) ) {
die( "Failed copying module data\n" ); die( "Failed copying module data\n" );
} }
if ( system( "depmod -b $tmpdir $kernel->{'version'}" ) ) { if ( system( "depmod -b $tmpdir $kernel->{'version'}" ) ) {