From 3645e874305ee108e8c0967d828e50d4310ba3c6 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Wed, 13 Jul 2022 00:51:21 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20insure=20that=20word=5Fdir=20is?= =?UTF-8?q?=20safe=20to=20delete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util-iso-mount.sh | 4 +--- util-iso.sh | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util-iso-mount.sh b/util-iso-mount.sh index 68b57b9..3da586b 100755 --- a/util-iso-mount.sh +++ b/util-iso-mount.sh @@ -20,13 +20,11 @@ umount_img() { check_umount() { if mountpoint -q "$1"; then - sudo umount -l "$1" + sudo umount "$1" fi } umount_fs(){ - FS_ACTIVE_MOUNTS=() - if [[ -n ${FS_ACTIVE_MOUNTS[@]} ]]; then info "overlayfs umount: [%s]" "${FS_ACTIVE_MOUNTS[@]}" #umount "${FS_ACTIVE_MOUNTS[@]}" diff --git a/util-iso.sh b/util-iso.sh index e2a4918..5db833e 100755 --- a/util-iso.sh +++ b/util-iso.sh @@ -92,11 +92,12 @@ run_build() { if $clean_first; then msg2 "Deleting the build folder if one exists - takes some time" + umount_fs [ -d ${work_dir} ] && sudo rm -rf ${work_dir} fi msg2 "Copying the Archiso folder to build work" - mkdir ${work_dir} + mkdir -p ${work_dir} cp -r archiso ${work_dir}/archiso msg "Start [Build ISO]" @@ -107,11 +108,12 @@ run_build() { sudo chown $USER $outFolder cp ${work_dir}/iso/arch/pkglist.x86_64.txt $outFolder/$(gen_iso_fn).pkgs.txt - mv $outFolder/"cachyos-$(date +%Y.%m.%d)-x86_64.iso" $outFolder/${iso_file} + mv "$outFolder/$_profile/cachyos-$(date +%Y.%m.%d)-x86_64.iso" $outFolder/${iso_file} msg "Done [Build ISO] ${iso_file}" msg "Finished building [%s]" "${_profile}" + cd "$outFolder/$_profile" for f in $(find . -maxdepth 1 -name '*.iso' | cut -d'/' -f2); do if [[ ! -e $f.sha256 ]]; then create_chksums $f