void-packages/srcpkgs/shadow/INSTALL
Juan RP 85cc462e1d Major infrastructure changes, part 2.
* Moved helpers, common and triggers dirs into xbps-src, where
  they belong.
* Renamed the templates dir to srcpkgs, it was so redundant before.
* Make it possible to add subpkgs with no restriction in names, for
  example udev now has a subpkgs called "libgudev". Previously
  subpkgs were named "${sourcepkg}-${pkgname}".
* xbps-src: changed to look for template files in current directory.
  That means that most arguments from the targets have been removed.
* xbps-src: added a reinstall target, to remove + install.
* xbps-src: do not overwrite binpkgs by default, skip them.

And more that I forgot because it's a mega-commit that I've been
working for some days already...

--HG--
extra : convert_revision : 0f466878584d1e6895d2a234f07ea1b2d1e61b3e
2009-11-22 08:31:44 +01:00

61 lines
1,003 B
Text

#
# This script creates default /etc/passwd and /etc/group
# files if they are unexistent.
#
# Also shadow passwords are enabled.
create_passwd()
{
cat > ./etc/passwd <<_EOF
root:x:0:0:root:/root:/bin/bash
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
_EOF
echo "Created default /etc/passwd file."
}
create_group()
{
# Default group list as specified by LFS.
cat > ./etc/group <<_EOF
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
wheel:x:4:
tty:x:5:
tape:x:6:
daemon:x:7:
floppy:x:8:
disk:x:9:
lp:x:10:
dialout:x:11:
audio:x:12:
video:x:13:
utmp:x:14:
usb:x:15:
cdrom:x:16:
optical:x:17:
mail:x:18:
storage:x:19:
scanner:x:20:
nogroup:x:99:
users:x:1000:
_EOF
echo "Created default /etc/group file."
}
case "${ACTION}" in
pre)
;;
post)
echo "Running ${PKGNAME}-${VERSION} post installation hooks..."
[ ! -f ./etc/passwd ] && create_passwd
[ ! -f ./etc/group ] && create_group
if [ ! -f ./etc/shadow ]; then
echo "Enabling shadowed (group) passwords..."
pwconv && grpconv
fi
;;
esac