Bug#833687: initscripts: Fix a few checkroot.sh warnings on GNU/kFreeBSD
Package: initscripts
Version: 2.88dsf-59.3
Severity: minor
Tags: patch
Hi
This patch fixes a few warnings caused by checkroot.sh when running on FreeBSD. The problem being that a few filesystems (tmpfs, linprocfs and linsysfs) can't be remounted, so with attached patch remount is avoided.
--
Jon Boden
ubuntuBSD -- The power of FreeBSD kernel with familiarity of Ubuntu OS!
http://www.ubuntubsd.org/ -- https://twitter.com/ubuntuBSD
diff -ur ../debian/src/initscripts/lib/init/mount-functions.sh debian/src/initscripts/lib/init/mount-functions.sh
--- ../debian/src/initscripts/lib/init/mount-functions.sh 2016-01-17 04:35:18.000000000 +0100
+++ debian/src/initscripts/lib/init/mount-functions.sh 2016-08-07 20:56:36.400457000 +0200
@@ -158,6 +158,9 @@
# $4: mount point
# $5: mount device name
# $6... : extra mount program options
+
+KERNEL="$(uname -s)"
+
domount () {
MOUNTMODE="$1"
PRIFSTYPE="$2"
@@ -174,6 +177,19 @@
# Mount options from fstab
FSTAB_OPTS=
+ if [ "$MOUNTMODE" = remount ] ; then
+ case "$KERNEL" in
+ *FreeBSD)
+ case "$PRIFSTYPE" in
+ proc|tmpfs|sysfs)
+ # can't be remounted
+ return 0
+ ;;
+ esac
+ ;;
+ esac
+ fi
+
if [ "$PRIFSTYPE" = proc ]; then
case "$KERNEL" in
Linux) FSTYPE=proc ;;
@@ -460,6 +476,15 @@
{
MNTMODE="$1"
+ if [ "$MNTMODE" = remount ] ; then
+ case "$KERNEL" in
+ *FreeBSD)
+ # tmpfs can't be remounted
+ return 0
+ ;;
+ esac
+ fi
+
# Needed to determine if root is being mounted read-only.
read_fstab
@@ -490,6 +515,15 @@
{
MNTMODE="$1"
+ if [ "$MNTMODE" = remount ] ; then
+ case "$KERNEL" in
+ *FreeBSD)
+ # tmpfs can't be remounted
+ return 0
+ ;;
+ esac
+ fi
+
# Make lock directory as the replacement for /var/lock
[ -d /run/lock ] || mkdir --mode=755 /run/lock
[ -x /sbin/restorecon ] && /sbin/restorecon /run/lock
Reply to: