gnomeos: Move /etc/passwd to /var/passwd

This makes "adduser" etc. work without significant modification, and
in general I think is in line with "OS-version indepedent data only
modifiable by programs" so it should be in /var.
This commit is contained in:
Colin Walters 2012-01-24 21:13:00 -05:00
parent 49e9b51df3
commit 5b00c108bf
2 changed files with 17 additions and 12 deletions

View File

@ -85,18 +85,12 @@ EOF
ln -sf /var/run/resolv.conf ${IMAGE_ROOTFS}/etc/resolv.conf
# Override base-passwd...it has lots of crap in it we don't
# want, and we do want dbus/gdm etc.
cat >${IMAGE_ROOTFS}/etc/passwd << EOF
root::0:0:root:/:/bin/sh
dbus:*:1:1:dbus:/:/bin/false
gdm:*:2:2:gdm:/var/lib/gdm:/bin/false
EOF
cat >${IMAGE_ROOTFS}/etc/group << EOF
root:*:0:root
dbus:*:1:
gdm:*:2:
EOF
# The passwd database is stored in /var.
rm -f ${IMAGE_ROOTFS}/etc/passwd ${IMAGE_ROOTFS}/etc/shadow ${IMAGE_ROOTFS}/etc/shadow-
ln -s /var/passwd ${IMAGE_ROOTFS}/etc/passwd
rm -f ${IMAGE_ROOTFS}/etc/group
ln -s /var/group ${IMAGE_ROOTFS}/etc/group
mkdir ${IMAGE_ROOTFS}/var/lib/gdm
chown 2:2 ${IMAGE_ROOTFS}/var/lib/gdm

View File

@ -74,6 +74,17 @@ if ! test -d ostree; then
mkdir ostree/repo
ostree --repo=ostree/repo init
fi
cat >ostree/var/passwd << EOF
root::0:0:root:/:/bin/sh
dbus:*:1:1:dbus:/:/bin/false
gdm:*:2:2:gdm:/var/lib/gdm:/bin/false
EOF
cat >ostree/var/group << EOF
root:*:0:root
dbus:*:1:
gdm:*:2:
EOF
cd ostree
ostree --repo=${OSTREE_REPO} local-clone repo ${BRANCH_PREFIX}runtime ${BRANCH_PREFIX}devel
for branch in runtime devel; do