I am building a custom Alpine image based on isolinux. Basically, I am squashing rootfs, and mounting it as overlayfs.
Bootloader does its job fine, kernel loads, but I am stuck at initramfs. Let say I have the following:
#!/bin/sh
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
/bin/busybox --install -s
rescue_shell() {
echo "Something went wrong. Dropping you to a shell."
#/bin/busybox --install -s
/bin/sh || exec /bin/busybox sh
}
mount -t sysfs sysfs /sys
mount -t proc proc /proc
mkdir -p /dev/pts
mount -t devtmpfs -o exec,nosuid,mode=0755,size=2M devtmpfs /dev 2>/dev/null \
|| mount -t tmpfs -o exec,nosuid,mode=0755,size=2M tmpfs /dev
[ -c /dev/ptmx ] || mknod -m 666 /dev/ptmx c 5 2
[ -d /dev/pts ] || mkdir -m 755 /dev/pts
mount -t devpts -o gid=5,mode=0620,noexec,nosuid devpts /dev/pts
# shared memory area (later system will need it)
[ -d /dev/shm ] || mkdir /dev/shm
mount -t tmpfs -o nodev,nosuid,noexec shm /dev/shm
/bin/sh
# other code left for simplicity
So once I enters /bin/sh
, I don't have any modules loaded, especially I am meaning for block devices, /dev/sda
, /dev/sr0
, which I need to mount and then extract squashed image, and mount overlay.
Listing /proc/partitions gives me only ram[0-15]
devices, which make sense since after boot it's loaded into RAM.
So, my question would be, is there any way that devices gets probed based on available hardware? I have tried with mdev
as well, but still can not get my block devices. Proper mdev.conf
is there, and tests are performed in VirtualBox.
Thank you.
MODPROBE_SMALL [=n]
, so I can get more feature-able modprobe. :) Thanks again! – fugitive Sep 06 '19 at 18:31