added utilities function for mount and umount

This commit is contained in:
ag-tsotetsi
2026-02-20 14:36:18 +02:00
parent afb43302af
commit 6324284d4d

View File

@@ -109,6 +109,25 @@ change_owner() {
sudo chown -R root:root "$SYSROOT"/{etc,cross,usr,dev,proc,sys,run,var} sudo chown -R root:root "$SYSROOT"/{etc,cross,usr,dev,proc,sys,run,var}
} }
do_mount() {
if ! mountpoint -q "$SYSROOT/dev"; then
sudo mount --bind /dev "$SYSROOT"/dev
sudo mount -t devpts devpts -o gid=5,mode=0620 "$SYSROOT"/dev/pts
sudo mount -t proc proc "$SYSROOT"/proc
sudo mount -t sysfs sysfs "$SYSROOT"/sys
sudo mount -t tmpfs tmpfs "$SYSROOT"/run
if [ -h "$SYSROOT"/dev/shm ]; then
sudo install -d -m 1777 "$SYSROOT"$(realpath /dev/shm)
else
sudo mount -t tmpfs -o nosuid,nodev tmpfs "$SYSROOT"/dev/shm
fi
fi
}
do_unmount() {
sudo umount -R "$SYSROOT/"
}
fetch() { fetch() {
wget -N -c --show-progress -q -P "$SOURCES" $1 wget -N -c --show-progress -q -P "$SOURCES" $1
} }
@@ -614,4 +633,5 @@ toolchain_gcc() {
#toolchain_xz #toolchain_xz
#toolchain_binutils #toolchain_binutils
#toolchain_gcc #toolchain_gcc
change_owner #change_owner
do_mount