mirror of
https://github.com/pygos/build.git
synced 2024-11-25 04:20:41 +01:00
cleanup: restructure user directories
Instead of having an overlay mounted /root in the root filesystem, move it to the other user directories, i.e. /usr/root. We then overlay mount the entire /usr directory. This still allows us to mount /usr from somewhere else if we wish, but cleans up/simplifies the filesystem for now and implements some default management of general user directories. Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
parent
a148a9bc38
commit
7f5f64978d
6 changed files with 21 additions and 23 deletions
|
@ -51,9 +51,9 @@ mount -t btrfs ${LODEV}p2 /tmp/mnt.$$
|
||||||
MOUNTED=1
|
MOUNTED=1
|
||||||
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
||||||
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
||||||
mkdir /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
mkdir -p /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chmod 750 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chmod 750 /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chown 0:0 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chown 0:0 /tmp/mnt.$$/usr/root
|
||||||
umount /tmp/mnt.$$
|
umount /tmp/mnt.$$
|
||||||
MOUNTED=0
|
MOUNTED=0
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,9 @@ mount -t btrfs ${DEVICE}2 /tmp/mnt.$$
|
||||||
MOUNTED=1
|
MOUNTED=1
|
||||||
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
||||||
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
||||||
mkdir /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
mkdir -p /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chmod 750 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chmod 750 /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chown 0:0 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chown 0:0 /tmp/mnt.$$/usr/root
|
||||||
umount /tmp/mnt.$$
|
umount /tmp/mnt.$$
|
||||||
MOUNTED=0
|
MOUNTED=0
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@ mount -t btrfs ${LODEV}p2 /tmp/mnt.$$
|
||||||
MOUNTED=1
|
MOUNTED=1
|
||||||
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
||||||
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
||||||
mkdir /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
mkdir -p /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chmod 750 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chmod 750 /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chown 0:0 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chown 0:0 /tmp/mnt.$$/usr/root
|
||||||
umount /tmp/mnt.$$
|
umount /tmp/mnt.$$
|
||||||
MOUNTED=0
|
MOUNTED=0
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,9 @@ mount -t btrfs ${DEVICE}p2 /tmp/mnt.$$
|
||||||
MOUNTED=1
|
MOUNTED=1
|
||||||
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
mkdir /tmp/mnt.$$/etc /tmp/mnt.$$/etc_work
|
||||||
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
mkdir /tmp/mnt.$$/var_lib /tmp/mnt.$$/var_lib_work
|
||||||
mkdir /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
mkdir -p /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chmod 750 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chmod 750 /tmp/mnt.$$/usr/root /tmp/mnt.$$/usr_work
|
||||||
chown 0:0 /tmp/mnt.$$/root /tmp/mnt.$$/root_work
|
chown 0:0 /tmp/mnt.$$/usr/root
|
||||||
umount /tmp/mnt.$$
|
umount /tmp/mnt.$$
|
||||||
MOUNTED=0
|
MOUNTED=0
|
||||||
|
|
||||||
|
|
|
@ -31,19 +31,17 @@ build() {
|
||||||
echo $OS_RELEASE > $PKGBUILDDIR/etc/$fname
|
echo $OS_RELEASE > $PKGBUILDDIR/etc/$fname
|
||||||
|
|
||||||
# setup root home directory
|
# setup root home directory
|
||||||
cp -r "$PKGBUILDDIR/etc/skel" "$PKGBUILDDIR/root"
|
mkdir -p "$PKGBUILDDIR/cfg/preserve/usr"
|
||||||
chmod 750 "$PKGBUILDDIR/root"
|
|
||||||
|
cp -r "$PKGBUILDDIR/etc/skel" "$PKGBUILDDIR/cfg/preserve/usr/root"
|
||||||
|
chmod 750 "$PKGBUILDDIR/cfg/preserve/usr/root"
|
||||||
|
|
||||||
# move configuration to preserve directory
|
# move configuration to preserve directory
|
||||||
mv ${PKGBUILDDIR}/etc ${PKGBUILDDIR}/cfg/preserve
|
mv "$PKGBUILDDIR/etc" "$PKGBUILDDIR/cfg/preserve"
|
||||||
mkdir -p ${PKGBUILDDIR}/etc
|
mv "$PKGBUILDDIR/var/lib" "$PKGBUILDDIR/cfg/preserve/var_lib"
|
||||||
|
rm -rf "$PKGBUILDDIR/var"
|
||||||
|
|
||||||
mv ${PKGBUILDDIR}/var/lib ${PKGBUILDDIR}/cfg/preserve/var_lib
|
mkdir -p ${PKGBUILDDIR}/{etc,var}
|
||||||
|
|
||||||
mv ${PKGBUILDDIR}/root ${PKGBUILDDIR}/cfg/preserve
|
|
||||||
mkdir -p ${PKGBUILDDIR}/root
|
|
||||||
chmod 750 ${PKGBUILDDIR}/root
|
|
||||||
chmod 750 ${PKGBUILDDIR}/cfg/preserve/root
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy() {
|
deploy() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
root:x:0:0:root:/root:/bin/bash
|
root:x:0:0:root:/usr/root:/bin/bash
|
||||||
bin:x:1:1:bin:/dev/null:/bin/false
|
bin:x:1:1:bin:/dev/null:/bin/false
|
||||||
daemon:x:6:6:Daemon User:/dev/null:/bin/false
|
daemon:x:6:6:Daemon User:/dev/null:/bin/false
|
||||||
messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
|
messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
|
||||||
|
|
Loading…
Reference in a new issue