From 9a1ea05dcb8a17255830c6f428bfe7c39c2f280f Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Sun, 4 Aug 2024 17:11:02 -0400 Subject: [PATCH] Added umount --- gentoo-install.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gentoo-install.sh b/gentoo-install.sh index 3b28805..4a25aac 100755 --- a/gentoo-install.sh +++ b/gentoo-install.sh @@ -199,7 +199,7 @@ function prepare_target() { ${cmd} mkdir -p /mnt/gentoo/swap ${cmd} mount -o noatime,ssd,subvol=@swap "$rootmount" /mnt/gentoo/swap - if [[ "$SWAP" ]]; then + if [[ "$SWAP" && ! -f /mnt/gentoo/swap/hibernate.swp ]]; then #${cmd} mkdir -p /mnt/gentoo/swap #${cmd} mount -o noatime,ssd,subvol=@swap "$rootmount" /mnt/gentoo/swap ${cmd} btrfs filesystem mkswapfile --size "$(get_hibernate_size)g" --uuid clear /mnt/gentoo/swap/hibernate.swp @@ -349,6 +349,20 @@ function install_mount() { prepare_target } +function install_umount() { + show_options + + read -rsn1 -p"Unounting: To proceed, press enter to continue." proceed + echo + if [[ "$proceed" != "" ]]; then + echo "Aborting." + exit 1 + fi + + echo "Mounting Partitions on ${RootDisk}..." + umount -R /mnt/gentoo +} + function install_stage() { show_options @@ -424,10 +438,14 @@ while [[ $# -gt 0 ]]; do DEBUG=true shift ;; - -m|--mount) + --mount) INSTALL_MODE=mount shift ;; + --umount) + INSTALL_MODE=umount + shift + ;; --stage) INSTALL_MODE=stage INSTALL_STAGE=$1 @@ -477,6 +495,7 @@ else case "$INSTALL_MODE" in normal) install_prep;; mount) install_mount;; + umount) install_umount;; stage) install_stage;; clean) install_cleanup;; *)