Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: reserve gpt tail for nix usb partitions

+5 -1
+5 -1
fedac/native/scripts/nixos-image-helper.sh
··· 65 65 local type_guid="$4" 66 66 local part_name="$5" 67 67 local sector_size=512 68 + local gpt_tail_sectors=34 68 69 local image_bytes 69 70 local image_sectors 70 71 local start_sector 71 72 local size_sectors 73 + local total_sectors 72 74 73 75 image_bytes=$(stat -c%s "${image_path}") 74 76 image_sectors=$(( (image_bytes + sector_size - 1) / sector_size )) 75 77 start_sector=$(( ((image_sectors + 2047) / 2048) * 2048 )) 76 78 size_sectors=$(( size_mib * 1024 * 1024 / sector_size )) 79 + total_sectors=$(( start_sector + size_sectors + gpt_tail_sectors )) 77 80 78 - truncate -s $(((start_sector + size_sectors) * sector_size)) "${image_path}" 81 + truncate -s $(( total_sectors * sector_size )) "${image_path}" 82 + sgdisk -e "${image_path}" >/dev/null 79 83 printf 'start=%s, size=%s, type=%s, name="%s"\n' \ 80 84 "${start_sector}" "${size_sectors}" "${type_guid}" "${part_name}" | 81 85 sfdisk --no-reread -N "${part_number}" "${image_path}" >/dev/null