diff options
author | Matt Housh <jaeger@morpheus.net> | 2017-11-24 14:42:49 -0600 |
---|---|---|
committer | Matt Housh <jaeger@morpheus.net> | 2017-11-24 14:42:49 -0600 |
commit | d8f081e6af31df3fd5507d209a61a18bc2112a4f (patch) | |
tree | 330854da7ca4bb167720e9b61280ce8d5dc4391c /initramfs | |
parent | 8b1a877e214317a6c78c4dab8b6797be815dd33a (diff) | |
download | iso-d8f081e6af31df3fd5507d209a61a18bc2112a4f.tar.gz iso-d8f081e6af31df3fd5507d209a61a18bc2112a4f.tar.xz |
Removed extra tmpfs from initramfs, limited size of newroot tempfs
Diffstat (limited to 'initramfs')
-rwxr-xr-x | initramfs/init | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/initramfs/init b/initramfs/init index d58f00d..036b92f 100755 --- a/initramfs/init +++ b/initramfs/init @@ -35,11 +35,6 @@ echoDone() { # search for and mount the crux media, populate a tmpfs from it, # and prepare /newroot for switch_root at the end of the script find_and_mount_media() { - echo -e -n " ${BOLD}${BLUE}*${NORM} Creating and mounting tmpfs... " - mkdir /.tmpfs - mount -t tmpfs tmpfs /.tmpfs - checkReturn - grep -q "prefix=*" /proc/cmdline if [ $? -eq 0 ] then @@ -52,10 +47,11 @@ find_and_mount_media() { fi done fi - MEDIAMNT=/.tmpfs/.media - echo -e " ${BOLD}${BLUE}*${NORM} Searching for the CRUX media..." + MEDIAMNT=/media mkdir -p ${MEDIAMNT} + + echo -e " ${BOLD}${BLUE}*${NORM} Searching for the CRUX media..." CRUXMEDIA="" CDROM_DEVICES="`awk '/drive name:/ { for (i=3;i<=NF;i++) { printf("%s ", $i) } }' /proc/sys/dev/cdrom/info`" BLOCK_DEVICES="`grep -E '[shv]d' /proc/partitions | awk '{ print $4 }'`" @@ -106,7 +102,7 @@ find_and_mount_media() { echo -e " ${BOLD}${BLUE}*${NORM} Populating root filesystem..." mkdir -p /newroot echo -e -n " ${BOLD}${BLUE}*${NORM} Mounting new root filesystem... " - mount -t tmpfs tmpfs /newroot + mount -t tmpfs -o size=320m tmpfs /newroot checkReturn echo -e -n " ${BOLD}${BLUE}*${NORM} Copying files from rootfs.tar.xz... " tar -xJf ${MEDIAMNT}/${PREFIX}/rootfs.tar.xz -C /newroot @@ -120,11 +116,6 @@ find_and_mount_media() { umount ${MEDIAMNT} rmdir ${MEDIAMNT} sed -i -e "s,#CRUXMEDIA#,${CRUXMEDIA}," /newroot/etc/fstab - - echo -e -n " ${BOLD}${BLUE}*${NORM} Unmounting tmpfs... " - umount /.tmpfs - checkReturn - rmdir /.tmpfs } /bin/busybox --install -s /bin @@ -158,12 +149,6 @@ then DSHELL=1 fi -if [ ! -z "$DSHELL" ] -then - echo "Starting debug shell." - /bin/ash -fi - echo -e -n " ${BOLD}${BLUE}*${NORM} Populating /dev via mdev... " mdev -s checkReturn @@ -352,6 +337,12 @@ then cp /bin/busybox /newroot/bin/ fi +if [ ! -z "$DSHELL" ] +then + echo "Starting debug shell." + /bin/ash +fi + echo -e " ${BOLD}${BLUE}*${NORM} Switching root.\n" echo "$PRINTK" > /proc/sys/kernel/printk echo > /proc/sys/kernel/hotplug |