From 57a8d9bb182295a3f83be2e06148c94261385dff Mon Sep 17 00:00:00 2001 From: nl6720 Date: Mon, 3 Jan 2022 22:28:08 +0200 Subject: hooks/archiso: mount cow_device read-only at first and remount it read-write right after This prevents errors when the device is already mounted read-only somewhere else (e.g. if cow_device and archisodevice are the same). Partially reverts d0d7eb25cf503753cb1452756059a281289e7a41 Fixes #9. --- hooks/archiso | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hooks/archiso b/hooks/archiso index 59c5765..7e40077 100644 --- a/hooks/archiso +++ b/hooks/archiso @@ -244,7 +244,10 @@ archiso_mount_handler() { fi if [ -n "${cow_device}" ]; then - _mnt_dev "${cow_device}" "/run/archiso/cowspace" "-w" "${cow_flags}" + # Mount cow_device read-only at first and remount it read-write right after. This prevents errors when the + # device is already mounted read-only somewhere else (e.g. if cow_device and archisodevice are the same). + _mnt_dev "${cow_device}" "/run/archiso/cowspace" "-r" "${cow_flags}" + mount -o remount,rw "/run/archiso/cowspace" else msg ":: Mounting /run/archiso/cowspace (tmpfs) filesystem, size=${cow_spacesize}..." mkdir -p /run/archiso/cowspace -- cgit v1.2.3-70-g09d2