Xiaotian Wu
6588f2c295
tests: Fix timezone inconsistency in squashfs_test
...
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 >
2023-05-17 13:27:41 +02:00
Xiaotian Wu
ad5e446af1
loongarch: Add to build system
...
This patch adds LoongArch to the GRUB build system and various tools,
so GRUB can be built on LoongArch as a UEFI application.
Signed-off-by: Zhou Yang <zhouyang@loongson.cn >
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 13:23:44 +02:00
Xiaotian Wu
d33cbf2d8f
loongarch: Add auxiliary files
...
Add support for manipulating architectural cache and timers, and EFI
memory maps.
Signed-off-by: Zhou Yang <zhouyang@loongson.cn >
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 13:21:43 +02:00
Xiaotian Wu
0b4693e32c
loongarch: Add support for ELF psABI v2.00 relocations
...
A new set of relocation types was added in the LoongArch ELF psABI v2.00
spec [1], [2] to replace the stack-based scheme in v1.00. Toolchain
support is available from binutils 2.40 and gcc 13 onwards.
This patch adds support for the new relocation types, that are simpler
to handle (in particular, stack operations are gone). Support for the
v1.00 relocs are kept for now, for compatibility with older toolchains.
[1] https://github.com/loongson/LoongArch-Documentation/pull/57
[2] https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_appendix_revision_history
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 13:18:36 +02:00
Xiaotian Wu
b264f098be
loongarch: Add support for ELF psABI v1.00 relocations
...
This patch adds support of the stack-based LoongArch relocations
throughout GRUB, including tools, dynamic linkage, and support for
conversion of ELF relocations into PE ones. A stack machine is required
to handle these per the spec [1] (see the R_LARCH_SOP types), of which
a simple implementation is included.
These relocations are produced by binutils 2.38 and 2.39, while the newer
v2.00 relocs require more recent toolchain (binutils 2.40+ & gcc 13+, or
LLVM 16+). GCC 13 has not been officially released as of early 2023, so
support for v1.00 relocs are expected to stay relevant for a while.
[1] https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_relocations
Signed-off-by: Zhou Yang <zhouyang@loongson.cn >
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 12:59:08 +02:00
Xiaotian Wu
6a42dd9e25
loongarch: Add early startup code
...
On entry, we need to save the system table pointer as well as our image
handle. Add an early startup file that saves them and then brings us
into our main function.
Signed-off-by: Zhou Yang <zhouyang@loongson.cn >
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 12:53:08 +02:00
Xiaotian Wu
b5d0474e20
loongarch: Add setjmp implementation
...
This patch adds a setjmp implementation for LoongArch.
Signed-off-by: Zhou Yang <zhouyang@loongson.cn >
Signed-off-by: Sun Haiyong <sunhaiyong@loongson.cn >
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 12:51:50 +02:00
Xiaotian Wu
00db303c68
elf: Add LoongArch definitions
...
Add ELF e_machine ID [1] and relocations types [2] for LoongArch to
the current in-repo definitions.
[1] https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_machine_identifies_the_machine
[2] https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_relocations
Signed-off-by: Zhou Yang <zhouyang@loongson.cn >
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 12:47:04 +02:00
Xiaotian Wu
cebbfc71df
pe: Add LoongArch definitions
...
Add PE machine types [1] and relocation types [2] for LoongArch to
the current in-repo definitions.
[1] https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types
[2] https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#base-relocation-types
Signed-off-by: Zhou Yang <zhouyang@loongson.cn >
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn >
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com >
2023-05-17 12:42:22 +02:00