All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] img layout
@ 2017-07-21  6:48 daggs
  2017-07-21  7:26 ` Thomas Petazzoni
  0 siblings, 1 reply; 11+ messages in thread
From: daggs @ 2017-07-21  6:48 UTC (permalink / raw)
  To: buildroot

Greetings,

I have a question about the image layout, if I dd some data into a final image, can I extrapolate what pre image creation file it touches and at what offset?

Thanks,

Dagg.

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

* [Buildroot] img layout
  2017-07-21  6:48 [Buildroot] img layout daggs
@ 2017-07-21  7:26 ` Thomas Petazzoni
  2017-07-21  9:19   ` daggs
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2017-07-21  7:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 21 Jul 2017 08:48:36 +0200, daggs wrote:

> I have a question about the image layout, if I dd some data into a
> final image, can I extrapolate what pre image creation file it
> touches and at what offset?

Not easily at all, as it depends on the filesystem and its internal
structure.

The big question is why you would want to do this.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] img layout
  2017-07-21  7:26 ` Thomas Petazzoni
@ 2017-07-21  9:19   ` daggs
  2017-07-21  9:46     ` Thomas Petazzoni
  2017-07-21 10:44     ` Peter Korsgaard
  0 siblings, 2 replies; 11+ messages in thread
From: daggs @ 2017-07-21  9:19 UTC (permalink / raw)
  To: buildroot

Greetings Thomas,

> Sent: Friday, July 21, 2017 at 10:26 AM
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: daggs <daggs@gmx.com>
> Cc: buildroot at buildroot.org
> Subject: Re: [Buildroot] img layout
>
> Hello,
> 
> On Fri, 21 Jul 2017 08:48:36 +0200, daggs wrote:
> 
> > I have a question about the image layout, if I dd some data into a
> > final image, can I extrapolate what pre image creation file it
> > touches and at what offset?
> 
> Not easily at all, as it depends on the filesystem and its internal
> structure.
> 
> The big question is why you would want to do this.
> 
> Best regards,
> 
> Thomas

well latest uboot supports the odroidc2 boards but there is a need to insert their signed blobs into the image.
as I don't know how the image's layout is, I'm not sure the dd specified in the uboot docs will work. I've never got it to boot. it maybe something else.

this is what they write:
DEV=/dev/your_sd_device
dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97

how can I be sure that the offsets above are the same in uboot generated image?

Dagg.

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

* [Buildroot] img layout
  2017-07-21  9:19   ` daggs
@ 2017-07-21  9:46     ` Thomas Petazzoni
  2017-07-21 10:57       ` daggs
  2017-07-21 10:44     ` Peter Korsgaard
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2017-07-21  9:46 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 21 Jul 2017 11:19:55 +0200, daggs wrote:

> well latest uboot supports the odroidc2 boards but there is a need to insert their signed blobs into the image.
> as I don't know how the image's layout is, I'm not sure the dd specified in the uboot docs will work. I've never got it to boot. it maybe something else.
> 
> this is what they write:
> DEV=/dev/your_sd_device
> dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
> dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
> dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
> 
> how can I be sure that the offsets above are the same in uboot generated image?

Use genimage, you can specify at which offset which image should be
placed. See board/engicam/icorem6/genimage.cfg for example.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] img layout
  2017-07-21  9:19   ` daggs
  2017-07-21  9:46     ` Thomas Petazzoni
@ 2017-07-21 10:44     ` Peter Korsgaard
  2017-07-21 10:59       ` daggs
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Korsgaard @ 2017-07-21 10:44 UTC (permalink / raw)
  To: buildroot

>>>>> "daggs" == daggs  <daggs@gmx.com> writes:

Hi,

 > well latest uboot supports the odroidc2 boards but there is a need to
 > insert their signed blobs into the image.
 > as I don't know how the image's layout is, I'm not sure the dd
 > specified in the uboot docs will work. I've never got it to boot. it
 > maybe something else.

 > this is what they write:
 > DEV=/dev/your_sd_device
 > dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
 > dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
 > dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97

 > how can I be sure that the offsets above are the same in uboot generated image?

That looks very similar to the logic we already have in
board/hardkernel/odroid2c2/post-image.sh, isn't that working for you?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] img layout
  2017-07-21  9:46     ` Thomas Petazzoni
@ 2017-07-21 10:57       ` daggs
  2017-07-22 15:58         ` daggs
  0 siblings, 1 reply; 11+ messages in thread
From: daggs @ 2017-07-21 10:57 UTC (permalink / raw)
  To: buildroot

Greetings Thomas

> Sent: Friday, July 21, 2017 at 12:46 PM
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: daggs <daggs@gmx.com>
> Cc: buildroot at buildroot.org
> Subject: Re: [Buildroot] img layout
>
> Hello,
> 
> On Fri, 21 Jul 2017 11:19:55 +0200, daggs wrote:
> 
> > well latest uboot supports the odroidc2 boards but there is a need to insert their signed blobs into the image.
> > as I don't know how the image's layout is, I'm not sure the dd specified in the uboot docs will work. I've never got it to boot. it maybe something else.
> > 
> > this is what they write:
> > DEV=/dev/your_sd_device
> > dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
> > dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
> > dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
> > 
> > how can I be sure that the offsets above are the same in uboot generated image?
> 
> Use genimage, you can specify at which offset which image should be
> placed. See board/engicam/icorem6/genimage.cfg for example.
> 
> Best regards,
> 
> Thomas
> -- 

interesting, I'll look into it, thanks.

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

* [Buildroot] img layout
  2017-07-21 10:44     ` Peter Korsgaard
@ 2017-07-21 10:59       ` daggs
  2017-07-21 15:57         ` Peter Korsgaard
  0 siblings, 1 reply; 11+ messages in thread
From: daggs @ 2017-07-21 10:59 UTC (permalink / raw)
  To: buildroot

Greetings Peter,

> Sent: Friday, July 21, 2017 at 1:44 PM
> From: "Peter Korsgaard" <peter@korsgaard.com>
> To: daggs <daggs@gmx.com>
> Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>, buildroot at buildroot.org
> Subject: Re: [Buildroot] img layout
>
> >>>>> "daggs" == daggs  <daggs@gmx.com> writes:
> 
> Hi,
> 
>  > well latest uboot supports the odroidc2 boards but there is a need to
>  > insert their signed blobs into the image.
>  > as I don't know how the image's layout is, I'm not sure the dd
>  > specified in the uboot docs will work. I've never got it to boot. it
>  > maybe something else.
> 
>  > this is what they write:
>  > DEV=/dev/your_sd_device
>  > dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
>  > dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
>  > dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
> 
>  > how can I be sure that the offsets above are the same in uboot generated image?
> 
> That looks very similar to the logic we already have in
> board/hardkernel/odroid2c2/post-image.sh, isn't that working for you?
> 
> -- 
> Bye, Peter Korsgaard

the original script won't work because it doesn't needs to address the signed bins because they are included.
it uses a uboot 2005 based git fork that already includes it. without adding the signed bins, the system will not boot.

Thanks,

Dagg.

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

* [Buildroot] img layout
  2017-07-21 10:59       ` daggs
@ 2017-07-21 15:57         ` Peter Korsgaard
  2017-07-21 19:42           ` daggs
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Korsgaard @ 2017-07-21 15:57 UTC (permalink / raw)
  To: buildroot

>>>>> "daggs" == daggs  <daggs@gmx.com> writes:

 >> That looks very similar to the logic we already have in
 >> board/hardkernel/odroid2c2/post-image.sh, isn't that working for you?
 >> 
 >> -- 
 >> Bye, Peter Korsgaard

 > the original script won't work because it doesn't needs to address the signed bins because they are included.
 > it uses a uboot 2005 based git fork that already includes it. without
 > adding the signed bins, the system will not boot.

Ehh, ok - That I get, but the lines you pasted before are pretty similar to what
we're already doing.

Looking at board/amlogic/odroid-c2/README in u-boot it looks like we
need to package the hardkernel host utilities and binary ATF builds - Or
perhaps we can use Andreas' meson-tools for (some of) the tasks:

https://github.com/afaerber/meson-tools

And then postprocess u-boot.bin with them and add it to the sdcard.img
like we do today.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] img layout
  2017-07-21 15:57         ` Peter Korsgaard
@ 2017-07-21 19:42           ` daggs
  0 siblings, 0 replies; 11+ messages in thread
From: daggs @ 2017-07-21 19:42 UTC (permalink / raw)
  To: buildroot

Greetings Peter,

> Sent: Friday, July 21, 2017 at 6:57 PM
> From: "Peter Korsgaard" <peter@korsgaard.com>
> To: daggs <daggs@gmx.com>
> Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>, buildroot at buildroot.org
> Subject: Re: [Buildroot] img layout
>
> >>>>> "daggs" == daggs  <daggs@gmx.com> writes:
> 
>  >> That looks very similar to the logic we already have in
>  >> board/hardkernel/odroid2c2/post-image.sh, isn't that working for you?
>  >> 
>  >> -- 
>  >> Bye, Peter Korsgaard
> 
>  > the original script won't work because it doesn't needs to address the signed bins because they are included.
>  > it uses a uboot 2005 based git fork that already includes it. without
>  > adding the signed bins, the system will not boot.
> 
> Ehh, ok - That I get, but the lines you pasted before are pretty similar to what
> we're already doing.
> 
> Looking at board/amlogic/odroid-c2/README in u-boot it looks like we
> need to package the hardkernel host utilities and binary ATF builds - Or
> perhaps we can use Andreas' meson-tools for (some of) the tasks:
> 
> https://github.com/afaerber/meson-tools
> 
> And then postprocess u-boot.bin with them and add it to the sdcard.img
> like we do today.
> 

my current implementation checks out the hk uboot repo and prepares it in the post install stage.
the offsets are known now (asked at their forums). first I'll get it to work, then the fixes will come.

Dagg.

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

* [Buildroot] img layout
  2017-07-21 10:57       ` daggs
@ 2017-07-22 15:58         ` daggs
  2017-07-22 18:05           ` Peter Korsgaard
  0 siblings, 1 reply; 11+ messages in thread
From: daggs @ 2017-07-22 15:58 UTC (permalink / raw)
  To: buildroot

Greetings Thomas

>
> Greetings Thomas
> 
> > Sent: Friday, July 21, 2017 at 12:46 PM
> > From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> > To: daggs <daggs@gmx.com>
> > Cc: buildroot at buildroot.org
> > Subject: Re: [Buildroot] img layout
> >
> > Hello,
> > 
> > On Fri, 21 Jul 2017 11:19:55 +0200, daggs wrote:
> > 
> > > well latest uboot supports the odroidc2 boards but there is a need to insert their signed blobs into the image.
> > > as I don't know how the image's layout is, I'm not sure the dd specified in the uboot docs will work. I've never got it to boot. it maybe something else.
> > > 
> > > this is what they write:
> > > DEV=/dev/your_sd_device
> > > dd if=$BL1 of=$DEV conv=fsync bs=1 count=442
> > > dd if=$BL1 of=$DEV conv=fsync bs=512 skip=1 seek=1
> > > dd if=$DIR/u-boot.gxbb of=$DEV conv=fsync bs=512 seek=97
> > > 
> > > how can I be sure that the offsets above are the same in uboot generated image?
> > 
> > Use genimage, you can specify at which offset which image should be
> > placed. See board/engicam/icorem6/genimage.cfg for example.
> > 
> > Best regards,
> > 
> > Thomas
> > -- 
> 
> interesting, I'll look into it, thanks.

I wonder, does setting offset to 0 will write a file to the start of the image?

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

* [Buildroot] img layout
  2017-07-22 15:58         ` daggs
@ 2017-07-22 18:05           ` Peter Korsgaard
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Korsgaard @ 2017-07-22 18:05 UTC (permalink / raw)
  To: buildroot

>>>>> "daggs" == daggs  <daggs@gmx.com> writes:

Hi,

 >> > Use genimage, you can specify at which offset which image should be
 >> > placed. See board/engicam/icorem6/genimage.cfg for example.

 >> interesting, I'll look into it, thanks.

 > I wonder, does setting offset to 0 will write a file to the start of the image?

I guess not, as the very first sector is used for the master boot record
/ partition table.

I think it would be safer/better to leave the manual dd invocations on
the outout of genimage.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2017-07-22 18:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-21  6:48 [Buildroot] img layout daggs
2017-07-21  7:26 ` Thomas Petazzoni
2017-07-21  9:19   ` daggs
2017-07-21  9:46     ` Thomas Petazzoni
2017-07-21 10:57       ` daggs
2017-07-22 15:58         ` daggs
2017-07-22 18:05           ` Peter Korsgaard
2017-07-21 10:44     ` Peter Korsgaard
2017-07-21 10:59       ` daggs
2017-07-21 15:57         ` Peter Korsgaard
2017-07-21 19:42           ` daggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.