diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-24 11:06:04 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-24 11:06:04 -0500 |
commit | 3d764cd1e8f5f8efe6eb4f32f67867daa2def2e9 (patch) | |
tree | 62f574a154a9f1f3286c171404000cb17988147e /mountvirtfs.sh | |
parent | d2610e90370dd558d1e7c870e312557eb988ae28 (diff) |
Extract virt fs mount commands to a separate script.
Diffstat (limited to 'mountvirtfs.sh')
-rw-r--r-- | mountvirtfs.sh | 32 |
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 |