Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-04 Thread Michal Marek
Dne 2.3.2016 v 15:28 Paolo Abeni napsal(a):
> This patch add a rpm preuninstall scriptlet to cleanup the
> boot loader configuration on kernel package uninstall.
> The initrd for the to-be-removed kernel is deleted, too.
> 
> Signed-off-by: Paolo Abeni 

Applied to kbuild.git#misc.

Michal



Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-04 Thread Michal Marek
Dne 2.3.2016 v 15:28 Paolo Abeni napsal(a):
> This patch add a rpm preuninstall scriptlet to cleanup the
> boot loader configuration on kernel package uninstall.
> The initrd for the to-be-removed kernel is deleted, too.
> 
> Signed-off-by: Paolo Abeni 

Applied to kbuild.git#misc.

Michal



Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-04 Thread Michal Marek
Dne 3.3.2016 v 10:09 Paolo Abeni napsal(a):
> I'm sorry, I try to dig a bit, but I did not find any distro agnostic
> kernel removal tools. Can you please point out some ?

There isn't any, so unfortunately we need a list of various
distro-specific methods, starting with ew-kernel-pkg. The %post script
should stay as is, though.

Michal


Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-04 Thread Michal Marek
Dne 3.3.2016 v 10:09 Paolo Abeni napsal(a):
> I'm sorry, I try to dig a bit, but I did not find any distro agnostic
> kernel removal tools. Can you please point out some ?

There isn't any, so unfortunately we need a list of various
distro-specific methods, starting with ew-kernel-pkg. The %post script
should stay as is, though.

Michal


Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-03 Thread Paolo Abeni
On Wed, 2016-03-02 at 10:09 -0500, Josh Boyer wrote:
> On Wed, Mar 2, 2016 at 9:38 AM, Hannes Frederic Sowa
>  wrote:
> > On 02.03.2016 15:28, Paolo Abeni wrote:
> >>
> >> This patch add a rpm preuninstall scriptlet to cleanup the
> >> boot loader configuration on kernel package uninstall.
> >> The initrd for the to-be-removed kernel is deleted, too.
> >>
> >> Signed-off-by: Paolo Abeni 
> >> ---
> >>   scripts/package/mkspec | 5 +
> >>   1 file changed, 5 insertions(+)
> >>
> >> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> >> index fe44d68..b6de63c 100755
> >> --- a/scripts/package/mkspec
> >> +++ b/scripts/package/mkspec
> >> @@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE
> >> /boot/.vmlinuz-$KERNELRELEASE-rpm /boot
> >>   echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm
> >> /boot/.System.map-$KERNELRELEASE-rpm"
> >>   echo "fi"
> >>   echo ""
> >> +echo "%preun"
> >> +echo "if [ -x /sbin/new-kernel-pkg ]; then"
> >> +echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd
> >> --initrdfile=/boot/initramfs-$KERNELRELEASE.img"
> >> +echo "fi"
> >> +echo ""
> >>   echo "%files"
> >>   echo '%defattr (-, root, root)'
> >>   echo "/lib/modules/$KERNELRELEASE"
> >>
> >
> > Maybe we should also switch to new-kernel-pkg for the postinstall call? How
> > about switching to kernel-install?
> 
> new-kernel-pkg probably shouldn't be used here either.  The
> installkernel binary is the distro agnostic kernel installation tool
> and the various distros provide that as either the tool they use or as
> a wrapper.  Switching to new-kernel-pkg implies this would only be
> viable on grubby based distros, and using kernel-install would require
> systemd.

I'm sorry, I try to dig a bit, but I did not find any distro agnostic
kernel removal tools. Can you please point out some ?

Elsewhere can we stuck with new-kernel-pkg, plus eventual fall-back to
other options, i.e. kernel-install?

Thank you,

Paolo



Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-03 Thread Paolo Abeni
On Wed, 2016-03-02 at 10:09 -0500, Josh Boyer wrote:
> On Wed, Mar 2, 2016 at 9:38 AM, Hannes Frederic Sowa
>  wrote:
> > On 02.03.2016 15:28, Paolo Abeni wrote:
> >>
> >> This patch add a rpm preuninstall scriptlet to cleanup the
> >> boot loader configuration on kernel package uninstall.
> >> The initrd for the to-be-removed kernel is deleted, too.
> >>
> >> Signed-off-by: Paolo Abeni 
> >> ---
> >>   scripts/package/mkspec | 5 +
> >>   1 file changed, 5 insertions(+)
> >>
> >> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
> >> index fe44d68..b6de63c 100755
> >> --- a/scripts/package/mkspec
> >> +++ b/scripts/package/mkspec
> >> @@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE
> >> /boot/.vmlinuz-$KERNELRELEASE-rpm /boot
> >>   echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm
> >> /boot/.System.map-$KERNELRELEASE-rpm"
> >>   echo "fi"
> >>   echo ""
> >> +echo "%preun"
> >> +echo "if [ -x /sbin/new-kernel-pkg ]; then"
> >> +echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd
> >> --initrdfile=/boot/initramfs-$KERNELRELEASE.img"
> >> +echo "fi"
> >> +echo ""
> >>   echo "%files"
> >>   echo '%defattr (-, root, root)'
> >>   echo "/lib/modules/$KERNELRELEASE"
> >>
> >
> > Maybe we should also switch to new-kernel-pkg for the postinstall call? How
> > about switching to kernel-install?
> 
> new-kernel-pkg probably shouldn't be used here either.  The
> installkernel binary is the distro agnostic kernel installation tool
> and the various distros provide that as either the tool they use or as
> a wrapper.  Switching to new-kernel-pkg implies this would only be
> viable on grubby based distros, and using kernel-install would require
> systemd.

I'm sorry, I try to dig a bit, but I did not find any distro agnostic
kernel removal tools. Can you please point out some ?

Elsewhere can we stuck with new-kernel-pkg, plus eventual fall-back to
other options, i.e. kernel-install?

Thank you,

Paolo



Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-02 Thread Josh Boyer
On Wed, Mar 2, 2016 at 9:38 AM, Hannes Frederic Sowa
 wrote:
> On 02.03.2016 15:28, Paolo Abeni wrote:
>>
>> This patch add a rpm preuninstall scriptlet to cleanup the
>> boot loader configuration on kernel package uninstall.
>> The initrd for the to-be-removed kernel is deleted, too.
>>
>> Signed-off-by: Paolo Abeni 
>> ---
>>   scripts/package/mkspec | 5 +
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
>> index fe44d68..b6de63c 100755
>> --- a/scripts/package/mkspec
>> +++ b/scripts/package/mkspec
>> @@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE
>> /boot/.vmlinuz-$KERNELRELEASE-rpm /boot
>>   echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm
>> /boot/.System.map-$KERNELRELEASE-rpm"
>>   echo "fi"
>>   echo ""
>> +echo "%preun"
>> +echo "if [ -x /sbin/new-kernel-pkg ]; then"
>> +echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd
>> --initrdfile=/boot/initramfs-$KERNELRELEASE.img"
>> +echo "fi"
>> +echo ""
>>   echo "%files"
>>   echo '%defattr (-, root, root)'
>>   echo "/lib/modules/$KERNELRELEASE"
>>
>
> Maybe we should also switch to new-kernel-pkg for the postinstall call? How
> about switching to kernel-install?

new-kernel-pkg probably shouldn't be used here either.  The
installkernel binary is the distro agnostic kernel installation tool
and the various distros provide that as either the tool they use or as
a wrapper.  Switching to new-kernel-pkg implies this would only be
viable on grubby based distros, and using kernel-install would require
systemd.

josh


Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-02 Thread Josh Boyer
On Wed, Mar 2, 2016 at 9:38 AM, Hannes Frederic Sowa
 wrote:
> On 02.03.2016 15:28, Paolo Abeni wrote:
>>
>> This patch add a rpm preuninstall scriptlet to cleanup the
>> boot loader configuration on kernel package uninstall.
>> The initrd for the to-be-removed kernel is deleted, too.
>>
>> Signed-off-by: Paolo Abeni 
>> ---
>>   scripts/package/mkspec | 5 +
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/scripts/package/mkspec b/scripts/package/mkspec
>> index fe44d68..b6de63c 100755
>> --- a/scripts/package/mkspec
>> +++ b/scripts/package/mkspec
>> @@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE
>> /boot/.vmlinuz-$KERNELRELEASE-rpm /boot
>>   echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm
>> /boot/.System.map-$KERNELRELEASE-rpm"
>>   echo "fi"
>>   echo ""
>> +echo "%preun"
>> +echo "if [ -x /sbin/new-kernel-pkg ]; then"
>> +echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd
>> --initrdfile=/boot/initramfs-$KERNELRELEASE.img"
>> +echo "fi"
>> +echo ""
>>   echo "%files"
>>   echo '%defattr (-, root, root)'
>>   echo "/lib/modules/$KERNELRELEASE"
>>
>
> Maybe we should also switch to new-kernel-pkg for the postinstall call? How
> about switching to kernel-install?

new-kernel-pkg probably shouldn't be used here either.  The
installkernel binary is the distro agnostic kernel installation tool
and the various distros provide that as either the tool they use or as
a wrapper.  Switching to new-kernel-pkg implies this would only be
viable on grubby based distros, and using kernel-install would require
systemd.

josh


Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-02 Thread Hannes Frederic Sowa

On 02.03.2016 15:28, Paolo Abeni wrote:

This patch add a rpm preuninstall scriptlet to cleanup the
boot loader configuration on kernel package uninstall.
The initrd for the to-be-removed kernel is deleted, too.

Signed-off-by: Paolo Abeni 
---
  scripts/package/mkspec | 5 +
  1 file changed, 5 insertions(+)

diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fe44d68..b6de63c 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE 
/boot/.vmlinuz-$KERNELRELEASE-rpm /boot
  echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm 
/boot/.System.map-$KERNELRELEASE-rpm"
  echo "fi"
  echo ""
+echo "%preun"
+echo "if [ -x /sbin/new-kernel-pkg ]; then"
+echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd 
--initrdfile=/boot/initramfs-$KERNELRELEASE.img"
+echo "fi"
+echo ""
  echo "%files"
  echo '%defattr (-, root, root)'
  echo "/lib/modules/$KERNELRELEASE"



Maybe we should also switch to new-kernel-pkg for the postinstall call? 
How about switching to kernel-install?


Thanks,
Hannes



Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-02 Thread Hannes Frederic Sowa

On 02.03.2016 15:28, Paolo Abeni wrote:

This patch add a rpm preuninstall scriptlet to cleanup the
boot loader configuration on kernel package uninstall.
The initrd for the to-be-removed kernel is deleted, too.

Signed-off-by: Paolo Abeni 
---
  scripts/package/mkspec | 5 +
  1 file changed, 5 insertions(+)

diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fe44d68..b6de63c 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE 
/boot/.vmlinuz-$KERNELRELEASE-rpm /boot
  echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm 
/boot/.System.map-$KERNELRELEASE-rpm"
  echo "fi"
  echo ""
+echo "%preun"
+echo "if [ -x /sbin/new-kernel-pkg ]; then"
+echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd 
--initrdfile=/boot/initramfs-$KERNELRELEASE.img"
+echo "fi"
+echo ""
  echo "%files"
  echo '%defattr (-, root, root)'
  echo "/lib/modules/$KERNELRELEASE"



Maybe we should also switch to new-kernel-pkg for the postinstall call? 
How about switching to kernel-install?


Thanks,
Hannes



[PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-02 Thread Paolo Abeni
This patch add a rpm preuninstall scriptlet to cleanup the
boot loader configuration on kernel package uninstall.
The initrd for the to-be-removed kernel is deleted, too.

Signed-off-by: Paolo Abeni 
---
 scripts/package/mkspec | 5 +
 1 file changed, 5 insertions(+)

diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fe44d68..b6de63c 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE 
/boot/.vmlinuz-$KERNELRELEASE-rpm /boot
 echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm 
/boot/.System.map-$KERNELRELEASE-rpm"
 echo "fi"
 echo ""
+echo "%preun"
+echo "if [ -x /sbin/new-kernel-pkg ]; then"
+echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd 
--initrdfile=/boot/initramfs-$KERNELRELEASE.img"
+echo "fi"
+echo ""
 echo "%files"
 echo '%defattr (-, root, root)'
 echo "/lib/modules/$KERNELRELEASE"
-- 
1.8.3.1



[PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal

2016-03-02 Thread Paolo Abeni
This patch add a rpm preuninstall scriptlet to cleanup the
boot loader configuration on kernel package uninstall.
The initrd for the to-be-removed kernel is deleted, too.

Signed-off-by: Paolo Abeni 
---
 scripts/package/mkspec | 5 +
 1 file changed, 5 insertions(+)

diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index fe44d68..b6de63c 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE 
/boot/.vmlinuz-$KERNELRELEASE-rpm /boot
 echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm 
/boot/.System.map-$KERNELRELEASE-rpm"
 echo "fi"
 echo ""
+echo "%preun"
+echo "if [ -x /sbin/new-kernel-pkg ]; then"
+echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd 
--initrdfile=/boot/initramfs-$KERNELRELEASE.img"
+echo "fi"
+echo ""
 echo "%files"
 echo '%defattr (-, root, root)'
 echo "/lib/modules/$KERNELRELEASE"
-- 
1.8.3.1