Hi, I'm using barebox 2014.11.0, kernel 3.14 on phyFlex imx6 and when loading barebox environment from userspace I get a wrong magic: ------- ./bareboxenv-target -l /mnt/bbox /dev/mtd1 envfs: wrong magic ------- root@imx6q-pbab01:~# cat /proc/mtd dev: size erasesize name mtd0: 00400000 00020000 "barebox" mtd1: 00020000 00020000 "barebox-environment" mtd2: 00800000 00020000 "kernel" mtd3: 3f3e0000 00020000 "root" mtd4: 01000000 00010000 "spi2.0" ----- I have the barebox environment in NOR flash and I think is good since I can modify it and save it with the barebox menu. Thank you, Bogdan _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On Fri, Nov 14, 2014 at 06:44:30PM +0000, Balasa, Bogdan wrote: > Hi, > > I'm using barebox 2014.11.0, kernel 3.14 on phyFlex imx6 and when loading barebox environment from userspace I get a wrong magic: > ------- > ./bareboxenv-target -l /mnt/bbox /dev/mtd1 > envfs: wrong magic > ------- > root@imx6q-pbab01:~# cat /proc/mtd > dev: size erasesize name > mtd0: 00400000 00020000 "barebox" > mtd1: 00020000 00020000 "barebox-environment" > mtd2: 00800000 00020000 "kernel" > mtd3: 3f3e0000 00020000 "root" This seems to be your Nand flash, so if you have your environment in NOR FLash, > mtd4: 01000000 00010000 "spi2.0" it should be here. However, the NOR Flash is not partitioned, so the partitions get lost somewhere between barebox and the kernel. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
I am building bareboxenv-target for a cortex-A9 board (not present upstream) with gcc 9.3.0 and got this error: arm-oe-linux-gnueabi-gcc -Wp,-MMD,scripts/.bareboxenv-target.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -I /mnt/projects/all/openware-core/home/renaud/sandbox/bootloader/barebox-rebase/scripts/include -o scripts/bareboxenv-target scripts/bareboxenv-target.c In file included from scripts/bareboxenv-target.c:1: scripts/bareboxenv.c:17:10: fatal error: stdio.h: No such file or directory 17 | #include <stdio.h> | ^~~~~~~~~ It looks like sysroot is missing as when I add to scripts/Makefile: ifdef SDKTARGETSYSROOT userccflags += --sysroot=$(SDKTARGETSYSROOT) endif It builds. Not much came out from search on google but one thread that refers to this problem when building with Yocto. Could it it be related to how our toolchain got build? Cheers, Renaud _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On Wed, Oct 28, 2020 at 11:09:18AM +0000, Barbier, Renaud wrote: > I am building bareboxenv-target for a cortex-A9 board (not present upstream) with gcc 9.3.0 and got this error: > > arm-oe-linux-gnueabi-gcc -Wp,-MMD,scripts/.bareboxenv-target.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -I /mnt/projects/all/openware-core/home/renaud/sandbox/bootloader/barebox-rebase/scripts/include -o scripts/bareboxenv-target scripts/bareboxenv-target.c > In file included from scripts/bareboxenv-target.c:1: > scripts/bareboxenv.c:17:10: fatal error: stdio.h: No such file or directory > 17 | #include <stdio.h> > | ^~~~~~~~~ > > > It looks like sysroot is missing as when I add to scripts/Makefile: > ifdef SDKTARGETSYSROOT > userccflags += --sysroot=$(SDKTARGETSYSROOT) > endif > > It builds. > > Not much came out from search on google but one thread that refers to this problem when building with Yocto. > > Could it it be related to how our toolchain got build? Which toolchain were you using? IIRC, the Yocto SDK builds don't set a valid SYSROOT during the build, and patch it in through a compile option when calling the compiler. - Roland -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
> Which toolchain were you using? IIRC, the Yocto SDK builds don't set a > valid SYSROOT during the build, and patch it in through a compile option > when calling the compiler. [Barbier, Renaud] The toolchain is built from our Yocto (dunfell-23.0.0) > > - Roland > > -- > Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | > Steuerwalder Str. 21 | > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww > w.pengutronix.de%2F&data=04%7C01%7Crenaud.barbier%40abaco.co > m%7Caf3bfcf353684c3ae9ae08d87f312089%7Ce6f27451899d4d0db8fa88baaf > a551a7%7C0%7C0%7C637399196270355233%7CUnknown%7CTWFpbGZsb3d8 > eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 > D%7C2000&sdata=%2BdontmtYoJ%2BsS1%2FkGternIF%2FOdHe1h2QaV > hQPE%2BbNeY%3D&reserved=0 | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
We derived out recipe for barebox from the barebox layer. We may have broken something in there. > -----Original Message----- > From: Roland Hieber [mailto:rhi@pengutronix.de] > Sent: 02 November 2020 13:14 > To: Barbier, Renaud <renaud.barbier@abaco.com> > Cc: barebox@lists.infradead.org > Subject: Re: bareboxenv-target > > > > [**EXTERNAL SOURCE**]:Please verify the source before clicking link or > opening attachment. > > On Wed, Oct 28, 2020 at 11:09:18AM +0000, Barbier, Renaud wrote: > > I am building bareboxenv-target for a cortex-A9 board (not present > upstream) with gcc 9.3.0 and got this error: > > > > arm-oe-linux-gnueabi-gcc -Wp,-MMD,scripts/.bareboxenv-target.d -Wall - > Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer - > std=gnu89 -I /mnt/projects/all/openware- > core/home/renaud/sandbox/bootloader/barebox-rebase/scripts/include > -o scripts/bareboxenv-target scripts/bareboxenv-target.c > > In file included from scripts/bareboxenv-target.c:1: > > scripts/bareboxenv.c:17:10: fatal error: stdio.h: No such file or directory > > 17 | #include <stdio.h> > > | ^~~~~~~~~ > > > > > > It looks like sysroot is missing as when I add to scripts/Makefile: > > ifdef SDKTARGETSYSROOT > > userccflags += --sysroot=$(SDKTARGETSYSROOT) > > endif > > > > It builds. > > > > Not much came out from search on google but one thread that refers to > this problem when building with Yocto. > > > > Could it it be related to how our toolchain got build? > > Which toolchain were you using? IIRC, the Yocto SDK builds don't set a > valid SYSROOT during the build, and patch it in through a compile option > when calling the compiler. > > - Roland > > -- > Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | > Steuerwalder Str. 21 | > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww > w.pengutronix.de%2F&data=04%7C01%7Crenaud.barbier%40abaco.co > m%7Caf3bfcf353684c3ae9ae08d87f312089%7Ce6f27451899d4d0db8fa88baaf > a551a7%7C0%7C0%7C637399196270355233%7CUnknown%7CTWFpbGZsb3d8 > eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 > D%7C2000&sdata=%2BdontmtYoJ%2BsS1%2FkGternIF%2FOdHe1h2QaV > hQPE%2BbNeY%3D&reserved=0 | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
> > > > > > It looks like sysroot is missing as when I add to scripts/Makefile: > > ifdef SDKTARGETSYSROOT > > userccflags += --sysroot=$(SDKTARGETSYSROOT) > > endif > > > > It builds. > > > > Not much came out from search on google but one thread that refers to > this problem when building with Yocto. In barebox.inc of the Yocto recipe, I replaced export TARGETCFLAGS="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" with export userccflags="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" It builds. Would that be the way to pass sysroot to scripts/Makefile? Cheers, Renaud _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On Fri, Nov 06, 2020 at 09:55:18AM +0000, Barbier, Renaud wrote: > We derived out recipe for barebox from the barebox layer. Which layer is "the barebox layer"? - Roland -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On Fri, Nov 06, 2020 at 12:06:08PM +0000, Barbier, Renaud wrote: > > > > > > > > > It looks like sysroot is missing as when I add to scripts/Makefile: > > > ifdef SDKTARGETSYSROOT > > > userccflags += --sysroot=$(SDKTARGETSYSROOT) > > > endif > > > > > > It builds. > > > > > > Not much came out from search on google but one thread that refers to > > this problem when building with Yocto. > > In barebox.inc of the Yocto recipe, I replaced > export TARGETCFLAGS="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" > with > export userccflags="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" > > It builds. > > Would that be the way to pass sysroot to scripts/Makefile? I think someone more knowledgeable about Yocto/OE needs to answer this, I don't know if anyone is here… - Roland -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
> -----Original Message----- > From: Roland Hieber [mailto:rhi@pengutronix.de] > Sent: 06 November 2020 12:25 > To: Barbier, Renaud <renaud.barbier@abaco.com> > Cc: barebox@lists.infradead.org > Subject: Re: bareboxenv-target > > > > [**EXTERNAL SOURCE**]:Please verify the source before clicking link or > opening attachment. > > On Fri, Nov 06, 2020 at 09:55:18AM +0000, Barbier, Renaud wrote: > > We derived out recipe for barebox from the barebox layer. > > Which layer is "the barebox layer"? meta-ptx https://git.pengutronix.de/cgit/meta-ptx/tree/recipes-bsp/barebox/barebox.inc > > - Roland > > -- > Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | > Steuerwalder Str. 21 | > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fww > w.pengutronix.de%2F&data=04%7C01%7Crenaud.barbier%40abaco.co > m%7Cbdb306aa2c3c408ae3db08d8824f019a%7Ce6f27451899d4d0db8fa88baa > fa551a7%7C0%7C0%7C637402623132252846%7CUnknown%7CTWFpbGZsb3d > 8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0% > 3D%7C1000&sdata=YjiJX5FHBtobL16tN2R2C%2BJGgCJ3cxCaxIqI2ZymXY4 > %3D&reserved=0 | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Hello Renaud, On 28.10.20 12:09, Barbier, Renaud wrote: > I am building bareboxenv-target for a cortex-A9 board (not present upstream) with gcc 9.3.0 and got this error: > > arm-oe-linux-gnueabi-gcc -Wp,-MMD,scripts/.bareboxenv-target.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -I /mnt/projects/all/openware-core/home/renaud/sandbox/bootloader/barebox-rebase/scripts/include -o scripts/bareboxenv-target scripts/bareboxenv-target.c > In file included from scripts/bareboxenv-target.c:1: > scripts/bareboxenv.c:17:10: fatal error: stdio.h: No such file or directory > 17 | #include <stdio.h> > | ^~~~~~~~~ > > > It looks like sysroot is missing as when I add to scripts/Makefile: > ifdef SDKTARGETSYSROOT > userccflags += --sysroot=$(SDKTARGETSYSROOT) > endif > > It builds. > > Not much came out from search on google but one thread that refers to this problem when building with Yocto. > > Could it it be related to how our toolchain got build? Just ran into the same issue. Cause is as Roland describes the lack of --sysroot as default and that it comes in via $CC, which Kbuild doesn't expect. I guess this would break building kernel host tools too or how do they solve it? Cheers, Ahmad > > Cheers, > Renaud > > _______________________________________________ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
> -----Original Message----- > From: Ahmad Fatoum [mailto:a.fatoum@pengutronix.de] > Sent: 23 March 2021 12:34 > To: Barbier, Renaud <renaud.barbier@abaco.com>; > barebox@lists.infradead.org; Roland Hieber <rhi@pengutronix.de> > Subject: Re: bareboxenv-target > > > > [**EXTERNAL SOURCE**]:Please verify the source before clicking link or > opening attachment. > > Hello Renaud, > > On 28.10.20 12:09, Barbier, Renaud wrote: > > I am building bareboxenv-target for a cortex-A9 board (not present > upstream) with gcc 9.3.0 and got this error: > > > > arm-oe-linux-gnueabi-gcc -Wp,-MMD,scripts/.bareboxenv-target.d -Wall - > Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 > -I /mnt/projects/all/openware- > core/home/renaud/sandbox/bootloader/barebox-rebase/scripts/include -o > scripts/bareboxenv-target scripts/bareboxenv-target.c > > In file included from scripts/bareboxenv-target.c:1: > > scripts/bareboxenv.c:17:10: fatal error: stdio.h: No such file or directory > > 17 | #include <stdio.h> > > | ^~~~~~~~~ > > > > > > It looks like sysroot is missing as when I add to scripts/Makefile: > > ifdef SDKTARGETSYSROOT > > userccflags += --sysroot=$(SDKTARGETSYSROOT) > > endif > > > > It builds. > > > > Not much came out from search on google but one thread that refers to this > problem when building with Yocto. > > > > Could it it be related to how our toolchain got build? > > Just ran into the same issue. Cause is as Roland describes the lack of --sysroot > as default and that it comes in via $CC, which Kbuild doesn't expect. > > I guess this would break building kernel host tools too or how do they solve it? > > > > Not working either: > > [renaud@ediowsrv01]$ make tools/leds > > DESCEND leds > > arm-oe-linux-gnueabi-gcc -Wall -Wextra -g -I../../include/uapi -o uledmon uledmon.c > > uledmon.c:14:10: fatal error: fcntl.h: No such file or directory > > 14 | #include <fcntl.h> > > | ^~~~~~~~~ > > Cheers, > Ahmad _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Hello Renaud, On 23.03.21 15:44, Barbier, Renaud wrote: >>> Could it it be related to how our toolchain got build? >> >> Just ran into the same issue. Cause is as Roland describes the lack of --sysroot >> as default and that it comes in via $CC, which Kbuild doesn't expect. >> >> I guess this would break building kernel host tools too or how do they solve it? >>> >>> Not working either: >>> [renaud@ediowsrv01]$ make tools/leds >>> DESCEND leds >>> arm-oe-linux-gnueabi-gcc -Wall -Wextra -g -I../../include/uapi -o uledmon uledmon.c >>> uledmon.c:14:10: fatal error: fcntl.h: No such file or directory >>> 14 | #include <fcntl.h> >>> | ^~~~~~~~~ Thanks for trying it out. Well, this is a general incompatibility of the SDK's environment setup script with Kbuild then. I am wondering why they decided on not having a default --sysroot. Raising the issue upstream could shed some light on this and perhaps result in a fix. I don't think there is anything to fix here at the barebox side. FTR: we use meta-ptx extensively and AFAIK we haven't run into this issue. It only popped up when using the SDK build, so bitbake seems to do the right thing in that case. Cheers, Ahmad -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
On 23.03.21 16:47, Ahmad Fatoum wrote: > Hello Renaud, > > On 23.03.21 15:44, Barbier, Renaud wrote: >>>> Could it it be related to how our toolchain got build? >>> >>> Just ran into the same issue. Cause is as Roland describes the lack of --sysroot >>> as default and that it comes in via $CC, which Kbuild doesn't expect. >>> >>> I guess this would break building kernel host tools too or how do they solve it? >>>> >>>> Not working either: >>>> [renaud@ediowsrv01]$ make tools/leds >>>> DESCEND leds >>>> arm-oe-linux-gnueabi-gcc -Wall -Wextra -g -I../../include/uapi -o uledmon uledmon.c >>>> uledmon.c:14:10: fatal error: fcntl.h: No such file or directory >>>> 14 | #include <fcntl.h> >>>> | ^~~~~~~~~ > > Thanks for trying it out. Well, this is a general incompatibility of the SDK's environment > setup script with Kbuild then. I am wondering why they decided on not having a default > --sysroot. Raising the issue upstream could shed some light on this and perhaps result > in a fix. I don't think there is anything to fix here at the barebox side. > > FTR: we use meta-ptx extensively and AFAIK we haven't run into this issue. It only > popped up when using the SDK build, so bitbake seems to do the right thing in that case. FTR: There's a pending meta-ptx fix here: https://github.com/pengutronix/meta-ptx/pull/74 The solution for now seems to be to: export TARGETCFLAGS="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" export userccflags="${TARGETCFLAGS}" It's yet unclear whether userccflags is meant to be used this way, but it works for barebox. Cheers, Ahmad > > Cheers, > Ahmad > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox