mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 08:33:24 +00:00
The existing bazaar and site-specific policy in rc.diskless1 is Just Wrong;
and looks like no other Unix diskless configuration I've ever seen. Thus allow a more traditional /etc. Note, the use of an MFS /var should also be settable. Otherwise installing ports(packages) is just a total PITA.
This commit is contained in:
parent
d46d3a1c02
commit
5158a0f59f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91074
@ -56,7 +56,7 @@ mount_md()
|
||||
}
|
||||
|
||||
# If there is a global system configuration file, suck it in.
|
||||
mount_md ${varsize:=65536} /var 1
|
||||
#
|
||||
if [ -r /etc/rc.subr ]; then
|
||||
. /etc/rc.subr
|
||||
load_rc_config $name
|
||||
@ -83,7 +83,7 @@ fi
|
||||
|
||||
# If /tmp is a symlink, assume it points to somewhere writable, like
|
||||
# /var/tmp, otherwise, use a small memory filesystem for /tmp.
|
||||
mount_md ${tmpsize:=20480} /tmp 2
|
||||
#
|
||||
# XXX: mtree runs too early to create any directories needed in /tmp,
|
||||
# so if /var/tmp == /tmp, then you don't get a vi.recover.
|
||||
#
|
||||
|
@ -92,13 +92,14 @@ for i in ${iflist} ; do
|
||||
done
|
||||
echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
|
||||
|
||||
if [ -d /conf/default/etc ]; then
|
||||
mount_md 4096 /etc 0
|
||||
chkerr $? "MFS mount on /etc"
|
||||
/bin/chmod 755 /etc
|
||||
|
||||
mount_md 4096 /etc 0
|
||||
chkerr $? "MFS mount on /etc"
|
||||
/bin/chmod 755 /etc
|
||||
|
||||
/bin/cp -Rp /conf/default/etc/* /etc
|
||||
chkerr $? "cp /conf/default/etc to /etc MFS"
|
||||
/bin/cp -Rp /conf/default/etc/* /etc
|
||||
chkerr $? "cp /conf/default/etc to /etc MFS"
|
||||
fi
|
||||
|
||||
# Allow for override files to replace files in /etc. Use /conf/*/etc to find
|
||||
# the override files. First choice is default files that # always override,
|
||||
@ -114,6 +115,11 @@ for i in ${bootp_ipbca} ${bootp_ipa} ; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Since we are starting with a very fresh /etc on an MFS:
|
||||
if [ -d /conf/default/etc ]; then
|
||||
newaliases
|
||||
if
|
||||
|
||||
# Tell /etc/rc to run the specified script after it does its mounts but
|
||||
# before it does anything else.
|
||||
#
|
||||
|
@ -56,7 +56,7 @@ mount_md()
|
||||
}
|
||||
|
||||
# If there is a global system configuration file, suck it in.
|
||||
mount_md ${varsize:=65536} /var 1
|
||||
#
|
||||
if [ -r /etc/rc.subr ]; then
|
||||
. /etc/rc.subr
|
||||
load_rc_config $name
|
||||
@ -83,7 +83,7 @@ fi
|
||||
|
||||
# If /tmp is a symlink, assume it points to somewhere writable, like
|
||||
# /var/tmp, otherwise, use a small memory filesystem for /tmp.
|
||||
mount_md ${tmpsize:=20480} /tmp 2
|
||||
#
|
||||
# XXX: mtree runs too early to create any directories needed in /tmp,
|
||||
# so if /var/tmp == /tmp, then you don't get a vi.recover.
|
||||
#
|
||||
|
@ -56,7 +56,7 @@ mount_md()
|
||||
}
|
||||
|
||||
# If there is a global system configuration file, suck it in.
|
||||
mount_md ${varsize:=65536} /var 1
|
||||
#
|
||||
if [ -r /etc/rc.subr ]; then
|
||||
. /etc/rc.subr
|
||||
load_rc_config $name
|
||||
@ -83,7 +83,7 @@ fi
|
||||
|
||||
# If /tmp is a symlink, assume it points to somewhere writable, like
|
||||
# /var/tmp, otherwise, use a small memory filesystem for /tmp.
|
||||
mount_md ${tmpsize:=20480} /tmp 2
|
||||
#
|
||||
# XXX: mtree runs too early to create any directories needed in /tmp,
|
||||
# so if /var/tmp == /tmp, then you don't get a vi.recover.
|
||||
#
|
||||
|
@ -56,7 +56,7 @@ mount_md()
|
||||
}
|
||||
|
||||
# If there is a global system configuration file, suck it in.
|
||||
mount_md ${varsize:=65536} /var 1
|
||||
#
|
||||
if [ -r /etc/rc.subr ]; then
|
||||
. /etc/rc.subr
|
||||
load_rc_config $name
|
||||
@ -83,7 +83,7 @@ fi
|
||||
|
||||
# If /tmp is a symlink, assume it points to somewhere writable, like
|
||||
# /var/tmp, otherwise, use a small memory filesystem for /tmp.
|
||||
mount_md ${tmpsize:=20480} /tmp 2
|
||||
#
|
||||
# XXX: mtree runs too early to create any directories needed in /tmp,
|
||||
# so if /var/tmp == /tmp, then you don't get a vi.recover.
|
||||
#
|
||||
|
@ -92,13 +92,14 @@ for i in ${iflist} ; do
|
||||
done
|
||||
echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
|
||||
|
||||
if [ -d /conf/default/etc ]; then
|
||||
mount_md 4096 /etc 0
|
||||
chkerr $? "MFS mount on /etc"
|
||||
/bin/chmod 755 /etc
|
||||
|
||||
mount_md 4096 /etc 0
|
||||
chkerr $? "MFS mount on /etc"
|
||||
/bin/chmod 755 /etc
|
||||
|
||||
/bin/cp -Rp /conf/default/etc/* /etc
|
||||
chkerr $? "cp /conf/default/etc to /etc MFS"
|
||||
/bin/cp -Rp /conf/default/etc/* /etc
|
||||
chkerr $? "cp /conf/default/etc to /etc MFS"
|
||||
fi
|
||||
|
||||
# Allow for override files to replace files in /etc. Use /conf/*/etc to find
|
||||
# the override files. First choice is default files that # always override,
|
||||
@ -114,6 +115,11 @@ for i in ${bootp_ipbca} ${bootp_ipa} ; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Since we are starting with a very fresh /etc on an MFS:
|
||||
if [ -d /conf/default/etc ]; then
|
||||
newaliases
|
||||
if
|
||||
|
||||
# Tell /etc/rc to run the specified script after it does its mounts but
|
||||
# before it does anything else.
|
||||
#
|
||||
|
@ -56,7 +56,7 @@ elif [ -r /etc/rc.conf ]; then
|
||||
fi
|
||||
|
||||
echo "+++ mount_md of /var"
|
||||
mount_md ${varsize:=65536} /var 1
|
||||
mount_md ${varsize:=32m} /var 1
|
||||
|
||||
echo "+++ populate /var using /etc/mtree/BSD.var.dist"
|
||||
/usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
|
||||
@ -83,7 +83,7 @@ mount -a # chown and chgrp are in /usr
|
||||
# so if /var/tmp == /tmp, then you don't get a vi.recover.
|
||||
#
|
||||
if [ ! -h /tmp ]; then
|
||||
mount_md ${tmpsize:=20480} /tmp 2
|
||||
mount_md ${tmpsize:=64m} /tmp 2
|
||||
chmod 01777 /tmp
|
||||
fi
|
||||
|
||||
|
@ -92,13 +92,14 @@ for i in ${iflist} ; do
|
||||
done
|
||||
echo "Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}"
|
||||
|
||||
if [ -d /conf/default/etc ]; then
|
||||
mount_md 4096 /etc 0
|
||||
chkerr $? "MFS mount on /etc"
|
||||
/bin/chmod 755 /etc
|
||||
|
||||
mount_md 4096 /etc 0
|
||||
chkerr $? "MFS mount on /etc"
|
||||
/bin/chmod 755 /etc
|
||||
|
||||
/bin/cp -Rp /conf/default/etc/* /etc
|
||||
chkerr $? "cp /conf/default/etc to /etc MFS"
|
||||
/bin/cp -Rp /conf/default/etc/* /etc
|
||||
chkerr $? "cp /conf/default/etc to /etc MFS"
|
||||
fi
|
||||
|
||||
# Allow for override files to replace files in /etc. Use /conf/*/etc to find
|
||||
# the override files. First choice is default files that # always override,
|
||||
@ -114,6 +115,11 @@ for i in ${bootp_ipbca} ${bootp_ipa} ; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Since we are starting with a very fresh /etc on an MFS:
|
||||
if [ -d /conf/default/etc ]; then
|
||||
newaliases
|
||||
if
|
||||
|
||||
# Tell /etc/rc to run the specified script after it does its mounts but
|
||||
# before it does anything else.
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user