The image timestamp was not returned in UTC, but the following logic
expected and used UTC.
This patch fixes the test failure like described below:
unsquashfs -s /tmp/grub-fs-tester.20230407111703613257436.squash4_gzip.9R4/squash4_gzip_512_4096_1_0.img
grep '^Creation'
awk '{print $6 " " $7 " " $8 " " $9 " " $10; }'
FSTIME='Fri Apr 7 11:17:05 2023'
date -d 'Fri Apr 7 11:17:05 2023' -u '+%Y-%m-%d %H:%M:%S'
FSTIME='2023-04-07 11:17:05'
date -d '2023-04-07 11:17:05 UTC -1 second' -u '+%Y-%m-%d %H:%M:%S'
FSTIMEM1='2023-04-07 11:17:04'
date -d '2023-04-07 11:17:05 UTC -2 second' -u '+%Y-%m-%d %H:%M:%S'
FSTIMEM2='2023-04-07 11:17:03'
date -d '2023-04-07 11:17:05 UTC -3 second' -u '+%Y-%m-%d %H:%M:%S'
FSTIMEM3='2023-04-07 11:17:02'
grep -F 'Last modification time 2023-04-07 11:17:05'
echo 'Device loop0: Filesystem type squash4 - Last modification time 2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
echo 'Device loop0: Filesystem type squash4 - Last modification time 2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
grep -F 'Last modification time 2023-04-07 11:17:04'
echo 'Device loop0: Filesystem type squash4 - Last modification time 2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
grep -F 'Last modification time 2023-04-07 11:17:03'
echo 'Device loop0: Filesystem type squash4 - Last modification time 2023-04-07 03:17:05 Friday - Sector size 512B - Total size 10680KiB'
grep -F 'Last modification time 2023-04-07 11:17:02'
echo FSTIME FAIL
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
Reviewed-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This is GRUB 2, the second version of the GRand Unified Bootloader. GRUB 2 is rewritten from scratch to make GNU GRUB cleaner, safer, more robust, more powerful, and more portable. See the file NEWS for a description of recent changes to GRUB 2. See the file INSTALL for instructions on how to build and install the GRUB 2 data and program files. See the file MAINTAINERS for information about the GRUB maintainers, etc. If you found a security vulnerability in the GRUB please check the SECURITY file to get more information how to properly report this kind of bugs to the maintainers. Please visit the official web page of GRUB 2, for more information. The URL is <http://www.gnu.org/software/grub/grub.html>. More extensive documentation is available in the Info manual, accessible using 'info grub' after building and installing GRUB 2. There are a number of important user-visible differences from the first version of GRUB, now known as GRUB Legacy. For a summary, please see: info grub Introduction 'Changes from GRUB Legacy'
Description
Languages
C
82.5%
Assembly
13.6%
M4
1.4%
Shell
1.3%
Makefile
0.5%
Other
0.5%