efahl / owut

OpenWrt Upgrade Tool
17 stars 0 forks source link

image type selection fails #18

Closed dangowrt closed 3 months ago

dangowrt commented 3 months ago

owut should consider only image types with matching filesystem. Currently this doesn't work and leads to breakage of the image selection heuristic:

root@puzzle:~# ubus call system board
{
    "kernel": "6.6.36",
    "hostname": "puzzle",
    "system": "ARMv8 Processor rev 3",
    "model": "iEi Puzzle-M902",
    "board_name": "iei,puzzle-m902",
    "rootfs_type": "squashfs",
    "release": {
        "distribution": "OpenWrt",
        "version": "SNAPSHOT",
        "revision": "r26885-2ded54972e",
        "target": "mvebu/cortexa72",
        "description": "OpenWrt SNAPSHOT r26885-2ded54972e"
    }
}
root@puzzle:~# owut check
ERROR: sysupgrade type 'sysupgrade' should be one of [ "kernel", "sdcard" ]

Screenshot from 2024-07-29 23-00-09

So image type kernel should not even be considered because it is of fstype initramfs while we should only consider squashfs images to begin with.

efahl commented 3 months ago

Thanks for the test case. I hadn't seen one with initramfs in the images before, most of the "bad" types had no filesystem value specified in the image block.

Got a fix that does this, will push in a few minutes.

$ owut check --device mvebu/cortexa72:iei,puzzle-m902
Target         mvebu/cortexa72
Profile        iei_puzzle-m902
Root-FS-type   squashfs
Sys-type       sdcard
Package-arch   aarch64_cortex-a72
Version-from   SNAPSHOT r26741-dcc4307205 (kernel 6.6.34)
Version-to     SNAPSHOT r27041-7686ce4a91 (kernel 6.6.43)
Build-FS-type  squashfs
Build-at       2024-07-29T08:32:57Z
Image-prefix   openwrt-mvebu-cortexa72-iei_puzzle-m902
Image-URL      https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa72
Image-file     openwrt-mvebu-cortexa72-iei_puzzle-m902-squashfs-sdcard.img.gz

$ owut check --device mvebu/cortexa72:iei,puzzle-m902 -F ext4
Target         mvebu/cortexa72
Profile        iei_puzzle-m902
Root-FS-type   squashfs
Sys-type       sdcard
Package-arch   aarch64_cortex-a72
Version-from   SNAPSHOT r26741-dcc4307205 (kernel 6.6.34)
Version-to     SNAPSHOT r27041-7686ce4a91 (kernel 6.6.43)
Build-FS-type  ext4
Build-at       2024-07-29T08:32:57Z
Image-prefix   openwrt-mvebu-cortexa72-iei_puzzle-m902
Image-URL      https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa72
Image-file     openwrt-mvebu-cortexa72-iei_puzzle-m902-ext4-sdcard.img.gz

$ owut check --device mvebu/cortexa72:iei,puzzle-m902 -F jffs2
ERROR: File system type 'jffs2' should be one of [ "ext4", "squashfs" ]