Package dev-minimal: Scripts

Post install

if [ -f /etc/fstab ]; then
	# Add /dev/pts to fstab if fstab exists (install2 does it during install).
	if grep -F -qs devpts /etc/fstab; then
		if grep -qs 'devpts.*mode=0622' /etc/fstab; then
			# Correct permissions from broken dev packages.
			TMP=$(mktemp /tmp/fstab.XXXXXX) &&
			sed -e 's/devpts.*mode=0622/devpts	gid=5,mode=0620/' </etc/fstab >"$TMP" &&
				cat "$TMP" >/etc/fstab ||
				echo "failed to correct devpts permissions in /etc/fstab" 1>&2
			rm -f "$TMP"
		fi
	else
		echo 'devpts		/dev/pts		devpts	gid=5,mode=0620	0 0' >>/etc/fstab
	fi
fi
PCA=/sbin/pam_console_apply
[ -x "$PCA" ] && "$PCA" ||:
Pre install

if [ -r /proc/mounts ]; then 
	(while read dev mountpoint rest ; do 
		[ "$mountpoint" != /dev ] || exit 1 
	done 
	exit 0 ) < /proc/mounts || { 
		echo 
		echo '** Cannot install dev-minimal: mounted udev detected.' 
		echo '** This is no problem, but to avoid side-effects with' 
		echo '** stopping and starting it automatically, please do:' 
		echo '/etc/init.d/udevd umount' 
		echo 'apt-get install dev-minimal' 
		echo '/etc/init.d/udevd restart' 
		echo '** Note that some services like syslogd or gpm might need' 
		echo '** restart after this, too; others might have problems.' 
		exit 1 
	} 
fi
Pre uninstall

if [ -r /proc/mounts ]; then 
	(while read dev mountpoint rest ; do 
		[ "$mountpoint" != /dev ] || exit 1 
	done 
	exit 0 ) < /proc/mounts || { 
		echo 
		echo '** Cannot remove dev-minimal: mounted udev detected.' 
		echo '** This is no problem, but to avoid side-effects with' 
		echo '** stopping and starting it automatically, please do:' 
		echo '/etc/init.d/udevd umount' 
		echo 'rpm -e dev-minimal' 
		echo '/etc/init.d/udevd restart' 
		echo '** Note that some services like syslogd or gpm might need' 
		echo '** restart after this, too; others might have problems.' 
		exit 1 
	} 
fi

# RPM would let dev-minimal installation break
# but install dev (which requires the same dev-minimal)
# during that transaction; so need to check here too