fixrtc script does not catch "Last mount time: n/a" string

Bug #1623125 reported by Oliver Grawert
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Critical
Oliver Grawert
initramfs-tools (Ubuntu)
Fix Released
Medium
Stefan Bader
Xenial
Fix Released
Undecided
Unassigned
Artful
Fix Released
Undecided
Unassigned
initramfs-tools-ubuntu-core (Ubuntu)
Fix Released
Critical
Oliver Grawert
Xenial
Fix Released
Undecided
Unassigned
Artful
New
Undecided
Unassigned

Bug Description

[TEST CASE]
* this will be tested by the snappy team
* without this fix the dragonboard will not boot on a freshly written image

[REGRESSION POTENTIAL]
* low as it only fixes an invalid string

trying to boot a new dragonboard image results in:

error: assertion is signed with expired public key "-CvQKAwRQ5h3Ffn10FILJoEZUXOv6km9FwA80-Rcj-f-6jadQ89VRswHNiEB9Lxk" by canonical

this is due to a clock skew that should normally be catched by the fixrtc script in the initrd.

the script is supposed to check the last mount time of the writable disk (SD card) and if this does not exist, fall back to the filesystem creation time ...

in former versions of mkfs.ext4 the last mount time filed was simply left empty, so this fallback worked fine ... in xenial the fields now look like:

Filesystem created: Tue Sep 13 17:32:20 2016
Last mount time: n/a
Last write time: Tue Sep 13 17:32:20 2016

due to the script running with "set -e" it falls over on the "n/a" and exists before falling back to creation time, there needs to be a check added for the "n/a" string now.

Revision history for this message
Oliver Grawert (ogra) wrote :

http://paste.ubuntu.com/23174192/ is the current fixrtc script

Changed in initramfs-tools-ubuntu-core (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Oliver Grawert (ogra)
Changed in snappy:
importance: Undecided → Critical
assignee: nobody → Oliver Grawert (ogra)
Changed in initramfs-tools-ubuntu-core (Ubuntu):
status: New → Triaged
Changed in snappy:
status: New → Triaged
Revision history for this message
Oliver Grawert (ogra) wrote :

diff -Nru initramfs-tools-0.122ubuntu8.1/debian/changelog initramfs-tools-0.122ubuntu8.1+ppa1/debian/changelog
--- initramfs-tools-0.122ubuntu8.1/debian/changelog 2016-06-06 20:32:03.000000000 +0200
+++ initramfs-tools-0.122ubuntu8.1+ppa1/debian/changelog 2016-09-13 22:35:44.000000000 +0200
@@ -1,3 +1,10 @@
+initramfs-tools (0.122ubuntu8.1+ppa1) xenial; urgency=medium
+
+ * make fixrtc catch "n/a" string and fall back to a sane value for the date
+ command instead (LP: #1623125)
+
+ -- Oliver Grawert <email address hidden> Tue, 13 Sep 2016 22:31:46 +0200
+
 initramfs-tools (0.122ubuntu8.1) xenial; urgency=medium

   * hook-functions: include ehci-msm in auto_add_modules_list
diff -Nru initramfs-tools-0.122ubuntu8.1/scripts/local-premount/fixrtc initramfs-tools-0.122ubuntu8.1+ppa1/scripts/local-premount/fixrtc
--- initramfs-tools-0.122ubuntu8.1/scripts/local-premount/fixrtc 2016-02-03 18:07:11.000000000 +0100
+++ initramfs-tools-0.122ubuntu8.1+ppa1/scripts/local-premount/fixrtc 2016-09-13 22:31:43.000000000 +0200
@@ -96,6 +96,11 @@
         DATE="/bin/date -D%c"
         date -D%c 2>/dev/null || DATE=/bin/date

+ if [ "$MOUNTDATE" = "n/a" ]; then
+ # some versions of mkfs set n/a now, date is not happy with this so
+ # let us use some half way sane epoch instead
+ MOUNTDATE="Fri Jan 1 00:00:00 1999"
+ fi
         TIMESTR=$MOUNTDATE
         TIME=$(${DATE} --utc --date "${TIMESTR}" +%s)

Revision history for this message
Oliver Grawert (ogra) wrote :

sigh, launchpad and diffs ... the above in a pastebin is at http://paste.ubuntu.com/23175211/

tags: added: rls-aa-incoming
Stefan Bader (smb)
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Stefan Bader (smb)
importance: Undecided → Medium
status: New → In Progress
Michael Vogt (mvo)
description: updated
description: updated
Michael Vogt (mvo)
Changed in snappy:
status: Triaged → Fix Released
Changed in initramfs-tools-ubuntu-core (Ubuntu):
status: Triaged → Confirmed
status: Confirmed → Fix Released
Changed in initramfs-tools-ubuntu-core (Ubuntu Xenial):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.125ubuntu13

---------------
initramfs-tools (0.125ubuntu13) bionic; urgency=medium

  [ Oliver Grawert ]
  * make fixrtc catch "n/a" string and fall back to a sane value for the date
    command instead (LP: #1623125)

 -- Michael Vogt <email address hidden> Wed, 20 Dec 2017 09:44:43 +0100

Changed in initramfs-tools (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Shouldn't this also be fixed in Artful? I'm not concerned about Zesty since its EoL is imminent.

Revision history for this message
Oliver Grawert (ogra) wrote :

since we dont build ubuntu core images based on the artful archive this would just be cosmetic ... (but yeah, technically we could also upload it to artful ... xenial and bionic are the critical ones here though)

Revision history for this message
Michael Vogt (mvo) wrote :

Yes, I will work on this!

Revision history for this message
Michael Vogt (mvo) wrote :

I uploaded updates for zesty and artful now as well.

Revision history for this message
Michael Vogt (mvo) wrote :

It is like ogra said - the snapd team does not care about zesty/artful, but if it makes the SRU easier we are happy to push to zesty/artful as well.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Oliver, or anyone else affected,

Accepted initramfs-tools into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/initramfs-tools/0.125ubuntu12.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 on 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-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, without details of your testing we will not be able to proceed.

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

Changed in initramfs-tools (Ubuntu Artful):
status: New → Fix Committed
tags: added: verification-needed verification-needed-artful
Changed in initramfs-tools (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Oliver, or anyone else affected,

Accepted initramfs-tools into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/initramfs-tools/0.122ubuntu8.11 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 on 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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

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

Revision history for this message
Steve Langasek (vorlon) wrote :

This SRU has gone 49 days without verification, and at this point looks like it will miss the window for 16.04.4. Will someone from the Snappy team be verifying this so that it can be included in future core snaps and ubuntu-core images?

Revision history for this message
Oliver Grawert (ogra) wrote :

I have verified the xenial one with a locally created core and kernel snap now (as mentioned before I can not verify it on artful simply because there is no Ubuntu Core for this release, using the deb from proposed on an artful desktop does not show any regressions though)

tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Since there is no possible way of testing this for artful, I assume the sanity-test performed by Oliver is enough. Also, the package has been in artful-proposed since 75 days and no regressions have been reported. Unblocking.

tags: added: verification-done-artful
removed: verification-needed verification-needed-artful
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.125ubuntu12.1

---------------
initramfs-tools (0.125ubuntu12.1) artful; urgency=medium

  [ Oliver Grawert ]
  * make fixrtc catch "n/a" string and fall back to a sane value for the date
    command instead (LP: #1623125)

 -- Michael Vogt <email address hidden> Fri, 05 Jan 2018 10:23:22 +0100

Changed in initramfs-tools (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for initramfs-tools 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 regressions.

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

This bug was fixed in the package initramfs-tools - 0.122ubuntu8.11

---------------
initramfs-tools (0.122ubuntu8.11) xenial; urgency=medium

  [ Oliver Grawert ]
  * make fixrtc catch "n/a" string and fall back to a sane value for the date
    command instead (LP: #1623125)

 -- Michael Vogt <email address hidden> Wed, 20 Dec 2017 09:38:07 +0100

Changed in initramfs-tools (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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