fixrtc fails due to bad format of input to the date command

Bug #1880968 reported by Alfonso Sanchez-Beato on 2020-05-27
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Medium
Unassigned
Focal
Medium
Unassigned

Bug Description

The fixrtc script is failing with message:

date: invalid date ' Wed Apr 1 17:23:44 2020'

when calling the date command. It looks like it does not like the leading spaces for the input date. The date is taken from 'dumpe2fs -h' ouptput, and some clean-up on it happens, but it looks like it is not enough for BusyBox' date command, at least for the version in focal.

Backporting this to focal is needed.

[Impact]

The system date shown on first boot is incorrect, which can be problematic on first boot if at that point in time there is no network connection. If fixrtc works correctly at least we get the date of the last time the rootfs was mounted, which is modern enough to avoid problems with snap assertions validation, etc.

[Test case]

Boot an image with fixrtc in the kernel command line in a system with no network. snap seeding will fail without the patch.

[Regression Potential]

Quite small, as the fix is small and targeted.

See attached debdiff for the fix

tags: added: groovy
tags: added: focal
Changed in initramfs-tools (Ubuntu):
importance: Undecided → Medium
description: updated
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.137ubuntu10

---------------
initramfs-tools (0.137ubuntu10) groovy; urgency=medium

  * Trim leading whitespaces in dumpe2fs output so date command
    is happy in the fixrtc script (LP: #1880968)

 -- Alfonso Sanchez-Beato (email Canonical) <email address hidden> Wed, 27 May 2020 16:52:16 +0200

Changed in initramfs-tools (Ubuntu):
status: New → Fix Released

Hello Alfonso, or anyone else affected,

Accepted initramfs-tools into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/initramfs-tools/0.136ubuntu6.2 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in initramfs-tools (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal

I have updated to focal-proposed and checked that now there is no

date: invalid date ' Wed Apr 1 17:23:44 2020'

output anymore in the console and that fixrtc finishes as expected.

$ apt info initramfs-tools
Package: initramfs-tools
Version: 0.136ubuntu6.2
...
$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-5.4.0-1003-bluefield root=LABEL=writable ro console=ttyAMA0 earlycon=pl011,0x01000000 fixrtc
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
$ uname -a
Linux ubuntu 5.4.0-1003-bluefield #4-Ubuntu SMP PREEMPT Fri Jun 12 17:02:31 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

tags: added: verification-done-focal
removed: verification-needed-focal
Mathew Hodson (mhodson) on 2020-06-23
Changed in initramfs-tools (Ubuntu Focal):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.136ubuntu6.2

---------------
initramfs-tools (0.136ubuntu6.2) focal; urgency=medium

  * Trim leading whitespaces in dumpe2fs output so date command
    is happy in the fixrtc script (LP: #1880968)

 -- Alfonso Sanchez-Beato (email Canonical) <email address hidden> Wed, 27 May 2020 16:52:16 +0200

Changed in initramfs-tools (Ubuntu Focal):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for initramfs-tools has completed successfully and the package is now being 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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers