ca3935f19d
Otherwise, random panics may occur. Explanation from ad@, patch from Zafer. Bump to 0.17.
72 lines
1.4 KiB
Text
72 lines
1.4 KiB
Text
# $NetBSD: livecd,v 1.8 2009/04/11 17:28:16 wiz 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: "
|
|
|
|
echo "dev, "
|
|
/rescue/@MNT_RAMFS_CMD@ @MNT_RAMFS_ARGS@ /dev
|
|
|
|
/rescue/@MNT_RAMFS_CMD@ @MNT_RAMFS_ARGS@ /ramfs
|
|
|
|
for f in etc root tmp var
|
|
do
|
|
/rescue/mkdir /ramfs/$f
|
|
[ "$f" = "tmp" ] && /rescue/chmod 01777 /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 dev etc var root
|
|
do
|
|
@TAR@ xfzp /stand/ramfs_$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"
|