1093 Commits

Author SHA1 Message Date
Wentao Guan
34e16ee7ef copy zfs.c zfs_lef.h
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
846cbabeee loader/linux: Remove magic number header field check
The "ARM\x64" magic number in the file header identifies an image as one
that implements the bare metal boot protocol, allowing the loader to
simply move the file to a suitably aligned address in memory, with
sufficient headroom for the trailing .bss segment (the required memory
size is described in the header as well).

Note of this matters for GRUB, as it only supports EFI boot. EFI does
not care about this magic number, and nor should GRUB: this prevents us
from booting other PE linux images, such as the generic EFI zboot
decompressor, which is a pure PE/COFF image, and does not implement the
bare metal boot protocol.

So drop the magic number check.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
e2e760c1a2 mdraid1x_linux: Fix gcc10 error -Werror=array-bounds
We bumped into the build error while testing gcc-10 pre-release.

../../grub-core/disk/mdraid1x_linux.c: In function 'grub_mdraid_detect':
../../grub-core/disk/mdraid1x_linux.c:181:15: error: array subscript <unknown> is outside array bounds of 'grub_uint16_t[0]' {aka 'short unsigned int[0]'} [-Werror=array-bounds]
  181 |      (char *) &sb.dev_roles[grub_le_to_cpu32 (sb.dev_number)]
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../grub-core/disk/mdraid1x_linux.c:98:17: note: while referencing 'dev_roles'
   98 |   grub_uint16_t dev_roles[0]; /* Role in array, or 0xffff for a spare, or 0xfffe for faulty.  */
      |                 ^~~~~~~~~
../../grub-core/disk/mdraid1x_linux.c:127:33: note: defined here 'sb'
  127 |       struct grub_raid_super_1x sb;
      |                                 ^~
cc1: all warnings being treated as errors

Apparently gcc issues the warning when trying to access sb.dev_roles
array's member, since it is a zero length array as the last element of
struct grub_raid_super_1x that is allocated sparsely without extra
chunks for the trailing bits, so the warning looks legitimate in this
regard.

As the whole thing here is doing offset computation, it is undue to use
syntax that would imply array member access then take address from it
later. Instead we could accomplish the same thing through basic array
pointer arithmetic to pacify the warning.

Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
280867088c efi: Move MS-DOS stub out of generic PE header definition
The PE/COFF spec permits the COFF signature and file header to appear
anywhere in the file, and the actual offset is recorded in 4 byte
little endian field at offset 0x3c of the image.

When GRUB is emitted as a PE/COFF binary, we reuse the 128 byte MS-DOS
stub (even for non-x86 architectures), putting the COFF signature and
file header at offset 0x80. However, other PE/COFF images may use
different values, and non-x86 Linux kernels use an offset of 0x40
instead.

So let's get rid of the grub_pe32_header struct from pe32.h, given that
it does not represent anything defined by the PE/COFF spec. Instead,
introduce a minimal struct grub_msdos_image_header type based on the
PE/COFF spec's description of the image header, and use the offset
recorded at file position 0x3c to discover the actual location of the PE
signature and the COFF image header.

The remaining fields are moved into a struct grub_pe_image_header,
which we will use later to access COFF header fields of arbitrary
images (and which may therefore appear at different offsets)

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
018b8e8ec0 Ventoy Version loader/efi: Move ARM64 linux loader to common code
ARM64 linux loader code is written in such a way that it can be reused
across different architectures without much change. Move it to common
code so that RISC-V doesn't have to define a separate loader.

Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
e45b2b4e44 loader: Drop argv[] argument in grub_initrd_load()
In the case of an error grub_initrd_load() uses argv[] to print the
filename that caused the error. It is also possible to obtain the
filename from the file handles and there is no need to duplicate that
information in argv[], so let's drop it.

Signed-off-by: Nikita Ermakov <arei@altlinux.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Backport-commit: also for mips64
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
26a4e6f96f copy files need mod for loader: Drop argv[] argument in grub_initrd_load()
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
680df77687 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
583bcc85a3 copy grub 2.04 Makefile.util.def to MOD
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
c8be8c5714 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
30b840dae2 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
a12fcf90ed 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
19c95139b9 copy grub 2.04 grub-core/kern/dl.c to MOD
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
e2359cc68f 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
fd9d0b6daa 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
1b467695d9 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
c6bef1ddad copy grub 2.04 elf.h to MOD
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
Wentao Guan
cee98dbb8b 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>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
2024-08-26 11:25:29 +08:00
longpanda
cb209f9b9e 1.0.99 v1.0.99 2024-06-08 17:26:33 +08:00
Andrei Stepanov
b7b2f6a5c1
Update Russian translation (#2857) 2024-06-08 17:10:31 +08:00
Zohir Tamda
3967fb5fb5
Fix French language (#2850)
Co-authored-by: tamdaz <tamda.zohir.pro@gmail.com>
2024-06-08 17:10:07 +08:00
bovirus
a2ad95792d
Fixed Italian language (#2840) 2024-06-08 17:09:53 +08:00
Re*Index. (ot_inc)
791308d2ce
Japanese Fix typo. (#2839)
* Japanese translation Fixed.

* Fix typo

Fix Typo.
2024-06-08 17:09:26 +08:00
longpanda
0ffb1b15ef Fix the issue that VTOY_LINUX_REMOUNT option does not take effect in latest openSUSE. (#2551) 2024-05-25 18:13:52 +08:00
longpanda
d6e1730ca0 Fix the install issue for /dev/mdX device. (#2846) 2024-05-23 19:30:11 +08:00
longpanda
4d55f505f9 Fix the UEFI boot issue for some computer. 2024-05-22 22:53:55 +08:00
longpanda
30a61ac5c4 1.0.98 release v1.0.98 2024-05-19 23:14:49 +08:00
Re*Index. (ot_inc)
9b79831516
Japanese translation Fixed. (#2808) 2024-05-19 16:43:20 +08:00
jermanuts
af2d6bc247
Update ar_AR.json (#2755)
* Update ar_AR.json

* Update ar_AR.json
2024-05-19 16:41:51 +08:00
bovirus
d8ae740427
Update Italian help/menu (#2752) 2024-05-19 16:41:37 +08:00
Samuel Johnson
b685157ae3
Minor Update on README.md for Consistency (#2687) 2024-05-19 16:41:12 +08:00
Fabian-Gruenbichler
3f6ddb6fb6
support zvol devices (#2678)
their partitions are exposed as "/dev/zdXXpY", handle accordingly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-05-19 16:39:34 +08:00
Zhymabek Roman
b8838b305d
Adding root user check to ExtendPersistentImg (as in CreatePersistentImg) (#2633)
* Adding root user check & Enhance help info

* Update root user check
2024-05-19 16:35:22 +08:00
Batuhan
00de8b932d
Update tr_TR.txt (#2618)
corrected grammar mistakes, fixed typos
2024-05-19 16:29:13 +08:00
WebSnke
1e49dbe957
Update German translation (#2612) 2024-05-19 16:28:35 +08:00
Ida Bagus
580416facc
Update languages.json (#2600)
minor update for indonesian language
2024-05-19 16:28:25 +08:00
gcf
75cf728fa9
The gpt pointer is not initialized, and when offset < 0, it may result in freeing unallocated memory. (#2499)
Signed-off-by: yuxiaojun <yuxiaojun1011@outlook.com>
Co-authored-by: yuxiaojun <yuxiaojun1011@outlook.com>
2024-05-19 16:27:19 +08:00
Ikko Eltociear Ashimine
8723aeb4cc
fix typo in diskio.h (#2497)
fucntion -> function
2024-05-19 16:25:42 +08:00
SunderB
dc9a99bb20
Correct some spelling and grammar in BuildVentoyFromSource.txt (#2491) 2024-05-19 16:24:41 +08:00
Hoang Nguyen
a40456d9d2
Added Vietnamese language support for GRUB and updated Vietnamese translation of the installer (#2362)
* Updated Vietnamese language

Added new translation for `STR_4KN_UNSUPPORTED` and retouched in some places

* Added Vietnamese language support for GRUB menu

* Removed vi_VN from helplist and menulist
2024-05-19 16:17:54 +08:00
Balázs Úr
bdab55e8aa
Updated Hungarian translation (#2836) 2024-05-19 16:11:30 +08:00
longpanda
1b2483ec14 Skip trash directory by default. (#2831) 2024-05-19 16:00:46 +08:00
longpanda
c16e76130b Fix VTOY_LINUX_REMOUNT option for latest CentOS 9 Stream. (#2827) 2024-05-19 15:35:05 +08:00
longpanda
d672af4819 Support ext4 fs with checksum seed feature. 2024-05-19 12:14:02 +08:00
longpanda
712f10e86a Fix VTOY_LINUX_REMOUNT feature in RHEL 9.4+ (#2827) 2024-05-14 14:59:12 +08:00
longpanda
2be340d2e8 update 2024-05-12 14:57:19 +08:00
longpanda
b77ef718b4 bugfix 2024-05-12 12:37:12 +08:00
longpanda
72f5710b88 Fix arch iso boot issue (#2825 #2824) 2024-05-12 12:36:58 +08:00
longpanda
ee7da60d88 Fix the boot issue for latest KAOS. 2024-04-06 23:53:07 +08:00
longpanda
44fb9f4564 Fix the VTOY_LINUX_REMOUNT option on latest linux kernel 2024-04-06 21:22:17 +08:00