Bug 1104253

Summary: sed: -e expression #1, char 21: unterminated `s' command
Product: [Fedora] Fedora Reporter: Andre Robatino <robatino>
Component: dkmsAssignee: Simone Caronni <negativo17>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: admiller, charles_rose, gansalmon, itamar, jonathan, kernel-maint, madhu.chinakonda, mario_limonciello, mchehab, negativo17, raselmsh, robatino, satellitgo, tcallawa
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dkms-2.2.0.3-25.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-19 16:36:59 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:
Bug Depends On: 1109736    
Bug Blocks:    

Description Andre Robatino 2014-06-03 15:59:50 UTC
Description of problem:
I've been seeing this error every kernel update for the past week or two. It appears between the last "Cleanup" and the first "Verifying". I also see it when just installing the kernel-core, kernel-modules and kernel-modules-extra packages. I suspect the kernel-core package since there is a sed command in its POST scriptlet.

[root@localhost ~]# yum --skip-broken --exclude=\*.i686 distro-sync kernel\*
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be installed
---> Package kernel-core.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be installed
---> Package kernel-devel.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be installed
---> Package kernel-headers.x86_64 0:3.15.0-0.rc7.git4.2.fc21 will be updated
---> Package kernel-headers.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be an update
---> Package kernel-modules.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be installed
---> Package kernel-modules-extra.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be installed
---> Package kernel-tools.x86_64 0:3.15.0-0.rc7.git4.2.fc21 will be updated
---> Package kernel-tools.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be an update
---> Package kernel-tools-libs.x86_64 0:3.15.0-0.rc7.git4.2.fc21 will be updated
---> Package kernel-tools-libs.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be an update
---> Package kernel-tools-libs-devel.x86_64 0:3.15.0-0.rc7.git4.2.fc21 will be updated
---> Package kernel-tools-libs-devel.x86_64 0:3.15.0-0.rc8.git0.1.fc21 will be an update
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:3.15.0-0.rc7.git3.1.fc21 will be erased
---> Package kernel-core.x86_64 0:3.15.0-0.rc7.git3.1.fc21 will be erased
---> Package kernel-devel.x86_64 0:3.15.0-0.rc7.git3.1.fc21 will be erased
---> Package kernel-modules.x86_64 0:3.15.0-0.rc7.git3.1.fc21 will be erased
---> Package kernel-modules-extra.x86_64 0:3.15.0-0.rc7.git3.1.fc21 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                 Arch   Version                  Repository        Size
================================================================================
Installing:
 kernel                  x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide           82 k
 kernel-core             x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide           18 M
 kernel-devel            x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide          8.9 M
 kernel-modules          x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide           17 M
 kernel-modules-extra    x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide          2.2 M
Updating:
 kernel-headers          x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide          977 k
 kernel-tools            x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide          161 k
 kernel-tools-libs       x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide           89 k
 kernel-tools-libs-devel x86_64 3.15.0-0.rc8.git0.1.fc21 rawhide           85 k
Removing:
 kernel                  x86_64 3.15.0-0.rc7.git3.1.fc21 @rawhide         0.0  
 kernel-core             x86_64 3.15.0-0.rc7.git3.1.fc21 @/kernel-core-3.15.0-0.rc7.git3.1.fc21.x86_64
                                                                           41 M
 kernel-devel            x86_64 3.15.0-0.rc7.git3.1.fc21 @rawhide          33 M
 kernel-modules          x86_64 3.15.0-0.rc7.git3.1.fc21 @/kernel-modules-3.15.0-0.rc7.git3.1.fc21.x86_64
                                                                           17 M
 kernel-modules-extra    x86_64 3.15.0-0.rc7.git3.1.fc21 @/kernel-modules-extra-3.15.0-0.rc7.git3.1.fc21.x86_64
                                                                          2.2 M

Transaction Summary
================================================================================
Install  5 Packages
Upgrade  4 Packages
Remove   5 Packages

Total download size: 47 M
Is this ok [y/d/N]: y
Downloading packages:
rawhide/x86_64/prestodelta                                  | 3.3 MB  00:47     
Delta RPMs reduced 9.8 M of updates to 2.3 M (76% saved)
(1/9): kernel-headers-3.15.0-0.rc7.git4.2.fc21_3.15.0-0.rc8 | 186 kB  00:03     
(2/9): kernel-3.15.0-0.rc8.git0.1.fc21.x86_64.rpm           |  82 kB  00:01     
(3/9): kernel-devel-3.15.0-0.rc7.git4.2.fc21_3.15.0-0.rc8.g | 2.2 MB  00:09     
(4/9): kernel-modules-3.15.0-0.rc8.git0.1.fc21.x86_64.rpm   |  17 MB  00:58     
(5/9): kernel-modules-extra-3.15.0-0.rc8.git0.1.fc21.x86_64 | 2.2 MB  00:32     
(6/9): kernel-tools-3.15.0-0.rc8.git0.1.fc21.x86_64.rpm     | 161 kB  00:02     
(7/9): kernel-tools-libs-3.15.0-0.rc8.git0.1.fc21.x86_64.rp |  89 kB  00:00     
(8/9): kernel-tools-libs-devel-3.15.0-0.rc8.git0.1.fc21.x86 |  85 kB  00:00     
(9/9): kernel-core-3.15.0-0.rc8.git0.1.fc21.x86_64.rpm      |  18 MB  05:11     
--------------------------------------------------------------------------------
Total                                              128 kB/s |  40 MB  05:16     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : kernel-core-3.15.0-0.rc8.git0.1.fc21.x86_64                 1/18 
  Installing : kernel-modules-3.15.0-0.rc8.git0.1.fc21.x86_64              2/18 
  Updating   : kernel-tools-libs-3.15.0-0.rc8.git0.1.fc21.x86_64           3/18 
  Updating   : kernel-tools-3.15.0-0.rc8.git0.1.fc21.x86_64                4/18 
  Updating   : kernel-tools-libs-devel-3.15.0-0.rc8.git0.1.fc21.x86_64     5/18 
  Installing : kernel-3.15.0-0.rc8.git0.1.fc21.x86_64                      6/18 
  Installing : kernel-modules-extra-3.15.0-0.rc8.git0.1.fc21.x86_64        7/18 
  Updating   : kernel-headers-3.15.0-0.rc8.git0.1.fc21.x86_64              8/18 
  Installing : kernel-devel-3.15.0-0.rc8.git0.1.fc21.x86_64                9/18 
  Cleanup    : kernel-tools-libs-devel-3.15.0-0.rc7.git4.2.fc21.x86_64    10/18 
  Cleanup    : kernel-3.15.0-0.rc7.git3.1.fc21.x86_64                     11/18 
  Cleanup    : kernel-headers-3.15.0-0.rc7.git4.2.fc21.x86_64             12/18 
  Cleanup    : kernel-devel-3.15.0-0.rc7.git3.1.fc21.x86_64               13/18 
  Cleanup    : kernel-modules-extra-3.15.0-0.rc7.git3.1.fc21.x86_64       14/18 
  Cleanup    : kernel-modules-3.15.0-0.rc7.git3.1.fc21.x86_64             15/18 
  Cleanup    : kernel-tools-3.15.0-0.rc7.git4.2.fc21.x86_64               16/18 
  Cleanup    : kernel-tools-libs-3.15.0-0.rc7.git4.2.fc21.x86_64          17/18 
dkms: removing: vboxguest 4.3.12 (3.15.0-0.rc7.git3.1.fc21.x86_64) (x86_64)

-------- Uninstall Beginning --------
Module:  vboxguest
Version: 4.3.12
Kernel:  3.15.0-0.rc7.git3.1.fc21.x86_64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.
Removing any linked weak-modules

vboxguest.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.15.0-0.rc7.git3.1.fc21.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxsf.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.15.0-0.rc7.git3.1.fc21.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxvideo.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.15.0-0.rc7.git3.1.fc21.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
  Cleanup    : kernel-core-3.15.0-0.rc7.git3.1.fc21.x86_64                18/18 
warning: file /lib/modules/3.15.0-0.rc7.git3.1.fc21.x86_64/updates: remove failed: No such file or directory
sed: -e expression #1, char 21: unterminated `s' command
  Verifying  : kernel-modules-3.15.0-0.rc8.git0.1.fc21.x86_64              1/18 
  Verifying  : kernel-devel-3.15.0-0.rc8.git0.1.fc21.x86_64                2/18 
  Verifying  : kernel-tools-libs-3.15.0-0.rc8.git0.1.fc21.x86_64           3/18 
  Verifying  : kernel-3.15.0-0.rc8.git0.1.fc21.x86_64                      4/18 
  Verifying  : kernel-tools-3.15.0-0.rc8.git0.1.fc21.x86_64                5/18 
  Verifying  : kernel-modules-extra-3.15.0-0.rc8.git0.1.fc21.x86_64        6/18 
  Verifying  : kernel-tools-libs-devel-3.15.0-0.rc8.git0.1.fc21.x86_64     7/18 
  Verifying  : kernel-core-3.15.0-0.rc8.git0.1.fc21.x86_64                 8/18 
  Verifying  : kernel-headers-3.15.0-0.rc8.git0.1.fc21.x86_64              9/18 
  Verifying  : kernel-core-3.15.0-0.rc7.git3.1.fc21.x86_64                10/18 
  Verifying  : kernel-tools-3.15.0-0.rc7.git4.2.fc21.x86_64               11/18 
  Verifying  : kernel-headers-3.15.0-0.rc7.git4.2.fc21.x86_64             12/18 
  Verifying  : kernel-devel-3.15.0-0.rc7.git3.1.fc21.x86_64               13/18 
  Verifying  : kernel-tools-libs-devel-3.15.0-0.rc7.git4.2.fc21.x86_64    14/18 
  Verifying  : kernel-3.15.0-0.rc7.git3.1.fc21.x86_64                     15/18 
  Verifying  : kernel-tools-libs-3.15.0-0.rc7.git4.2.fc21.x86_64          16/18 
  Verifying  : kernel-modules-extra-3.15.0-0.rc7.git3.1.fc21.x86_64       17/18 
  Verifying  : kernel-modules-3.15.0-0.rc7.git3.1.fc21.x86_64             18/18 

Removed:
  kernel.x86_64 0:3.15.0-0.rc7.git3.1.fc21                                      
  kernel-core.x86_64 0:3.15.0-0.rc7.git3.1.fc21                                 
  kernel-devel.x86_64 0:3.15.0-0.rc7.git3.1.fc21                                
  kernel-modules.x86_64 0:3.15.0-0.rc7.git3.1.fc21                              
  kernel-modules-extra.x86_64 0:3.15.0-0.rc7.git3.1.fc21                        

Installed:
  kernel.x86_64 0:3.15.0-0.rc8.git0.1.fc21                                      
  kernel-core.x86_64 0:3.15.0-0.rc8.git0.1.fc21                                 
  kernel-devel.x86_64 0:3.15.0-0.rc8.git0.1.fc21                                
  kernel-modules.x86_64 0:3.15.0-0.rc8.git0.1.fc21                              
  kernel-modules-extra.x86_64 0:3.15.0-0.rc8.git0.1.fc21                        

Updated:
  kernel-headers.x86_64 0:3.15.0-0.rc8.git0.1.fc21                              
  kernel-tools.x86_64 0:3.15.0-0.rc8.git0.1.fc21                                
  kernel-tools-libs.x86_64 0:3.15.0-0.rc8.git0.1.fc21                           
  kernel-tools-libs-devel.x86_64 0:3.15.0-0.rc8.git0.1.fc21                     

Complete!
[root@localhost ~]#

Version-Release number of selected component (if applicable):
kernel-3.15.0-0.rc8.git0.1.fc21

Comment 1 Andre Robatino 2014-06-03 16:57:12 UTC
By removing a few packages with dependency problems, I was able to update over a hundred packages that wouldn't previously install. I'll check if this bug still appears when the next kernel update happens.

Comment 2 Josh Boyer 2014-06-03 17:18:05 UTC
You're using vbox drivers with DKMS.  Does it happen without any of that installed?

Comment 3 Andre Robatino 2014-06-03 18:29:22 UTC
Appears that the error is coming from installing the VirtualBox guest modules, based on the following. Sorry for the noise.

[root@localhost ~]# dkms status 
vboxguest, 4.3.12, 3.15.0-0.rc7.git0.1.fc21.x86_64, x86_64: installed
vboxguest, 4.3.12, 3.15.0-0.rc8.git0.1.fc21.x86_64, x86_64: installed
[root@localhost ~]# rpm -q kernel
kernel-3.15.0-0.rc7.git0.1.fc21.x86_64
kernel-3.15.0-0.rc7.git4.2.fc21.x86_64
kernel-3.15.0-0.rc8.git0.1.fc21.x86_64
[root@localhost ~]# dkms install vboxguest/4.3.12 -k 3.15.0-0.rc7.git4.2.fc21.x86_64

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.15.0-0.rc7.git4.2.fc21.x86_64 -C /lib/modules/3.15.0-0.rc7.git4.2.fc21.x86_64/build M=/var/lib/dkms/vboxguest/4.3.12/build........................................
cleaning build area....

DKMS: build completed.

vboxguest.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.15.0-0.rc7.git4.2.fc21.x86_64/extra/

vboxsf.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.15.0-0.rc7.git4.2.fc21.x86_64/extra/

vboxvideo.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.15.0-0.rc7.git4.2.fc21.x86_64/extra/
Adding any weak-modules

sed: -e expression #1, char 21: unterminated `s' command
depmod.......

DKMS: install completed.
[root@localhost ~]# dkms status 
vboxguest, 4.3.12, 3.15.0-0.rc7.git0.1.fc21.x86_64, x86_64: installed
vboxguest, 4.3.12, 3.15.0-0.rc7.git4.2.fc21.x86_64, x86_64: installed
vboxguest, 4.3.12, 3.15.0-0.rc8.git0.1.fc21.x86_64, x86_64: installed
[root@localhost ~]#

Comment 4 Andre Robatino 2014-06-03 18:42:05 UTC
Filed https://www.virtualbox.org/ticket/13097 for anyone else who stumbles on this.

Comment 5 Andre Robatino 2014-06-05 15:19:11 UTC
The VirtualBox ticket was closed, according to the dev it actually appears to be a problem with Rawhide's dkms (the problem does not happen in F20). See https://www.virtualbox.org/ticket/13097#comment:1 for his explanation.

Comment 6 Simone Caronni 2014-06-06 07:55:25 UTC
I'm sorry but I'm not able to reproduce this. Also testing as specified in the vbox bug (bash -x /sbin/dkms) doesn't return me the sed error.

The dkms package is identical across all RHEL/Fedora distribution; so it's a bit strange that you have this error on rawhide.

[root@rawhide ~]# dkms build -m xpad/105

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make KERNELRELEASE=3.15.0-0.rc8.git2.1.fc21.x86_64 KVERSION=3.15.0-0.rc8.git2.1.fc21.x86_64....
cleaning build area...

DKMS: build completed.
[root@rawhide ~]# dkms install -m xpad/105

xpad:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.15.0-0.rc8.git2.1.fc21.x86_64/extra/
Adding any weak-modules

depmod.....

DKMS: install completed.
[root@rawhide ~]# dkms uninstall -m xpad/105

-------- Uninstall Beginning --------
Module:  xpad
Version: 105
Kernel:  3.15.0-0.rc8.git2.1.fc21.x86_64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.
Removing any linked weak-modules

xpad.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.15.0-0.rc8.git2.1.fc21.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.

Comment 7 Simone Caronni 2014-06-06 07:56:34 UTC
One note, I just installed a rawhide VM to check for this.

Comment 8 Simone Caronni 2014-06-06 08:03:29 UTC
Which DKMS package are you using?
I don't even get the output that is specified in the vbox report.

Comment 9 Andre Robatino 2014-06-06 12:42:36 UTC
(In reply to Simone Caronni from comment #8)
> Which DKMS package are you using?
> I don't even get the output that is specified in the vbox report.

See https://www.virtualbox.org/ticket/13097#comment:2 - I'm using dkms-2.2.0.3-21.fc21 in Rawhide. All packages in my Rawhide guest are Fedora packages from the Rawhide repo, and there are no package problems (all installed packages are still in the Rawhide repo, no duplicate packages, etc.).

Note that I only started seeing this bug within the last few weeks or so, long after the last dkms change, but it could have been around the time of the 3.15 kernel package reorganization, so that could have been the trigger. I've only seen the bug with the VirtualBox kernel modules (those are the only DKMS modules I have).

Comment 10 Andre Robatino 2014-06-06 13:16:12 UTC
I noticed that in Rawhide, unlike F20, /etc/sysconfig/kernel is now 0 bytes. Can one of the kernel devs in the CC list say if this is intentional and permanent? From https://www.virtualbox.org/ticket/13097#comment:1 maybe the VirtualBox dkms script is assuming that it's nonempty? (In which case it really is a vbox bug, and I'll reopen that ticket.)

Comment 11 Josh Boyer 2014-06-06 13:19:59 UTC
I have no idea what sets /etc/sysconfig/kernel, but it does not come from the kernel package explicitly.  The file isn't owned by anything in the RPM db on my F20 system either.

Comment 12 Simone Caronni 2014-06-06 14:03:00 UTC
I think that is the issue. The file, on my fresh rawhide installation should be populated like this:

# UPDATEDEFAULT specifies if new-kernel-pkg should make
# new kernels the default
UPDATEDEFAULT=yes

# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel-core

The file is not owned by any package, that's correct. It's generated at install time.

Can you try filling it with the above information and see if the error persists?

Comment 13 Josh Boyer 2014-06-06 14:26:00 UTC
I'm not entirely sure that's correct.  We still ship a kernel metapackage, so DEFAULTKERNEL=kernel sounds more accurate to me.  Similarly kernel-PAE, etc for other situations.  If you just list kernel-core, it likely isn't going to work out well.

Comment 14 Simone Caronni 2014-06-06 14:32:56 UTC
Agree, but this is the file that has been installed today as part of the fresh VM installation.

Comment 15 Andre Robatino 2014-06-06 14:33:43 UTC
On both my F20 and Rawhide installs, the mtime of /etc/sysconfig/kernel is roughly the same as the install date of the latest kernel. I could populate /etc/sysconfig/kernel in Rawhide, but the question is, if I do, does the next kernel install preserve it? Or does it go back to 0 bytes?

Comment 16 Simone Caronni 2014-06-06 14:38:18 UTC
Actually I've never seen in my life that file being 0 in size. Maybe it's the VirtualBox package corrupting it.

Anyway, if you populate it, it should stay as is.

Comment 17 Andre Robatino 2014-06-06 15:47:27 UTC
(In reply to Josh Boyer from comment #13)
> I'm not entirely sure that's correct.  We still ship a kernel metapackage,
> so DEFAULTKERNEL=kernel sounds more accurate to me.  Similarly kernel-PAE,
> etc for other situations.  If you just list kernel-core, it likely isn't
> going to work out well.

In F20 it does say DEFAULTKERNEL=kernel. I just asked on #fedora-qa what other people's contents were, and roshi said his Rawhide install was several months old and had DEFAULTKERNEL=kernel (so his file is identical to the F20 version). I'm going to go with "kernel" and see what happens in the next kernel update. Maybe the 3.15 kernel changes (including the introduction of the kernel-core package) changed how it gets created from scratch.

Comment 18 Andre Robatino 2014-06-07 13:49:33 UTC
Using the "kernel" version of /etc/sysconfig/kernel (copied from F20) I just did a Rawhide kernel update, and saw the sed error again. I'll try again using the "kernel-core" version and report back after the next kernel update. BTW, the file's mtime was updated during the installation of kernel-core, not kernel, which was installed after, and didn't change the mtime. Josh: please look into what this file's role is (it appears to be read and then rewritten by kernel-core, during its installation), whether it's deprecated (since the vbox dkms script is using it), and whether "kernel" or "kernel-core" is correct. Thanks.

Comment 19 Andre Robatino 2014-06-10 18:04:07 UTC
Today's Rawhide kernel update (the first since the 7th), using the "kernel-core" version of /etc/sysconfig/kernel, still shows the sed error. So the fact that the file was empty wasn't relevant, and it's either a Fedora or VirtualBox bug.

Comment 20 Simone Caronni 2014-06-12 08:24:15 UTC
My guess is that there is something else manipulating the file on your system and not VirtualBox. For sure not DKMS, as it never writes into that file, only parses it for output.

I've been running DKMS on all supported RHEL/Fedora distributions including rawhide for years and never experienced such problem.

Have you tried using RPMFusion's VirtualBox packages instead of VirtualBox.org provided ones?

Comment 21 Michael T 2014-06-16 07:52:28 UTC
As mentioned in the virtualbox.org bug report, this seems to be due to change in behaviour in /bin/bash.  Try running the following on both Fedora 20 and rawhide:

bash -x -c 'arr[0]=; arr[1]=; [[ ${arr[@]} ]] || echo false' 

This affects the line

[[ ${modules_conf_obsoletes[@]} ]] || return 0

in the moduleconfig_update_obsoletes() function of /sbin/dkms: on rawhide it fails to execute the "return 0".

Comment 22 Simone Caronni 2014-06-16 09:08:28 UTC
Ouch, that's strange. I've looked on the web about changes in bash 4.3 but could not find anything about this. Even setting compatibility mode in bash to 4.2 does not solve the issue.

Looks like a bug.

Comment 23 Michael T 2014-06-16 09:15:00 UTC
For reference, Ubuntu 14.04 with bash 4.3.11(1) behaves like Fedora 20.

Comment 24 Simone Caronni 2014-06-16 09:39:52 UTC
(In reply to Michael T from comment #23)
> For reference, Ubuntu 14.04 with bash 4.3.11(1) behaves like Fedora 20.

Many thanks for the information.

Comment 25 Andre Robatino 2014-06-16 23:30:43 UTC
Ok, looks pretty certain that it's not dkms, and likely that it's the bash change. So the question is, is the bash change intentional, or a bug? Switching components. (Bash devs: the change in question is the one referred to in comment 21, and in https://www.virtualbox.org/ticket/13097#comment:5 .

Comment 26 Simone Caronni 2014-06-17 07:07:30 UTC
Hello,

the bug already blocks #1109736; which is the bug related to the undocumented change. It also references the Virtualbox bug comment.

Michael T has already identified the commit where the issue was introduced.

Regards,
--Simone

Comment 27 Simone Caronni 2014-06-17 13:30:03 UTC
Ok, so this needs an update in dkms itself for the more strict syntax. I'm preparing a build of the package with the particular line corrected, but probably this needs also some other adjustments to the code.

I don't have time to audit it all, so I'm posting a koji scratch build with the first patch.

I kindly ask for some testing feedback so we can maybe add all that's missing in additional steps. Unless, of course, someone wants to audit all dkms.

Comment 28 Simone Caronni 2014-06-17 13:44:52 UTC
RPMS here:

http://koji.fedoraproject.org/koji/taskinfo?taskID=7051147

Comment 29 Andre Robatino 2014-06-19 07:40:12 UTC
Using dkms-2.2.0.3-23.fc21.noarch, when I use dkms remove and dkms install to install the vbox guest modules for one of the kernels, near the end of the dkms install I still see the exact same sed error as with -22.

Adding any weak-modules

sed: -e expression #1, char 21: unterminated `s' command
depmod....

DKMS: install completed.

Comment 30 Andre Robatino 2014-06-19 08:00:28 UTC
As an aside, I discovered that running dkms install causes /etc/sysconfig/kernel to be truncated to 0 bytes. This happens with either -22 or -23. (The reason I didn't see the extra output in the previous comment was presumably because the file had already been truncated to 0 bytes before and I didn't notice.)

[root@localhost ~]# ls -l /etc/sysconfig/kernel 
-rw-r--r--. 1 root root 185 Jun  7 09:47 /etc/sysconfig/kernel
[root@localhost ~]# dkms install vboxguest/4.3.12 -k 3.15.0-1.fc21.x86_64

Creating symlink /var/lib/dkms/vboxguest/4.3.12/source ->
                 /usr/src/vboxguest-4.3.12

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.15.0-1.fc21.x86_64 -C /lib/modules/3.15.0-1.fc21.x86_64/build M=/var/lib/dkms/vboxguest/4.3.12/build.........................
cleaning build area....

DKMS: build completed.

vboxguest.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.15.0-1.fc21.x86_64/extra/

vboxsf.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.15.0-1.fc21.x86_64/extra/

vboxvideo.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.15.0-1.fc21.x86_64/extra/
Adding any weak-modules

sed: -e expression #1, char 21: unterminated `s' command
/etc/sysconfig/kernel updated to replace obsoleted module references:
--- /tmp/dkms.u155Am/kernel.new	2014-06-19 03:49:12.205080158 -0400
+++ /etc/sysconfig/kernel	2014-06-07 09:47:50.424778080 -0400
@@ -0,0 +1,6 @@
+# UPDATEDEFAULT specifies if new-kernel-pkg should make
+# new kernels the default
+UPDATEDEFAULT=yes
+
+# DEFAULTKERNEL specifies the default kernel package type
+DEFAULTKERNEL=kernel-core
depmod....

DKMS: install completed.
[root@localhost ~]# ls -l /etc/sysconfig/kernel 
-rw-r--r--. 1 root root 0 Jun 19 03:49 /etc/sysconfig/kernel
[root@localhost ~]#

Comment 31 Simone Caronni 2014-06-19 09:18:20 UTC
Ok, I think I got it right. I was able to reproduce the error (including the blanking of /etc/sysconfig/kernel) only with the VirtualBox rpm from virtualbox.org.

All the other DKMS modules I have (nvidia, fglrx, xpad) do not exhibit the issue at all. The fix:

http://pkgs.fedoraproject.org/cgit/dkms.git/tree/dkms-bash-syntax-fix.patch

First step is to make sure that the check on the "modules_conf_obsoletes" array does not bring you in the loop for obsolete modules.

Second part, in case the check is legitimate, makes sure your files are not destroyed by sed.

If you want to make sure the sed command is fixed, first restore line eight here on your system by editing /usr/sbin/dkms directly:

http://pkgs.fedoraproject.org/cgit/dkms.git/tree/dkms-bash-syntax-fix.patch#n8

and relaunch dkms remove/install again.

I've created another scratch build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=7057073

Please re-populate your /etc/sysconfig/kernel before using this rpm and making the test. If it works, I'll build it in rawhide.

Comment 32 Andre Robatino 2014-06-19 16:14:22 UTC
> If you want to make sure the sed command is fixed, first restore line eight here on your system by editing /usr/sbin/dkms directly:

I'm not sure whether this is something _I'm_ expected to do, but I'm guessing not, since you provided a binary dkms package. I simply tested that, after repopulating /etc/sysconfig/kernel, and dkms remove and dkms install both work now without any visible error, and without touching /etc/sysconfig/kernel.

Comment 33 Simone Caronni 2014-06-19 16:36:59 UTC
(In reply to Andre Robatino from comment #32)
> I'm not sure whether this is something _I'm_ expected to do, but I'm
> guessing not, since you provided a binary dkms package.

Exactly, this was only to test it. Before the fix, line 8 was bringing you into a loop in which you should not have ended, and the rest of the sed lines were breaking your config file.

The package contains fix for both, but if you wanted to check the sed commands you had to restore line 8 (thus restoring the error).

Thanks for reporting; I've built the package in rawhide.

Comment 34 Fedora Update System 2014-07-23 16:47:32 UTC
dkms-2.2.0.3-25.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-25.el6

Comment 35 Fedora Update System 2014-07-23 16:47:58 UTC
dkms-2.2.0.3-25.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-25.el5

Comment 36 Fedora Update System 2014-07-23 16:48:30 UTC
dkms-2.2.0.3-25.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-25.fc20

Comment 37 Fedora Update System 2014-07-23 17:03:11 UTC
dkms-2.2.0.3-25.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/dkms-2.2.0.3-25.fc19

Comment 38 Fedora Update System 2014-07-26 16:00:20 UTC
dkms-2.2.0.3-25.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 39 Fedora Update System 2014-09-02 03:53:48 UTC
dkms-2.2.0.3-25.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 40 Fedora Update System 2014-09-02 03:56:06 UTC
dkms-2.2.0.3-25.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 41 Fedora Update System 2014-09-02 06:42:57 UTC
dkms-2.2.0.3-25.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.