Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inputpath: Colon-separated list #211

Open
AndreiCherniaev opened this issue Jan 26, 2023 · 1 comment
Open

inputpath: Colon-separated list #211

AndreiCherniaev opened this issue Jan 26, 2023 · 1 comment

Comments

@AndreiCherniaev
Copy link

AndreiCherniaev commented Jan 26, 2023

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
Copy link
Member

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:

  • for files like in your example
    here we can just iterate over the path list until the file is found.
  • in pre/post exec scripts via the INPUTPATH environment variable
    I think we can just set a colon separated list here. For existing users, there is just one entry so nothing changes.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants