Fix errors in install to disk too.

This commit is contained in:
Storm Dragon
2025-08-26 15:29:12 -04:00
parent f41fd0907f
commit 91266ac08a
+22 -3
View File
@@ -70,10 +70,10 @@ regenerate_partition_identifiers() {
# Get all partitions on the target device # Get all partitions on the target device
local partitions=() local partitions=()
while IFS= read -r partition; do while IFS= read -r partition; do
if [[ "$partition" != "$target_device" ]]; then if [[ "$partition" != "$target_device" && "$partition" =~ ^${target_device}.+ ]]; then
partitions+=("$partition") partitions+=("$partition")
fi fi
done < <(lsblk -lpno NAME "$target_device" 2>/dev/null | grep "^${target_device}") done < <(lsblk -lpno NAME "$target_device" 2>/dev/null)
# Process each partition # Process each partition
for partition in "${partitions[@]}"; do for partition in "${partitions[@]}"; do
@@ -346,12 +346,15 @@ done
# Regenerate partition UUIDs and labels to prevent boot conflicts with USB # Regenerate partition UUIDs and labels to prevent boot conflicts with USB
echo "Regenerating partition identifiers..." echo "Regenerating partition identifiers..."
mapfile -t uuid_mappings < <(regenerate_partition_identifiers "$TARGET_DEVICE") mapfile -t uuid_mappings < <(regenerate_partition_identifiers "$TARGET_DEVICE")
echo "Found ${#uuid_mappings[@]} UUID mappings to update"
# Mount and make final adjustments # Mount and make final adjustments
TEMP_MOUNT="/mnt/stormux_target" TEMP_MOUNT="/mnt/stormux_target"
sudo mkdir -p "$TEMP_MOUNT" sudo mkdir -p "$TEMP_MOUNT"
echo "Mounting $TARGET_ROOT_PART for final adjustments..."
if sudo mount "$TARGET_ROOT_PART" "$TEMP_MOUNT" 2>/dev/null; then if sudo mount "$TARGET_ROOT_PART" "$TEMP_MOUNT" 2>/dev/null; then
echo "Successfully mounted target partition"
# Remove any USB-specific markers # Remove any USB-specific markers
sudo rm -f "$TEMP_MOUNT/home/stormux/.firstboot" 2>/dev/null || true sudo rm -f "$TEMP_MOUNT/home/stormux/.firstboot" 2>/dev/null || true
@@ -364,22 +367,38 @@ if sudo mount "$TARGET_ROOT_PART" "$TEMP_MOUNT" 2>/dev/null; then
# Update /etc/fstab with new UUIDs # Update /etc/fstab with new UUIDs
if [[ ${#uuid_mappings[@]} -gt 0 ]]; then if [[ ${#uuid_mappings[@]} -gt 0 ]]; then
update_fstab_uuids "$TEMP_MOUNT" "${uuid_mappings[@]}" echo "Updating fstab with new UUIDs..."
if update_fstab_uuids "$TEMP_MOUNT" "${uuid_mappings[@]}"; then
echo "fstab updated successfully"
else
echo "Warning: fstab update failed"
fi
else
echo "No UUID mappings found - fstab will not be updated"
fi fi
echo "Unmounting target partition..."
sudo umount "$TEMP_MOUNT" sudo umount "$TEMP_MOUNT"
else
echo "ERROR: Failed to mount target partition $TARGET_ROOT_PART"
echo "Installation may have failed - please check the target disk"
echo "However, the disk cloning operation completed."
fi fi
sudo rmdir "$TEMP_MOUNT" sudo rmdir "$TEMP_MOUNT"
# Re-enable speech before success message # Re-enable speech before success message
echo "Restoring speech output..."
echo "command toggletempdisablespeech" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock 2>/dev/null || true echo "command toggletempdisablespeech" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock 2>/dev/null || true
sleep 1
# Success message # Success message
echo echo
echo "========================================="
echo "Installation completed successfully!" echo "Installation completed successfully!"
echo "The USB system has been cloned to $TARGET_DEVICE" echo "The USB system has been cloned to $TARGET_DEVICE"
echo "You can now reboot and remove the USB drive." 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 "Press Enter to continue..." echo "Press Enter to continue..."
read -r read -r