load bunch of modules manually

pull/23/merge
Tomas M 2017-05-18 03:54:25 -05:00
parent d9617ee2cd
commit 35d6b2364f
3 changed files with 42 additions and 6 deletions

View File

@ -21,9 +21,11 @@ init_proc_sysfs
debug_start debug_start
debug_shell debug_shell
# load some modules manually first, then modprobe everything we have
init_devs init_devs
init_aufs init_aufs
init_zram init_zram
modprobe_everything
# find data dir with filesystem bundles # find data dir with filesystem bundles
DATA="$(find_data 60 "$DATAMNT")" DATA="$(find_data 60 "$DATAMNT")"

View File

@ -67,13 +67,32 @@ mknod $INITRAMFS/dev/tty4 c 4 4
#copy_including_deps /usr/bin/lsof #copy_including_deps /usr/bin/lsof
# TODO: add all common filesystems which are NOT compiled in kernel already # TODO: add all common filesystems which are NOT compiled in kernel already
copy_including_deps /$LMK/kernel/fs/aufs
copy_including_deps /$LMK/kernel/fs/squashfs copy_including_deps /$LMK/kernel/fs/squashfs
copy_including_deps /$LMK/kernel/drivers/staging/zsmalloc # needed by zram copy_including_deps /$LMK/kernel/drivers/staging/zsmalloc # needed by zram
copy_including_deps /$LMK/kernel/drivers/staging/zram copy_including_deps /$LMK/kernel/drivers/staging/zram
copy_including_deps /$LMK/kernel/drivers/block/loop.* copy_including_deps /$LMK/kernel/drivers/block/loop.*
copy_including_deps /$LMK/kernel/fs/fuse copy_including_deps /$LMK/kernel/fs/fuse
copy_including_deps /$LMK/kernel/fs/isofs
copy_including_deps /$LMK/modules.* copy_including_deps /$LMK/modules.*
# usb drivers
copy_including_deps /$LMK/kernel/drivers/usb/host
copy_including_deps /$LMK/kernel/drivers/usb/common
copy_including_deps /$LMK/kernel/drivers/usb/core
copy_including_deps /$LMK/kernel/drivers/hid/usbhid
copy_including_deps /$LMK/kernel/drivers/hid/hid.*
copy_including_deps /$LMK/kernel/drivers/hid/uhid.*
copy_including_deps /$LMK/kernel/drivers/hid/hid-generic.*
# disk and cdrom drivers
copy_including_deps /$LMK/kernel/drivers/cdrom
copy_including_deps /$LMK/kernel/drivers/scsi/sr_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/sd_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/scsi_mod.*
copy_including_deps /$LMK/kernel/drivers/scsi/sg.*
copy_including_deps /$LMK/kernel/drivers/ata
find $INITRAMFS -name "*.ko.gz" -exec gunzip {} \; find $INITRAMFS -name "*.ko.gz" -exec gunzip {} \;
# trim modules.order file. Perhaps we could remove it entirely # trim modules.order file. Perhaps we could remove it entirely

View File

@ -148,6 +148,21 @@ init_proc_sysfs()
ln -sf /proc/mounts /etc/mtab ln -sf /proc/mounts /etc/mtab
} }
# modprobe all modules found in initial ramdisk
modprobe_everything()
{
debug_log "modprobe_everything" "$*"
echo_green_star >&2
echo -n "Probing for hardware" >&2
find /lib/modules/ | while read MODULE; do
modprobe $MODULE 2>/dev/null
done
}
# make sure some devices are there # make sure some devices are there
init_devs() init_devs()
{ {
@ -632,14 +647,14 @@ change_root()
if [ ! -e sbin/fsck.aufs ]; then ln -s /bin/true sbin/fsck.aufs; fi if [ ! -e sbin/fsck.aufs ]; then ln -s /bin/true sbin/fsck.aufs; fi
# find chroot and init # find chroot and init
if [ -x bin/chroot ]; then CHROOT=bin/chroot; fi if [ -x bin/chroot -o -L bin/chroot ]; then CHROOT=bin/chroot; fi
if [ -x sbin/chroot ]; then CHROOT=sbin/chroot; fi if [ -x sbin/chroot -o -L sbin/chroot ]; then CHROOT=sbin/chroot; fi
if [ -x usr/bin/chroot ]; then CHROOT=usr/bin/chroot; fi if [ -x usr/bin/chroot -o -L usr/bin/chroot ]; then CHROOT=usr/bin/chroot; fi
if [ -x usr/sbin/chroot ]; then CHROOT=usr/sbin/chroot; fi if [ -x usr/sbin/chroot -o -L usr/sbin/chroot ]; then CHROOT=usr/sbin/chroot; fi
if [ "$CHROOT" = "" ]; then fatal "Can't find executable chroot command"; fi if [ "$CHROOT" = "" ]; then fatal "Can't find executable chroot command"; fi
if [ -x bin/init ]; then INIT=bin/init; fi if [ -x bin/init -o -L bin/init ]; then INIT=bin/init; fi
if [ -x sbin/init ]; then INIT=sbin/init; fi if [ -x sbin/init -o -L sbin/init ]; then INIT=sbin/init; fi
if [ "$INIT" = "" ]; then fatal "Can't find executable init command"; fi if [ "$INIT" = "" ]; then fatal "Can't find executable init command"; fi
mkdir -p mnt/live mkdir -p mnt/live