Add omarchy-iso disk-cleanup and archinstall-patch bash helpers
This commit is contained in:
2 files changed
+66
No files matched your search
+40
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Clean up any holders / mounts / LVM / crypt devices on the install disk
|
||||||
|
# before archinstall starts wiping. Idempotent — called once per install attempt
|
||||||
|
# from the orchestrator's cleanup_disk phase.
|
||||||
|
#
|
||||||
|
# Ported verbatim from .automated_script.sh's cleanup_install_disk(). Kept in
|
||||||
|
# bash because lsblk / findmnt / lvm / cryptsetup are all easier to drive
|
||||||
|
# here than from Python.
|
||||||
|
|
||||||
|
set -uo pipefail
|
||||||
|
|
||||||
|
disk="${1:-}"
|
||||||
|
[[ -n $disk && -b $disk ]] || { echo "Need a block device argument; got '$disk'" >&2; exit 1; }
|
||||||
|
|
||||||
|
echo "Cleaning up existing holders on install disk: $disk"
|
||||||
|
findmnt -R /mnt >/dev/null && umount -R /mnt || true
|
||||||
|
|
||||||
|
while read -r dev; do
|
||||||
|
[[ -b $dev ]] || continue
|
||||||
|
swapoff "$dev" 2>/dev/null || true
|
||||||
|
while read -r target; do
|
||||||
|
[[ -n $target ]] && umount "$target" 2>/dev/null || true
|
||||||
|
done < <(findmnt -rn -S "$dev" -o TARGET 2>/dev/null || true)
|
||||||
|
done < <(lsblk -rnpo PATH "$disk")
|
||||||
|
|
||||||
|
while read -r dev type; do
|
||||||
|
[[ $type == disk || $type == part || $type == crypt ]] || continue
|
||||||
|
while read -r vg; do
|
||||||
|
[[ -n $vg ]] && vgchange -an "$vg" 2>/dev/null || true
|
||||||
|
done < <(pvs --noheadings -o vg_name "$dev" 2>/dev/null | awk '{$1=$1; print}' | sort -u)
|
||||||
|
done < <(lsblk -rnpo PATH,TYPE "$disk")
|
||||||
|
|
||||||
|
while read -r dev type; do
|
||||||
|
[[ $type == crypt ]] && cryptsetup close "$dev" 2>/dev/null || true
|
||||||
|
done < <(lsblk -rnpo PATH,TYPE "$disk")
|
||||||
|
|
||||||
|
blockdev --flushbufs "$disk" 2>/dev/null || true
|
||||||
|
partprobe "$disk" 2>/dev/null || true
|
||||||
|
udevadm settle || true
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Patch upstream archinstall in place for two Python 3.14 / archinstall 4.3
|
||||||
|
# bugs that hit our flow:
|
||||||
|
#
|
||||||
|
# 1. logfile_target join: '/' on an absolute Path with another absolute Path
|
||||||
|
# raises. Strip leading slash so the join produces target / "var/log/..."
|
||||||
|
# instead of throwing.
|
||||||
|
#
|
||||||
|
# 2. Limine EFI copy: archinstall passes the destination directory but limine
|
||||||
|
# .copy() expects the destination file path. Two sites: limine_x64.efi
|
||||||
|
# copy and limine-bios.sys copy.
|
||||||
|
#
|
||||||
|
# Idempotent: re-running is a no-op (sed only matches the buggy form). Carry
|
||||||
|
# this until upstream Arch's packaged archinstall has the fixes.
|
||||||
|
|
||||||
|
set -eEo pipefail
|
||||||
|
|
||||||
|
target="/usr/lib/python3.14/site-packages/archinstall/lib/installer.py"
|
||||||
|
[[ -f $target ]] || { echo "archinstall installer.py not found at $target" >&2; exit 1; }
|
||||||
|
|
||||||
|
sed -i \
|
||||||
|
-e 's|logfile_target = self\.target / absolute_logfile$|logfile_target = self.target / absolute_logfile.relative_to("/")|' \
|
||||||
|
-e 's|(limine_path / file)\.copy(efi_dir_path)|(limine_path / file).copy(efi_dir_path / file)|' \
|
||||||
|
-e "s|(limine_path / 'limine-bios.sys')\.copy(boot_limine_path)|(limine_path / 'limine-bios.sys').copy(boot_limine_path / 'limine-bios.sys')|" \
|
||||||
|
"$target"
|
||||||
Reference in new issue
Block a user