summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2016-11-05 09:14:38 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2016-11-05 09:14:38 +0000
commit91e6875b0d32af209e27a29e5469461e2d6ea882 (patch)
treeb3c2ce0f9afb8e54066f7f946c31c23d48f30b40
parent800f3218920d50aad4b6556c81f27fdf249b8c3a (diff)
Remove the obj, xobj and src directories from the base set.
The installer will create these directories during install. So local setups will not get overwritten during upgrades. idea from and OK deraadt@ with help from and OK tb@ feedback from and no objections halex@
-rw-r--r--distrib/miniroot/group1
-rw-r--r--distrib/miniroot/install.sub14
-rw-r--r--distrib/sets/lists/base/mi3
-rw-r--r--etc/Makefile11
4 files changed, 14 insertions, 15 deletions
diff --git a/distrib/miniroot/group b/distrib/miniroot/group
index defb619a020..95a445f734d 100644
--- a/distrib/miniroot/group
+++ b/distrib/miniroot/group
@@ -5,6 +5,7 @@ sys:*:3:root
tty:*:4:root
operator:*:5:root
bin:*:7:
+wsrc:*:9:
_ping:*:51:
_shadow:*:65:
_dhcp:*:77:
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 7f6c96f39fc..be0993bc405 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.929 2016/10/30 13:27:05 rpe Exp $
+# $OpenBSD: install.sub,v 1.930 2016/11/05 09:14:36 rpe Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
@@ -2382,7 +2382,7 @@ store_random() {
# Final steps common for installs and upgrades.
finish_up() {
- local _dev _mp _fstype _rest
+ local _dev _mp _fstype _rest _d
# Mount all known swap partitions. This gives systems with little
# memory a better chance at running 'MAKEDEV all'.
@@ -2419,6 +2419,16 @@ finish_up() {
# dynamic. That is highly discouraged, but let us play it safe.
rm -f /mnt/var/run/ld.so.hints
+ # Conditionally create /usr/{src,obj,xobj} directories and set
+ # proper ownership (root:wsrc) and permissions during install.
+ if [[ $MODE == install ]]; then
+ for _d in /mnt/usr/{obj,src,xobj}; do
+ mkdir -p $_d
+ chmod 775 $_d
+ chown root:wsrc $_d
+ done
+ fi
+
[[ -x /mnt/$MODE.site ]] && chroot /mnt /$MODE.site
# In case this is a softraid device, make sure all underlying
diff --git a/distrib/sets/lists/base/mi b/distrib/sets/lists/base/mi
index 8f498b83d88..ec1411f940a 100644
--- a/distrib/sets/lists/base/mi
+++ b/distrib/sets/lists/base/mi
@@ -2283,7 +2283,6 @@
./usr/local/share/pkgconfig
./usr/local/share/skel
./usr/mdec
-./usr/obj
./usr/sbin
./usr/sbin/ac
./usr/sbin/accton
@@ -7245,8 +7244,6 @@
./usr/share/zoneinfo/right/Zulu
./usr/share/zoneinfo/zone.tab
./usr/share/zoneinfo/zone1970.tab
-./usr/src
-./usr/xobj
./var
./var/account
./var/audit
diff --git a/etc/Makefile b/etc/Makefile
index d85fc0e9ddd..fdada477dfa 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.443 2016/10/14 18:45:12 deraadt Exp $
+# $OpenBSD: Makefile,v 1.444 2016/11/05 09:14:37 rpe Exp $
TZDIR= /usr/share/zoneinfo
LOCALTIME= Canada/Mountain
@@ -228,15 +228,6 @@ distrib-dirs:
${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}; \
fi
mtree -qdef mtree/4.4BSD.dist -p ${DESTDIR}/ -U
- if [ ! -d ${DESTDIR}/usr/src ]; then \
- ${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/src; \
- fi
- if [ ! -d ${DESTDIR}/usr/obj ]; then \
- ${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/obj; \
- fi
- if [ ! -d ${DESTDIR}/usr/xobj ]; then \
- ${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/xobj; \
- fi
cd ${DESTDIR}/; ln -fhs usr/src/sys sys
chown -h root:wheel ${DESTDIR}/sys