diff --git a/initramfs/busybox/update b/initramfs/busybox/update new file mode 100755 index 0000000..dcd8069 --- /dev/null +++ b/initramfs/busybox/update @@ -0,0 +1,4 @@ +#!/bin/bash +# we're using precompiled busybox i486 binary, which runs on 64bit systems as well! +wget -O ./busybox http://busybox.net/downloads/binaries/latest/busybox-i486 +chmod a+x ./busybox diff --git a/initramfs/init b/initramfs/init index f221d58..fa20194 100644 --- a/initramfs/init +++ b/initramfs/init @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Initial script for Linux Live Kit # Author: Tomas M @@ -28,4 +28,4 @@ union_append_bundles "$DATA" # testing message echo "If you see this message, then something went terribly wrong. Sorry!" -/bin/bash +/bin/sh diff --git a/initramfs/initramfs_create b/initramfs/initramfs_create index 713baf9..68c6a86 100755 --- a/initramfs/initramfs_create +++ b/initramfs/initramfs_create @@ -35,22 +35,45 @@ copy_including_deps() rm -Rf $INITRAMFS mkdir -p $INITRAMFS/{bin,dev,etc,lib,lib64,mnt,proc,root,run,sbin,sys,tmp,usr,var/log} +if [ ! -e busybox/busybox ]; then + cd busybox + ./update + cd .. +fi + +cp busybox/busybox $INITRAMFS/bin +busybox/busybox | grep , | grep -v Copyright | tr "," " " | while read LINE; do + for TOOL in $LINE; do + ln -s busybox $INITRAMFS/bin/$TOOL + ln -s ../bin/busybox $INITRAMFS/sbin/$TOOL + done +done + +mknod $INITRAMFS/dev/console c 5 1 +mknod $INITRAMFS/dev/null c 1 3 +mknod $INITRAMFS/dev/ram0 b 1 0 +#mknod $INITRAMFS/dev/systty +mknod $INITRAMFS/dev/tty1 c 4 1 +mknod $INITRAMFS/dev/tty2 c 4 2 +mknod $INITRAMFS/dev/tty3 c 4 3 +mknod $INITRAMFS/dev/tty4 c 4 4 + #tar -C $INITRAMFS -xf initrd-tree.tar.gz #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 +#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 copy_including_deps /$LMK/kernel/fs/squashfs diff --git a/livekitlib b/livekitlib index 62d02a5..bac8e75 100644 --- a/livekitlib +++ b/livekitlib @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Functions library :: for Linux Live Kit scripts # Author: Tomas M. @@ -116,6 +116,7 @@ init_devs() if [ ! -e /dev/console ]; then mknod dev/console c 5 1; fi if [ ! -e /dev/null ]; then mknod dev/null c 1 3; fi if [ ! -e /dev/zram0 ]; then mknod dev/zram0 b 252 0; fi + } # Activate zram (auto-compression of RAM) @@ -185,4 +186,4 @@ mount_device() union_append_bundles() { echo "B" -} \ No newline at end of file +}