diff --git a/usr/local/bin/install_to_disk.sh b/usr/local/bin/install_to_disk.sh index dff805c..e48e206 100755 --- a/usr/local/bin/install_to_disk.sh +++ b/usr/local/bin/install_to_disk.sh @@ -107,58 +107,41 @@ regenerate_partition_identifiers() { esac fi - # Generate new UUID and update label based on filesystem type + # Handle the known 3-partition structure case "$fstype" in "vfat"|"fat32"|"fat16") - # FAT32 has 11 character limit for labels + # Partition 2: FAT32 EFI boot partition if [[ -n "$new_label" ]]; then - new_label="${new_label:0:11}" + new_label="${new_label:0:11}" # FAT32 has 11 character limit if command -v fatlabel >/dev/null 2>&1; then sudo fatlabel "$partition" "$new_label" 2>/dev/null || echo "Warning: Could not rename FAT partition $partition" fi fi - # Generate new UUID for FAT - mlabel -s generates a new random serial + # Generate new UUID for FAT if command -v mlabel >/dev/null 2>&1; then sudo mlabel -s -i "$partition" :: 2>/dev/null || echo "Warning: Could not change FAT serial on $partition" fi ;; - "ext2"|"ext3"|"ext4") - # ext* has 16 character limit for labels + "ext4") + # Partition 3: ext4 root filesystem if [[ -n "$new_label" ]]; then - new_label="${new_label:0:16}" + new_label="${new_label:0:16}" # ext4 has 16 character limit if command -v tune2fs >/dev/null 2>&1; then - sudo tune2fs -L "$new_label" "$partition" 2>/dev/null || echo "Warning: Could not rename ext partition $partition" + sudo tune2fs -L "$new_label" "$partition" 2>/dev/null || echo "Warning: Could not rename ext4 partition $partition" fi fi - # Generate new UUID for ext filesystems + # Generate new UUID for ext4 if command -v tune2fs >/dev/null 2>&1; then sudo tune2fs -U random "$partition" 2>/dev/null || echo "Warning: Could not change UUID on $partition" fi ;; - "ntfs") - # NTFS has 32 character limit for labels - if [[ -n "$new_label" ]]; then - new_label="${new_label:0:32}" - if command -v ntfslabel >/dev/null 2>&1; then - sudo ntfslabel "$partition" "$new_label" 2>/dev/null || echo "Warning: Could not rename NTFS partition $partition" - fi - fi - ;; - "xfs") - # XFS has 12 character limit for labels - if [[ -n "$new_label" ]]; then - new_label="${new_label:0:12}" - if command -v xfs_admin >/dev/null 2>&1; then - sudo xfs_admin -L "$new_label" "$partition" 2>/dev/null || echo "Warning: Could not rename XFS partition $partition" - fi - fi - # Generate new UUID for XFS - if command -v xfs_admin >/dev/null 2>&1; then - sudo xfs_admin -U generate "$partition" 2>/dev/null || echo "Warning: Could not change UUID on $partition" - fi + "") + # Partition 1: No filesystem (skip) + echo "Skipping partition $partition (no filesystem)" + continue ;; *) - echo "Info: Skipping unknown filesystem type '$fstype' on $partition" + echo "Warning: Unexpected filesystem type '$fstype' on $partition" continue ;; esac @@ -357,6 +340,9 @@ if sudo mount "$TARGET_ROOT_PART" "$TEMP_MOUNT" 2>/dev/null; then sudo cp "$TEMP_MOUNT/etc/fstab" "$TEMP_MOUNT/etc/fstab.backup" || echo "Warning: Could not backup fstab" fi +# Restore speech +echo "command toggletempdisablespeech" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock + echo "Unmounting target partition..." sudo umount "$TEMP_MOUNT" else @@ -375,5 +361,5 @@ echo "You can now reboot and remove the USB drive." echo "The system will boot from the internal disk." echo "=========================================" echo -echo "Press any key to continue..." +echo "Press enter to continue..." read -r