install.sh fixes: free space detection, btrfs online resize, partition naming #13

Closed
unbrot wants to merge 12 commits from main into devel
Contributor

Summary

  • Add detection of unpartitioned free space as an alternative to shrinking a partition
  • Fix double /dev/ prefix bug in collect_partitions (lsblk -p already returns full path for PKNAME)
  • Fix btrfs resize: use online resize instead of unmounting (avoids busy-partition failures)
  • Replace parted resizepart with sfdisk --force to avoid interactive TTY requirement
  • Set GPT partition name to anacondainstall for the new OEMDRV partition
  • Fix early exit when script is run as non-root

Test plan

  • Tested end-to-end on a VirtualBox VM via SSH: btrfs shrink + sfdisk resize + mkfs.btrfs + mount + git clone all succeeded
  • Non-root exit verified via bash <(curl ...)
  • Free space path (no shrink needed) covered by new collect_free_space / show_free_table
## Summary - Add detection of unpartitioned free space as an alternative to shrinking a partition - Fix double `/dev/` prefix bug in `collect_partitions` (lsblk -p already returns full path for PKNAME) - Fix btrfs resize: use online resize instead of unmounting (avoids busy-partition failures) - Replace `parted resizepart` with `sfdisk --force` to avoid interactive TTY requirement - Set GPT partition name to `anacondainstall` for the new OEMDRV partition - Fix early exit when script is run as non-root ## Test plan - [ ] Tested end-to-end on a VirtualBox VM via SSH: btrfs shrink + sfdisk resize + mkfs.btrfs + mount + git clone all succeeded - [ ] Non-root exit verified via `bash <(curl ...)` - [ ] Free space path (no shrink needed) covered by new `collect_free_space` / `show_free_table`
unbrot added 12 commits 2026-04-27 16:52:34 +02:00
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Flatpak autoprovisioning command does not reliably write credentials
to KWallet from inside the sandbox. After provisioning, directly write
both KWallet entries (user:url/:0 and user_app-password:url/:0) via
qdbus, creating the Nextcloud folder first if needed. kwallet-query was
tried but silently returns 0 without creating missing folders.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Shrinks a selected ext4/btrfs partition by 4 GiB, creates a new BTRFS
partition labeled OEMDRV, mounts it to /opt/sys_config and clones the
repository into it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If a disk has unpartitioned space >= 4096 MiB, it is offered as a direct
target for the OEMDRV partition, avoiding any filesystem resize.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lsblk -p returns PKNAME as a full path (/dev/sda), so stripping
the basename before prepending /dev/ avoids /dev//dev/sda.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
btrfs supports live filesystem resize, so there is no need to
unmount a mounted btrfs partition before shrinking it. This also
avoids umount failures when the partition is busy (e.g. /home with
an active SSH session). ext4 still requires offline resize.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
parted -s answers confirmation prompts with "no" (conservative),
causing resizepart/mkpart to fail on a mounted partition. Pipe
"Yes" to parted stdin instead so busy-partition warnings are
confirmed and the operation proceeds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
parted fails to resize a mounted partition non-interactively.
sfdisk --no-reread --force writes the updated partition table
directly without TTY/confirmation issues, and partprobe
re-reads it afterwards.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner

Please update install.md also

Please update install.md also
obel1x closed this pull request 2026-04-27 17:04:27 +02:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: obel1x/fedora-OEMDRV#13