# $NetBSD: livecd,v 1.2 2005/08/13 23:35:45 xtraeme Exp $ # # Mount mfs 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 based filesystems: " mount_mfs @MNT_DEV_ARGS@ swap /dev echo -n "/dev, " mount_mfs @MNT_ETC_ARGS@ swap /etc echo -n "/etc, " mount_mfs @MNT_ROOT_ARGS@ swap /root echo -n "/root, " mount_mfs @MNT_TMP_ARGS@ swap /tmp echo -n "/tmp, " mount_mfs @MNT_VAR_ARGS@ swap /var echo "/var." @HOME@ @HOMETAR@ @USRPKGETC@ @USRPKGETCTAR@ 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"