oxidecomputer / helios-engvm

Tools for creating and using Helios images on i86pc (classic PC) physical and virtual machines
Mozilla Public License 2.0
30 stars 1 forks source link

images: add flag to specify opte version for netdev ramdisk image #16

Closed luqmana closed 1 year ago

luqmana commented 1 year ago

Lets you build an image with a specific opte version. e.g. installing an older version:

$ pkg list -g https://pkg.oxide.computer/helios-netdev opte
NAME (PUBLISHER)                                  VERSION                    IFO
driver/network/opte (helios-netdev)               0.19.152                   ---

# Latest is 0.19.* but we want opte API version 18, so pass `-o 0.18` instead of `-N`

$ VARIANT=ramdisk ./strap.sh -f -o 0.18 -B
[...snip...]
Jan 09 16:26:28.987 INFO STEP 3: pkg_install, from: /home/luqman/helios-engvm/image/templates/helios/ramdisk-02-image.json                                                                                  
Jan 09 16:26:29.001 INFO exec: ["/usr/bin/pkg", "-R", "/rpool/images/work/helios/ramdisk-netdev", "install", "/driver/misc/tofino", "/driver/network/opte@0.18"]                                            
[...snip...]
skip global-only package = pkg://helios-netdev/driver/network/opte@0.18.145:20221111T210652Z
[...snip...]
+ ls -lh /rpool/images/output/helios-netdev-0.18-ramdisk.tar.gz
-rw-r--r--   1 root     root        176M Jan  9 16:29 /rpool/images/output/helios-netdev-0.18-ramdisk.tar.gz

$ MACHINE=builder ./ufs.sh -o 0.18
[...snip...]
+ ls -lh /rpool/images/output/helios-builder-netdev-0.18-ttya-ufs.ufs
-rw-r--r--   1 root     root        600M Jan  9 16:30 /rpool/images/output/helios-builder-netdev-0.18-ttya-ufs.ufs

$ ls -lh /rpool/images/output
total 1771545
-rw-r--r--   1 root     root        600M Jan  9 16:30 helios-builder-netdev-0.18-ttya-ufs.ufs
-rw-r--r--   1 root     root       2.15M Jan  9 16:28 helios-netdev-0.18-ramdisk-boot.tar.gz
-rw-r--r--   1 root     root        176M Jan  9 16:29 helios-netdev-0.18-ramdisk.tar.gz

Requires https://github.com/illumos/image-builder/pull/3