From 5a7b37a14bb8d7c972451ddf15e18749eb3e18f3 Mon Sep 17 00:00:00 2001 From: Syahrial Agni Prasetya Date: Sat, 6 Mar 2021 12:39:59 +0700 Subject: [PATCH] Add remount_run to uth. --- archbox.bash | 4 ++-- exp/startx-killxdg.bash | 2 +- install.sh | 1 - remount_run.bash | 24 ------------------------ uth.bash | 19 +++++++++++++++++++ 5 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 remount_run.bash diff --git a/archbox.bash b/archbox.bash index 6c5046f..e1de6d7 100644 --- a/archbox.bash +++ b/archbox.bash @@ -104,12 +104,12 @@ case $1 in ;; --remount-run) storeenv - $PRIV $PREFIX/share/archbox/bin/remount_run + $PRIV $PREFIX/share/archbox/bin/uth remountrun exit $? ;; --mount-runtime-only) storeenv - $PRIV $PREFIX/share/archbox/bin/remount_run runtimeonly + $PRIV $PREFIX/share/archbox/bin/uth runtimeonly exit $? ;; -h|--help) diff --git a/exp/startx-killxdg.bash b/exp/startx-killxdg.bash index fc5f8d1..8ec6443 100755 --- a/exp/startx-killxdg.bash +++ b/exp/startx-killxdg.bash @@ -3,4 +3,4 @@ source /etc/archbox.conf startx -$PRIV $PREFIX/share/archbox/bin/remount_run killxdg +$PRIV $PREFIX/share/archbox/bin/uth killxdg diff --git a/install.sh b/install.sh index 7953757..3130677 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,6 @@ install -v -D -m 755 ./archbox.bash $PREFIX/bin/archbox install -v -D -m 755 ./archbox-desktop.bash $PREFIX/bin/archbox-desktop [[ ! -e /etc/archbox.conf ]] && install -v -D -m 755 ./archbox.conf /etc/archbox.conf install -v -D -m 755 ./archboxcommand.bash $PREFIX/share/archbox/bin/archbox -install -v -D -m 755 ./remount_run.bash $PREFIX/share/archbox/bin/remount_run install -v -D -m 755 ./chroot_setup.bash $PREFIX/share/archbox/chroot_setup.bash install -v -D -m 755 ./archboxinit.bash $PREFIX/share/archbox/bin/archboxinit install -v -D -m 755 ./uth.bash $PREFIX/share/archbox/bin/uth diff --git a/remount_run.bash b/remount_run.bash deleted file mode 100644 index 0bd8d1c..0000000 --- a/remount_run.bash +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -source /etc/archbox.conf -source /tmp/archbox_env - -case $1 in - killxdg) - umount -l $CHROOT/run - fuser -km $XDG_RUNTIME_DIR - exit $? - ;; - runtimeonly) - mkdir -p $CHROOT$XDG_RUNTIME_DIR - umount -Rl $CHROOT$XDG_RUNTIME_DIR 2>/dev/null - mount | grep $CHROOT$XDG_RUNTIME_DIR || \ - mount --rbind $XDG_RUNTIME_DIR $CHROOT$XDG_RUNTIME_DIR - exit $? - ;; - *) - umount -l $CHROOT/run - mount --rbind /run $CHROOT/run - exit $? - ;; -esac diff --git a/uth.bash b/uth.bash index 76d4588..5bf8ab1 100644 --- a/uth.bash +++ b/uth.bash @@ -1,8 +1,27 @@ #!/usr/bin/env bash + source /etc/archbox.conf +source /tmp/archbox_env case $1 in copyresolv) cp /etc/resolv.conf $CHROOT/etc/resolv.conf ;; + killxdg) + umount -l $CHROOT/run + fuser -km $XDG_RUNTIME_DIR + exit $? + ;; + runtimeonly) + mkdir -p $CHROOT$XDG_RUNTIME_DIR + umount -Rl $CHROOT$XDG_RUNTIME_DIR 2>/dev/null + mount | grep $CHROOT$XDG_RUNTIME_DIR || \ + mount --rbind $XDG_RUNTIME_DIR $CHROOT$XDG_RUNTIME_DIR + exit $? + ;; + remountrun) + umount -l $CHROOT/run 2>/dev/null + mount --rbind /run $CHROOT/run + exit $? + ;; esac \ No newline at end of file