initrd.img symlink is created absolute when the initrd creation is delayed

Bug #1248053 reported by Daniel J Blueman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Andy Whitcroft
Saucy
Won't Fix
Medium
Andy Whitcroft

Bug Description

When the linux-image package is installed, it creates symlinks from the root directory:

# ls -l /
initrd.img -> /boot/initrd.img-3.11.0-13-generic
vmlinuz -> boot/vmlinuz-3.11.0-13-generic

This is needed for booting the currently installed kernel (managed from within the distro for security updates etc) in certain environments, such as virtual hosts or root-NFS booting.

The bug is that the initrd.img symlink is absolute, since the test_relative() perl function checks for the presence of the initrd.img file, which is created after the postinst scripts runs, so it assumes a absolute symlink is needed. This isn't the case for the vmlinuz file, since it is shipped.
---
ApportVersion: 2.12.5-0ubuntu2.1
Architecture: i386
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: lightdm 1818 F.... pulseaudio
DistroRelease: Ubuntu 13.10
HibernationDevice: RESUME=UUID=921107b8-2551-4cc2-9a4f-7d63bdf8dbf5
InstallationDate: Installed on 2013-11-01 (3 days ago)
InstallationMedia: Edubuntu 13.10 "Saucy Salamander" - Release i386 (20131016.1)
IwConfig:
 lo no wireless extensions.

 eth0 no wireless extensions.

 lxcbr0 no wireless extensions.
MachineType: ZOTAC ZBOXNANO-ID63/ID64/ID65
MarkForUpload: True
Package: linux (not installed)
ProcEnviron:
 LANGUAGE=en_SG:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_SG.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.11.0-12-generic root=UUID=2ee0f15b-e265-4cd7-acb2-adb6e0928d61 ro quiet splash ipv6.disable=1 vt.handoff=7
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
PulseList:
 Error: command ['pacmd', 'list'] failed with exit code 1: Home directory not accessible: Permission denied
 No PulseAudio daemon running, or not running as session daemon.
RelatedPackageVersions:
 linux-restricted-modules-3.11.0-12-generic N/A
 linux-backports-modules-3.11.0-12-generic N/A
 linux-firmware 1.116
RfKill:

StagingDrivers: rts5139
Tags: saucy staging
Uname: Linux 3.11.0-12-generic i686
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

dmi.bios.date: 05/07/2013
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 4.6.5
dmi.board.asset.tag: NA
dmi.board.name: ZBOXNANO-ID63/ID64/ID65
dmi.board.vendor: ZOTAC
dmi.board.version: XX
dmi.chassis.asset.tag: NA
dmi.chassis.type: 3
dmi.chassis.vendor: NA
dmi.chassis.version: NA
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr4.6.5:bd05/07/2013:svnZOTAC:pnZBOXNANO-ID63/ID64/ID65:pvrXX:rvnZOTAC:rnZBOXNANO-ID63/ID64/ID65:rvrXX:cvnNA:ct3:cvrNA:
dmi.product.name: ZBOXNANO-ID63/ID64/ID65
dmi.product.version: XX
dmi.sys.vendor: ZOTAC

Revision history for this message
Daniel J Blueman (watchmaker) wrote :

A candidate fix is to pass the vmlinuz-3.11.0-12-generic (or whatever) filename into the test_relative() function for the 'Test File' parameter, when it's called for the non-existent initrd.img-* file, since the vmlinuz is guaranteed to be present.

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1248053

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel J Blueman (watchmaker) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected saucy staging
description: updated
Revision history for this message
Daniel J Blueman (watchmaker) wrote : BootDmesg.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : CRDA.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : Lspci.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : Lsusb.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : ProcModules.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : UdevDb.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : UdevLog.txt

apport information

Revision history for this message
Daniel J Blueman (watchmaker) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Daniel J Blueman (watchmaker) wrote : Re: initrd.img symlink is absolute

Just for the record, viewing the report data crashed apport-collect:

root@zbox:~# apport-collect 1248053
...
The collected information can be sent to the developers to improve the
application. This might take a few minutes.
..dpkg-query: no packages found matching linux
.......

*** Send problem report to the developers?

After the problem report has been sent, please fill out the form in the
automatically opened web browser.

What would you like to do? Your options are:
  S: Send report (972.0 KB)
  V: View report
  K: Keep report file for sending later or copying to somewhere else
  I: Cancel and ignore future crashes of this program version
  C: Cancel
Please choose (S/V/K/I/C): v
Traceback (most recent call last):
  File "/usr/bin/apport-cli", line 367, in <module>
    if not app.run_argv():
  File "/usr/lib/python2.7/dist-packages/apport/ui.py", line 656, in run_argv
    return self.run_update_report()
  File "/usr/lib/python2.7/dist-packages/apport/ui.py", line 572, in run_update_report
    response = self.ui_present_report_details(allowed_to_report)
  File "/usr/bin/apport-cli", line 206, in ui_present_report_details
    self.collect_info()
  File "/usr/lib/python2.7/dist-packages/apport/ui.py", line 969, in collect_info
    if self.report['ProblemType'] == 'Crash':
  File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'ProblemType'

Revision history for this message
Andy Whitcroft (apw) wrote :

@Daniel -- that 'V' view bug should be reported against apport, that is rather, sad.

I think you are saying that if the file already exists then the linking code will emit a non-absolute link, if it is missing then an absolute one. I think this is born out by my system which clearly has a reinstalled kernel at the same version on it:

lrwxrwxrwx 1 root root 32 Nov 4 18:45 initrd.img -> boot/initrd.img-3.8.0-32-generic
lrwxrwxrwx 1 root root 33 Nov 4 18:45 initrd.img.old -> /boot/initrd.img-3.8.0-32-generic

The first one (.old) would have not had an initrd in place when linking the other would.

Changed in linux (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Andy Whitcroft (apw) wrote :

This actually occurs because test_relative() as used in the really_move_link() call will fail as the destination file actually does not exist, triggering a failure in that incantation. This also highlights we are going to incorrectly indicate that the link is dandling in the case of installing linux-image and linux-image-extra at the same time.

Andy Whitcroft (apw)
Changed in linux (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Andy Whitcroft (apw)
Revision history for this message
Daniel J Blueman (watchmaker) wrote :

I don't think it's directly related, but I also see the umask not being consistent:

$ ls -l boot/
total 42968
-rw-r--r-- 1 root root 1005798 Oct 10 00:49 abi-3.11.0-12-generic
-rw-r--r-- 1 root root 1003704 Nov 4 08:44 abi-3.12.0-031200-generic
-rw-r--r-- 1 root root 163251 Oct 10 00:49 config-3.11.0-12-generic
-rw-r--r-- 1 root root 162643 Nov 4 08:44 config-3.12.0-031200-generic
-rw-r--r-- 1 root root 11724654 Nov 4 10:13 initrd.img-3.11.0-12-generic
-rw-r--r-- 1 root root 11768349 Nov 5 19:50 initrd.img-3.12.0-031200-generic
-rw-r--r-- 1 root root 3285893 Oct 10 00:49 System.map-3.11.0-12-generic
-rw------- 1 root root 3466224 Nov 4 08:44 System.map-3.12.0-031200-generic
-rw-r--r-- 1 root root 5600016 Oct 10 00:49 vmlinuz-3.11.0-12-generic
-rw------- 1 root root 5793312 Nov 4 08:44 vmlinuz-3.12.0-031200-generic

I can log this as a separate issue, though what package should it be against if it's the mainline kernel, as we see here?

Andy Whitcroft (apw)
Changed in linux (Ubuntu Saucy):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Andy Whitcroft (apw)
summary: - initrd.img symlink is absolute
+ initrd.img symlink is created absolute when the initrd creation is
+ delayed
Revision history for this message
Andy Whitcroft (apw) wrote :

@Daniel -- which bit is inconsistent. I would expect, and see on my kit, that the abi and config are 644 and System.map and vmlinuz are 600 consistently across the board. The mainline ones in your case seem to be so also. I am assuming you have modified the others yourself.

Changed in linux (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Andy Whitcroft (apw) wrote :

Ok fixed both of these issues and pushed the fixes to Trusty for testing. Will be in the next upload there.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.12.0-2.5

---------------
linux (3.12.0-2.5) trusty; urgency=low

  [ Andy Whitcroft ]

  * rebase to mainline v3.12
  * [Config] updateconfigs following rebase to v3.12
  * postinst -- improve relative symlink detection with missing files
    - LP: #1248053
  * postinst -- fix unchanged link detection
  * [Config] update configs following addition of apparmor fixes

  [ Anthony Wong ]

  * SAUCE: Work around broken ACPI backlight on Dell Inspiron 5537
    - LP: #1231305

  [ John Johansen ]

  * SAUCE: (no-up) apparmor: Sync to apparmor 3 - alpha 4 snapshot
  * SAUCE: apparmor: fix unix domain sockets to be mediated on connection
    - LP: #1208988
  * SAUCE: apparmor: allocate path lookup buffers during init
    - LP: #1208988

  [ Tim Gardner ]

  * [Config] Remove superfluous ubuntu/lttng-modules

  [ Upstream Kernel Changes ]

  * Revert "fork: unify and tighten up CLONE_NEWUSER/CLONE_NEWPID checks"
    - LP: #1248590

  [ Upstream Kernel Changes ]

  * rebase to v3.12
    - LP: #1222850

  [ Adam Conrad ]
  * etc/getabis: Fetch arm64/generic abis as well
 -- Andy Whitcroft <email address hidden> Wed, 06 Nov 2013 21:00:21 +0000

Changed in linux (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Joseph Salisbury (jsalisbury) wrote : Closing unsupported series nomination.

This bug was nominated against a series that is no longer supported, ie saucy. The bug task representing the saucy nomination is being closed as Won't Fix.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu Saucy):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.