From 3d764cd1e8f5f8efe6eb4f32f67867daa2def2e9 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Wed, 24 Mar 2021 11:06:04 -0500 Subject: Extract virt fs mount commands to a separate script. --- mountvirtfs.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 mountvirtfs.sh (limited to 'mountvirtfs.sh') 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 -- cgit v1.2.3-54-g00ecf