PREIN
/bin/sh
# Make sure that the needed groups exist on the install machine
/usr/sbin/groupadd -g 19 -r -f floppy > /dev/null
/usr/sbin/groupadd -g 20 -r -f console > /dev/null
/usr/sbin/groupadd -g 65 -r -f audio > /dev/null
/usr/sbin/groupadd -g 66 -r -f x10 >/dev/null
/usr/sbin/groupadd -g 67 -r -f radio >/dev/null
POSTIN
/bin/sh
if [ -f /etc/fstab ] ; then
# add /dev/pts to fstab if fstab exists (install2 does it during install)
if grep 'devpts' /etc/fstab >/dev/null 2>&1 ; then
# correct permissions from broken dev packages
LC_ALL=C \
perl -pi -e 's/devpts.*mode=0622/devpts gid=5,mode=620/' /etc/fstab
else
# note that we do not disallow comments; we wish to allow people
# to comment it out if they so desire.
if [ $(grep '/proc' /dev/fstab 2>/dev/null | wc -l) -gt 1 ] ; then
# ugly but robust
echo '
none /dev/pts devpts gid=5,mode=620 0 0' \
>> /etc/fstab || { echo "failed to add devpts filesystem to /etc/fstab" 1>&2 ; exit 1 ; }
else
# beautiful in the common case
TMP=$(mktemp /tmp/fstab.XXXXXX)
sed '/\/proc/a\
none /dev/pts devpts gid=5,mode=620 0 0
' < /etc/fstab > $TMP && cat $TMP > /etc/fstab || { echo "failed to add devpts filesystem to /etc/fstab" 1>&2 ; exit 1 ; }
rm -f $TMP
fi
fi
fi