mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Environment is not overwritten at barebox update
@ 2021-01-15 10:22 AD
  2021-01-15 10:35 ` Ahmad Fatoum
  0 siblings, 1 reply; 4+ messages in thread
From: AD @ 2021-01-15 10:22 UTC (permalink / raw)
  To: barebox


Dear all,

I've compiled an image and try to get my environment scripts on my 
target but I can't get them.

Here a snippet of my DTS :

/ {
         model = "Main Board";

         compatible = "fsl,imx6dl";
     chosen {
             stdout-path = &uart3;
     };

     environment@0 {
         compatible = "barebox,environment";
         device-path = &usdhc3, "partname:barebox-environment";
     };
};

&usdhc3 {
     partition@0 {
         label = "barebox";
         reg = <0x0 0x80000>;
     };
     partition@1 {
         label = "barebox-environment";
         reg = <0x80000 0x80000>;
     };

         ...

         # Many other partitions

         ...

};


Here a snippet of my .config :

CONFIG_DEFAULT_ENVIRONMENT=y
# CONFIG_DEFAULT_COMPRESSION_GZIP is not set
# CONFIG_DEFAULT_COMPRESSION_LZO is not set
# CONFIG_DEFAULT_COMPRESSION_LZ4 is not set
# CONFIG_DEFAULT_COMPRESSION_XZ is not set
CONFIG_DEFAULT_COMPRESSION_NONE=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU=y
CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU=y
CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/al-mx6/env/"

And here the content of : "arch/arm/boards/al-mx6/env/"

ad@debian:~/workspace/barebox/chrysalis/arch/arm/boards/al-mx6/env$ tree
.
├── bin
│   └── init
├── boot
│   ├── al
│   ├── tftp
│   └── usb
├── config
└── data
     ├── ansi-colors


Now, on the target, I'm upgrading barebox using a simple : cp 
barebox.img /dev/mmc2


With the compiled date and hour from the Barebox logs at starting, I can 
see that the "new" barebox is really the one that I juste compiled.

But I don't have my env correctly updated :

barebox@Main Board:/env ls -l
drwxrwxrwx              0 .
d---------              0 ..
drwxrwxrwx              0 bin
-rwxrwxrwx             25 config
drwxrwxrwx              0 data
drwxrwxrwx              0 init
drwxrwxrwx              0 menu
drwxrwxrwx              0 network
drwxrwxrwx              0 nv


My config file is not the one that I compiled, and the boot/ directory 
has not been updated...
But the newly created files are always updated.
Only the already existing ones are not overwritten.
Not sure of that, but it seems to be different between several boards...


I am missing something?


Here the starting logs :


barebox 2019.07.0-06872-g2c7ca71f9-dirty #2 Tue Dec 8 18:41:29 CET 2020


Board: Main Board
detected i.MX6 DualLite revision 1.4
i.MX reset reason POR (SRSR: 0x00000001)
i.MX6 DualLite unique ID: f21fd23e181bc1d4
mdio_bus: miibus0: probed
imx-usb 2184200.usb@02184200.of: USB EHCI 1.00
imx-esdhc 2194000.usdhc@02194000.of: registered as mmc1
imx-esdhc 2198000.usdhc@02198000.of: registered as mmc2
imx-ipuv3 2400000.ipu@02400000.of: IPUv3H probed
caam 2100000.caam@2100000.of: Instantiated RNG4 SH0
caam 2100000.caam@2100000.of: Instantiated RNG4 SH1
caam 2100000.caam@2100000.of: registering rng-caam
netconsole: registered as netconsole-1
GPR1 = 48600005
malloc space: 0x3fdf6540 -> 0x4fdf653f (size 256 MiB)
mmc2: detected MMC card version 5.0
mmc2: registered mmc2.boot0
mmc2: registered mmc2.boot1
mmc2: registered mmc2
running /env/bin/init...

Hit m for menu or any other key to stop autoboot:
type exit to get to the menu
barebox@Chrysalis Main Board:/


Thanks for everything,

AD





_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Environment is not overwritten at barebox update
  2021-01-15 10:22 Environment is not overwritten at barebox update AD
@ 2021-01-15 10:35 ` Ahmad Fatoum
  2021-01-15 12:12   ` AD
  0 siblings, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2021-01-15 10:35 UTC (permalink / raw)
  To: AD, barebox



On 15.01.21 11:22, AD wrote:
> 
> Dear all,
> 
> I've compiled an image and try to get my environment scripts on my target but I can't get them.
> 
> Here a snippet of my DTS :
> 
> / {
>         model = "Main Board";
> 
>         compatible = "fsl,imx6dl";
>     chosen {
>             stdout-path = &uart3;
>     };
> 
>     environment@0 {
>         compatible = "barebox,environment";
>         device-path = &usdhc3, "partname:barebox-environment";
>     };
> };
> 
> &usdhc3 {
>     partition@0 {
>         label = "barebox";
>         reg = <0x0 0x80000>;
>     };
>     partition@1 {
>         label = "barebox-environment";
>         reg = <0x80000 0x80000>;
>     };
> 
>         ...
> 
>         # Many other partitions
> 
>         ...
> 
> };
> 
> 
> Here a snippet of my .config :
> 
> CONFIG_DEFAULT_ENVIRONMENT=y
> # CONFIG_DEFAULT_COMPRESSION_GZIP is not set
> # CONFIG_DEFAULT_COMPRESSION_LZO is not set
> # CONFIG_DEFAULT_COMPRESSION_LZ4 is not set
> # CONFIG_DEFAULT_COMPRESSION_XZ is not set
> CONFIG_DEFAULT_COMPRESSION_NONE=y
> CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
> CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU=y
> CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU=y
> CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/al-mx6/env/"
> 
> And here the content of : "arch/arm/boards/al-mx6/env/"
> 
> ad@debian:~/workspace/barebox/chrysalis/arch/arm/boards/al-mx6/env$ tree
> .
> ├── bin
> │   └── init
> ├── boot
> │   ├── al
> │   ├── tftp
> │   └── usb
> ├── config
> └── data
>     ├── ansi-colors
> 
> 
> Now, on the target, I'm upgrading barebox using a simple : cp barebox.img /dev/mmc2
> 
> 
> With the compiled date and hour from the Barebox logs at starting, I can see that the "new" barebox is really the one that I juste compiled.
> 
> But I don't have my env correctly updated :
> 
> barebox@Main Board:/env ls -l
> drwxrwxrwx              0 .
> d---------              0 ..
> drwxrwxrwx              0 bin
> -rwxrwxrwx             25 config
> drwxrwxrwx              0 data
> drwxrwxrwx              0 init
> drwxrwxrwx              0 menu
> drwxrwxrwx              0 network
> drwxrwxrwx              0 nv
> 
> 
> My config file is not the one that I compiled, and the boot/ directory has not been updated...
> But the newly created files are always updated.
> Only the already existing ones are not overwritten.
> Not sure of that, but it seems to be different between several boards...
> 
> 
> I am missing something?
> 
> 
> Here the starting logs :
> 
> 
> barebox 2019.07.0-06872-g2c7ca71f9-dirty #2 Tue Dec 8 18:41:29 CET 2020
> 
> 
> Board: Main Board
> detected i.MX6 DualLite revision 1.4
> i.MX reset reason POR (SRSR: 0x00000001)
> i.MX6 DualLite unique ID: f21fd23e181bc1d4
> mdio_bus: miibus0: probed
> imx-usb 2184200.usb@02184200.of: USB EHCI 1.00
> imx-esdhc 2194000.usdhc@02194000.of: registered as mmc1
> imx-esdhc 2198000.usdhc@02198000.of: registered as mmc2
> imx-ipuv3 2400000.ipu@02400000.of: IPUv3H probed
> caam 2100000.caam@2100000.of: Instantiated RNG4 SH0
> caam 2100000.caam@2100000.of: Instantiated RNG4 SH1
> caam 2100000.caam@2100000.of: registering rng-caam
> netconsole: registered as netconsole-1
> GPR1 = 48600005
> malloc space: 0x3fdf6540 -> 0x4fdf653f (size 256 MiB)
> mmc2: detected MMC card version 5.0
> mmc2: registered mmc2.boot0
> mmc2: registered mmc2.boot1
> mmc2: registered mmc2
> running /env/bin/init...
> 
> Hit m for menu or any other key to stop autoboot:
> type exit to get to the menu
> barebox@Chrysalis Main Board:/
> 
> 
> Thanks for everything,

The barebox mutable environment is meant as development
feature, so you can override the built-in environment.

You'll probably want to run saveenv -z to override this
and force use of the built-in environment.

Cheers,
Ahmad

> 
> AD
> 
> 
> 
> 
> 
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Environment is not overwritten at barebox update
  2021-01-15 10:35 ` Ahmad Fatoum
@ 2021-01-15 12:12   ` AD
  2021-01-18 17:32     ` Ahmad Fatoum
  0 siblings, 1 reply; 4+ messages in thread
From: AD @ 2021-01-15 12:12 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox

Dear Ahmad,

thanks for your help.

On 15/01/2021 11:35, Ahmad Fatoum wrote:
>
> On 15.01.21 11:22, AD wrote:
>> Dear all,
>>
>> I've compiled an image and try to get my environment scripts on my target but I can't get them.
>>
>> Here a snippet of my DTS :
>>
>> / {
>>          model = "Main Board";
>>
>>          compatible = "fsl,imx6dl";
>>      chosen {
>>              stdout-path = &uart3;
>>      };
>>
>>      environment@0 {
>>          compatible = "barebox,environment";
>>          device-path = &usdhc3, "partname:barebox-environment";
>>      };
>> };
>>
>> &usdhc3 {
>>      partition@0 {
>>          label = "barebox";
>>          reg = <0x0 0x80000>;
>>      };
>>      partition@1 {
>>          label = "barebox-environment";
>>          reg = <0x80000 0x80000>;
>>      };
>>
>>          ...
>>
>>          # Many other partitions
>>
>>          ...
>>
>> };
>>
>>
>> Here a snippet of my .config :
>>
>> CONFIG_DEFAULT_ENVIRONMENT=y
>> # CONFIG_DEFAULT_COMPRESSION_GZIP is not set
>> # CONFIG_DEFAULT_COMPRESSION_LZO is not set
>> # CONFIG_DEFAULT_COMPRESSION_LZ4 is not set
>> # CONFIG_DEFAULT_COMPRESSION_XZ is not set
>> CONFIG_DEFAULT_COMPRESSION_NONE=y
>> CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
>> CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_MENU=y
>> CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW_DFU=y
>> CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/al-mx6/env/"
>>
>> And here the content of : "arch/arm/boards/al-mx6/env/"
>>
>> ad@debian:~/workspace/barebox/chrysalis/arch/arm/boards/al-mx6/env$ tree
>> .
>> ├── bin
>> │   └── init
>> ├── boot
>> │   ├── al
>> │   ├── tftp
>> │   └── usb
>> ├── config
>> └── data
>>      ├── ansi-colors
>>
>>
>> Now, on the target, I'm upgrading barebox using a simple : cp barebox.img /dev/mmc2
>>
>>
>> With the compiled date and hour from the Barebox logs at starting, I can see that the "new" barebox is really the one that I juste compiled.
>>
>> But I don't have my env correctly updated :
>>
>> barebox@Main Board:/env ls -l
>> drwxrwxrwx              0 .
>> d---------              0 ..
>> drwxrwxrwx              0 bin
>> -rwxrwxrwx             25 config
>> drwxrwxrwx              0 data
>> drwxrwxrwx              0 init
>> drwxrwxrwx              0 menu
>> drwxrwxrwx              0 network
>> drwxrwxrwx              0 nv
>>
>>
>> My config file is not the one that I compiled, and the boot/ directory has not been updated...
>> But the newly created files are always updated.
>> Only the already existing ones are not overwritten.
>> Not sure of that, but it seems to be different between several boards...
>>
>>
>> I am missing something?
>>
>>
>> Here the starting logs :
>>
>>
>> barebox 2019.07.0-06872-g2c7ca71f9-dirty #2 Tue Dec 8 18:41:29 CET 2020
>>
>>
>> Board: Main Board
>> detected i.MX6 DualLite revision 1.4
>> i.MX reset reason POR (SRSR: 0x00000001)
>> i.MX6 DualLite unique ID: f21fd23e181bc1d4
>> mdio_bus: miibus0: probed
>> imx-usb 2184200.usb@02184200.of: USB EHCI 1.00
>> imx-esdhc 2194000.usdhc@02194000.of: registered as mmc1
>> imx-esdhc 2198000.usdhc@02198000.of: registered as mmc2
>> imx-ipuv3 2400000.ipu@02400000.of: IPUv3H probed
>> caam 2100000.caam@2100000.of: Instantiated RNG4 SH0
>> caam 2100000.caam@2100000.of: Instantiated RNG4 SH1
>> caam 2100000.caam@2100000.of: registering rng-caam
>> netconsole: registered as netconsole-1
>> GPR1 = 48600005
>> malloc space: 0x3fdf6540 -> 0x4fdf653f (size 256 MiB)
>> mmc2: detected MMC card version 5.0
>> mmc2: registered mmc2.boot0
>> mmc2: registered mmc2.boot1
>> mmc2: registered mmc2
>> running /env/bin/init...
>>
>> Hit m for menu or any other key to stop autoboot:
>> type exit to get to the menu
>> barebox@Chrysalis Main Board:/
>>
>>
>> Thanks for everything,
> The barebox mutable environment is meant as development
> feature, so you can override the built-in environment.
>
> You'll probably want to run saveenv -z to override this
> and force use of the built-in environment.

If I understand well, the issue is not that my built-in env is not 
"updated" on the target, but that it is not loaded at startup.
And it is not loaded, because I already have a modified environment, on 
which I did a "saveenv" previously ; as a consequence, at startup, this 
"local dev env" is loaded instead of the built-in one?
I tried a saveenv -z on a modified env, and it restores properly the 
built-in env at the next startup.

On some targets, I don't have the issue.
Is it possible that on those targets, I never did a saveenv which would 
have created a "local" env ; as a consequence, every time I update 
Barebox, the built-in env is always used?

As a conclusion, I guess that updating barebox with "cp ${image} 
/dev/mmc2" and "saveenv -z" instead of only using the first command 
would solve this issue.


In any case, many thanks for helping me to understand this mechanism.

Best Regards,
AD



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Environment is not overwritten at barebox update
  2021-01-15 12:12   ` AD
@ 2021-01-18 17:32     ` Ahmad Fatoum
  0 siblings, 0 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2021-01-18 17:32 UTC (permalink / raw)
  To: AD, barebox

Hello,

On 15.01.21 13:12, AD wrote:
>> You'll probably want to run saveenv -z to override this
>> and force use of the built-in environment.
> 
> If I understand well, the issue is not that my built-in env is not "updated" on the target, but that it is not loaded at startup.

Exactly.

> And it is not loaded, because I already have a modified environment, on which I did a "saveenv" previously ; as a consequence, at startup, this "local dev env" is loaded instead of the built-in one?

Yep.

> I tried a saveenv -z on a modified env, and it restores properly the built-in env at the next startup.
> 
> On some targets, I don't have the issue.
> Is it possible that on those targets, I never did a saveenv which would have created a "local" env ; as a consequence, every time I update Barebox, the built-in env is always used?

That's my assumption as well.

> As a conclusion, I guess that updating barebox with "cp ${image} /dev/mmc2" and "saveenv -z" instead of only using the first command would solve this issue.

Preferably, you'd update barebox with barebox_update ${image}. barebox_update knows
how to handle eMMC boot partitions if you need that and it can be readily exported
over Android Fastboot.

saveenv -z is something you need to do when you have written an environment manually
during development. When bringing up a board in the factory, there shouldn't be
a valid environment in the eMMC, so you could skip that step.

> In any case, many thanks for helping me to understand this mechanism.

Glad it helped,
Ahmad

> 
> Best Regards,
> AD
> 
> 
> 

-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-18 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 10:22 Environment is not overwritten at barebox update AD
2021-01-15 10:35 ` Ahmad Fatoum
2021-01-15 12:12   ` AD
2021-01-18 17:32     ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox