To fix build with clang while using ASAN, define all linker list
elements with __ll_elem.
Signed-off-by: Ahmad Fatoum
---
drivers/clk/clk.c| 3 +-
include/command.h| 4 +--
include/deep-probe.h | 3 +-
include/image-metadata.h | 4 +--
include/init.h | 60
When built with clang + AddressSanitizer, global variables end up with
a redzone that breaks linker list elements.
The __no_sanitize_address attribute prevents these redzones, but GCC
isn't happy about applying it to anything but functions. Therefore
define a __ll_elem macro for defining linker
When built with clang + AddressSanitizer, global variables end up with
a redzone that can break linker list elements.
As clang isn't officially supported (yet), this can go into next.
Ahmad Fatoum (2):
compiler: define __ll_elem for linker list elements
treewide: mark linker list elements
On Tue, Jan 02, 2024 at 12:01:15PM +0100, Marco Felsch wrote:
> The gencsf header is required to build HAB (secure-boot) compatible
> images. This commit add the support for this for all i.MX8M boards.
>
> To finally build HAB compatible images the CONFIG_HABV4 and
> CONFIG_HABV4_IMAGE_SIGNED
The regulator self test requires fixed regulator support, which itself
already requires REGULATOR && OFDEVICE, which we already depend on.
Therefore, just add REGULATOR_FIXED as dependency.
Signed-off-by: Ahmad Fatoum
---
test/self/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2
expect_success is meant for return values of functions that return
negative error codes and as such compares the first argument to be
zero or greater, which means PTR_ERR_OR_ZERO will treat NULL pointers as
valid all the same leading to NULL pointer dereferences should the test
fail instead of a
Qemu prints an error during barebox shutdown when virtio-net was used:
qemu-system-aarch64: wrong value for queue_enable 0
This warning was added a few years back in Qemu commit 10d35e5819:
| virtio-pci: fix queue_enable write
|
| Spec said: The driver uses this to selectively prevent the
The reference to kernel panic is taken from the original Linux Kconfig
help text. Leaving it as-is may be confusing, so adjust it for barebox.
Signed-off-by: Ahmad Fatoum
---
lib/Kconfig.hardening | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Kconfig.hardening
We did not have any protection in place to ensure that KASAN shadow memory
isn't overwritten during boot. Add that now to avoid strange effects
during debugging.
Signed-off-by: Ahmad Fatoum
---
arch/arm/cpu/start.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch/arm/cpu/start.c
The message currently reads:
"skipping CONFIG_ARCH_HAS_DATA_ABORT_MASK because test_zero_page=n\n"
when it should be the other way round. Fix that.
Signed-off-by: Ahmad Fatoum
---
test/self/mmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/self/mmu.c
We have different helpers for creating cdevs, depending on whether they
are loop devices, partitions or links.
Create a common cdev_alloc function, so it's easier to instrument cdev
creation during debugging.
Signed-off-by: Ahmad Fatoum
---
fs/devfs-core.c | 21 +++--
1 file
We don't need to compare the cdev's device node pointer both against NULL
and against the searched for device node on each iteration.
Instead, it's sufficient to just compare the device nodes directly.
To maintain previous behavior, when searching for a NULL device node, we
shouldn't return the
blockdevice_unregister only calls devfs_remove on the root cdev and
leaves the partition cdevs dangling. This doesn't break until the
block device parent struct device is freed at which time, it will
iterate over its cdevs to free them. If there's partitions there,
list_del on the partitions
__devfs_add_partition was added, so it can internally be used by
functions that already have a cdev and don't require looking it up first
by file path. This is useful elsewhere as well, so give it a less
internal-sounding name and start exporting it.
Signed-off-by: Ahmad Fatoum
---
Follow-up commit will expose __devfs_add_partition after rename to more
users. Most of these don't care about the last parameter, so accept
NULL to indicate that it won't be read back.
Signed-off-by: Ahmad Fatoum
---
fs/devfs-core.c | 14 --
1 file changed, 8 insertions(+), 6
blockdevice_unregister only calls devfs_remove on the root cdev and
leaves the partition cdevs dangling. This doesn't break until the
block device parent struct device is freed at which time, it will
iterate over its cdevs to free them. If there's partitions there,
list_del on the partitions
This groups the function with similar functions and prepares adding
variants that take a struct devfs_partition argument, as that's only
defined later.
Signed-off-by: Ahmad Fatoum
---
include/driver.h | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/driver.h
Like what's the case with cdevfs_add_partition, a couple of users
already have a cdev, so it's wasteful to get its name and do a lookup
only to arrive at the same cdev. Export a cdevfs_del_partition that
directly works on the cdev and start using it instead.
Signed-off-by: Ahmad Fatoum
---
We already have a cdev, so it's wasteful to do a lookup by cdev name
using devfs_add_partition. Use the newly exported cdevfs_add_partition
helper directly instead.
Signed-off-by: Ahmad Fatoum
---
common/partitions.c| 12
drivers/of/partition.c | 16
2 files
Thanks to Denis Orlov's work on dma_sync_single_for_*()
interface and e1000 patches we can enable e1000 support
on both 32-bit and 64-bit qemu malta boards.
32-bit malta qemu command line:
qemu-system-mips -M malta -cpu 24Kf -m 256M \
-nographic -serial mon:stdio \
-bios
Linux recently renamed the name of these helpers, so have barebox follow
suit before implementing them out of line when optional list debugging
is enabled.
Signed-off-by: Ahmad Fatoum
---
include/linux/list.h | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff
When enabled, this outputs messages like:
list_del corruption, 5fe4a9d0->next is LIST_POISON1 (0100)
which can be useful when debugging.
Signed-off-by: Ahmad Fatoum
---
common/Kconfig| 8 +
include/linux/bug.h | 17 +++
lib/Kconfig.hardening | 10
On Tue, Jan 02, 2024 at 05:55:37PM +0100, Ahmad Fatoum wrote:
> We can already read /dev/hwrng to get the randomness as generated by the
> device. Printing 32K bytes of randomness to the log (or even worse to
> console) is just not useful for debugging. There are debug prints for
> the job
On Wed, Jan 03, 2024 at 11:13:24AM +0100, Ahmad Fatoum wrote:
> The reference to kernel panic is taken from the original Linux Kconfig
> help text. Leaving it as-is may be confusing, so adjust it for barebox.
>
> Signed-off-by: Ahmad Fatoum
> ---
> lib/Kconfig.hardening | 4 ++--
> 1 file
On Wed, Jan 03, 2024 at 11:13:42AM +0100, Ahmad Fatoum wrote:
> expect_success is meant for return values of functions that return
> negative error codes and as such compares the first argument to be
> zero or greater, which means PTR_ERR_OR_ZERO will treat NULL pointers as
> valid all the same
On Wed, Jan 03, 2024 at 11:13:54AM +0100, Ahmad Fatoum wrote:
> Qemu prints an error during barebox shutdown when virtio-net was used:
>
> qemu-system-aarch64: wrong value for queue_enable 0
>
> This warning was added a few years back in Qemu commit 10d35e5819:
>
> | virtio-pci: fix
Hello Sascha,
On 03.01.24 15:51, Sascha Hauer wrote:
> +static int enetc_ls1028a_write_hwaddr(struct eth_device *edev, const
> unsigned char *mac)
> +{
> + struct enetc_priv *priv = edev->priv;
> + struct pci_dev *pdev = to_pci_dev(priv->dev);
> + const int devfn_to_pf[] = {0, 1, 2,
This adds support for the fsl_enetc network controller found on several
Layerscape SoCs. The code is originally from U-Boot-2023.10-rc1.
Signed-off-by: Sascha Hauer
---
drivers/net/Kconfig | 9 +
drivers/net/Makefile | 1 +
drivers/net/fsl_enetc.c | 602
This syncs the phy interface modes with Linux as of linux-6.7-rc7.
Signed-off-by: Sascha Hauer
---
include/linux/phy.h | 55 +
1 file changed, 51 insertions(+), 4 deletions(-)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index
On Wed, Jan 03, 2024 at 11:13:08AM +0100, Ahmad Fatoum wrote:
> We did not have any protection in place to ensure that KASAN shadow memory
> isn't overwritten during boot. Add that now to avoid strange effects
> during debugging.
>
> Signed-off-by: Ahmad Fatoum
> ---
> arch/arm/cpu/start.c | 4
At the moment CONFIG_TIMESTAMP help text is inherited from U-Boot.
Fix it in accordance with barebox realities.
Signed-off-by: Antony Pavlov
---
common/Kconfig | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/common/Kconfig b/common/Kconfig
index
Antony Pavlov (2):
uImage: use IS_ENABLED(CONFIG_TIMESTAMP)
common: Kconfig: TIMESTAMP: fix help
common/Kconfig | 7 +++
common/uimage.c | 22 --
fs/uimagefs.c | 24 ++--
3 files changed, 25 insertions(+), 28 deletions(-)
--
2.39.0
Signed-off-by: Antony Pavlov
---
common/uimage.c | 22 --
fs/uimagefs.c | 24 ++--
2 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/common/uimage.c b/common/uimage.c
index 72c37b7d15d..3c9a79d9109 100644
--- a/common/uimage.c
+++
On Wed, Jan 03, 2024 at 11:13:08AM +0100, Ahmad Fatoum wrote:
> We did not have any protection in place to ensure that KASAN shadow memory
> isn't overwritten during boot. Add that now to avoid strange effects
> during debugging.
>
> Signed-off-by: Ahmad Fatoum
> ---
> arch/arm/cpu/start.c | 4
Software running under EFI can query the type of a block device. For
barebox to be able to report this, start assigning types to all block
devices it can create. No functional change yet.
Signed-off-by: Ahmad Fatoum
---
arch/sandbox/board/hostfile.c | 1 +
common/block.c| 24
The implementation of strjoin is a bit suboptimal. The destination
string is traversed from the beginning due to strcat and we have a
left-over separator at the end, while it should only be in-between.
Fix this.
Signed-off-by: Ahmad Fatoum
---
Originally posted at:
Typedef'ing efi_handle_t as void * means that we don't catch instance
where we pass a double indirect pointer when a normal pointer is
expected.
With loader support, we will start to dereference it anyway, so have it
point at an opaque type instead.
Signed-off-by: Ahmad Fatoum
---
We have a lot of function pointer members in the protocols, that were
defined as void pointers instead of properly prototyped function pointers.
Similarly, a lot of data types are defined to equivalent types that
aren't as descriptive, e.g. size_t vs ulong and s16 vs efi_char16_t.
Let's switch
Adding a size to the error message means that we can just use a single
error message for either error case with no loss of information.
While at it, we turn the error string into a code: This file can be
built for PBL later on and we won't have efi_strerror there.
Signed-off-by: Ahmad Fatoum
creat is a oneliner that can be inlined at no extra cost, so move it
into a header.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 6 --
include/fcntl.h | 6 +-
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/fs/fs.c b/fs/fs.c
index bd2f0b6294ff..7c4e2f250ea8 100644
Existing device_path_to_str() formats a buffer once to determines the amount
of space necessary and then allocates it and formats it again.
To make this functionality available as printf format specifier, we need
a variant that doesn't allocate memory and that's preferably single
pass, which we
simple_strtoul should probably be removed altogether. Let's start by
removing it from efi_handle_dump.c, so invalid input is not ignored.
Signed-off-by: Ahmad Fatoum
---
commands/efi_handle_dump.c | 32 +---
1 file changed, 17 insertions(+), 15 deletions(-)
diff
barebox allocates at maximum 256M for its own use when running as EFI
payload. With bigger kernel images and initrds, this may exceed the
space barebox has available, especially if decompression needs to happen
within barebox.
In that case, instead of failing with -ENOMEM, let's ask the EFI
unreaddir should return a directory entry at the top of the list, so
readdir consumes it again, not at the end.
Fixes: 7876018f7333 ("fs: implement unreaddir")
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/fs.c b/fs/fs.c
index
With open() on / no longer accessing uninitialized memory, it now always
fails with errno == ENOENT. This is because d_lookup only compares
children of /, but never / itself.
Fix this by comparing the parent and while at it, rework the existing
code to be more concise.
Signed-off-by: Ahmad
EFI v2.10 documents the following about EFI events:
| // EFI_EVENT: Handle to an event structure. Type VOID *
|
| typedef
| EFI_STATUS
| (EFIAPI *EFI_WAIT_FOR_EVENT) (
| IN UINTN NumberOfEvents,
| IN EFI_EVENT *Event,
| OUT UINTN *Index
| );
|
| typedef struct
While at it, drop DP_IS_END_TYPE and DP_IS_END_SUBTYPE, which are
unused.
Signed-off-by: Ahmad Fatoum
---
efi/devicepath.c | 12
include/efi/device-path.h | 10 ++
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/efi/devicepath.c b/efi/devicepath.c
The default for %pU is to format as big endian, which isn't the correct
representation for EFI GUIDs, which are little endian.
Fix the format specifier to avoid the confusion.
Signed-off-by: Ahmad Fatoum
---
efi/devicepath.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
There's no common code yet, but board code may iterate over cdevs to
handle the boot partition specially. Make writing such code easier
by adding the new flags to the stat command's output.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 4
1 file changed, 4 insertions(+)
diff --git a/fs/fs.c
Device path nodes are tightly packed and subsequent device nodes may
start at any boundary. To parse these, existing code allocated a new
buffer and unpacked device paths into it, so they are at a natural
boundary (chosen as 8 bytes with x86_64 in mind).
We can simplify this by using __packed and
EFI loader support will need to map barebox VFS paths to fs_device and
back. Make development easier by providing a findmnt command to test
the mapping.
Signed-off-by: Ahmad Fatoum
---
commands/Kconfig | 15 +++
commands/Makefile | 1 +
commands/findmnt.c | 108
This is used no where, so it can just be dropped.
Signed-off-by: Ahmad Fatoum
---
include/efi/device-path.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/efi/device-path.h b/include/efi/device-path.h
index 433233f38c0d..39221ca369de 100644
--- a/include/efi/device-path.h
+++
While a call to dump_stack() is easily hacked into the code, it can be
useful during development to just print the stacktrace from the shell,
e.g. to verify that kallsyms sharing for EFI works as intended.
Add an option to cpuinfo to provide this functionality.
Signed-off-by: Ahmad Fatoum
---
For barebox as EFI payload on ARM, we will not call start_barebox()
ourselves as we will be using PBL, which we don't on x86 yet.
Therefore move that code out of the common init.c into a new
entry-single.c and early-mem.c that can be used as needed.
Signed-off-by: Ahmad Fatoum
---
For use by EFI loader code that needs to report block size, export the
BLOCKSIZE macro.
Signed-off-by: Ahmad Fatoum
---
common/block.c | 2 --
include/block.h | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/block.c b/common/block.c
index 3a4a9fb73149..79d277e35ae1
It's the BIOS boot specification (BBS) and not BSS. Fix the typo in
preparation for abusing it.
Signed-off-by: Ahmad Fatoum
---
efi/devicepath.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/efi/devicepath.c b/efi/devicepath.c
index 0df43f222018..23963aa0cbb7
So far we only ever built EFI for x86. Prepare building it for ARM by
removing the x86-specific attributes.
Signed-off-by: Ahmad Fatoum
---
efi/payload/image.c | 4 ++--
include/efi/types.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/efi/payload/image.c
It may not be directly apparent, what device a cdev spawned from.
Have stat report this information for debugging purposes.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/fs.c b/fs/fs.c
index 1e357872f6ae..a7097dd3946e 100644
--- a/fs/fs.c
A number of members in the struct are either unused or only ever written
and never read. Drop them to tidy up the code.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 9 -
1 file changed, 9 deletions(-)
diff --git a/fs/fs.c b/fs/fs.c
index ca1bcef1adf0..be0b38d8bc30 100644
--- a/fs/fs.c
+++
The initcall's only function is to open /boot/EFI/barebox/state.dtb
and to register it as barebox state description. If nothing is mounted
at /boot, this will fail anyway, so early exit in that case.
Signed-off-by: Ahmad Fatoum
---
efi/payload/init.c | 7 +++
1 file changed, 7 insertions(+)
Kernel coding style is to usually not hide the fact that a type is a
struct or enum behind a typedef. Follow that in the EFI code.
Besides being more descriptive, this also allows forward declarations,
so doesn't have to be included everywhere.
No functional change.
Signed-off-by: Ahmad Fatoum
\EFI\BOOT\BOOTx64.EFI is only the default file path for x86_64. It's
different for other architectures and even for x86_64, the EFI loader
may be configured to execute a differently named file.
Fix this by querying the EFI loader for the file name instead of
hardcoding it and while at it, we add
In the quest for making barebox PBL code W^X mappable, we have now taken
care to make the ARM64 assembly routines not emit code relocations,
so let's do the same for the C code as well.
We do this by setting pragma GCC visibility push(hidden) globally. This
option is stronger than
efi_handle_t is a typedef for a void pointer. We use either void *
directly or unsigned long at places, where a handle would be the more
descriptive type. Fix this.
Signed-off-by: Ahmad Fatoum
---
drivers/serial/efi-stdio.c | 2 +-
include/efi.h | 10 +-
2 files changed, 6
Most flags used during VFS lookup are apparently unused, so let's delete
them to make the code easier to reason about.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 11 +--
include/linux/namei.h | 13 -
2 files changed, 1 insertion(+), 23 deletions(-)
diff --git
Now that we remember the Type GUID of block devices, let's import the
UUIDs assigned by the UAPI group discoverable partition specification
as found in systemd v255's src/systemd/sd-gpt.h.
Signed-off-by: Ahmad Fatoum
---
include/uapi/spec/dps.h | 370
1
struct barebox_arm_boarddata is a way for PBL to handover a machine
number instead of a FDT. We will reuse this mechanism to hand over EFI
image handle and system table in a later commit, so prepare for that by
moving it to a central location and adjust the naming.
Signed-off-by: Ahmad Fatoum
When run as EFI payload, barebox will not have full access to DRAM and will
have to ask the EFI firmware for memory. It does so once at the beginning
and since commit 356aaef5a37d ("efi: improve malloc pool allocation"),
the buffer was always placed beneath the 1G boundary.
Aforementioned commit
The efi_handle_dump command is currently used when barebox is built as
payload, but it's also useful when running as a loader to list handles
and their protocols. Move the code into a common area to make it
accessible in both configurations.
Signed-off-by: Ahmad Fatoum
---
commands/Kconfig
BBS paths can have multiple types, one of them is the device type, which
we will start abusing in a later commit, so make sure it's
translated to a readable string.
Signed-off-by: Ahmad Fatoum
---
efi/devicepath.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/efi/devicepath.c
When we start using fortified string operations in the future, we will
need to replace zero and one sized trailing arrays with flexible arrays
where required everywhere, but for now let's just avoid having any in
the EFI code.
Signed-off-by: Ahmad Fatoum
---
include/efi/device-path.h | 8
barebox as EFI loader can use the information about which partitions are
bootable to guide its decision. Record this information.
Signed-off-by: Ahmad Fatoum
---
common/partitions.c| 4 ++--
common/partitions/dos.c| 10 ++
common/partitions/efi.c| 18 ++
For use by EFI file system path resolution, implement an O_CHROOT
flag that will map / to the root of the file system the dirfd points
to instead of the VFS root. If the dirfd points to a mountpoint, it will
be followed to the file system inside. This is similar to Linux openat2
with
An EFI stubbed ARM64 kernel can be booted either via EFI or via the
normal boot protocol. We'll want barebox to be able to behave the same,
so extend section alignment to enable this.
Signed-off-by: Ahmad Fatoum
---
arch/arm/include/asm/memory.h | 20
arch/arm/lib/pbl.lds.S
These constants can be returned by some of the EFI loader protocols
implemented later on.
Signed-off-by: Ahmad Fatoum
---
include/efi.h | 8
1 file changed, 8 insertions(+)
diff --git a/include/efi.h b/include/efi.h
index 1749001adb48..7e8b7f0a49b8 100644
--- a/include/efi.h
+++
Hi!
I have prepared a linux uImage file for testing my uImage-related patches.
barebox$ dumpimage -l ./defaultenv/defaultenv-2-base/uImage
Image Name: Linux-6.7.0-rc4-3-ge185a416f
Created: Wed Jan 3 15:28:27 2024
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size:
barebox' EFI loaded image handle should have a device path, but on the
off-case that it doesn't, we should just return an error code instead of
dereferencing a null pointer.
Signed-off-by: Ahmad Fatoum
---
efi/payload/init.c | 3 +++
1 file changed, 3 insertions(+)
diff --git
We already have a few users that will want to print EFI device paths and
will gain quite a few more with incoming loader support, so let's allow
printing them directly with printf with the %pD format specifier.
Signed-off-by: Ahmad Fatoum
---
lib/vsprintf.c | 14 ++
1 file changed,
EFI loader will need to parse and load PE executables. Add functions to
facilitate that. The API is inspired by the already existing ELF API.
Signed-off-by: Ahmad Fatoum
---
common/Kconfig | 3 +
common/Makefile | 1 +
common/pe.c | 377
This fixes bootsource detection running barebox as EFI payload under
EDK2 2020.11.
Fixes: 443eb41376d9 ("efi: add bootsource detection")
Cc: Enrico Jorns
Signed-off-by: Ahmad Fatoum
---
drivers/efi/efi-device.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/efi/efi-device.c
The last member is normally written by link_path_walk(), before being
read by __lookup_hash, among others.
In the special case of calling open() on "/", link_path_walk() will
terminate early without setting the last member, leading __d_alloc
called by __lookup_hash to read uninitialized memory.
In preparation for supporting fdopendir and rewinddir, add an __opendir
helper that is reused in a follow-up commit.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 52
1 file changed, 32 insertions(+), 20 deletions(-)
diff --git a/fs/fs.c
For debugging, it can be useful to dump handles from within the loader
without having to boot barebox as EFI payload first.
Prepare for this by removing implicit dependency on being an EFI
payload.
Signed-off-by: Ahmad Fatoum
---
commands/efi_handle_dump.c | 33
Using a DEVICE_PATH_ prefix everywhere will make it clear what the
definitions is about and in part align us with the naming in U-Boot.
Signed-off-by: Ahmad Fatoum
---
drivers/efi/efi-device.c | 5 +-
efi/devicepath.c | 164 +++---
arm_cpu_lowlevel_init will disable the MMU, but there are valid cases to
not call it on startup, e.g. when barebox is being run as EFI payload.
To allow booting an EFI-stubbed barebox both as primary bootloader and
as EFI payload, teach mmu_early_enable() to bail out when the MMU is
already set
We didn't need this for the EFI payload use case, but will need this for
the EFI loader use case.
Signed-off-by: Ahmad Fatoum
---
include/efi.h | 19 +++
1 file changed, 19 insertions(+)
diff --git a/include/efi.h b/include/efi.h
index 08cb07c8b946..a6dbc14ff3d9 100644
---
While very recent binutils releases have dedicated efi-*-aarch targets,
we may want to support older toolchains. For this reason, we import
the kernel's EFI stub PE fakery, so the same barebox-dt-2nd.img may be
loaded as if it were a "normal" or an EFI-stubbed kernel.
Signed-off-by: Ahmad Fatoum
Adding directory fds involved a bit of rework to the VFS layer.
We have ramfs tests that check the previous behavior, so add now tests
to check that path resolution in openat and statat work as one would expect.
As we need a separate file system to test O_CHROOT, the test has a
dependency on the
time concatenates all its remaining arguments with a space in-between
and then passes that to the command executor. This can be useful
elsewhere as well, so factor it out into a new strjoin function.
No functional change.
Signed-off-by: Ahmad Fatoum
---
commands/time.c | 11 +--
of_read_file already prints to log messages when it fails, so
duplicating the error message in the caller is needlessly verbose.
Signed-off-by: Ahmad Fatoum
---
commands/of_diff.c| 5 ++---
commands/of_display_timings.c | 4 +---
commands/of_overlay.c | 4 +---
We will need these definitions for the EFI loader as well, so move them
into a header.
Signed-off-by: Ahmad Fatoum
---
drivers/block/efi-block-io.c | 27 ---
include/efi.h| 27 +++
2 files changed, 27 insertions(+), 27 deletions(-)
These GUIDs will be useful for the incoming EFI loader support, so add
them all at once.
Signed-off-by: Ahmad Fatoum
---
efi/guid.c| 35 +-
include/efi.h | 59 +++
2 files changed, 93 insertions(+), 1 deletion(-)
For use with the newly added openat and friends API, add O_PATH file
descriptors that are not usable for doing actual I/O, but only for use
as dirfd.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 58 +
include/fcntl.h | 1 +
2 files changed,
We opencode this at least once in EFI code, so import the Linux
definition and start using that instead.
Signed-off-by: Ahmad Fatoum
---
lib/uuid.c | 63 ++
1 file changed, 63 insertions(+)
diff --git a/lib/uuid.c b/lib/uuid.c
index
We will be using the incoming O_PATH support to implement the EFI file
system protocol for when barebox acts as EFI loader.
The protocol also requires being able to rewind iteration, so add
support for that too.
Signed-off-by: Ahmad Fatoum
---
fs/fs.c | 55
Device Path and Loaded Image Device Path are different things.
Print both for maximum utility.
Signed-off-by: Ahmad Fatoum
---
commands/efi_handle_dump.c | 17 -
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/commands/efi_handle_dump.c
All block devices except for virtio-mmio have a pointer to the hardware
device tree node if available, so add it to virtio-mmio as well.
Signed-off-by: Ahmad Fatoum
---
drivers/block/virtio_blk.c | 1 +
drivers/virtio/virtio.c| 1 +
2 files changed, 2 insertions(+)
diff --git
Starting with Linux v6.2, there's a loader type assigned to barebox:
commit a27e292b8a54e24f85181d949fac8c51fdec8ff3
Author: Ahmad Fatoum
AuthorDate: Sun Oct 2 14:57:53 2022 +0200
Commit: Borislav Petkov
CommitDate: Mon Oct 17 11:22:33 2022 +0200
Documentation/x86/boot:
The device path traversal functions don't modify the device path itself,
so reflect that in the function prototypes.
Signed-off-by: Ahmad Fatoum
---
efi/devicepath.c | 140 ---
include/efi.h| 10 ++--
2 files changed, 76 insertions(+), 74
So far, whether we are running under EFI was a compile-time decision.
This will change with ARM support, where the same barebox binary can
either probe from DT or from EFI. Prepare for this by adding helpers
to determine whether barebox is acting as EFI loader or as payload.
Signed-off-by: Ahmad
1 - 100 of 149 matches
Mail list logo