Adapta el instalador a archinstall 4.3 y arregla paru/helpwire
- disk_config: archinstall 4.3 cambió el schema (exige sector_size, sin unidad Percent). Nuevo shared/gen-disk-config.py genera el layout con los modelos de archinstall, dimensionado al disco real; ambos setup.sh lo invocan y se quita el disk_config 3.0 muerto de los JSON. - paru: compilar de fuente, no paru-bin (su binario enlaza contra una libalpm.so concreta y rompe si la del sistema nuevo difiere). - rustup default stable antes de compilar paru (si no, no hay cargo). - helpwire: debtap nombra el paquete 'helpwire', no 'helpwire-operator'; convertir en dir limpio e instalar el único .zst. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8edbd0d026
commit
e15727782d
@@ -3,7 +3,9 @@
|
|||||||
"archinstall-language": "Spanish",
|
"archinstall-language": "Spanish",
|
||||||
"bootloader": "Grub",
|
"bootloader": "Grub",
|
||||||
"hostname": "arch-gnome",
|
"hostname": "arch-gnome",
|
||||||
"kernels": ["linux"],
|
"kernels": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
"ntp": true,
|
"ntp": true,
|
||||||
"swap": true,
|
"swap": true,
|
||||||
"timezone": "Europe/Madrid",
|
"timezone": "Europe/Madrid",
|
||||||
@@ -13,67 +15,31 @@
|
|||||||
"sys_lang": "es_ES.UTF-8"
|
"sys_lang": "es_ES.UTF-8"
|
||||||
},
|
},
|
||||||
"mirror_config": {
|
"mirror_config": {
|
||||||
"mirror_regions": { "Spain": [] }
|
"mirror_regions": {
|
||||||
|
"Spain": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"network_config": {
|
||||||
|
"type": "nm"
|
||||||
|
},
|
||||||
|
"audio_config": {
|
||||||
|
"audio": "pipewire"
|
||||||
},
|
},
|
||||||
"network_config": { "type": "nm" },
|
|
||||||
"audio_config": { "audio": "pipewire" },
|
|
||||||
"profile_config": {
|
"profile_config": {
|
||||||
"gfx_driver": "All open-source",
|
"gfx_driver": "All open-source",
|
||||||
"greeter": "gdm",
|
"greeter": "gdm",
|
||||||
"profile": { "main": "Desktop", "details": ["GNOME"] }
|
"profile": {
|
||||||
},
|
"main": "Desktop",
|
||||||
"packages": ["networkmanager", "git", "sudo", "vim", "curl"],
|
"details": [
|
||||||
"disk_config": {
|
"GNOME"
|
||||||
"config_type": "manual_partitioning",
|
|
||||||
"device_modifications": [
|
|
||||||
{
|
|
||||||
"device": "/dev/nvme0n1",
|
|
||||||
"wipe": true,
|
|
||||||
"partitions": [
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "fat32",
|
|
||||||
"mountpoint": "/boot/efi",
|
|
||||||
"start": { "unit": "MiB", "value": 1 },
|
|
||||||
"size": { "unit": "MiB", "value": 512 },
|
|
||||||
"flags": ["boot", "esp"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "ext4",
|
|
||||||
"mountpoint": "/boot",
|
|
||||||
"start": { "unit": "MiB", "value": 513 },
|
|
||||||
"size": { "unit": "GiB", "value": 1 },
|
|
||||||
"flags": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "btrfs",
|
|
||||||
"mountpoint": "/",
|
|
||||||
"start": { "unit": "GiB", "value": 2 },
|
|
||||||
"size": { "unit": "Percent", "value": 100 },
|
|
||||||
"flags": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"device": "/dev/sda",
|
|
||||||
"wipe": true,
|
|
||||||
"partitions": [
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "ext4",
|
|
||||||
"mountpoint": "/home",
|
|
||||||
"start": { "unit": "MiB", "value": 1 },
|
|
||||||
"size": { "unit": "Percent", "value": 100 },
|
|
||||||
"flags": []
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"packages": [
|
||||||
|
"networkmanager",
|
||||||
|
"git",
|
||||||
|
"sudo",
|
||||||
|
"vim",
|
||||||
|
"curl"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+5
-1
@@ -25,8 +25,12 @@ if [[ "$SETUP_PHASE" == "host" ]]; then
|
|||||||
read -rp "Nombre para git [$INSTALL_USER]: " GIT_NAME; GIT_NAME="${GIT_NAME:-$INSTALL_USER}"
|
read -rp "Nombre para git [$INSTALL_USER]: " GIT_NAME; GIT_NAME="${GIT_NAME:-$INSTALL_USER}"
|
||||||
read -rp "Email para git [josevisw@gmail.com]: " GIT_EMAIL; GIT_EMAIL="${GIT_EMAIL:-josevisw@gmail.com}"
|
read -rp "Email para git [josevisw@gmail.com]: " GIT_EMAIL; GIT_EMAIL="${GIT_EMAIL:-josevisw@gmail.com}"
|
||||||
|
|
||||||
|
echo ">> Generando disk_config dimensionado a los discos reales..."
|
||||||
|
# archinstall 4.x quitó "Percent": el layout se calcula aquí (ver shared/gen-disk-config.py)
|
||||||
|
python3 "$REPO_DIR/shared/gen-disk-config.py" "$REPO_DIR/$DE/archinstall-config.json" >/tmp/archinstall-merged.json
|
||||||
|
|
||||||
echo ">> Lanzando archinstall (instala base + GNOME en /mnt)..."
|
echo ">> Lanzando archinstall (instala base + GNOME en /mnt)..."
|
||||||
archinstall --config "$REPO_DIR/$DE/archinstall-config.json" --silent
|
archinstall --config /tmp/archinstall-merged.json --silent
|
||||||
|
|
||||||
echo ">> Copiando arch-setup al sistema nuevo y entrando en chroot..."
|
echo ">> Copiando arch-setup al sistema nuevo y entrando en chroot..."
|
||||||
cp -r "$REPO_DIR" /mnt/root/arch-setup
|
cp -r "$REPO_DIR" /mnt/root/arch-setup
|
||||||
|
|||||||
+23
-57
@@ -3,7 +3,9 @@
|
|||||||
"archinstall-language": "Spanish",
|
"archinstall-language": "Spanish",
|
||||||
"bootloader": "Grub",
|
"bootloader": "Grub",
|
||||||
"hostname": "arch-kde",
|
"hostname": "arch-kde",
|
||||||
"kernels": ["linux"],
|
"kernels": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
"ntp": true,
|
"ntp": true,
|
||||||
"swap": true,
|
"swap": true,
|
||||||
"timezone": "Europe/Madrid",
|
"timezone": "Europe/Madrid",
|
||||||
@@ -13,67 +15,31 @@
|
|||||||
"sys_lang": "es_ES.UTF-8"
|
"sys_lang": "es_ES.UTF-8"
|
||||||
},
|
},
|
||||||
"mirror_config": {
|
"mirror_config": {
|
||||||
"mirror_regions": { "Spain": [] }
|
"mirror_regions": {
|
||||||
|
"Spain": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"network_config": {
|
||||||
|
"type": "nm"
|
||||||
|
},
|
||||||
|
"audio_config": {
|
||||||
|
"audio": "pipewire"
|
||||||
},
|
},
|
||||||
"network_config": { "type": "nm" },
|
|
||||||
"audio_config": { "audio": "pipewire" },
|
|
||||||
"profile_config": {
|
"profile_config": {
|
||||||
"gfx_driver": "All open-source",
|
"gfx_driver": "All open-source",
|
||||||
"greeter": "sddm",
|
"greeter": "sddm",
|
||||||
"profile": { "main": "Desktop", "details": ["KDE Plasma"] }
|
"profile": {
|
||||||
},
|
"main": "Desktop",
|
||||||
"packages": ["networkmanager", "git", "sudo", "vim", "curl"],
|
"details": [
|
||||||
"disk_config": {
|
"KDE Plasma"
|
||||||
"config_type": "manual_partitioning",
|
|
||||||
"device_modifications": [
|
|
||||||
{
|
|
||||||
"device": "/dev/nvme0n1",
|
|
||||||
"wipe": true,
|
|
||||||
"partitions": [
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "fat32",
|
|
||||||
"mountpoint": "/boot/efi",
|
|
||||||
"start": { "unit": "MiB", "value": 1 },
|
|
||||||
"size": { "unit": "MiB", "value": 512 },
|
|
||||||
"flags": ["boot", "esp"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "ext4",
|
|
||||||
"mountpoint": "/boot",
|
|
||||||
"start": { "unit": "MiB", "value": 513 },
|
|
||||||
"size": { "unit": "GiB", "value": 1 },
|
|
||||||
"flags": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "btrfs",
|
|
||||||
"mountpoint": "/",
|
|
||||||
"start": { "unit": "GiB", "value": 2 },
|
|
||||||
"size": { "unit": "Percent", "value": 100 },
|
|
||||||
"flags": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"device": "/dev/sda",
|
|
||||||
"wipe": true,
|
|
||||||
"partitions": [
|
|
||||||
{
|
|
||||||
"type": "primary",
|
|
||||||
"status": "create",
|
|
||||||
"fs_type": "ext4",
|
|
||||||
"mountpoint": "/home",
|
|
||||||
"start": { "unit": "MiB", "value": 1 },
|
|
||||||
"size": { "unit": "Percent", "value": 100 },
|
|
||||||
"flags": []
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"packages": [
|
||||||
|
"networkmanager",
|
||||||
|
"git",
|
||||||
|
"sudo",
|
||||||
|
"vim",
|
||||||
|
"curl"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
+5
-1
@@ -22,8 +22,12 @@ if [[ "$SETUP_PHASE" == "host" ]]; then
|
|||||||
read -rp "Nombre para git [$INSTALL_USER]: " GIT_NAME; GIT_NAME="${GIT_NAME:-$INSTALL_USER}"
|
read -rp "Nombre para git [$INSTALL_USER]: " GIT_NAME; GIT_NAME="${GIT_NAME:-$INSTALL_USER}"
|
||||||
read -rp "Email para git [josevisw@gmail.com]: " GIT_EMAIL; GIT_EMAIL="${GIT_EMAIL:-josevisw@gmail.com}"
|
read -rp "Email para git [josevisw@gmail.com]: " GIT_EMAIL; GIT_EMAIL="${GIT_EMAIL:-josevisw@gmail.com}"
|
||||||
|
|
||||||
|
echo ">> Generando disk_config dimensionado a los discos reales..."
|
||||||
|
# archinstall 4.x quitó "Percent": el layout se calcula aquí (ver shared/gen-disk-config.py)
|
||||||
|
python3 "$REPO_DIR/shared/gen-disk-config.py" "$REPO_DIR/$DE/archinstall-config.json" >/tmp/archinstall-merged.json
|
||||||
|
|
||||||
echo ">> Lanzando archinstall (instala base + KDE en /mnt)..."
|
echo ">> Lanzando archinstall (instala base + KDE en /mnt)..."
|
||||||
archinstall --config "$REPO_DIR/$DE/archinstall-config.json" --silent
|
archinstall --config /tmp/archinstall-merged.json --silent
|
||||||
|
|
||||||
echo ">> Copiando arch-setup al sistema nuevo y entrando en chroot..."
|
echo ">> Copiando arch-setup al sistema nuevo y entrando en chroot..."
|
||||||
cp -r "$REPO_DIR" /mnt/root/arch-setup
|
cp -r "$REPO_DIR" /mnt/root/arch-setup
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# Genera el disk_config de archinstall (>=4.x) dimensionado al disco REAL y lo
|
||||||
|
# inyecta en el JSON base. archinstall 4.x quitó la unidad "Percent", así que un
|
||||||
|
# JSON con tamaños fijos no es portable entre la VM (20G/10G) y el hardware
|
||||||
|
# (250G/1TB): por eso se calcula en tiempo de instalación con los propios modelos
|
||||||
|
# de archinstall (válido ante cambios de schema entre versiones).
|
||||||
|
#
|
||||||
|
# gen-disk-config.py BASE.json [NVME_DEV] [SDA_DEV] > merged.json
|
||||||
|
#
|
||||||
|
# Layout (replica el hardware): NVMe = ESP 512M + /boot 1G ext4 + / btrfs (resto);
|
||||||
|
# SDA = /home ext4 (todo). swap = zram (lo pone "swap": true del base).
|
||||||
|
import json, sys
|
||||||
|
from pathlib import Path
|
||||||
|
from archinstall.lib.disk.device_handler import device_handler
|
||||||
|
from archinstall.lib.models.device import (
|
||||||
|
DiskLayoutConfiguration, DiskLayoutType, DeviceModification,
|
||||||
|
PartitionModification, ModificationStatus, PartitionType,
|
||||||
|
FilesystemType, PartitionFlag, Size, Unit,
|
||||||
|
)
|
||||||
|
|
||||||
|
MiB = 1024 ** 2
|
||||||
|
END_MARGIN = MiB # deja 1 MiB al final para la cabecera GPT de respaldo
|
||||||
|
|
||||||
|
def part(status, ptype, start_b, len_b, ss, fs=None, mnt=None, flags=()):
|
||||||
|
return PartitionModification(
|
||||||
|
status=status, type=ptype,
|
||||||
|
start=Size(start_b, Unit.B, ss),
|
||||||
|
length=Size(len_b, Unit.B, ss),
|
||||||
|
fs_type=fs, mountpoint=Path(mnt) if mnt else None,
|
||||||
|
flags=list(flags),
|
||||||
|
)
|
||||||
|
|
||||||
|
def nvme_mods(dev):
|
||||||
|
ss = dev.device_info.sector_size
|
||||||
|
total = dev.device_info.total_size._normalize()
|
||||||
|
esp_start, esp_len = 1 * MiB, 511 * MiB # 1 -> 512 MiB
|
||||||
|
boot_start, boot_len = 512 * MiB, 1024 * MiB # 512 -> 1536 MiB
|
||||||
|
root_start = boot_start + boot_len # 1536 MiB
|
||||||
|
root_len = total - root_start - END_MARGIN
|
||||||
|
return DeviceModification(device=dev, wipe=True, partitions=[
|
||||||
|
part(ModificationStatus.CREATE, PartitionType.PRIMARY, esp_start, esp_len, ss,
|
||||||
|
FilesystemType.FAT32, "/boot/efi", (PartitionFlag.BOOT, PartitionFlag.ESP)),
|
||||||
|
part(ModificationStatus.CREATE, PartitionType.PRIMARY, boot_start, boot_len, ss,
|
||||||
|
FilesystemType.EXT4, "/boot"),
|
||||||
|
part(ModificationStatus.CREATE, PartitionType.PRIMARY, root_start, root_len, ss,
|
||||||
|
FilesystemType.BTRFS, "/"),
|
||||||
|
])
|
||||||
|
|
||||||
|
def sda_mods(dev):
|
||||||
|
ss = dev.device_info.sector_size
|
||||||
|
total = dev.device_info.total_size._normalize()
|
||||||
|
start = 1 * MiB
|
||||||
|
return DeviceModification(device=dev, wipe=True, partitions=[
|
||||||
|
part(ModificationStatus.CREATE, PartitionType.PRIMARY, start,
|
||||||
|
total - start - END_MARGIN, ss, FilesystemType.EXT4, "/home"),
|
||||||
|
])
|
||||||
|
|
||||||
|
def main():
|
||||||
|
base_path = sys.argv[1]
|
||||||
|
nvme = sys.argv[2] if len(sys.argv) > 2 else "/dev/nvme0n1"
|
||||||
|
sda = sys.argv[3] if len(sys.argv) > 3 else "/dev/sda"
|
||||||
|
|
||||||
|
dev_nvme = device_handler.get_device(Path(nvme))
|
||||||
|
dev_sda = device_handler.get_device(Path(sda))
|
||||||
|
if not dev_nvme or not dev_sda:
|
||||||
|
sys.exit(f"No encuentro los discos {nvme} / {sda} (revisa lsblk)")
|
||||||
|
|
||||||
|
layout = DiskLayoutConfiguration(
|
||||||
|
config_type=DiskLayoutType.Manual,
|
||||||
|
device_modifications=[nvme_mods(dev_nvme), sda_mods(dev_sda)],
|
||||||
|
)
|
||||||
|
cfg = json.loads(Path(base_path).read_text())
|
||||||
|
cfg["disk_config"] = layout.json()
|
||||||
|
json.dump(cfg, sys.stdout, indent=2)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -41,9 +41,14 @@ as_user() { sudo -u "$INSTALL_USER" bash -lc "$*"; }
|
|||||||
bootstrap_paru() {
|
bootstrap_paru() {
|
||||||
command -v paru &>/dev/null && return 0
|
command -v paru &>/dev/null && return 0
|
||||||
install_pacman git base-devel
|
install_pacman git base-devel
|
||||||
as_user 'cd /tmp && rm -rf paru-bin && \
|
# rustup sin toolchain por defecto no expone cargo y rompe el build de paru
|
||||||
git clone https://aur.archlinux.org/paru-bin.git && \
|
as_user 'rustup default stable'
|
||||||
cd paru-bin && makepkg -si --noconfirm'
|
# paru (fuente, no paru-bin): el binario de paru-bin enlaza contra una
|
||||||
|
# libalpm.so concreta y rompe si la del sistema nuevo difiere; compilar de
|
||||||
|
# fuente enlaza contra la libalpm instalada.
|
||||||
|
as_user 'cd /tmp && rm -rf paru && \
|
||||||
|
git clone https://aur.archlinux.org/paru.git && \
|
||||||
|
cd paru && makepkg -si --noconfirm'
|
||||||
}
|
}
|
||||||
|
|
||||||
install_aur() {
|
install_aur() {
|
||||||
@@ -57,7 +62,10 @@ install_helpwire() {
|
|||||||
local url="https://www.helpwire.app/downloads/operator/linux/helpwire-operator.deb"
|
local url="https://www.helpwire.app/downloads/operator/linux/helpwire-operator.deb"
|
||||||
install_aur debtap
|
install_aur debtap
|
||||||
as_user "sudo debtap -u || true"
|
as_user "sudo debtap -u || true"
|
||||||
as_user "cd /tmp && curl -fsSL -o helpwire.deb '$url' && \
|
# debtap nombra el paquete por el campo Package del .deb ('helpwire', no
|
||||||
yes '' | sudo debtap -Q helpwire.deb && \
|
# 'helpwire-operator'): convertir en un dir limpio e instalar el único .zst,
|
||||||
sudo pacman -U --noconfirm helpwire-operator*.pkg.tar.zst"
|
# sin depender del nombre exacto.
|
||||||
|
as_user "d=\$(mktemp -d) && cd \"\$d\" && curl -fsSL -o hw.deb '$url' && \
|
||||||
|
yes '' | sudo debtap -Q hw.deb && \
|
||||||
|
sudo pacman -U --noconfirm \"\$d\"/*.pkg.tar.zst && rm -rf \"\$d\""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user