Re: [gentoo-catalyst] [PATCH 1/5] embedded: remove actions that are broken by default

2020-05-21 Thread Daniel Cordero
On Thu, May 21, 2020 at 01:41:18PM -0700, Matt Turner wrote:
> So, you must use the embedded target. Could you tell me how you use
> it, for what device, etc?

I produce mini-systemd tarballs to run under systemd-nspawn (or other
container systems). Sometimes, those tarballs can be used as
installation tarballs on bare metal systems, but in those cases
I need to bring my own kernel and bootloader.

systemd does require dynamic library dependencies so I modified (patches
probably will not sent upstream for inclusion) the embedded target to
pull in dependencies. The embedded target usually leaves dependency
resolution to the user (with embedded/packages).


> It's not obvious to me what specific tools this requires to be
> installed in the seed stage. Presumably you're referring to this?
> 
> cmd([self.settings['controller_file'], 'bootloader',
> self.settings['target_path'].rstrip('/')]
> 
> which eventually runs bootloader-setup.sh.

So the "controller.sh bootloader" is executed, but it kills the build in
the create_bootloader() function:

22 May 2020 03:58:27 UTC: NOTICE  : --- Running action sequence: bootloader
NOTICE:catalyst:--- Running action sequence: bootloader
touch: cannot touch 
'/substrate/next/builds/amd64/minimal/20200521/embedded-amd64-minimal-20200521/livecd':
 No such file or directory
Unable to find grub-mkstandalone
22 May 2020 03:58:27 UTC: ERROR   : CatalystError: 
cmd(['/substrate/next/catalyst/targets/embedded/controller.sh', 'bootloader', 
'/substrate/next/builds/amd64/minimal/20200521/embedded-amd64-minimal-20200521'])
 exited 1
ERROR:catalyst:CatalystError: 
cmd(['/substrate/next/catalyst/targets/embedded/controller.sh', 'bootloader', 
'/substrate/next/builds/amd64/minimal/20200521/embedded-amd64-minimal-20200521'])
 exited 1

I don't have grub in the seed stage (it _is_ optional), and don't make livecd 
images (I
don't know why it's trying to touch the builds/ path; maybe it wants tmp/...)


> I'd assume it's generally sensible to install a bootloader in the
> embedded target, and I don't think we have mechanism for customizing
> the action_sequence, so if we remove bootloader from the list then I
> think the python bootloader() function is just dead code, isn't it? I
> doubt that's the end result we want.

Personally, I just need the tarball of the mergeroot, so I don't need the
bootloader action. In lieu of this particular change, maybe some if
statements to see if bootloader-setup.sh can run successfully may be
needed.



Re: [gentoo-catalyst] [PATCH 1/5] embedded: remove actions that are broken by default

2020-05-21 Thread Matt Turner
On Thu, May 21, 2020 at 3:08 PM Brian Dolbec  wrote:
>
> On Thu, 21 May 2020 13:41:18 -0700
> Matt Turner  wrote:
>
> > On Thu, May 21, 2020 at 10:34 AM Daniel Cordero
> >  wrote:
> > >
> > > From: Daniel Cordero 
> > >
> > > dir_setup() doesn't exist, bootloader() exists but requires specific
> > > tools to be installed in the seed stage and doesn't check that they
> > > are, causing the build to fail.
> > > ---
> > > If I have misconstrued the purpose of bootloader, then documentation
> > > needs to be written.
> >
> > I don't actually see any documentation about
> > >  catalyst/targets/embedded.py | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/catalyst/targets/embedded.py
> > > b/catalyst/targets/embedded.py index aa23f5b3..1b4ad9d6 100644
> > > --- a/catalyst/targets/embedded.py
> > > +++ b/catalyst/targets/embedded.py
> > > @@ -41,7 +41,6 @@ class embedded(StageBase):
> > >
> > >  def set_action_sequence(self):
> > >  self.settings['action_sequence'] = [
> > > -"dir_setup",
> >
> > Nice. This function was removed in 2005, so the embedded target has
> > been broken ever since. That certainly answers my question as to
> > whether anyone uses it.
> >
> > Fixes: 1dafb5fa06d2 (Add locking support. ...)
> >
> > So, you must use the embedded target. Could you tell me how you use
> > it, for what device, etc?
> >
> > >  "unpack",
> > >  "config_profile_link",
> > >  "setup_confdir",
> > > @@ -51,7 +50,6 @@ class embedded(StageBase):
> > >  "setup_environment",
> > >  "build_kernel",
> > >  "build_packages",
> > > -"bootloader",
> >
> > It's not obvious to me what specific tools this requires to be
> > installed in the seed stage. Presumably you're referring to this?
> >
> > cmd([self.settings['controller_file'], 'bootloader',
> > self.settings['target_path'].rstrip('/')]
> >
> > which eventually runs bootloader-setup.sh.
> >
> > I'd assume it's generally sensible to install a bootloader in the
> > embedded target, and I don't think we have mechanism for customizing
> > the action_sequence, so if we remove bootloader from the list then I
> > think the python bootloader() function is just dead code, isn't it? I
> > doubt that's the end result we want.
> >
>
>
> No, if you notice, this is removing the bootloader action sequence only
> for the embedded target.  Each target subclasses stagebase, so can
> override what is defined in stagebase as needed.  Customizing the
> action_sequence is something that pretty much all the targets do.

Sorry I misspoke. Yes, bootloader() is called for livecd_stage2 and
stage4 as well, so removing it from embedded's action sequence would
not make the function dead.

I have doubts that we actually want to not run bootloader() for the
embedded target though.



Re: [gentoo-catalyst] [PATCH 1/5] embedded: remove actions that are broken by default

2020-05-21 Thread Brian Dolbec
On Thu, 21 May 2020 13:41:18 -0700
Matt Turner  wrote:

> On Thu, May 21, 2020 at 10:34 AM Daniel Cordero
>  wrote:
> >
> > From: Daniel Cordero 
> >
> > dir_setup() doesn't exist, bootloader() exists but requires specific
> > tools to be installed in the seed stage and doesn't check that they
> > are, causing the build to fail.
> > ---
> > If I have misconstrued the purpose of bootloader, then documentation
> > needs to be written.  
> 
> I don't actually see any documentation about
> >  catalyst/targets/embedded.py | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/catalyst/targets/embedded.py
> > b/catalyst/targets/embedded.py index aa23f5b3..1b4ad9d6 100644
> > --- a/catalyst/targets/embedded.py
> > +++ b/catalyst/targets/embedded.py
> > @@ -41,7 +41,6 @@ class embedded(StageBase):
> >
> >  def set_action_sequence(self):
> >  self.settings['action_sequence'] = [
> > -"dir_setup",  
> 
> Nice. This function was removed in 2005, so the embedded target has
> been broken ever since. That certainly answers my question as to
> whether anyone uses it.
> 
> Fixes: 1dafb5fa06d2 (Add locking support. ...)
> 
> So, you must use the embedded target. Could you tell me how you use
> it, for what device, etc?
> 
> >  "unpack",
> >  "config_profile_link",
> >  "setup_confdir",
> > @@ -51,7 +50,6 @@ class embedded(StageBase):
> >  "setup_environment",
> >  "build_kernel",
> >  "build_packages",
> > -"bootloader",  
> 
> It's not obvious to me what specific tools this requires to be
> installed in the seed stage. Presumably you're referring to this?
> 
> cmd([self.settings['controller_file'], 'bootloader',
> self.settings['target_path'].rstrip('/')]
> 
> which eventually runs bootloader-setup.sh.
> 
> I'd assume it's generally sensible to install a bootloader in the
> embedded target, and I don't think we have mechanism for customizing
> the action_sequence, so if we remove bootloader from the list then I
> think the python bootloader() function is just dead code, isn't it? I
> doubt that's the end result we want.
> 


No, if you notice, this is removing the bootloader action sequence only
for the embedded target.  Each target subclasses stagebase, so can
override what is defined in stagebase as needed.  Customizing the
action_sequence is something that pretty much all the targets do.



Re: [gentoo-catalyst] [PATCH 1/5] embedded: remove actions that are broken by default

2020-05-21 Thread Matt Turner
On Thu, May 21, 2020 at 10:34 AM Daniel Cordero  wrote:
>
> From: Daniel Cordero 
>
> dir_setup() doesn't exist, bootloader() exists but requires specific
> tools to be installed in the seed stage and doesn't check that they are,
> causing the build to fail.
> ---
> If I have misconstrued the purpose of bootloader, then documentation
> needs to be written.

I don't actually see any documentation about
>  catalyst/targets/embedded.py | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/catalyst/targets/embedded.py b/catalyst/targets/embedded.py
> index aa23f5b3..1b4ad9d6 100644
> --- a/catalyst/targets/embedded.py
> +++ b/catalyst/targets/embedded.py
> @@ -41,7 +41,6 @@ class embedded(StageBase):
>
>  def set_action_sequence(self):
>  self.settings['action_sequence'] = [
> -"dir_setup",

Nice. This function was removed in 2005, so the embedded target has
been broken ever since. That certainly answers my question as to
whether anyone uses it.

Fixes: 1dafb5fa06d2 (Add locking support. ...)

So, you must use the embedded target. Could you tell me how you use
it, for what device, etc?

>  "unpack",
>  "config_profile_link",
>  "setup_confdir",
> @@ -51,7 +50,6 @@ class embedded(StageBase):
>  "setup_environment",
>  "build_kernel",
>  "build_packages",
> -"bootloader",

It's not obvious to me what specific tools this requires to be
installed in the seed stage. Presumably you're referring to this?

cmd([self.settings['controller_file'], 'bootloader',
self.settings['target_path'].rstrip('/')]

which eventually runs bootloader-setup.sh.

I'd assume it's generally sensible to install a bootloader in the
embedded target, and I don't think we have mechanism for customizing
the action_sequence, so if we remove bootloader from the list then I
think the python bootloader() function is just dead code, isn't it? I
doubt that's the end result we want.