diff options
author | davidovski <david@davidovski.xyz> | 2022-03-13 18:39:11 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-03-13 18:39:11 +0000 |
commit | bfdef0f304e13766423aaabd1022c888e3193ff6 (patch) | |
tree | da642096d046663fdd3455e64085aa72d442f779 | |
parent | 9f79ba0ae923d6a66326ebb68f7e7475f8ea4d1c (diff) |
fixed mkinitrd
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | mkinitrd/init.in (renamed from mkinitrd/initramfs-init.sh) | 0 | ||||
-rwxr-xr-x | mkinitrd/mkinitramfs.sh | 17 |
3 files changed, 12 insertions, 11 deletions
@@ -24,7 +24,9 @@ utmps: mkdir -p $(DESTDIR)/var/log/utmps mv $(DESTDIR)/var/log/wtmp /var/log/utmps/ -install-mkinitramfs: mkinitrd/mkinitramfs.sh mkinitrd/initramfs-init.sh +install-mkinitramfs: mkinitrd/mkinitramfs.sh mkinitrd/init.in + install -d $(DESTDIR)$(PREFIX)/bin + install -d $(DESTDIR)$(PREFIX)/share/mkinitramfs install -m755 mkinitrd/mkinitramfs.sh ${DESTDIR}${PREFIX}/bin/mkinitramfs - install -m755 mkinitrd/initramfs-init.sh ${DESTDIR}${PREFIX}/bin/initramfs-init + install -m644 mkinitrd/init.in ${DESTDIR}${PREFIX}/share/mkinitramfs/ diff --git a/mkinitrd/initramfs-init.sh b/mkinitrd/init.in index 9353e0f..9353e0f 100644 --- a/mkinitrd/initramfs-init.sh +++ b/mkinitrd/init.in diff --git a/mkinitrd/mkinitramfs.sh b/mkinitrd/mkinitramfs.sh index 42fad85..9acff17 100755 --- a/mkinitrd/mkinitramfs.sh +++ b/mkinitrd/mkinitramfs.sh @@ -1,9 +1,8 @@ -#!/bin/sh +#!/bin/bash # This file based in part on the mkinitramfs script for the LFS LiveCD # written by Alexander E. Patrakov and Jeremy Huntwork. -copy() -{ +copy() { local file if [ "$2" == "lib" ]; then @@ -12,7 +11,7 @@ copy() file=$(type -p $1) fi - if [ -n $file ] ; then + if [ "${#file}" != "0" ]; then cp $file $WDIR/$2 else echo "Missing required file: $1 for directory $2" @@ -35,7 +34,7 @@ fi printf "Creating $INITRAMFS_FILE... " -binfiles="sh cat cp dd killall ls mkdir mknod mount " +binfiles="bash cat cp dd killall ls mkdir mknod mount " binfiles="$binfiles umount sed sleep ln rm uname" binfiles="$binfiles readlink basename" @@ -78,7 +77,7 @@ for file in $(find /etc/udev/rules.d/ -type f) ; do done # Install any firmware present -cp -a /lib/firmware $WDIR/lib +[ -e /lib/firmware ] && cp -a /lib/firmware $WDIR/lib # Copy the RAID configuration file if present if [ -f /etc/mdadm.conf ] ; then @@ -104,6 +103,8 @@ for f in $binfiles ; do copy $d/$f bin done +ln -s bash $WDIR/bin/sh + # Add lvm if present if [ -x /sbin/lvm ] ; then sbinfiles="$sbinfiles lvm dmsetup"; fi @@ -156,7 +157,6 @@ sort $unsorted | uniq | while read library ; do [ "$library" == "linux-gate.so.1" ]; then continue fi - copy $library lib done @@ -167,8 +167,7 @@ if [ -d /lib/systemd ]; then cp -a /lib/systemd $WDIR/lib fi -# Install
100 4957 100 4957 0 0 36023 0 --:--:-- --:--:-- --:--:-- 36182 -the kernel modules if requested +# Install the kernel modules if requested if [ -n "$KERNEL_VERSION" ]; then find \ /lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib} \ |