aboutsummaryrefslogtreecommitdiffstats
path: root/mountvirtfs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mountvirtfs.sh')
-rw-r--r--mountvirtfs.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/mountvirtfs.sh b/mountvirtfs.sh
new file mode 100644
index 0000000..7eea548
--- /dev/null
+++ b/mountvirtfs.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+printf "%b" "${GRN}Mounting virtual kernel filesystems...${RST}\n"
+if ! mountpoint "${LFS}"/dev >/dev/null 2>&1; then
+ sudo mount -v --bind /dev "${LFS}"/dev
+else
+ printf "%b" " ${YLW}${LFS}/dev${GRN} is already mounted${RST}\n"
+fi
+if ! mountpoint "${LFS}"/dev/pts >/dev/null 2>&1; then
+ sudo mount -v --bind /dev/pts "${LFS}"/dev/pts
+else
+ printf "%b" " ${YLW}${LFS}/dev/pts${GRN} is already mounted${RST}\n"
+fi
+if ! mountpoint "${LFS}"/proc >/dev/null 2>&1; then
+ sudo mount -v --bind /proc "${LFS}"/proc
+else
+ printf "%b" " ${YLW}${LFS}/proc${GRN} is already mounted${RST}\n"
+fi
+if ! mountpoint "${LFS}"/sys >/dev/null 2>&1; then
+ sudo mount -v --bind /sys "${LFS}"/sys
+else
+ printf "%b" " ${YLW}${LFS}/sys${GRN} is already mounted${RST}\n"
+fi
+if ! mountpoint "${LFS}"/run >/dev/null 2>&1; then
+ sudo mount -v --bind /run "${LFS}"/run
+else
+ printf "%b" " ${YLW}${LFS}/run${GRN} is already mounted${RST}\n"
+fi
+
+if [ -h "${LFS}"/dev/shm ]; then
+ sudo mkdir -pv "${LFS}"/"$(readlink "${LFS}"/dev/shm)"
+fi