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

Bug #1623125 reported by Oliver Grawert on 2016-09-13
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Oliver Grawert
initramfs-tools (Ubuntu)
Stefan Bader
initramfs-tools-ubuntu-core (Ubuntu)
Oliver Grawert

Bug Description

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.

Oliver Grawert (ogra) wrote : 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
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
         TIME=$(${DATE} --utc --date "${TIMESTR}" +%s)

Oliver Grawert (ogra) wrote :

sigh, launchpad and diffs ... the above in a pastebin is at

tags: added: rls-aa-incoming
Stefan Bader (smb) on 2017-09-06
Changed in initramfs-tools (Ubuntu):
assignee: nobody → Stefan Bader (smb)
importance: Undecided → Medium
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers