mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 10:51:36 -04:00
`wrolpi-usb.sh upgrade <iso> <device>` replaces the boot partition of an
existing WROLPi USB with a new ISO while preserving the persistence
partition.
Flow:
1. Locate the persistence partition by label.
2. Read its sector range from sfdisk -d.
3. Confirm the new ISO fits in the headroom (i.e. its byte count <=
persistence_start_sector * 512). If not, bail with instructions
telling the user to back up /media/wrolpi, re-flash from scratch,
and restore. This is the case for USBs flashed before the 8 GiB-
headroom commit.
4. Save the partition table to /tmp/ for emergency recovery.
5. Prompt for "yes".
6. dd the new ISO onto the device. The persistence partition's
sectors are past the ISO's end, so its data is untouched.
7. sfdisk --append to re-add the persistence partition entry at the
saved sector range. The data on disk is still there; we are just
fixing up the partition table the new ISO wrote.
8. partx -u to refresh the kernel view; verify the label is reachable.
`install` subcommand is wired up to a die() for now; will land in a
follow-up commit.
The script refuses to operate on non-removable disks (foot-gun guard).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| cleanup_orphaned_tags.py | ||
| delete_downloads.py | ||
| delete_similarly_named_videos.py | ||
| dev_build.sh | ||
| find_and_convert_srt_to_vtt.py | ||
| find_and_rename_orphan_video_files.py | ||
| find_corrupt_videos.py | ||
| fix_media_permissions.sh | ||
| generate_certificates.sh | ||
| generate_subtitles.py | ||
| initialize_api_db.sh | ||
| install_debian_12.sh | ||
| install_help_service.sh | ||
| install_protomaps.sh | ||
| install_raspberrypios.sh | ||
| renew_certificates.sh | ||
| reset_api_db.sh | ||
| reset_tags.sh | ||
| reset_virtual_environments.sh | ||
| singlefile_to_archive.py | ||
| start_kiwix_serve.sh | ||
| upgrade.sh | ||
| upgrade_yt-dlp.sh | ||
| wrolpi-usb.sh | ||