From a535a126b5212e268ef42601f7caa5347a66e100 Mon Sep 17 00:00:00 2001 From: Josevi Canet Date: Thu, 25 Jun 2026 21:49:11 +0200 Subject: [PATCH] =?UTF-8?q?disk-config:=20soportar=20instalaci=C3=B3n=20en?= =?UTF-8?q?=20un=20solo=20disco?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Si /dev/sda no existe (portátil de 1 disco), se omite y /home queda dentro del btrfs raíz. Con dos discos, comportamiento de siempre. Co-Authored-By: Claude Opus 4.8 --- shared/gen-disk-config.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/shared/gen-disk-config.py b/shared/gen-disk-config.py index c551127..27f86f0 100644 --- a/shared/gen-disk-config.py +++ b/shared/gen-disk-config.py @@ -9,6 +9,7 @@ # # Layout (replica el hardware): NVMe = ESP 512M + /boot 1G ext4 + / btrfs (resto); # SDA = /home ext4 (todo). swap = zram (lo pone "swap": true del base). +# Si SDA no existe (portatil de 1 disco), se omite: /home queda dentro del / btrfs. import json, sys from pathlib import Path from archinstall.lib.disk.device_handler import device_handler @@ -61,13 +62,19 @@ def main(): sda = sys.argv[3] if len(sys.argv) > 3 else "/dev/sda" dev_nvme = device_handler.get_device(Path(nvme)) + if not dev_nvme: + sys.exit(f"No encuentro el disco de sistema {nvme} (revisa lsblk)") + + # 2 discos -> layout hardware: NVMe=sistema, SDA=/home aparte. + # 1 disco (portatil) -> todo en el NVMe; /home vive dentro del btrfs raiz. 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)") + mods = [nvme_mods(dev_nvme)] + if dev_sda: + mods.append(sda_mods(dev_sda)) layout = DiskLayoutConfiguration( config_type=DiskLayoutType.Manual, - device_modifications=[nvme_mods(dev_nvme), sda_mods(dev_sda)], + device_modifications=mods, ) cfg = json.loads(Path(base_path).read_text()) cfg["disk_config"] = layout.json()