zopencommunity / metaport

To be able to build the meta repo with zopen
Apache License 2.0
1 stars 2 forks source link

zopen-promote ZOPEN_ROOTFS needs to be dynamic #39

Open lbdyck opened 9 months ago

lbdyck commented 9 months ago

The ZOPEN_ROOTFS is statically defined and needs to be dynamic.

For example

With the current process the ZOPEN_ROOTFS must be changed in the zopen-config file. If dynamic then it won't :)

DevonianTeuchter commented 9 months ago

The slight issue is that zopen-config itself needs to have some frame of reference as to where the ZOPEN_ROOTFS is to setup the infrastructure. It could calculate it from being located within an '/etc' directory. However... we don't currently state that zopen-config has to be located in that location (ZOPEN_ROOTFS/etc/zopen-config) but with the auto-updating when meta updates, it would be hard to allow it to be anywhere else [like if a user copies it to their $HOME, modifies it and then sources it from there to customize something]. My vote would be to document that zopen-config must not be copied elsewhere and would thus remain the "source-of-truth" for where the ZOPEN_ROOTFS is anchored (at ./../), with ZOPEN_ROOTFS being dynamically calculated based off the zopen-config location itself. Would also not be a breaking change...

lbdyck commented 9 months ago

Given that

  1. No one in their right minds will do a promote to a production level filesystem
  2. the promote will be to a temp location to verify
  3. the temp location will be unmounted
  4. the production location will be unmounted
  5. the new promote zfs will be mounted at the production mount point
  6. The zopen-config will have to be updated with the new ZOPEN_ROOTFS.

Perhaps have a command that one runs from the newly mounted filesystem to update the zopen-config or determine dynamically that it was called from a user/system profile as . /usr/zopen/etc/zopen-config and use that path?

Just looking for ways to make sure it works in this mode, which I suspect will be the norm.

DevonianTeuchter commented 9 months ago

@MikeFultonDev 's blog post about sudo here links to some scripts of his that do just that...

lbdyck commented 9 months ago

Nice - but this needs to be dynamic/automatic and not something each site needs to do manually. That script may be a good thing to incorporate.