device hotplug

pull/5/head
Tomas M 2012-09-06 13:29:59 -05:00
parent 0421e9e1ab
commit 528d3ea214
4 changed files with 19 additions and 22 deletions

3
build
View File

@ -41,6 +41,9 @@ cp /boot/vmlinuz $BOOT/
# create compressed bundles # create compressed bundles
# ... TODO! # ... TODO!
if [ -d sb ]; then
cp sb/* $LIVEKITDATA/$LIVEKITNAME/
fi
# create ISO for CD image # create ISO for CD image
echo "Creating ISO file for CD boot..." echo "Creating ISO file for CD boot..."

View File

@ -24,6 +24,12 @@ DATA="$(find_data $LIVEKITNAME)"
# add data to union # add data to union
union_append_bundles "$DATA" union_append_bundles "$DATA"
mkdir /m
mount /dev/sr0 /m
modprobe squashfs
mkdir /s
mount -o loop -t squashfs /m/mylinux/core.sb /s
# possibly switch root # possibly switch root
# testing message # testing message

View File

@ -52,32 +52,20 @@ done
mknod $INITRAMFS/dev/console c 5 1 mknod $INITRAMFS/dev/console c 5 1
mknod $INITRAMFS/dev/null c 1 3 mknod $INITRAMFS/dev/null c 1 3
mknod $INITRAMFS/dev/ram0 b 1 0 mknod $INITRAMFS/dev/ram0 b 1 0
#mknod $INITRAMFS/dev/systty
mknod $INITRAMFS/dev/tty1 c 4 1 mknod $INITRAMFS/dev/tty1 c 4 1
mknod $INITRAMFS/dev/tty2 c 4 2 mknod $INITRAMFS/dev/tty2 c 4 2
mknod $INITRAMFS/dev/tty3 c 4 3 mknod $INITRAMFS/dev/tty3 c 4 3
mknod $INITRAMFS/dev/tty4 c 4 4 mknod $INITRAMFS/dev/tty4 c 4 4
#for i in $(seq 0 255); do
# mknod $INITRAMFS/dev/loop$i b 7 $i
#done
#tar -C $INITRAMFS -xf initrd-tree.tar.gz copy_including_deps /usr/bin/strace
#rm $INITRAMFS/* 2>/dev/null # only files
#copy_including_deps /lib64/libc.so.*
#copy_including_deps /lib64/libm.so.*
#copy_including_deps /dev/ram /dev/systty /dev/fuse
#copy_including_deps /dev/tty /dev/tty?
#copy_including_deps /bin/bash /bin/mount /bin/umount /bin/mkdir
#copy_including_deps /bin/ln /bin/cat /bin/ls /bin/free
#copy_including_deps /sbin/blkid /sbin/swapon /sbin/mkswap /sbin/modprobe
#copy_including_deps /bin/grep /bin/egrep /bin/cut /bin/tr
#copy_including_deps /sbin/lsmod
#copy_including_deps /sbin/fdisk
#copy_including_deps /bin/uname
#copy_including_deps /usr/bin/vi
#copy_including_deps /usr/bin/strace
# TODO: add all comon filesystems which are NOT compiled in kernel already # TODO: add all comon filesystems which are NOT compiled in kernel already
copy_including_deps /$LMK/kernel/fs/squashfs copy_including_deps /$LMK/kernel/fs/squashfs
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/modules.* copy_including_deps /$LMK/modules.*
depmod -b $INITRAMFS depmod -b $INITRAMFS

View File

@ -113,10 +113,11 @@ init_proc()
# make sure some devices are there # make sure some devices are there
init_devs() init_devs()
{ {
if [ ! -e /dev/console ]; then mknod dev/console c 5 1; fi echo /sbin/mdev > /proc/sys/kernel/hotplug
if [ ! -e /dev/null ]; then mknod dev/null c 1 3; fi mdev -s
if [ ! -e /dev/zram0 ]; then mknod dev/zram0 b 252 0; fi modprobe zram
modprobe loop
modprobe squashfs
} }
# Activate zram (auto-compression of RAM) # Activate zram (auto-compression of RAM)
@ -127,7 +128,6 @@ init_zram()
{ {
debug_log "init_zram" debug_log "init_zram"
echo "Setting dynamic RAM compression using ZRAM" echo "Setting dynamic RAM compression using ZRAM"
modprobe zram
echo 536870912 > /sys/block/zram0/disksize # 512MB echo 536870912 > /sys/block/zram0/disksize # 512MB
mkswap /dev/zram0 mkswap /dev/zram0
swapon /dev/zram0 -p 32767 swapon /dev/zram0 -p 32767