Skip to content

Commit

Permalink
Loop devices: partially revert
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Jan 2, 2025
1 parent b202541 commit 8c8c748
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/functions/image/partitioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,17 @@ function prepare_partitions() {
display_alert "Partitioning with the following options" "$partition_script_output" "debug"
echo "${partition_script_output}" | run_host_command_logged sfdisk "${SDCARD}".raw || exit_with_error "Partitioning failed!"
fi

declare -g LOOP
call_extension_method "post_create_partitions" <<- 'POST_CREATE_PARTITIONS'
*called after all partitions are created, but not yet formatted*
POST_CREATE_PARTITIONS

# stage: mount image
# lock access to loop devices
exec {FD}> /var/lock/armbian-debootstrap-losetup
flock -x $FD
if [[ -z $LOOP ]]; then
exec {FD}> /var/lock/armbian-debootstrap-losetup
flock -x $FD

LOOP=$(losetup -f)
[[ -z $LOOP ]] && exit_with_error "Unable to find free loop device"
display_alert "Allocated loop device" "LOOP=${LOOP}"
Expand Down

0 comments on commit 8c8c748

Please sign in to comment.