Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archiso/mkarchiso
diff options
context:
space:
mode:
authornl6720 <nl6720@gmail.com>2021-08-03 12:04:11 +0300
committernl6720 <nl6720@gmail.com>2021-08-15 16:39:55 +0300
commitb040ef1774ed3f3755128b18fdd5ba4eb2598794 (patch)
tree7de115f7b50c9b04f8fd4b3683f264e7c234e0f6 /archiso/mkarchiso
parent6185448477313e304a8ab662e5857b50a515d1fa (diff)
mkarchiso: ensure there are no existing image files before trying to create them
This could prevent a few issues when creating an image file when re-running mkarchiso after a failure. Remove useless test before running rm -f. The command will always succeed.
Diffstat (limited to 'archiso/mkarchiso')
-rwxr-xr-xarchiso/mkarchiso6
1 files changed, 5 insertions, 1 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index 8b43f75..e726e0e 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -160,6 +160,7 @@ _cleanup_pacstrap_dir() {
# $@: options to pass to mksquashfs
_run_mksquashfs() {
local image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.sfs"
+ rm -f -- "${image_path}"
if [[ "${quiet}" == "y" ]]; then
mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" -no-progress > /dev/null
else
@@ -186,6 +187,7 @@ _mkairootfs_ext4+squashfs() {
'-U' 'clear'
)
[[ ! "${quiet}" == "y" ]] || mkfs_ext4_options+=('-q')
+ rm -f -- "${pacstrap_dir}.img"
E2FSPROGS_FAKE_TIME="${SOURCE_DATE_EPOCH}" mkfs.ext4 "${mkfs_ext4_options[@]}" -- "${pacstrap_dir}.img" 32G
tune2fs -c 0 -i 0 -- "${pacstrap_dir}.img" > /dev/null
_msg_info "Done!"
@@ -213,6 +215,7 @@ _mkairootfs_erofs() {
install -d -m 0755 -- "${isofs_dir}/${install_dir}/${arch}"
local image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.erofs"
+ rm -f -- "${image_path}"
# Generate reproducible file system UUID from SOURCE_DATE_EPOCH
fsuuid="$(uuidgen --sha1 --namespace 93a870ff-8565-4cf3-a67b-f47299271a96 --name "${SOURCE_DATE_EPOCH}")"
_msg_info "Creating EROFS image, this may take some time..."
@@ -490,7 +493,7 @@ _make_efibootimg() {
)"
# The FAT image must be created with mkfs.fat not mformat, as some systems have issues with mformat made images:
# https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html
- [[ -e "${work_dir}/efiboot.img" ]] && rm -f -- "${work_dir}/efiboot.img"
+ rm -f -- "${work_dir}/efiboot.img"
_msg_info "Creating FAT image of size: ${imgsize} KiB..."
mkfs.fat -C -n ARCHISO_EFI "${work_dir}/efiboot.img" "${imgsize}"
@@ -903,6 +906,7 @@ _build_iso_image() {
typeset -f "_add_xorrisofs_options_${bootmode}" &> /dev/null && "_add_xorrisofs_options_${bootmode}"
done
+ rm -f -- "${out_dir}/${image_name}"
_msg_info "Creating ISO image..."
xorriso -as mkisofs \
-iso-level 3 \