Mercurial > code > home > repos > infra
diff pi-setup/setup_pi.py @ 313:b3acb9fff274
updates for new ga-iot (pi reformat of host=garage)
author | drewp@bigasterisk.com |
---|---|
date | Mon, 23 Sep 2024 00:32:36 -0700 |
parents | 957eb07e06e6 |
children |
line wrap: on
line diff
--- a/pi-setup/setup_pi.py Mon Sep 16 20:11:34 2024 -0700 +++ b/pi-setup/setup_pi.py Mon Sep 23 00:32:36 2024 -0700 @@ -56,6 +56,7 @@ async with mount(WORK, WORK / 'raspios.img', IMG_BOOT_OFFSET) as img_boot: await run('cp', img_boot / 'bcm2710-rpi-3-b-plus.dtb', WORK) await run('cp', img_boot / 'kernel8.img', WORK) + await run('cp', img_boot / 'bootcode.bin', WORK) @step @@ -80,7 +81,7 @@ ['-m', '1G'], ['-smp', '4'], ['-kernel', WORK / 'kernel8.img'], - ['-sd', WORK / 'raspios.img'], + ['-drive', 'file=' + str(WORK / 'raspios.img') + ',format=raw'], ['-append', "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1"], ['-device', 'usb-net,netdev=net0'], ['-netdev', 'user,id=net0,hostfwd=tcp::2222-:22'], @@ -116,7 +117,7 @@ await run('ssh', ssh_opts, 'root@localhost', *cmd_on_pi) -async def _get_iscsi_device(better_be_the_iscsi_device='sde') -> Path: +async def _get_iscsi_device(better_be_the_iscsi_device='sdh') -> Path: # don't screw up- this device is about to get formatted! dev_path = Path(f'/dev/{better_be_the_iscsi_device}') @@ -125,6 +126,7 @@ if f'/dev/{m}' != str(dev_path): raise ValueError(f'surprised by attached iscsi disk {m!r} (try `iscsiadm -m node --logoutall=all`)') + # the following might no longer work. check /dev/disk/by-path/*scsi* too. fdisk = await get_output('fdisk', '-l', dev_path) for m in re.findall(r'Disk model: (\S+)', fdisk): if m != 'VIRTUAL-DISK':