summaryrefslogtreecommitdiff
path: root/sys-apps
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-04-06 18:49:43 +0200
committerKarel Kočí <cynerd@email.cz>2018-04-06 18:50:42 +0200
commit9fdc5c3f07e3592fed8ef4202f6c1362ed773a9c (patch)
tree4668d25588320b1f8ee56ef5384df516724a35dd /sys-apps
parent6257247fd0a68459c60523bc11140371f5f70462 (diff)
downloadgentoo-personal-overlay-9fdc5c3f07e3592fed8ef4202f6c1362ed773a9c.tar.gz
gentoo-personal-overlay-9fdc5c3f07e3592fed8ef4202f6c1362ed773a9c.tar.bz2
gentoo-personal-overlay-9fdc5c3f07e3592fed8ef4202f6c1362ed773a9c.zip
personal-utils: fix gentoo-mount prints and check for DIR
Diffstat (limited to 'sys-apps')
-rwxr-xr-xsys-apps/personal-utils/files/gentoo-mount22
-rw-r--r--sys-apps/personal-utils/personal-utils-1.5.1-r1.ebuild (renamed from sys-apps/personal-utils/personal-utils-1.5-r1.ebuild)0
2 files changed, 13 insertions, 9 deletions
diff --git a/sys-apps/personal-utils/files/gentoo-mount b/sys-apps/personal-utils/files/gentoo-mount
index f3cd674..812d7d5 100755
--- a/sys-apps/personal-utils/files/gentoo-mount
+++ b/sys-apps/personal-utils/files/gentoo-mount
@@ -35,6 +35,10 @@ if [ $(id -u) != 0 ]; then
echo "This script has to be run only as root." >&2
exit 1
fi
+if [ ! -d "$DIR" ]; then
+ echo "No DIR specified or no such directory exists: $DIR" >&2
+ exit 1
+fi
# Interactive mount
@@ -48,13 +52,13 @@ imount() {
return mount -o "$3" "$1" "$2"
fi
- echo "\e[1;32mPlease choose device\e[0m"
+ echo -e "\e[1;32mPlease choose device\e[0m"
lsblk -o NAME,LABEL,SIZE,FSTYPE,MOUNTPOINT
while true; do
echo -n "Device: /dev/"
read DEVICE
if [ ! -b "/dev/$DEVICE" ]; then
- echo "No such device: /dev/$DEVICE" >&2
+ echo -e "No such device: /dev/$DEVICE" >&2
else
break
fi
@@ -66,7 +70,7 @@ imount() {
while [ -e "/dev/mapper/$CSNAME" ]; do
CSNAME="${CSNAME}2"
done
- echo "\e[1;32mOpening encrypted filesystem\e[0m"
+ echo -e "\e[1;32mOpening encrypted filesystem\e[0m"
cryptsetup open "/dev/$DEVICE" "$CSNAME"
DEVICE="mapper/$CSNAME"
fi
@@ -83,7 +87,7 @@ imount() {
local TMP="$(mktemp -d)"
mount "/dev/$DEVICE" "$TMP"
while true; do
- echo "\e[1;32mPlease choose subvolume\e[0m"
+ echo -e "\e[1;32mPlease choose subvolume\e[0m"
btrfs subvolume list -t "$TMP"
# TODO default value? Probably same as name?
echo -n "Subvolume: "
@@ -102,24 +106,24 @@ imount() {
}
# Mount root filesystem ##########################################################
-echo "\e[1;34mMount root filesystem\e[0m"
+echo -e "\e[1;34mMount root filesystem\e[0m"
imount "$DEV_ROOT" "$DIR" "" root
# Mount system paths #############################################################
-echo "\e[1;34mMount system paths\e[0m"
+echo -e "\e[1;34mMount system paths\e[0m"
mount -t proc /proc "$DIR/proc"
mount --rbind /dev "$DIR/dev"
mount --rbind /sys "$DIR/sys"
# Copy current resolv.conf #######################################################
-echo "\e[1;34mCopy system resolv.conf\e[0m"
+echo -e "\e[1;34mCopy system resolv.conf\e[0m"
cp /etc/resolv.conf "$DIR/etc/resolv.conf"
# Mount boot partition ###########################################################
-echo "\e[1;34mMount boot partition\e[0m"
+echo -e "\e[1;34mMount boot partition\e[0m"
imount "$DEV_BOOT" "$DIR/boot"
# Mount home partition ###########################################################
-echo "\e[1;34mMount home partition\e[0m"
+echo -e "\e[1;34mMount home partition\e[0m"
imount "$DEV_HOME" "$DIR/home"
diff --git a/sys-apps/personal-utils/personal-utils-1.5-r1.ebuild b/sys-apps/personal-utils/personal-utils-1.5.1-r1.ebuild
index 0f40c22..0f40c22 100644
--- a/sys-apps/personal-utils/personal-utils-1.5-r1.ebuild
+++ b/sys-apps/personal-utils/personal-utils-1.5.1-r1.ebuild