[SCM] Debian Live build scripts branch, master, updated. 1.0.1-1-20-g3f4d8bf
Daniel Baumann
daniel at debian.org
Sun Oct 12 09:11:50 UTC 2008
The following commit has been merged in the master branch:
commit 3f4d8bfd052529c7ed5dc47a780394970563178d
Author: Daniel Baumann <daniel at debian.org>
Date: Sun Oct 12 11:07:42 2008 +0200
Adding lh_chroot_selinuxfs helper to support building live images on a selinux enabled host (Closes: #501652).
diff --git a/helpers/lh_binary b/helpers/lh_binary
index 48087c0..41d111c 100755
--- a/helpers/lh_binary
+++ b/helpers/lh_binary
@@ -36,6 +36,7 @@ then
# Configuring chroot
lh_chroot_devpts install ${*}
lh_chroot_proc install ${*}
+ lh_chroot_selinuxfs install ${*}
lh_chroot_sysfs install ${*}
lh_chroot_hosts install ${*}
lh_chroot_resolv install ${*}
@@ -68,6 +69,7 @@ if [ "${LH_CHROOT_BUILD}" != "enabled" ]
then
lh_chroot_devpts install ${*}
lh_chroot_proc install ${*}
+ lh_chroot_selinuxfs install ${*}
lh_chroot_sysfs install ${*}
fi
@@ -87,5 +89,6 @@ then
fi
lh_chroot_sysfs remove ${*}
+lh_chroot_selinuxfs remove ${*}
lh_chroot_proc remove ${*}
lh_chroot_devpts remove ${*}
diff --git a/helpers/lh_chroot b/helpers/lh_chroot
index 6bd4e90..81681c3 100755
--- a/helpers/lh_chroot
+++ b/helpers/lh_chroot
@@ -32,6 +32,7 @@ Set_defaults
lh_chroot_cache restore ${*}
lh_chroot_devpts install ${*}
lh_chroot_proc install ${*}
+lh_chroot_selinuxfs install ${*}
lh_chroot_sysfs install ${*}
lh_chroot_debianchroot install ${*}
lh_chroot_dpkg install ${*}
@@ -72,6 +73,7 @@ lh_chroot_sysv-rc remove ${*}
lh_chroot_dpkg remove ${*}
lh_chroot_debianchroot remove ${*}
lh_chroot_sysfs remove ${*}
+lh_chroot_selinuxfs remove ${*}
lh_chroot_proc remove ${*}
lh_chroot_devpts remove ${*}
lh_chroot_cache save ${*}
diff --git a/helpers/lh_chroot_proc b/helpers/lh_chroot_selinuxfs
similarity index 53%
copy from helpers/lh_chroot_proc
copy to helpers/lh_chroot_selinuxfs
index 0cb5205..69340c6 100755
--- a/helpers/lh_chroot_proc
+++ b/helpers/lh_chroot_selinuxfs
@@ -1,6 +1,6 @@
#!/bin/sh
-# lh_chroot_proc(1) - mount /proc
+# lh_chroot_sysfs(1) - mount /selinux
# Copyright (C) 2006-2008 Daniel Baumann <daniel at debian.org>
#
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
@@ -18,7 +18,7 @@ do
done
# Setting static variables
-DESCRIPTION="mount /proc"
+DESCRIPTION="mount /selinux"
HELP=""
USAGE="${PROGRAM} {install|remove} [--force]"
@@ -36,35 +36,38 @@ Require_stagefile .stage/bootstrap
case "${1}" in
install)
- Echo_message "Begin mounting /proc..."
+ if [ -e /selinux/enforce ] && [ "$(cat /selinux/enforce)" = "1" ]
+ then
+ Echo_message "Begin mounting /selinux..."
- # Checking stage file
- Check_stagefile .stage/chroot_proc
+ # Checking stage file
+ Check_stagefile .stage/chroot_selinuxfs
- # Checking lock file
- Check_lockfile .lock
+ # Checking lock file
+ Check_lockfile .lock
- # Creating lock file
- Create_lockfile .lock
+ # Creating lock file
+ Create_lockfile .lock
- if [ "${LH_USE_FAKEROOT}" != "enabled" ]
- then
- # Creating mountpoint
- mkdir -p chroot/proc
+ if [ "${LH_USE_FAKEROOT}" != "enabled" ]
+ then
+ # Create mountpoint
+ mkdir -p chroot/selinux
+
+ # Mounting /selinux
+ ${LH_ROOT_COMMAND} mount selinuxfs-live -t selinuxfs chroot/selinux
+ else
+ rm -rf chroot/selinux
+ ln -s /selinux chroot/
+ fi
- # Mounting /proc
- ${LH_ROOT_COMMAND} mount proc-live -t proc chroot/proc
- else
- rm -rf chroot/proc
- ln -s /proc chroot/
+ # Creating stage file
+ Create_stagefile .stage/chroot_selinuxfs
fi
-
- # Creating stage file
- Create_stagefile .stage/chroot_proc
;;
remove)
- Echo_message "Begin unmounting /proc..."
+ Echo_message "Begin unmounting /selinux..."
# Checking lock file
Check_lockfile .lock
@@ -74,25 +77,19 @@ case "${1}" in
if [ "${LH_USE_FAKEROOT}" != "enabled" ]
then
- # Workaround binfmt-support /proc locking
- if [ -e chroot/proc/sys/fs/binfmt_misc/status ]
- then
- ${LH_ROOT_COMMAND} umount chroot/proc/sys/fs/binfmt_misc
- fi
-
- # Unmounting /proc
- #fuser -km chroot/proc
- if [ -e chroot/proc/version ]
+ # Unmounting /selinux
+ #fuser -km chroot/selinux
+ if [ -e chroot/selinux/enforce ]
then
- ${LH_ROOT_COMMAND} umount chroot/proc
+ ${LH_ROOT_COMMAND} umount chroot/selinux
fi
else
- rm -rf chroot/proc
- mkdir -p chroot/proc
+ rm -rf chroot/selinux
+ mkdir -p chroot/selinux
fi
# Removing stage file
- rm -f .stage/chroot_proc
+ rm -f .stage/chroot_selinux
;;
*)
--
Debian Live build scripts
More information about the debian-live-changes
mailing list