minix/etc/rc.cd
Jean-Baptiste Boric 69eead77ff New image framework generation
The CD now boots directly from the ISO 9660 filesystem instead of using
MBR partitioning with Minix file systems. This saves some space on the
CD and reduces memory requirements by some unknown amount as the root
ramdisk is completely eliminated.

The x86 hard drive image creation is also rewritten in the same
fashion.

The setup is modified to be more NetBSD-like (unpacking sets
tarballs instead of blindly copying the CD contents). Splitting MINIX
into sets is done in another commit due to it being a nightmare to
rebase.

Since MINIX lacks union mounts for now, a bunch of ramdisks are
generated at run-time to make parts of the filesystem writeable for the
CD. This solution isn't ideal, but it's enough for an installation CD.

Change-Id: Icbd9cca4dafebf7b42c345b107a17679a622d5cd
2015-10-10 19:09:35 +02:00

31 lines
616 B
Bash

#!/bin/sh
# CD boottime initializations.
echo -n "Creating ramdisks:"
# Set up a ramdisk to make a read-only part of the directory tree writable
# $1 : ramdisk dev node to use
# $2 : path to make writeable
# $3 : ramdisk size in blocks
create_ramdisk()
{
echo -n " $2"
ramdisk $3 /dev/$1 > /dev/null
mkfs.mfs /dev/$1 > /dev/null
# copy files
mount /dev/$1 /mnt > /dev/null
(cd $2 && pax -rw . /mnt)
umount /mnt > /dev/null
mount /dev/$1 $2 > /dev/null
}
# Create /var ramdisk
create_ramdisk ram0 /var 256
create_ramdisk ram1 /tmp 128
create_ramdisk ram2 /usr/run 64
create_ramdisk ram3 /root 512
echo