<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">Unaligned partitions are fine, but the partition code should mark<br>
them as readonly.<br><br></blockquote><div><br>That's why I was unable to erase it getting -EINVAL, things are clear now <br><br>It works fine, my kernel is booting :) ! <br><br>Thank you Sascha<br> <br></div><div class="gmail_quote">
2011/10/18 Sascha Hauer <span dir="ltr"><<a href="mailto:s.hauer@pengutronix.de">s.hauer@pengutronix.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Oct 18, 2011 at 09:35:38AM +0200, Kamel BOUHARA wrote:<br>
> I tried with a zImage, here is what I'm getting :<br>
><br>
> barebox:/ bootz /dev/<a href="http://nand0.kernel.bb" target="_blank">nand0.kernel.bb</a><br>
> invalid magic 0x00002018<br>
><br>
> And here the ls -l /dev/nand0.* output :<br>
><br>
> barebox:/ ls -l /dev/nand0.*<br>
> crw------- 393216 /dev/<a href="http://nand0.barebox.bb" target="_blank">nand0.barebox.bb</a><br>
> crw------- 131072 /dev/<a href="http://nand0.bareboxenv.bb" target="_blank">nand0.bareboxenv.bb</a><br>
> crw------- 2883584 /dev/<a href="http://nand0.kernel.bb" target="_blank">nand0.kernel.bb</a><br>
> crw------- <a href="tel:533200896" value="+33533200896">533200896</a> /dev/<a href="http://nand0.root.bb" target="_blank">nand0.root.bb</a><br>
> crw------- <a href="tel:533667840" value="+33533667840">533667840</a> /dev/nand0.root<br>
> crw------- 2764800 /dev/nand0.kernel<br>
> crw------- 131072 /dev/nand0.bareboxenv<br>
> crw------- 307200 /dev/nand0.barebox<br>
><br>
> Here is how I did my kernel and root partitions, following this steps :<br>
><br>
> addpart /dev/nand0 300k(barebox)ro,128k(bareboxenv),2700k(kernel),-(root)<br>
<br>
</div>Ok, that puts some light into this. Please make sure your partitions are<br>
aligned to eraseblock boundaries, usually 128k. so:<br>
<br>
addpart /dev/nand0 512k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)<br>
<br>
barebox currently does not enforce this, it's probably time to change<br>
this. Unaligned partitions are fine, but the partition code should mark<br>
them as readonly.<br>
Currently we have no way of passing the eraseblocksize through to the<br>
partition code, so it's not trivial to enforce alignment.<br>
<div><div></div><div class="h5"><br>
Sascha<br>
<br>
<br>
--<br>
Pengutronix e.K. | |<br>
Industrial Linux Solutions | <a href="http://www.pengutronix.de/" target="_blank">http://www.pengutronix.de/</a> |<br>
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: <a href="tel:%2B49-5121-206917-0" value="+4951212069170">+49-5121-206917-0</a> |<br>
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>__________________________________<br><i><font face="'comic sans ms', sans-serif">Kamel BOUHARA</font></i><div>7 rue Jules César<div>02100 SAINT-QUENTIN<br>
06.17.83.29.04<br><br></div></div><br>