Bug 1391829

Summary: 20-grubby.install: return: can only `return' from a function or sourced script
Product: [Fedora] Fedora Reporter: Yu Watanabe <watanabe.yu>
Component: systemdAssignee: systemd-maint
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: johannbg, lnykryn, msekleta, muadda, ssahani, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-232-2.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-12 01:28:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yu Watanabe 2016-11-04 07:39:14 UTC
Description of problem:

When install kernel, preun and posttrans rpm scripts failed as follows.
================
/bin/kernel-install: line 143: return: can only `return' from a function or sourced script
error: %preun(kernel-core-4.7.7-200.fc24.x86_64) scriptlet failed, exit status 77
Error in PREUN scriptlet in rpm package kernel-core
Error in PREUN scriptlet in rpm package kernel-core
error: kernel-core-4.7.7-200.fc24.x86_64: erase failed
/bin/kernel-install: line 130: return: can only `return' from a function or sourced script
/usr/lib/kernel/install.d/51-dracut-rescue.install: line 68: /boot/loader/entries/81c8b41cb75e472dabc8e298e2402fc9-0-rescue.conf: No such file or directory
warning: %posttrans(kernel-core-4.8.6-201.fc24.x86_64) scriptlet failed, exit status 78
Non-fatal POSTTRANS scriptlet failure in rpm package kernel-core
Non-fatal POSTTRANS scriptlet failure in rpm package kernel-core
================

I guess the line 4 in 20-grubby.install
http://pkgs.fedoraproject.org/cgit/rpms/systemd.git/tree/20-grubby.install?id=12da227455a6872d695cdcac1093b6b5fe9f9008#n4
should be `exit` instead of `return`.

Version-Release number of selected component (if applicable):

systemd-232-1

How reproducible:

Always.

Steps to Reproduce:
1. update systemd to 232-1
2. update or install kernel
3.

Actual results:

Install completes without the above error messages.

Expected results:

Shows the above error messages.

Additional info:

Comment 1 Yu Watanabe 2016-11-04 08:49:00 UTC
Sorry, the above error messages comes from kernel-install script,
https://github.com/systemd/systemd/pull/4565

> I guess the line 4 in 20-grubby.install
> http://pkgs.fedoraproject.org/cgit/rpms/systemd.git/tree/20-grubby.install?id=12da227455a6872d695cdcac1093b6b5fe9f9008#n4
> should be `exit` instead of `return`.

However the above modification is also required I think.