summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--mkinitrd/init.in (renamed from mkinitrd/initramfs-init.sh)0
-rwxr-xr-xmkinitrd/mkinitramfs.sh17
3 files changed, 12 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index ff9704b..f7b9363 100644
--- a/Makefile
+++ b/Makefile
@@ -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} \