godarch / darch

A tool for building and booting stateless and immutable images, bare metal.
https://godarch.com/
MIT License
832 stars 32 forks source link

Add the ability to sort stages by age #35

Open arnarg opened 5 years ago

arnarg commented 5 years ago

I renamed the darch grub config to /etc/grub.d/05_darch so it would appear on the top of the list in grub.

I however tag my images by the build number (imagename:v10, imagename:v11, ...) so staging a new one will make it appear in grub after the old one as it's sorted alphabetically.

It would be nice to be able to sort them by age in grub menu so an unattended reboot will boot the newest stage.

pauldotknopf commented 5 years ago

Maybe a /etc/darch/config.toml to configure how the darch command runs (particularly when invoked by grub)? I've been meaning to add a /etc/darch/config.toml for other reasons as well (like the location of the containerd socket, etc).

arnarg commented 5 years ago

Sounds good to me.

For my use case a reverse alphabetical order would work fine (with the exception of going from v99 to v100) but having more options might be useful.

But as far as I can tell darch doesn't save the stage time anywhere so that would need to be implemented first, right?

pauldotknopf commented 5 years ago

But as far as I can tell darch doesn't save the stage time anywhere so that would need to be implemented first, right?

Correct.

arnarg commented 5 years ago

Can you think of an obvious place to put it? image.json doesn't seem like it.

pauldotknopf commented 5 years ago

Question, if you tag an existing staged image, would you expect the date to stay the same?

pauldotknopf commented 5 years ago

Maybe get the date modified/created of the folder for the staged item?

arnarg commented 5 years ago

Question, if you tag an existing staged image, would you expect the date to stay the same?

I would expect it to be when you actually ran darch stage upload I think.

Maybe get the date modified/created of the folder for the staged item?

I think that's a good plan! 👍

arnarg commented 5 years ago

@pauldotknopf Is there any work being done on implementing /etc/darch/config.toml?

phunni commented 4 years ago

Also, making it easier (possible?) to tweak /etc defaults/grub which would allow an unnatended reboot to the same image name - obviously @arnarg that's not exactly your use case, but it's a similar concept.