# $NetBSD: livecd,v 1.5 2006/10/13 14:58:34 xtraeme Exp $ # # Mount ramfs directories and unpack the required files # before anything. # PROVIDE: mklivecd # BEFORE: disks $_rc_subr_loaded . /etc/rc.subr name="livecd" rcvar=$name start_cmd="livecd_start" stop_cmd="livecd_stop" livecd_start() { if [ -f /stand/usr.zfs ]; then /rescue/vnconfig -z vnd0 /stand/usr.zfs /rescue/mount -r /dev/vnd0a /usr fi echo -n "=> Mounting memory filesystem directories: " /rescue/@MNT_RAMFS_CMD@ @MNT_RAMFS_ARGS@ /ramfs for f in dev etc root tmp var do /rescue/mkdir /ramfs/$f /rescue/mount_null /ramfs/$f /$f if [ "$f" = "var" ]; then echo "/$f." else echo -n "/$f, " fi done @HOME_MKDIR@ @HOME_MOUNT@ @HOME_UNPACK@ @USRPKGETC_MKDIR@ @USRPKGETC_MOUNT@ @USRPKGETC_UNPACK@ for f in mfs_dev mfs_etc mfs_var mfs_root do @TAR@ xfzp /stand/$f.tgz -C / > /dev/null 2>&1 if [ "$?" -eq 0 ]; then echo "=> $f unpacked successfully." else echo "=> $f not unpacked correctly!" fi done if [ -f /stand/var_db_pkg.zfs ]; then /rescue/vnconfig -z vnd1 /stand/var_db_pkg.zfs /rescue/mount -r /dev/vnd1a /var/db/pkg fi } livecd_stop() { echo "Please don't do that :-)" } load_rc_config $name run_rc_command "$1"