Skip to content

Commit

Permalink
Fixed missing deps for initramfs build
Browse files Browse the repository at this point in the history
  • Loading branch information
dslm4515 committed Jun 21, 2022
1 parent d953d31 commit f70607c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions doc/3-Chroot/097-Initramfs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ ln -sv ../sbin usr/sbin
# Copy binaries
for b in bash s6-cat cp dd killall kmod s6-ln s6-ls \
s6-mkdir mknod s6-mount rm sed s6-sleep \
umount uname s6-basename readlink
umount uname s6-basename readlink printf
do
cp -va /bin/$b bin/
done
ln -sv kmod bin/insmod
ln -sv kmod bin/lsmod
ln -sv bash bin/sh

# Create the nodes for udev to mount on:
mknod -m 600 dev/console c 5 1
Expand All @@ -43,7 +44,8 @@ cp -v ../files/initramfs-init sbin/init
# Copy required libraries
for l in libreadline.so.8 libhistory.so.8 libcurses.so \
libterminfo.so libacl.so.1 libattr.so.1 libzstd.so.1 \
liblzma.so.5 libz.so.1 libmount.so.1 libblkid.so.1
liblzma.so.5 libz.so.1 libmount.so.1 libblkid.so.1 \
libkmod.so.2
do
cp -va /lib/$l.* lib/
done
Expand Down
16 changes: 8 additions & 8 deletions files/initramfs-init
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ do_mount_root()
problem
done

if ! mount -n -t "$rootfstype" -o "$rootflags" "$device" /.root ; then
if ! s6-mount -n -t "$rootfstype" -o "$rootflags" "$device" /.root ; then
no_mount $device
cat /proc/partitions
s6-cat /proc/partitions
while true ; do sleep 10000 ; done
else
echo "Successfully mounted device $root"
s6-echo "Successfully mounted device $root"
fi
}

Expand All @@ -61,10 +61,10 @@ ro="ro"
rootflags=
device=

mount -n -t devtmpfs devtmpfs /dev
mount -n -t proc proc /proc
mount -n -t sysfs sysfs /sys
mount -n -t tmpfs tmpfs /run
s6-mount -n -t devtmpfs devtmpfs /dev
s6-mount -n -t proc proc /proc
s6-mount -n -t sysfs sysfs /sys
s6-mount -n -t tmpfs tmpfs /run

read -r cmdline < /proc/cmdline

Expand All @@ -88,7 +88,7 @@ elif [ -x /lib/udev/udevd ]; then
elif [ -x /lib/systemd/systemd-udevd ]; then
UDEVD=/lib/systemd/systemd-udevd
else
echo "Cannot find udevd nor systemd-udevd"
s6-echo "Cannot find udevd nor systemd-udevd"
problem
fi

Expand Down

0 comments on commit f70607c

Please sign in to comment.