pengutronix / genimage

tool to generate multiple filesystem and flash images from a tree
GNU General Public License v2.0
298 stars 107 forks source link

inputpath: Colon-separated list #211

Open AndreiCherniaev opened 1 year ago

AndreiCherniaev commented 1 year ago

At this moment I can't use inputpath with not one, but a list of paths. Why? i suggest allow something like

/mnt/ramdisk/buildroot/board/pc$ genimage --config genimage-bios.cfg --inputpath /mnt/ramdisk/buildroot/output/images/:/mnt/ramdisk/buildroot/output/target/lib/grub/i386-pc/ --outputpath /mnt/ramdisk/buildroot/output/images/

At this moment I can use includepath with a list of options, but includepath is for .cfg files only, I can't set in genimage-bios.cfg

    partition boot {
        in-partition-table = "no"
        image = include("boot.img") #error
        offset = 0
        size = 512
        holes = {"(440; 512)"}
    }

includepath use set_include_path() to parse a list, I thing something the same we should use for inputpath. Isn't it? And of cause if there are two files with one name genimage should produce error... (And we need at autotest for this situation)

michaelolbrich commented 1 year ago

I think it makes sense in general. I don't think that the same file name in multiple directories should cause an error. Instead we should define a clear search order.

Currently there are two places where inputpath is used:

I'm not sure if I like the colon separated argument on the command-line. Maybe just allow specifying it multiple times? But I'm not sure if that can be implemented easily.