All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make builddeb invoke calls to linux-update-symlink
@ 2020-05-10  3:25 Jason Self
  2020-05-10  3:49 ` Jason Self
  0 siblings, 1 reply; 6+ messages in thread
From: Jason Self @ 2020-05-10  3:25 UTC (permalink / raw)
  To: linux-kbuild; +Cc: j

The official Debian kernel packages, in addition to running the
scripts in /etc/kernel, also runs linux-update-symlinks via the
postinst script. This updates the /vmlinuz and /initrd.img (if it uses
an initramfs) symlinks to point to the newly installed kernel. This
update causes the builddeb script to do the same.

Signed-off-by: Jason Self <j@jxself.org>
---
 scripts/package/builddeb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 6df3c9f8b2da..1932c54cc338 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -195,6 +195,12 @@ export DEB_MAINT_PARAMS="\$*"
 # Tell initramfs builder whether it's wanted
 export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No)
 
+$(case $script in
+postinst)
+        echo linux-update-symlinks install $version $installed_image_path
+        ;;
+esac)
+
 test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
 exit 0
 EOF
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] make builddeb invoke calls to linux-update-symlink
  2020-05-10  3:25 [PATCH] make builddeb invoke calls to linux-update-symlink Jason Self
@ 2020-05-10  3:49 ` Jason Self
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Self @ 2020-05-10  3:49 UTC (permalink / raw)
  To: linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

My apologies. I realized this patch is incomplete. It should also be
invoking linux-update-symlinks as part of postrm as well. I will
re-send this. My apologies for the added noise.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] make builddeb invoke calls to linux-update-symlink
  2020-05-22 17:01 ` Masahiro Yamada
  2020-05-23  0:41   ` Jason Self
@ 2020-05-23  1:14   ` Ben Hutchings
  1 sibling, 0 replies; 6+ messages in thread
From: Ben Hutchings @ 2020-05-23  1:14 UTC (permalink / raw)
  To: Masahiro Yamada, Jason Self; +Cc: Linux Kbuild mailing list

[-- Attachment #1: Type: text/plain, Size: 2020 bytes --]

On Sat, 2020-05-23 at 02:01 +0900, Masahiro Yamada wrote:
> Hi Ben,
> 
> On Sun, May 10, 2020 at 1:06 PM Jason Self <j@jxself.org> wrote:
> > The official Debian kernel packages,
> 
> I'd like to consult you.
> Does this patch look OK?

No, it doesn't.

> > in addition to running the
> > scripts in /etc/kernel, also runs linux-update-symlinks via the
> > postinst and postrm scripts. This maintains the /vmlinuz and
> > /initrd.img (if it uses an initramfs) symlinks. This change makes the
> > builddeb script generate those same calls.
> > 
> > Signed-off-by: Jason Self <j@jxself.org>
> > ---
> >  scripts/package/builddeb | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> > index 6df3c9f8b2da..f34c11c63ede 100755
> > --- a/scripts/package/builddeb
> > +++ b/scripts/package/builddeb
> > @@ -195,6 +195,14 @@ export DEB_MAINT_PARAMS="\$*"
> >  # Tell initramfs builder whether it's wanted
> >  export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No)
> > 
> > +$(case $script in
> > +postinst)
> > +        echo linux-update-symlinks install $version $installed_image_path
> > +        ;;
> > +postrm)
> > +        echo linux-update-symlinks remove $version $installed_image_path
> > +esac)

This doesn't handle upgrades properly.  The extra conditions in the
maintainer scripts for official Debian packages really are needed.

It's also not correct to assume that linux-update-symlinks is always
available.  If the generated linux-image package depends on "linux-base 
(>= 4.1~)" then the postinst script can use it unconditionally. 
However, the postrm script will always have to check whether it is
present.

Ben.

> >  test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
> >  exit 0
> >  EOF
> > --
> > 2.26.0
> > 
> 
> 
-- 
Ben Hutchings
Every program is either trivial or else contains at least one bug



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] make builddeb invoke calls to linux-update-symlink
  2020-05-22 17:01 ` Masahiro Yamada
@ 2020-05-23  0:41   ` Jason Self
  2020-05-23  1:14   ` Ben Hutchings
  1 sibling, 0 replies; 6+ messages in thread
From: Jason Self @ 2020-05-23  0:41 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Ben Hutchings, Linux Kbuild mailing list

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

On Sat, 23 May 2020 02:01:17 +0900
Masahiro Yamada <masahiroy@kernel.org> wrote:

> Hi Ben,
> 
> On Sun, May 10, 2020 at 1:06 PM Jason Self <j@jxself.org> wrote:
> >
> > The official Debian kernel packages,  
> 
> I'd like to consult you.
> Does this patch look OK?

No. After submitting the patch I saw that I made a stupid mistake and
forgot to terminate one of the case statements and to use 
/$installed_image_path instead of $installed_image_path so that it
provides the absolute path. I can resubmit it with those corrections
but have been waiting before doing so in case there is more feedback.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] make builddeb invoke calls to linux-update-symlink
  2020-05-10  4:06 Jason Self
@ 2020-05-22 17:01 ` Masahiro Yamada
  2020-05-23  0:41   ` Jason Self
  2020-05-23  1:14   ` Ben Hutchings
  0 siblings, 2 replies; 6+ messages in thread
From: Masahiro Yamada @ 2020-05-22 17:01 UTC (permalink / raw)
  To: Jason Self, Ben Hutchings; +Cc: Linux Kbuild mailing list

Hi Ben,

On Sun, May 10, 2020 at 1:06 PM Jason Self <j@jxself.org> wrote:
>
> The official Debian kernel packages,

I'd like to consult you.
Does this patch look OK?


Thanks.



> in addition to running the
> scripts in /etc/kernel, also runs linux-update-symlinks via the
> postinst and postrm scripts. This maintains the /vmlinuz and
> /initrd.img (if it uses an initramfs) symlinks. This change makes the
> builddeb script generate those same calls.
>
> Signed-off-by: Jason Self <j@jxself.org>
> ---
>  scripts/package/builddeb | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index 6df3c9f8b2da..f34c11c63ede 100755
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -195,6 +195,14 @@ export DEB_MAINT_PARAMS="\$*"
>  # Tell initramfs builder whether it's wanted
>  export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No)
>
> +$(case $script in
> +postinst)
> +        echo linux-update-symlinks install $version $installed_image_path
> +        ;;
> +postrm)
> +        echo linux-update-symlinks remove $version $installed_image_path
> +esac)
> +
>  test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
>  exit 0
>  EOF
> --
> 2.26.0
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] make builddeb invoke calls to linux-update-symlink
@ 2020-05-10  4:06 Jason Self
  2020-05-22 17:01 ` Masahiro Yamada
  0 siblings, 1 reply; 6+ messages in thread
From: Jason Self @ 2020-05-10  4:06 UTC (permalink / raw)
  To: linux-kbuild; +Cc: j

The official Debian kernel packages, in addition to running the
scripts in /etc/kernel, also runs linux-update-symlinks via the
postinst and postrm scripts. This maintains the /vmlinuz and
/initrd.img (if it uses an initramfs) symlinks. This change makes the
builddeb script generate those same calls.

Signed-off-by: Jason Self <j@jxself.org>
---
 scripts/package/builddeb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 6df3c9f8b2da..f34c11c63ede 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -195,6 +195,14 @@ export DEB_MAINT_PARAMS="\$*"
 # Tell initramfs builder whether it's wanted
 export INITRD=$(if_enabled_echo CONFIG_BLK_DEV_INITRD Yes No)
 
+$(case $script in
+postinst)
+        echo linux-update-symlinks install $version $installed_image_path
+        ;;
+postrm)
+        echo linux-update-symlinks remove $version $installed_image_path
+esac)
+
 test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
 exit 0
 EOF
-- 
2.26.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-23  1:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-10  3:25 [PATCH] make builddeb invoke calls to linux-update-symlink Jason Self
2020-05-10  3:49 ` Jason Self
2020-05-10  4:06 Jason Self
2020-05-22 17:01 ` Masahiro Yamada
2020-05-23  0:41   ` Jason Self
2020-05-23  1:14   ` Ben Hutchings

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.