Re: [PATCH 1/1] scripts/package/builddeb: allow hooks also in /usr/share/kernel

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

 



On Tue, Dec 3, 2024 at 6:41 PM Johannes Schauer Marin Rodrigues
<josch@xxxxxxxxxxxxxxxx> wrote:
>
> Quoting Masahiro Yamada (2024-12-03 10:27:11)
> > > @@ -68,11 +70,18 @@ install_linux_image () {
> > >         # kernel packages, as well as kernel packages built using make-kpkg.
> > >         # make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and
> > >         # so do we; recent versions of dracut and initramfs-tools will obey this.
> > > -       debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
> > > +       debhookdir=${KDEB_HOOKDIR:-/etc/kernel /usr/share/kernel}
> > > +
> > > +       # Only pre-create the first hook directory. Support for more than one hook
> > > +       # directory requires run-parts 5.21 and it is the responsibility of packages
> > > +       # creating additional hook directories to declare that dependency.
> > > +       firsthookdir=${debhookdir%% *}
> > >         for script in postinst postrm preinst prerm; do
> > > -               mkdir -p "${pdir}${debhookdir}/${script}.d"
> > > +               mkdir -p "${pdir}${firsthookdir}/${script}.d"
> >
> > I still do not understand why this 'mkdir' is needed.
> >
> > linux-image package does not install any script into the hook directory.
> > In general, there exist some scripts (e.g. initramfs-tools) already
> > under /etc/kernel/*.d/  (and under /usr/share/kernel/*.d/ once the
> > new location is used broader).
> > If nothing exists under the hook directory, there is no point to
> > execute run-parts.
>
> Unless I'm misunderstanding the old code, the existing script *does* create
> /etc/kernel/*.d/ (That's the "- mkdir -p" line above) so I wanted to preserve
> this behaviour even with more than one directory in KDEB_HOOKDIR. Do I
> misunderstand something?

Right. The existing code does create empty directories, which
are unnecessary.


> Are you saying that with this change, no
> /etc/kernel/*.d/ should be created anymore? Why?


The 'mkdir' is unnecessary regardless of your patch,
unless I am misunderstanding the code.

At present, it is a single line of code.
You are extending it into several lines of verbose code simply
in order to precisely retain these unnecessary directories.
This is a problem for me because I will need to maintain code
whose necessity is unclear.

Judging from your cautious approach and verbose changes, I
assume you are trying to avoid any risks (a common trait
among many contributors).

That said, I understand you are not motivated to strive for
clean code at all costs. Once you commit the run-parts
changes, you may feel your work is done. However, as the
maintainer, I must manage this code for many years,
so I aim to proactively remove unneeded code.

I have decided to take responsibility for cleaning up this
single line myself:

https://lore.kernel.org/linux-kbuild/CAK7LNARU=M282fAOOgzPOBPtDNFPjH8To9eK2vYstWxkEDEEPA@xxxxxxxxxxxxxx/T/#t

If something breaks due to missing directories,
it will be my fault, not yours.

Now that the dummy directories are gone from the linux-image
package, please prepare the next version without the
"pre-create the first hook directory" stuff.

A few more requests.

Please add the version number (the next patch will be v4?) like others do.
And "kbuild: deb-pkg:" as the patch subject.
('git log script/package/buildeb' to see examples)



>
> > > +       done
> > >
> > > -               mkdir -p "${pdir}/DEBIAN"
> > > +       mkdir -p "${pdir}/DEBIAN"
> >
> > Please drop this noise change.
> >
> > If you want to optimize this, please split it into a separate patch like
> > "kbuild: deb-pkg: create DEBIAN directory just once" etc.
>
> Okay, no need to optimize this now. mkdir -p is cheap.
>
> Thanks!
>
> cheers, josch
--
Best Regards
Masahiro Yamada





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux