lfs mount-virt.sh added
This commit is contained in:
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
function mountbind
|
||||
{
|
||||
if ! mountpoint $LFS/$1 >/dev/null; then
|
||||
$SUDO mount --bind /$1 $LFS/$1
|
||||
echo $LFS/$1 mounted
|
||||
else
|
||||
echo $LFS/$1 already mounted
|
||||
fi
|
||||
}
|
||||
|
||||
function mounttype
|
||||
{
|
||||
if ! mountpoint $LFS/$1 >/dev/null; then
|
||||
$SUDO mount -t $2 $3 $4 $5 $LFS/$1
|
||||
echo $LFS/$1 mounted
|
||||
else
|
||||
echo $LFS/$1 already mounted
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $EUID -ne 0 ]; then
|
||||
SUDO=sudo
|
||||
else
|
||||
SUDO=""
|
||||
fi
|
||||
|
||||
if [ x$LFS == x ]; then
|
||||
echo "LFS not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mountbind dev
|
||||
mounttype dev/pts devpts devpts -o gid=5,mode=620
|
||||
mounttype proc proc proc
|
||||
mounttype sys sysfs sysfs
|
||||
mounttype run tmpfs run
|
||||
if [ -h $LFS/dev/shm ]; then
|
||||
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
|
||||
else
|
||||
mounttype dev/shm tmpfs tmpfs -o nosuid,nodev
|
||||
fi
|
||||
|
||||
#mountbind usr/src
|
||||
#mountbind boot
|
||||
#mountbind home
|
||||
Reference in New Issue
Block a user