Removed extra tmpfs from initramfs, limited size of newroot tempfs
This commit is contained in:
parent
8b1a877e21
commit
d8f081e6af
@ -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
|
||||
|
||||
MEDIAMNT=/media
|
||||
mkdir -p ${MEDIAMNT}
|
||||
|
||||
echo -e " ${BOLD}${BLUE}*${NORM} Searching for the CRUX media..."
|
||||
mkdir -p ${MEDIAMNT}
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user