Commit 7e533a67 authored by Hideki Yamane's avatar Hideki Yamane 🐈

Fix second-stage failure within systemd-nspawn (Closes: #840372)

And it also bring another fix on lxc (Closes: #731802)
parent 812de13f
......@@ -1133,12 +1133,16 @@ setup_proc () {
umount_on_exit /proc
umount_on_exit /proc/bus/usb
umount "$TARGET/proc" 2>/dev/null || true
in_target mount -t proc proc /proc
if [ -d "$TARGET/sys" ] && \
grep -q '[[:space:]]sysfs' /proc/filesystems 2>/dev/null; then
umount_on_exit /sys
umount "$TARGET/sys" 2>/dev/null || true
in_target mount -t sysfs sysfs /sys
# if systemd-nspawn is used at second-stage, it already treats /proc and so on
# and also fix failure on lxc environment
if [ ! -n "$(ls -A /proc)" ]; then
in_target mount -t proc proc /proc
if [ -d "$TARGET/sys" ] && \
grep -q '[[:space:]]sysfs' /proc/filesystems 2>/dev/null; then
umount_on_exit /sys
umount "$TARGET/sys" 2>/dev/null || true
in_target mount -t sysfs sysfs /sys
fi
fi
on_exit clear_mtab
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment