Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Refactor rootfs.sh #39

Closed
jodh-intel opened this issue Jan 22, 2018 · 4 comments · Fixed by #63
Closed

Refactor rootfs.sh #39

jodh-intel opened this issue Jan 22, 2018 · 4 comments · Fixed by #63
Assignees

Comments

@jodh-intel
Copy link
Contributor

All the rootfs_lib.sh scripts use a repository URL. That could be a required variable in config.sh which would allow rootfs_lib.sh to shrink.

In fact, looking at rootfs_lib.sh, we should move the following to a common scripts/lib.sh that all the rootfs_lib.sh files can source:

  • check_program()
  • check_root()

Even generate_dnf() could be parameterised to allow that too to be moved to scripts/lib.sh.

The ideal would be that each repo would only need to specify:

  • a config.sh

Iff rootfs_lib.sh exists for a distro, it could be used. But the default would be for rootfs.sh to call build_rootfs() from scripts/lib.sh by default (if there is no rootfs_lib.sh` for a particular distro).

The ideal would be to only have a single config file for all distros ("declarative") with all the logic in scripts/lib.sh.

@jodh-intel
Copy link
Contributor Author

WDYT @jcvenegas?

@jcvenegas
Copy link
Member

@jodh-intel I like the idea, I can work latter this week or next to have refactor it.

@jodh-intel
Copy link
Contributor Author

Thanks @jcvenegas!

@jodh-intel
Copy link
Contributor Author

It would be great to have this as it would make adding a new distro much simpler and would minimise code getting out of sync.

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

Successfully merging a pull request may close this issue.

5 participants