Bug 965897 - systemd's kernel-install calls new-kernel-pkg with wrong parameters
systemd's kernel-install calls new-kernel-pkg with wrong parameters
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: ARMTracker
  Show dependency treegraph
 
Reported: 2013-05-21 19:19 EDT by Brendan Conoboy
Modified: 2013-06-03 11:56 EDT (History)
13 users (show)

See Also:
Fixed In Version: systemd-204-4.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-28 05:27:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Call new-kernel-pkg with --update instead of --install (530 bytes, patch)
2013-05-21 19:19 EDT, Brendan Conoboy
no flags Details | Diff

  None (edit)
Description Brendan Conoboy 2013-05-21 19:19:52 EDT
Created attachment 751443 [details]
Call new-kernel-pkg with --update instead of --install

The 3.9 kernel series and earlier called /sbin/new-kernel-pkg directly as part of posttrans.  As of 3.10 the kernel calls /bin/kernel-install which then calls /sbin/new-kernel-pkg.  The invocation of new-kernel-pkg uses a different, incompatible, set of arguments than were used in 3.9.

How it was handled in 3.9's posttrans:

/sbin/new-kernel-pkg --package $kernelpkg --mkinitrd --dracut --depmod --update $kernelnvr || exit $?
/sbin/new-kernel-pkg --package $kernelpkg--rpmposttrans $kernelnvr || exit $?

How it is handled in kernel-install:

/sbin/new-kernel-pkg --package $kernelpkg --mkinitrd --dracut --depmod --install "$2" || exit $?
/sbin/new-kernel-pkg --package $kernelpkg --rpmposttrans "$2" || exit $?

As you can see, new-kernel-pkg is being called with --install instead of with --update.  This breaks, at minimum, installing kernels on ARM systems since some of the necessary configuration management only runs when --update is used.

The attached one-liner fixes the issue.
Comment 1 Kay Sievers 2013-05-22 18:00:45 EDT
http://koji.fedoraproject.org/koji/buildinfo?buildID=421077

Thanks!
Comment 2 Fedora Update System 2013-05-23 02:49:45 EDT
systemd-204-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/systemd-204-3.fc19
Comment 3 Fedora Update System 2013-05-23 15:58:44 EDT
Package systemd-204-3.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-204-3.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-8993/systemd-204-3.fc19
then log in and leave karma (feedback).
Comment 4 Kevin Fenzi 2013-05-23 17:04:50 EDT
Hum. 

[root@jelerak ~]# /bin/kernel-install add 3.10.0-0.rc2.git1.1.fc20.x86_64 /boot/vmlinuz-3.10.0-0.rc2.git1.1.fc20.x86_64 
depmod: WARNING: could not open /lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.order: No such file or directory
depmod: WARNING: could not open /lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.builtin: No such file or directory
depmod: WARNING: could not open /var/tmp/initramfs.RES8tO/lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/initramfs.RES8tO/lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.builtin: No such file or directory
[root@jelerak ~]# grep kernel-3.10.0-0.rc2.git1.1 /etc/grub2.cfg 

Doesn't seem to be working right here. :( 

This is rawhide, but same systemd version: 

systemd-204-3.fc20.x86_64
Comment 5 Kevin Fenzi 2013-05-23 17:10:29 EDT
I see. The patch was never actually applied in the spec file. ;) 

If you like I can do so, or you can and push out a new rawhide / f19 versions?
Comment 6 Kay Sievers 2013-05-23 18:00:08 EDT
I *edited* the patch, not *added* it. :)

Why would it be used in F19, this should only affect rawhide, doesn't it?

Initialized empty Git repository in /home/kay/data/fedora/systemd/systemd-204/.git/
+ git config user.email systemd-maint@redhat.com
+ git config user.name 'Fedora systemd team'
+ git add .
+ git commit -a -q -m '204 baseline.'
+ git am /home/kay/data/fedora/systemd/kernel-install-grubby.patch
Applying: kernel-install: add fedora specific callouts to new-kernel-pkg
+ exit 0
Comment 7 Jóhann B. Guðmundsson 2013-05-23 18:29:19 EDT
Alot of us in the QA community have fedora-rawhide-kernel-nodebug repo install or just generally run the latest kernel to test on our workstation and doing so on F18 yields this these days since the kernel has started to have hard dependency on specific dracut/systemd releases 

--> Finished Dependency Resolution
Error: Package: kernel-3.10.0-0.rc2.git0.4.fc20.x86_64 (fedora-rawhide-kernel-nodebug)
           Requires: systemd >= 203-2
           Installed: systemd-201-2.fc18.7.x86_64 (@updates-testing)
               systemd = 201-2.fc18.7
           Available: systemd-195-15.fc18.x86_64 (fedora)
               systemd = 195-15.fc18
Error: Package: kernel-3.10.0-0.rc2.git0.4.fc20.x86_64 (fedora-rawhide-kernel-nodebug)
           Requires: dracut >= 027
           Installed: dracut-024-25.git20130205.fc18.x86_64 (@updates)
               dracut = 024-25.git20130205.fc18
           Available: dracut-024-18.git20130102.fc18.x86_64 (fedora)
               dracut = 024-18.git20130102.fc18
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

so we should or rather need to start considering syncing better the updates strategy of the core/base OS releases to GA ( F18/F19+ ) at least come up with somekind of strategy/plan involving updating the kernel/dracut/systemd/util-linux etc.probably an topic for guadec if all the relevant parties are there.
Comment 8 Kevin Fenzi 2013-05-23 18:45:57 EDT
(In reply to Kay Sievers from comment #6)
> I *edited* the patch, not *added* it. :)
> 
> Why would it be used in F19, this should only affect rawhide, doesn't it?

ok. I see the setup now... :) 

So, yes, the patch was changed was applied, but doesn't seem to work here. 

It never adds the new kernel to grub. 

[root@jelerak ~]# sh -x /bin/kernel-install add 3.10.0-0.rc2.git1.1.fc20.x86_64 /boot/vmlinuz-3.10.0-0.rc2.git1.1.fc20.x86_64 
+ [[ -x /sbin/new-kernel-pkg ]]
+ case "$1" in
+ /sbin/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --update 3.10.0-0.rc2.git1.1.fc20.x86_64
depmod: WARNING: could not open /lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.order: No such file or directory
depmod: WARNING: could not open /lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.builtin: No such file or directory
depmod: WARNING: could not open /var/tmp/initramfs.cuyYn4/lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/initramfs.cuyYn4/lib/modules/3.10.0-0.rc2.git1.1.fc20.x86_64/modules.builtin: No such file or directory
+ /sbin/new-kernel-pkg --package kernel --rpmposttrans 3.10.0-0.rc2.git1.1.fc20.x86_64
+ [[ -d /boot/loader/entries ]]
+ [[ -L /boot/loader/entries ]]
+ exit 0

So, this seems now to be a bug in /sbin/new-kernel-pkg / grubby?
Comment 9 Fedora Update System 2013-05-25 23:43:46 EDT
systemd-204-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Bruno Wolff III 2013-05-26 15:35:44 EDT
I don't think grubby has changed since things starting breaking. For a while kernel-install was sort of working (not for PAE kernels, see bug 964023), but now grub.conf files are not getting updated.
Comment 11 Kevin Fenzi 2013-05-27 22:19:35 EDT
This is still not right. ;) 

Old kernels: 

postinstall scriptlet (using /bin/sh):

if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&
   [ -f /etc/sysconfig/kernel ]; then
  /bin/sed -r -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel || exit $?
fi

/sbin/new-kernel-pkg --package kernel --install 3.9.4-200.fc18.x86_64 || exit $?
preuninstall scriptlet (using /bin/sh):
/sbin/new-kernel-pkg --rminitrd --rmmoddep --remove 3.9.4-200.fc18.x86_64 || exit $?
posttrans scriptlet (using /bin/sh):
/sbin/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --update 3.9.4-200.fc18.x86_64 || exit $?
/sbin/new-kernel-pkg --package kernel --rpmposttrans 3.9.4-200.fc18.x86_64 || exit $?

new kernels: 

postinstall scriptlet (using /bin/sh):

if [ `uname -i` == "x86_64" -o `uname -i` == "i386" ] &&
   [ -f /etc/sysconfig/kernel ]; then
  /bin/sed -r -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel || exit $?
fi
preuninstall scriptlet (using /bin/sh):
/bin/kernel-install remove 3.10.0-0.rc2.git1.2.fc20.x86_64 /boot/vmlinuz-3.10.0-0.rc2.git1.2.fc20.x86_64 || exit $?
posttrans scriptlet (using /bin/sh):
/bin/kernel-install add 3.10.0-0.rc2.git1.2.fc20.x86_64 /boot/vmlinuz-3.10.0-0.rc2.git1.2.fc20.x86_64 || exit $?

system's /bin/kernel-install is only being called in posttrans now, and only doing 'update' which does nothing at all since the entry was never added. Old kernels called install in post, then update in posttrans. So, either the kernel needs to call /bin/kernel-install with a install argument in post, or /bin/kernel-install needs to install and update in posttrans. 

Happy to gather more info or whatnot, but rawhide kernels are never updating now, which is kinda anoying. ;)
Comment 12 Adam Williamson 2013-05-27 22:40:26 EDT
kay: in addition to what others have said, F19 will certainly be rebased to kernel 3.10 post-release, so we may as well fix this there now.
Comment 13 Peter Robinson 2013-05-28 04:13:12 EDT
(In reply to Adam Williamson from comment #12)
> kay: in addition to what others have said, F19 will certainly be rebased to
> kernel 3.10 post-release, so we may as well fix this there now.

When the kernel is rebased the kernel.spec or major changes generally are not so the mechanism used for kernel installs should remain as it is now for the lifecycle of F-19.
Comment 14 Harald Hoyer 2013-05-28 05:27:39 EDT
(In reply to Kevin Fenzi from comment #11)
> system's /bin/kernel-install is only being called in posttrans now, and only
> doing 'update' which does nothing at all since the entry was never added.
> Old kernels called install in post, then update in posttrans. So, either the
> kernel needs to call /bin/kernel-install with a install argument in post, or
> /bin/kernel-install needs to install and update in posttrans. 

kernel-install now does "--install" and "--update" and "--posttrans" in posttrans.

3 calls to /sbin/new-kernel-pkg to do a simple job :-/
Comment 15 Bruno Wolff III 2013-05-28 09:31:08 EDT
People have been encouraged to test rawhide kernels in f19. It would be nice to keep it easy to keep using them. (Copying over the config entries by hand is a pain.)
Comment 16 Adam Williamson 2013-05-29 12:22:33 EDT
Does the new mechanism respect configuration set in /etc/sysconfig/kernel ?
Comment 17 Brendan Conoboy 2013-05-29 15:27:38 EDT
Please also queue this fix for F19.
Comment 18 Peter Robinson 2013-05-29 15:30:48 EDT
(In reply to Brendan Conoboy from comment #17)
> Please also queue this fix for F19.

kernel-install is currently only being used on rawhide so there is no fix needed for F-19
Comment 19 Brendan Conoboy 2013-05-29 15:32:38 EDT
The kernel-install script is being used by the 3.10 kernel which will land in F19 post-release.
Comment 20 Peter Robinson 2013-05-29 15:39:16 EDT
(In reply to Brendan Conoboy from comment #19)
> The kernel-install script is being used by the 3.10 kernel which will land
> in F19 post-release.

Not necessarily. It's a patch being applied to the rawhide kernel that won't necessarily be merged back to F-19. It was my understanding that the request was just for rawhide to get wider testing. Maybe the kernel team can clarify this

[1] http://pkgs.fedoraproject.org/cgit/kernel.git/commit/?id=6d752ab3ea52e9562776f850f7b884824aea7a21
Comment 21 Josh Boyer 2013-05-29 15:54:23 EDT
(In reply to Peter Robinson from comment #20)
> (In reply to Brendan Conoboy from comment #19)
> > The kernel-install script is being used by the 3.10 kernel which will land
> > in F19 post-release.
> 
> Not necessarily. It's a patch being applied to the rawhide kernel that won't
> necessarily be merged back to F-19. It was my understanding that the request
> was just for rawhide to get wider testing. Maybe the kernel team can clarify
> this
> 
> [1]
> http://pkgs.fedoraproject.org/cgit/kernel.git/commit/
> ?id=6d752ab3ea52e9562776f850f7b884824aea7a21

3.10 has nothing to do with kernel-install.  kernel-install is an F20 and beyond change.
Comment 22 Josh Boyer 2013-05-29 15:57:29 EDT
(In reply to Josh Boyer from comment #21)
> (In reply to Peter Robinson from comment #20)
> > (In reply to Brendan Conoboy from comment #19)
> > > The kernel-install script is being used by the 3.10 kernel which will land
> > > in F19 post-release.
> > 
> > Not necessarily. It's a patch being applied to the rawhide kernel that won't
> > necessarily be merged back to F-19. It was my understanding that the request
> > was just for rawhide to get wider testing. Maybe the kernel team can clarify
> > this
> > 
> > [1]
> > http://pkgs.fedoraproject.org/cgit/kernel.git/commit/
> > ?id=6d752ab3ea52e9562776f850f7b884824aea7a21
> 
> 3.10 has nothing to do with kernel-install.  kernel-install is an F20 and
> beyond change.

That being said, if it continues to remain broken in rawhide we'll revert the kernel.spec changes.  The intention is to get it working in rawhide ASAP so that it's fixed well before F20 is released.
Comment 23 Bruno Wolff III 2013-06-03 11:56:29 EDT
It looks like a fixed systemd got built for f19 today. Thanks.

Note You need to log in before you can comment on or make changes to this bug.