Fixed press any key to press enter to be more accurate. Attempt to restore speech for final message, probably still broken, may be a bug in Fenrir itself.

This commit is contained in:
Storm Dragon
2025-08-26 16:53:50 -04:00
parent 2b825300b0
commit a966772418
+18 -32
View File
@@ -107,58 +107,41 @@ regenerate_partition_identifiers() {
esac esac
fi fi
# Generate new UUID and update label based on filesystem type # Handle the known 3-partition structure
case "$fstype" in case "$fstype" in
"vfat"|"fat32"|"fat16") "vfat"|"fat32"|"fat16")
# FAT32 has 11 character limit for labels # Partition 2: FAT32 EFI boot partition
if [[ -n "$new_label" ]]; then 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 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" sudo fatlabel "$partition" "$new_label" 2>/dev/null || echo "Warning: Could not rename FAT partition $partition"
fi fi
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 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" sudo mlabel -s -i "$partition" :: 2>/dev/null || echo "Warning: Could not change FAT serial on $partition"
fi fi
;; ;;
"ext2"|"ext3"|"ext4") "ext4")
# ext* has 16 character limit for labels # Partition 3: ext4 root filesystem
if [[ -n "$new_label" ]]; then 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 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
fi fi
# Generate new UUID for ext filesystems # Generate new UUID for ext4
if command -v tune2fs >/dev/null 2>&1; then 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" sudo tune2fs -U random "$partition" 2>/dev/null || echo "Warning: Could not change UUID on $partition"
fi fi
;; ;;
"ntfs") "")
# NTFS has 32 character limit for labels # Partition 1: No filesystem (skip)
if [[ -n "$new_label" ]]; then echo "Skipping partition $partition (no filesystem)"
new_label="${new_label:0:32}" continue
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
;; ;;
*) *)
echo "Info: Skipping unknown filesystem type '$fstype' on $partition" echo "Warning: Unexpected filesystem type '$fstype' on $partition"
continue continue
;; ;;
esac 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" sudo cp "$TEMP_MOUNT/etc/fstab" "$TEMP_MOUNT/etc/fstab.backup" || echo "Warning: Could not backup fstab"
fi fi
# Restore speech
echo "command toggletempdisablespeech" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
echo "Unmounting target partition..." echo "Unmounting target partition..."
sudo umount "$TEMP_MOUNT" sudo umount "$TEMP_MOUNT"
else 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 "The system will boot from the internal disk."
echo "=========================================" echo "========================================="
echo echo
echo "Press any key to continue..." echo "Press enter to continue..."
read -r read -r