aboutsummaryrefslogtreecommitdiffstats
path: root/mountvirtfs.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-03-24 11:06:04 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-03-24 11:06:04 -0500
commit3d764cd1e8f5f8efe6eb4f32f67867daa2def2e9 (patch)
tree62f574a154a9f1f3286c171404000cb17988147e /mountvirtfs.sh
parentd2610e90370dd558d1e7c870e312557eb988ae28 (diff)
Extract virt fs mount commands to a separate script.
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