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 ln -sf /var/run/resolv.conf ${IMAGE_ROOTFS}/etc/resolv.conf
# Override base-passwd...it has lots of crap in it we don't # The passwd database is stored in /var.
# want, and we do want dbus/gdm etc. rm -f ${IMAGE_ROOTFS}/etc/passwd ${IMAGE_ROOTFS}/etc/shadow ${IMAGE_ROOTFS}/etc/shadow-
cat >${IMAGE_ROOTFS}/etc/passwd << EOF ln -s /var/passwd ${IMAGE_ROOTFS}/etc/passwd
root::0:0:root:/:/bin/sh rm -f ${IMAGE_ROOTFS}/etc/group
dbus:*:1:1:dbus:/:/bin/false ln -s /var/group ${IMAGE_ROOTFS}/etc/group
gdm:*:2:2:gdm:/var/lib/gdm:/bin/false
EOF
cat >${IMAGE_ROOTFS}/etc/group << EOF
root:*:0:root
dbus:*:1:
gdm:*:2:
EOF
mkdir ${IMAGE_ROOTFS}/var/lib/gdm mkdir ${IMAGE_ROOTFS}/var/lib/gdm
chown 2:2 ${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 mkdir ostree/repo
ostree --repo=ostree/repo init ostree --repo=ostree/repo init
fi 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 cd ostree
ostree --repo=${OSTREE_REPO} local-clone repo ${BRANCH_PREFIX}runtime ${BRANCH_PREFIX}devel ostree --repo=${OSTREE_REPO} local-clone repo ${BRANCH_PREFIX}runtime ${BRANCH_PREFIX}devel
for branch in runtime devel; do for branch in runtime devel; do