[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#884355: live-boot: Please support live-{top,premount,bottom} hooks



Am Freitag, den 23.02.2018, 19:20 +0100 schrieb Raphael Hertzog:
> Hi,
> 
> On Thu, 14 Dec 2017, Benjamin Drung wrote:
> > initramfs-tools support hooks for top, premount, bottom when
> > booting
> > with boot=local or boot=nfs. Please add similar support to live-
> > boot
> > when booting with boot=live. A patch (for git) is attached.
> 
> I will gladly apply your patch but I think it's time to clean up the
> mess with this:
> 
> > --- a/components/9990-initramfs-tools.sh
> > +++ b/components/9990-initramfs-tools.sh
> > @@ -73,3 +73,25 @@ panic()
> >  	. /scripts/functions
> >  	panic "$@"
> >  }
> > +
> > +# Note: Other components source /scripts/functions before sourcing
> > this file.
> > +# /scripts/functions overrides the mount_* functions (to no-ops).
> > Thus fix
> > +# the mount_* options here again.
> 
> This kind of duplication is just ugly. I looked around and saw this:
> $ grep -r -E 'functions|9990-initramfs-tools.sh' components/
> components/9990-initramfs-tools.sh:# Override maybe_break from
> scripts/functions
> components/9990-initramfs-tools.sh:		.
> /scripts/functions
> components/9990-initramfs-tools.sh:# Override panic from
> scripts/functions
> components/9990-initramfs-tools.sh:	. /scripts/functions
> components/9990-fstab.sh:	# FIXME: stop hardcoding overloading
> of initramfs-tools functions
> components/9990-fstab.sh:	. /scripts/functions
> components/9990-fstab.sh:	. /lib/live/boot/9990-initramfs-
> tools.sh
> components/9990-misc-helpers.sh:	# the output of setup_loop is
> evaluated in other functions,
> components/9990-netbase.sh:	# FIXME: stop hardcoding
> overloading of initramfs-tools functions
> components/9990-netbase.sh:	. /scripts/functions
> components/9990-netbase.sh:	. /lib/live/boot/9990-initramfs-
> tools.sh
> 
> I have the feeling that all those problematic include are no longer
> necessary
> nowadays because we first source all the files and then we execute
> functions
> in the expected order. My review has not been thorough but can you
> try to remove
> all those include and see if things still work?
> 
> /script/functions is already sourced in backend/initramfs-
> tools/live.script
> so it should not be required to have it in the components, right?

I have removed the includes (except the ones that are needed to access
the panic function) and the plugin system still works. The tested pull
request: https://salsa.debian.org/live-team/live-boot/merge_requests/6

I have just tested my use case. So I haven't verified that removing the
problematic includes doesn't break anything.

> BTW, I merged all you other patches. For the future, please send
> patches
> as merge requests on the salsa repositories.

Yes. Thanks for merging.

-- 
Benjamin Drung
System Developer
Debian & Ubuntu Developer

ProfitBricks GmbH
Greifswalder Str. 207
D - 10405 Berlin

Email: benjamin.drung@profitbricks.com
URL: https://www.profitbricks.de

Sitz der Gesellschaft: Berlin
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B
Geschäftsführer: Achim Weiss, Matthias Steinberg


Reply to: