Skip to contentSkip to conversation

fs: Fix SPL build if SPL_FS_LOADER is enabled and FS_LOADER is disabled

PATCH In review Hiago De Franco 3 participants 7 messages Aug 26, 2024 – Sep 5, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: Fix SPL build if SPL_FS_LOADER is enabled and FS_LOADER is disabled

From: Hiago De Franco <[email protected]>

When SPL_FS_LOADER is set to y and FS_LOADER is not enabled, the SPL build fails with the following errors:

AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function `fw_get_filesystem_firmware':
/u-boot/drivers/misc/fs_loader.c:162: undefined reference to `fs_set_blk_dev'
arm-none-linux-gnueabihf-ld.bfd: /home/frh/tdx/src/u-boot/drivers/misc/ fs_loader.c:185: undefined reference to fs_read' arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function select_fs_dev':
/u-boot/drivers/misc/fs_loader.c:89: undefined reference to `fs_set_blk_dev_with_part'
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2055: spl/u-boot-spl] Error 2

Fix it by replacing the FS_LOADER with SPL_FS_LOADER in the Makefile, so the fs.c with the necessary function definitions are compiled.

Fixes b071a07743d4 ("drivers: misc: Makefile: Enable fs_loader compilation at SPL Level")
---
 fs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/Makefile +1 -1
index 7b05c79e0ccf..a3ee0a361d3d 100644
@@ -5,7 +5,7 @@
 # Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
 
 ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_FS_LOADER) += fs.o
+obj-$(CONFIG_SPL_FS_LOADER) += fs.o
 obj-$(CONFIG_SPL_FS_FAT) += fat/
 obj-$(CONFIG_SPL_FS_EXT4) += ext4/
 obj-$(CONFIG_SPL_FS_CBFS) += cbfs/
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

When SPL_FS_LOADER is set to y and FS_LOADER is not enabled, the SPL build fails with the following errors:

AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function `fw_get_filesystem_firmware':
/u-boot/drivers/misc/fs_loader.c:162: undefined reference to `fs_set_blk_dev'
arm-none-linux-gnueabihf-ld.bfd: /home/frh/tdx/src/u-boot/drivers/misc/ fs_loader.c:185: undefined reference to fs_read' arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function select_fs_dev':
/u-boot/drivers/misc/fs_loader.c:89: undefined reference to `fs_set_blk_dev_with_part'
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2055: spl/u-boot-spl] Error 2

Quoted 6 lines

Fix it by replacing the FS_LOADER with SPL_FS_LOADER in the Makefile, so the fs.c with the necessary function definitions are compiled.

Fixes b071a07743d4 ("drivers: misc: Makefile: Enable fs_loader compilation at SPL Level")
Signature · 1 line
Tom
#2 lore raw
In reply to Hiago De Franco
Quoted 20 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

When SPL_FS_LOADER is set to y and FS_LOADER is not enabled, the SPL build fails with the following errors:

AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function `fw_get_filesystem_firmware':
/u-boot/drivers/misc/fs_loader.c:162: undefined reference to `fs_set_blk_dev'
arm-none-linux-gnueabihf-ld.bfd: /home/frh/tdx/src/u-boot/drivers/misc/ fs_loader.c:185: undefined reference to fs_read' arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function select_fs_dev':
/u-boot/drivers/misc/fs_loader.c:89: undefined reference to `fs_set_blk_dev_with_part'
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2055: spl/u-boot-spl] Error 2

Quoted 7 lines

Fix it by replacing the FS_LOADER with SPL_FS_LOADER in the Makefile, so the fs.c with the necessary function definitions are compiled.

Fixes b071a07743d4 ("drivers: misc: Makefile: Enable fs_loader compilation at SPL Level")

This leads to failure to build on sandbox_noinst_defconfig.

Quoted 17 lines
---
 fs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/Makefile +1 -1
index 7b05c79e0ccf..a3ee0a361d3d 100644
@@ -5,7 +5,7 @@
 # Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
 
 ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_FS_LOADER) += fs.o
+obj-$(CONFIG_SPL_FS_LOADER) += fs.o
 obj-$(CONFIG_SPL_FS_FAT) += fat/
 obj-$(CONFIG_SPL_FS_EXT4) += ext4/
 obj-$(CONFIG_SPL_FS_CBFS) += cbfs/
Signature · 1 line
Tom
#3 lore raw
Quoted 25 lines · Tom Rini
Quoted 23 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

When SPL_FS_LOADER is set to y and FS_LOADER is not enabled, the SPL build fails with the following errors:

AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function `fw_get_filesystem_firmware':
/u-boot/drivers/misc/fs_loader.c:162: undefined reference to `fs_set_blk_dev'
arm-none-linux-gnueabihf-ld.bfd: /home/frh/tdx/src/u-boot/drivers/misc/ fs_loader.c:185: undefined reference to fs_read' arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function select_fs_dev':
/u-boot/drivers/misc/fs_loader.c:89: undefined reference to `fs_set_blk_dev_with_part'
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2055: spl/u-boot-spl] Error 2

Fix it by replacing the FS_LOADER with SPL_FS_LOADER in the Makefile, so the fs.c with the necessary function definitions are compiled.

Quoted 6 lines
Quoted 4 lines
Fixes b071a07743d4 ("drivers: misc: Makefile: Enable fs_loader compilation at SPL Level")

This leads to failure to build on sandbox_noinst_defconfig.

drivers/block/Kconfig +1 -0
@@ -110,6 +110,7 @@ config EFI_MEDIA
 config SPL_BLK_FS
        bool "Load images from filesystems on block devices"
        depends on SPL_BLK
+       select SPL_FS_LOADER
        help
          Use generic support to load images from fat/ext filesystems on
          different types of block devices such as NVMe.

?

#4 lore raw
Quoted 45 lines · Francesco Dolcini
Quoted 31 lines · Tom Rini
Quoted 20 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

When SPL_FS_LOADER is set to y and FS_LOADER is not enabled, the SPL build fails with the following errors:

AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function `fw_get_filesystem_firmware':
/u-boot/drivers/misc/fs_loader.c:162: undefined reference to `fs_set_blk_dev'
arm-none-linux-gnueabihf-ld.bfd: /home/frh/tdx/src/u-boot/drivers/misc/ fs_loader.c:185: undefined reference to fs_read' arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function select_fs_dev':
/u-boot/drivers/misc/fs_loader.c:89: undefined reference to `fs_set_blk_dev_with_part'
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2055: spl/u-boot-spl] Error 2

Quoted 7 lines

Fix it by replacing the FS_LOADER with SPL_FS_LOADER in the Makefile, so the fs.c with the necessary function definitions are compiled.

Fixes b071a07743d4 ("drivers: misc: Makefile: Enable fs_loader compilation at SPL Level")

This leads to failure to build on sandbox_noinst_defconfig.

drivers/block/Kconfig +1 -0
@@ -110,6 +110,7 @@ config EFI_MEDIA
 config SPL_BLK_FS
        bool "Load images from filesystems on block devices"
        depends on SPL_BLK
+       select SPL_FS_LOADER
        help
          Use generic support to load images from fat/ext filesystems on
          different types of block devices such as NVMe.
Quoted 1 line

?

I think "depends on" and sandbox_noinst_defconfig should enable CONFIG_SPL_FS_LOADER too.

Signature · 1 line
Tom
#5 lore raw

Hello Tom,

Quoted 46 lines · Tom Rini
Quoted 45 lines · Francesco Dolcini
Quoted 31 lines · Tom Rini
Quoted 20 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

When SPL_FS_LOADER is set to y and FS_LOADER is not enabled, the SPL build fails with the following errors:

AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function `fw_get_filesystem_firmware':
/u-boot/drivers/misc/fs_loader.c:162: undefined reference to `fs_set_blk_dev'
arm-none-linux-gnueabihf-ld.bfd: /home/frh/tdx/src/u-boot/drivers/misc/ fs_loader.c:185: undefined reference to fs_read' arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function select_fs_dev':
/u-boot/drivers/misc/fs_loader.c:89: undefined reference to `fs_set_blk_dev_with_part'
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2055: spl/u-boot-spl] Error 2

Quoted 7 lines

Fix it by replacing the FS_LOADER with SPL_FS_LOADER in the Makefile, so the fs.c with the necessary function definitions are compiled.

Fixes b071a07743d4 ("drivers: misc: Makefile: Enable fs_loader compilation at SPL Level")

This leads to failure to build on sandbox_noinst_defconfig.

drivers/block/Kconfig +1 -0
@@ -110,6 +110,7 @@ config EFI_MEDIA
 config SPL_BLK_FS
        bool "Load images from filesystems on block devices"
        depends on SPL_BLK
+       select SPL_FS_LOADER
        help
          Use generic support to load images from fat/ext filesystems on
          different types of block devices such as NVMe.
Quoted 4 lines
Quoted 1 line

?

I think "depends on" and sandbox_noinst_defconfig should enable CONFIG_SPL_FS_LOADER too.

What do you mean?

The change I proposed fixes the issue you reported with sandbox_noinst_defconfig and I think is the right solution. Are you ok with that or are you proposing to just change sandbox_noinst_defconfig enabling CONFIG_SPL_FS_LOADER explicitly?

Francesco

#6 lore raw
Quoted 54 lines · Francesco Dolcini

Hello Tom,

Quoted 46 lines · Tom Rini
Quoted 45 lines · Francesco Dolcini
Quoted 31 lines · Tom Rini
Quoted 20 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

When SPL_FS_LOADER is set to y and FS_LOADER is not enabled, the SPL build fails with the following errors:

AR spl/boot/built-in.o
LD spl/u-boot-spl
arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function `fw_get_filesystem_firmware':
/u-boot/drivers/misc/fs_loader.c:162: undefined reference to `fs_set_blk_dev'
arm-none-linux-gnueabihf-ld.bfd: /home/frh/tdx/src/u-boot/drivers/misc/ fs_loader.c:185: undefined reference to fs_read' arm-none-linux-gnueabihf-ld.bfd: drivers/misc/fs_loader.o: in function select_fs_dev':
/u-boot/drivers/misc/fs_loader.c:89: undefined reference to `fs_set_blk_dev_with_part'
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2055: spl/u-boot-spl] Error 2

Quoted 7 lines

Fix it by replacing the FS_LOADER with SPL_FS_LOADER in the Makefile, so the fs.c with the necessary function definitions are compiled.

Fixes b071a07743d4 ("drivers: misc: Makefile: Enable fs_loader compilation at SPL Level")

This leads to failure to build on sandbox_noinst_defconfig.

drivers/block/Kconfig +1 -0
@@ -110,6 +110,7 @@ config EFI_MEDIA
 config SPL_BLK_FS
        bool "Load images from filesystems on block devices"
        depends on SPL_BLK
+       select SPL_FS_LOADER
        help
          Use generic support to load images from fat/ext filesystems on
          different types of block devices such as NVMe.
Quoted 4 lines
Quoted 1 line

?

I think "depends on" and sandbox_noinst_defconfig should enable CONFIG_SPL_FS_LOADER too.

Quoted 5 lines

What do you mean?

The change I proposed fixes the issue you reported with sandbox_noinst_defconfig and I think is the right solution. Are you ok with that or are you proposing to just change sandbox_noinst_defconfig enabling CONFIG_SPL_FS_LOADER explicitly?

I'm saying, based on the other options which use SPL_FS_LOADER it should be a depends not select here, and that sandbox_noinst_defconfig should be enabling SPL_FS_LOADER. There's also an argument to be made that SPL_FS_LOADER (and FS_LOADER) should be unprompted options (ie "bool" without the text to explain the option) and selected by all of its users. I'm not immediately sure which is better now.

Signature · 1 line
Tom