Browse Source

lib: make sure /tmp is there and mount it

Duncan Overbruck 5 năm trước cách đây
mục cha
commit
2b1aa4f45d
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      lib.sh.in

+ 5 - 0
lib.sh.in

@@ -58,6 +58,10 @@ mount_pseudofs() {
             mount -r --bind /$f "$ROOTFS/$f"
         fi
     done
+    if ! mountpoint -q "$ROOTFS/tmp" ; then
+        mkdir -p "$ROOTFS/tmp"
+        mount -o mode=0755,nosuid,nodev -t tmpfs tmpfs "$ROOTFS/tmp"
+    fi
 }
 
 umount_pseudofs() {
@@ -71,6 +75,7 @@ umount_pseudofs() {
             umount -f "$ROOTFS/$f" >/dev/null 2>&1
         done
     fi
+    umount -f "$ROOTFS/tmp" >/dev/null 2>&1
 }
 
 run_cmd_target() {