installing casper on a non live system causes update-initramfs to fail

Bug #984276 reported by Brian Murray on 2012-04-17
496
This bug affects 25 people
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
High
mayed
Precise
High
mayed
Quantal
High
Stéphane Graber

Bug Description

In the event that someone decides to install casper on their Ubuntu system, which a lot of people apparently do decide to do, then they will be unable to use update-initramfs which will cause package installation failures for initramfs-tools.

Workaround:
Uninstall the casper package

[rationale]
Some people are weird and install casper on a standard Ubuntu system.
The postinst then tries to mess with their update-initramfs, fails to do so and causes a ton of bug reports.

This fix drops that code and moves the symlinking logic to a casper script which apparently does the right thing since we haven't heard of this bug again since 12.10 was released.

[test case]
1) Install casper on a 12.04 system
2) Check that the installation doesn't fail
3) Check that installing another package doesn't fail
4) Check that update-initramfs -u succeeds

[regression potential]
It's a perfect cherry-pick from the fix pushed to 12.10, so it should be working fine.
The worst case scenario would be the symlinking magic failing in casper and our live medias ending up without update-initramfs disabled, which would be a bit annoying but not dramatic.

tags: added: precise
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in casper (Ubuntu):
status: New → Confirmed
Oliver Grawert (ogra) on 2012-04-18
Changed in casper (Ubuntu):
assignee: nobody → Oliver Grawert (ogra)
importance: Undecided → Medium
tags: added: bugpattern-written
nargel (serglegr) wrote :

migration ubuntu 11.10 to 12.04

Jeremy Yoder (jyoder) wrote :

Casper was installed on my system by remastersys, which I used to create a backup before upgrading. Nice synergy :)

Thank you, have solved the problem by upgrading to 4.12 on 4/26/2012, once
again thank you my friends!

2012/4/28 Jeremy Yoder <email address hidden>

> Casper was installed on my system by remastersys, which I used to create
> a backup before upgrading. Nice synergy :)
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (971215).
> https://bugs.launchpad.net/bugs/984276
>
> Title:
> installing casper on a non live system causes update-initramfs to fail
>
> Status in “casper” package in Ubuntu:
> Confirmed
> Status in “casper” source package in Precise:
> Confirmed
>
> Bug description:
> In the event that someone decides to install casper on their Ubuntu
> system, which a lot of people apparently do decide to do, then they
> will be unable to use update-initramfs which will cause package
> installation failures for initramfs-tools.
>
> Workaround:
> Uninstall the casper package
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/casper/+bug/984276/+subscriptions
>

Brian Murray (brian-murray) wrote :

I think why this is only happening for some people is that update-initramfs doesn't end up being a symlink for them. casper.postinst contains the following:

#! /bin/sh

# If running from writable media, make sure that update-initramfs is
# properly a symlink.
if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 1.253 && \
   [ -w /cdrom ] && [ -e /usr/sbin/update-initramfs.distrib ] && \
   [ ! -L /usr/sbin/update-initramfs ] && \
   fgrep -qs update-initramfs.distrib /usr/sbin/update-initramfs; then
    ln -nsf /usr/share/casper/casper-update-initramfs \
            /usr/sbin/update-initramfs
fi

update-initramfs -u

#DEBHELPER#

If you just install casper and don't pass all the tests update-initramfs won't be symlinked to casper-update-initramfs and then you will be able to install kernel updates. However, if the symlink is created you'll likely have problems using update-initramfs.

Tony Brijeski (tb6517) wrote :

This makes more sense.  It would appear this issue might arise after an install from a usb created remaster that has persistence on.  I will do some testing of this very scenario tonight and see what happens.  I can fix this for remastersys but it will still be an issue for folks that do it manually or using another tool.

Thanks for following up with me on this.  I'll let you know what I find with my testing.  Colin must have changed this to fix the persistence issue with usb.  If this is the case I'd add one more check that would fix the issue for all involved and that would be to check for "/casper".  If it exists then it is running live from usb but if it doesn't exist then it is a real install.  I'll do some testing with this theory as well and if it works and doesn't cause issues I can offer up a patch for Colin to include.

Regards,
Tony

>________________________________
> From: Brian Murray <email address hidden>
>To: <email address hidden>
>Sent: Thursday, May 3, 2012 4:09:50 PM
>Subject: [Bug 984276] Re: installing casper on a non live system causes update-initramfs to fail
>
>I think why this is only happening for some people is that update-
>initramfs doesn't end up being a symlink for them.  casper.postinst
>contains the following:
>
>#! /bin/sh
>
># If running from writable media, make sure that update-initramfs is
># properly a symlink.
>if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 1.253 && \
>  [ -w /cdrom ] && [ -e /usr/sbin/update-initramfs.distrib ] && \
>  [ ! -L /usr/sbin/update-initramfs ] && \
>  fgrep -qs update-initramfs.distrib /usr/sbin/update-initramfs; then
>    ln -nsf /usr/share/casper/casper-update-initramfs \
>            /usr/sbin/update-initramfs
>fi
>
>update-initramfs -u
>
>#DEBHELPER#
>
>If you just install casper and don't pass all the tests update-initramfs
>won't be symlinked to casper-update-initramfs and then you will be able
>to install kernel updates.  However, if the symlink is created you'll
>likely have problems using update-initramfs.
>
>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/984276
>
>Title:
>  installing casper on a non live system causes update-initramfs to fail
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/ubuntu/+source/casper/+bug/984276/+subscriptions
>
>
>

Tony Brijeski (tb6517) wrote :

Can the folks having these issues tell me if the system they are using to install from is USB with persistence?

It seems this is only happening on installs that take place from USB with persistence. Are all of the bug reporters installing remasters made by remastersys or are some of these official Ubuntu iso's with persistence that they later try to install?

I had no issues last night with usb or dvd based installs but haven't tried it with persistence yet. I might not get a chance to test this part of it for a few days as I have too many other things that I'm working both in linux and otherwise.

Steve Langasek (vorlon) on 2012-08-30
Changed in casper (Ubuntu):
importance: Medium → High
Changed in casper (Ubuntu Precise):
importance: Medium → High
Changed in casper (Ubuntu Quantal):
assignee: Oliver Grawert (ogra) → Stéphane Graber (stgraber)
Changed in casper (Ubuntu Quantal):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package casper - 1.326

---------------
casper (1.326) quantal; urgency=low

  * 22desktop_settings:
    - Rename 22screensaver to 22desktop_settings
    - Move 22gnome_panel_data's content to 22desktop_settings
    - Flush overrides in 22desktop_settings to avoid getting duplicate keys
      when using persistence.
    - Check for gsettings-desktop-schemas instead of gnome-panel-data
  * 35fix_language_selector:
    - Use sed against the original file (from rofs) instead of the target file.
      This avoids another case where the change is re-applied at every boot
      when using persistence.
  * 25adduser:
    - Remove RUNNING_UNDER_GDM from /etc/environment which was a big hack
      for back when we still used xscreensaver and was getting appended with
      every single boot.
    - Use /etc/sudoers.d instead of appending to /etc/sudoers, avoid getting
      duplicate lines with every reboot.
  * 23networking:
    - Change default /etc/network/interfaces to match that in /rofs, makes it
      easier to diff /etc when debugging casper.
  * casper-init, casper, 19-keyboard, casper-functions:
    - Remove any remaining reference to usplash as it's been deprecated for a
      long long time and just makes things harder to read.
  * casper-update-initramfs:
    - Exit when called from a non-writable media (cdrom) or when called from
      ubiquity. This fixes a > 1 minute wait when clicking "Try Ubuntu".
  * 19keyboard:
    - Add code to detect that the keyboard layout changed from the previous
      value and flush the gsettings key so that the indicator is properly
      reset. (LP: #946406)
  * 43disable_updateinitramfs:
    - Don't try to chmod a dangling symlink.
    - Only write /usr/sbin/update-initramfs if it doesn't already exist.
  * postinst:
    - Remove code generating symlink for /usr/sbin/update-initramfs to
      /usr/share/casper/casper-update-iniramfs as the diversion and symlinking
      is done in the initramfs and that code was only useful when the shim was
      first introduced. (LP: #984276)
  * scripts/casper:
    - Allow specifying live-media on the command line, helps when booting
      computers that are unable to boot a CD/USB disk. (LP: #423616)
    - Fix NFSOPTS handling by adding the needed comma and sticking it to the
      existing "ro" option of nfsmount (LP: #476208)
  * 22serialtty:
    - Move 22serialtty to 26serialtty to avoid overriding the newly generated
      upstart jobs. Note that this will spawn getty instead of login, but
      it's probably for the best as we need a specific baudrate. (LP: #747888)
 -- Stephane Graber <email address hidden> Tue, 02 Oct 2012 18:11:44 -0400

Changed in casper (Ubuntu Quantal):
status: Fix Committed → Fix Released
Changed in casper (Ubuntu Precise):
milestone: none → ubuntu-12.04.2
Stéphane Graber (stgraber) wrote :

Uploaded a cherry-pick of the update-initramfs bits from the quantal upload to precise-proposed.

description: updated
description: updated
Changed in casper (Ubuntu Precise):
assignee: Oliver Grawert (ogra) → Stéphane Graber (stgraber)
status: Confirmed → In Progress

Hello Brian, or anyone else affected,

Accepted casper into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/casper/1.315.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in casper (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Brian Murray (brian-murray) wrote :

After installing casper version 1.315.1 from precise-proposed I confirm that it is possible to use update-initramfs.

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package casper - 1.315.1

---------------
casper (1.315.1) precise-proposed; urgency=low

  * postinst:
    - Remove code generating symlink for /usr/sbin/update-initramfs to
      /usr/share/casper/casper-update-iniramfs as the diversion and symlinking
      is done in the initramfs and that code was only useful when the shim was
      first introduced. (LP: #984276)
 -- Stephane Graber <email address hidden> Tue, 22 Jan 2013 18:24:17 -0500

Changed in casper (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in casper (Ubuntu Precise):
assignee: Stéphane Graber (stgraber) → mohamed Othman (othmanm99)
Changed in casper (Ubuntu Precise):
assignee: mohamed Othman (othmanm99) → Stéphane Graber (stgraber)
mayed (mayed19908) on 2013-10-08
Changed in casper (Ubuntu):
assignee: Stéphane Graber (stgraber) → mayed (mayed19908)
Changed in casper (Ubuntu Precise):
assignee: Stéphane Graber (stgraber) → mayed (mayed19908)
To post a comment you must log in.