Bug 1391829 - 20-grubby.install: return: can only `return' from a function or sourced script
Summary: 20-grubby.install: return: can only `return' from a function or sourced script
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-04 07:39 UTC by Yu Watanabe
Modified: 2017-01-12 01:28 UTC (History)
8 users (show)

Fixed In Version: systemd-232-2.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-12 01:28:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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