diff --git a/build b/build index 3b30ec0..369c550 100755 --- a/build +++ b/build @@ -39,7 +39,8 @@ cp /boot/vmlinuz $BOOT/ # create ISO for CD image (so I can test it) cd "$LIVEKITDATA" -mkisofs -o "/tmp/iso.iso" -v -J -R -D -A "$LIVEKITNAME" -V "$LIVEKITNAME" \ +mkisofs -o "/mnt/z/iso.iso" -v -J -R -D -A "$LIVEKITNAME" -V "$LIVEKITNAME" \ -no-emul-boot -boot-info-table -boot-load-size 4 \ -b "$LIVEKITNAME"/boot/isolinux.bin -c "$LIVEKITNAME"/boot/isolinux.boot . \ >/dev/null 2>/dev/null +sync \ No newline at end of file diff --git a/initramfs/init b/initramfs/init index 12f34fe..81b19d2 100644 --- a/initramfs/init +++ b/initramfs/init @@ -13,11 +13,27 @@ ln -sf /proc/mounts /etc/mtab # this allows us to use umount -a echo "0" >/proc/sys/kernel/printk # Activate zram (auto-compression of RAM) +# Compressed RAM consumes 1/2 or even 1/4 of original size +# Setup static size of 500MB modprobe zram -echo $(($(grep MemTotal /proc/meminfo | tr -s " " | cut -d " " -f 2)*2*1024)) > /sys/block/zram0/disksize +echo $((512*1024*1024)) > /sys/block/zram0/disksize mkswap /dev/zram0 -swapon /dev/zram0 +swapon /dev/zram0 -p 32767 +echo 100 > /proc/sys/vm/swappiness -echo -echo "Here is a shell for you:" +MEMORYDIR=/memory +UNIONDIR=/union + +# Setup empty union +mkdir $MEMORYDIR +mkdir $UNIONDIR +mount -t ramfs ramfs $MEMORYDIR +mount -t aufs -o xino=$MEMORYDIR/xino,br=$MEMORYDIR none $UNIONDIR + +# find LiveKit data + +# add to union + +header "You shouldn't be here" +echo "If you reached this far, something wrong happened. Here is a shell for you:" /bin/bash diff --git a/initramfs/initramfs_create b/initramfs/initramfs_create index 36a3c85..349a2cb 100755 --- a/initramfs/initramfs_create +++ b/initramfs/initramfs_create @@ -51,15 +51,15 @@ copy_including_deps /dev/zram0 copy_including_deps /dev/console /dev/null /dev/fb0 /dev/zero copy_including_deps /dev/ram /dev/systty /dev/fuse copy_including_deps /dev/tty /dev/tty? -copy_including_deps /bin/bash /bin/mount +copy_including_deps /bin/bash /bin/mount /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 /usr/bin/vi -#copy_including_deps /usr/bin/strace +copy_including_deps /usr/bin/vi +copy_including_deps /usr/bin/strace copy_including_deps /$LMK/kernel/fs copy_including_deps /$LMK/kernel/drivers/staging/zram