* [PATCH] sdcard_image: align partitions with flash pages
@ 2011-10-27 1:36 Jason Kridner
2011-10-27 1:38 ` Kridner, Jason
2011-10-27 21:39 ` Denys Dmytriyenko
0 siblings, 2 replies; 5+ messages in thread
From: Jason Kridner @ 2011-10-27 1:36 UTC (permalink / raw)
To: meta-ti
See
http://sakoman.com/OMAP/a-script-for-partitioningformatting-a-bootable-sdmicrosd-card.html
Signed-off-by: Jason Kridner <jdk@ti.com>
---
classes/sdcard_image.bbclass | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/classes/sdcard_image.bbclass b/classes/sdcard_image.bbclass
index 4ebc998..9e4a959 100644
--- a/classes/sdcard_image.bbclass
+++ b/classes/sdcard_image.bbclass
@@ -46,9 +46,9 @@ IMAGE_CMD_sdimg () {
SIZE=$(/sbin/fdisk -l ${LOOPDEV} | grep Disk | grep bytes | awk '{print $5}')
CYLINDERS=$(echo $SIZE/255/63/512 | bc)
{
- echo ,9,0x0C,*
- echo ,,,-
- } | /sbin/sfdisk -D -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
+ echo 128,130944,0x0C,*
+ echo 131072,,,-
+ } | /sbin/sfdisk -D -uS -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
# Prepare loop devices for boot and filesystem partitions
BOOT_OFFSET=32256
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sdcard_image: align partitions with flash pages
2011-10-27 1:36 [PATCH] sdcard_image: align partitions with flash pages Jason Kridner
@ 2011-10-27 1:38 ` Kridner, Jason
2011-10-27 21:39 ` Denys Dmytriyenko
1 sibling, 0 replies; 5+ messages in thread
From: Kridner, Jason @ 2011-10-27 1:38 UTC (permalink / raw)
To: meta-ti@yoctoproject.org
See http://github.com/jadonk/meta-texasinstruments for-upstream branch for this patch as well.
________________________________________
From: Kridner, Jason
Sent: Wednesday, October 26, 2011 9:36 PM
To: meta-ti@yoctoproject.org
Cc: Kridner, Jason
Subject: [PATCH] sdcard_image: align partitions with flash pages
See
http://sakoman.com/OMAP/a-script-for-partitioningformatting-a-bootable-sdmicrosd-card.html
Signed-off-by: Jason Kridner <jdk@ti.com>
---
classes/sdcard_image.bbclass | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/classes/sdcard_image.bbclass b/classes/sdcard_image.bbclass
index 4ebc998..9e4a959 100644
--- a/classes/sdcard_image.bbclass
+++ b/classes/sdcard_image.bbclass
@@ -46,9 +46,9 @@ IMAGE_CMD_sdimg () {
SIZE=$(/sbin/fdisk -l ${LOOPDEV} | grep Disk | grep bytes | awk '{print $5}')
CYLINDERS=$(echo $SIZE/255/63/512 | bc)
{
- echo ,9,0x0C,*
- echo ,,,-
- } | /sbin/sfdisk -D -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
+ echo 128,130944,0x0C,*
+ echo 131072,,,-
+ } | /sbin/sfdisk -D -uS -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
# Prepare loop devices for boot and filesystem partitions
BOOT_OFFSET=32256
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sdcard_image: align partitions with flash pages
2011-10-27 1:36 [PATCH] sdcard_image: align partitions with flash pages Jason Kridner
2011-10-27 1:38 ` Kridner, Jason
@ 2011-10-27 21:39 ` Denys Dmytriyenko
2011-10-27 21:58 ` Jason Kridner
1 sibling, 1 reply; 5+ messages in thread
From: Denys Dmytriyenko @ 2011-10-27 21:39 UTC (permalink / raw)
To: Jason Kridner; +Cc: meta-ti
On Wed, Oct 26, 2011 at 09:36:01PM -0400, Jason Kridner wrote:
> See
> http://sakoman.com/OMAP/a-script-for-partitioningformatting-a-bootable-sdmicrosd-card.html
If I was Paul Menzel, I'd complain about non-descriptive description :)
Here's what I gathered from the above URL, which just gives the new script:
# Modifications to align partitioning by Steve Sakoman
# based on work by Arnd Bergmann
# Align partitions for SD card performance/wear optimization
# FAT partition size is 131072 sectors (64MB) less:
# MBR - 1 sector
# padding to align to the page size of the underlying flash - 127 sectors
# so we start the first partition at sector 128 and make it 131072 - 128 = 130944 sectors
# second partition starts at 131072 and continues to fill the card
It would be nice to have that in the commit message just to explain the
simingly random change of numbers below... :)
BTW, Arnd Bergmann is the expert in SD card wear issues http://lwn.net/Articles/428584/
and, if I remember correctly, he was showing some tests abusing whole bunch of
SD cards at the last ELC.
--
Denys
> Signed-off-by: Jason Kridner <jdk@ti.com>
> ---
> classes/sdcard_image.bbclass | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/classes/sdcard_image.bbclass b/classes/sdcard_image.bbclass
> index 4ebc998..9e4a959 100644
> --- a/classes/sdcard_image.bbclass
> +++ b/classes/sdcard_image.bbclass
> @@ -46,9 +46,9 @@ IMAGE_CMD_sdimg () {
> SIZE=$(/sbin/fdisk -l ${LOOPDEV} | grep Disk | grep bytes | awk '{print $5}')
> CYLINDERS=$(echo $SIZE/255/63/512 | bc)
> {
> - echo ,9,0x0C,*
> - echo ,,,-
> - } | /sbin/sfdisk -D -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
> + echo 128,130944,0x0C,*
> + echo 131072,,,-
> + } | /sbin/sfdisk -D -uS -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
>
> # Prepare loop devices for boot and filesystem partitions
> BOOT_OFFSET=32256
> --
> 1.7.4.1
>
> _______________________________________________
> meta-ti mailing list
> meta-ti@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sdcard_image: align partitions with flash pages
2011-10-27 21:39 ` Denys Dmytriyenko
@ 2011-10-27 21:58 ` Jason Kridner
2011-10-28 2:05 ` Denys Dmytriyenko
0 siblings, 1 reply; 5+ messages in thread
From: Jason Kridner @ 2011-10-27 21:58 UTC (permalink / raw)
To: Denys Dmytriyenko; +Cc: meta-ti
On Thu, Oct 27, 2011 at 5:39 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> On Wed, Oct 26, 2011 at 09:36:01PM -0400, Jason Kridner wrote:
>> See
>> http://sakoman.com/OMAP/a-script-for-partitioningformatting-a-bootable-sdmicrosd-card.html
>
> If I was Paul Menzel, I'd complain about non-descriptive description :)
Fair enough. I thought giving the URL was better than taking the
credit for the ideas, but I could have extracted the ideas for the
change as well. Do you need me to resubmit? I'm comfortable with you
adding comments into the commit.
Or should I apply an additional patch to put comments into the code?
>
> Here's what I gathered from the above URL, which just gives the new script:
>
> # Modifications to align partitioning by Steve Sakoman
> # based on work by Arnd Bergmann
> # Align partitions for SD card performance/wear optimization
> # FAT partition size is 131072 sectors (64MB) less:
> # MBR - 1 sector
> # padding to align to the page size of the underlying flash - 127 sectors
> # so we start the first partition at sector 128 and make it 131072 - 128 = 130944 sectors
> # second partition starts at 131072 and continues to fill the card
>
> It would be nice to have that in the commit message just to explain the
> simingly random change of numbers below... :)
>
> BTW, Arnd Bergmann is the expert in SD card wear issues http://lwn.net/Articles/428584/
> and, if I remember correctly, he was showing some tests abusing whole bunch of
> SD cards at the last ELC.
Yeah, I sat down with Arnd and discussed it at ELC, which is why I
wanted to pick up the changes not only in mkcard as Steve did, but in
this class which is more convenient for people using OE to build SD
card images.
>
> --
> Denys
>
>> Signed-off-by: Jason Kridner <jdk@ti.com>
>> ---
>> classes/sdcard_image.bbclass | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/classes/sdcard_image.bbclass b/classes/sdcard_image.bbclass
>> index 4ebc998..9e4a959 100644
>> --- a/classes/sdcard_image.bbclass
>> +++ b/classes/sdcard_image.bbclass
>> @@ -46,9 +46,9 @@ IMAGE_CMD_sdimg () {
>> SIZE=$(/sbin/fdisk -l ${LOOPDEV} | grep Disk | grep bytes | awk '{print $5}')
>> CYLINDERS=$(echo $SIZE/255/63/512 | bc)
>> {
>> - echo ,9,0x0C,*
>> - echo ,,,-
>> - } | /sbin/sfdisk -D -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
>> + echo 128,130944,0x0C,*
>> + echo 131072,,,-
>> + } | /sbin/sfdisk -D -uS -H 255 -S 63 -C ${CYLINDERS} ${LOOPDEV}
>>
>> # Prepare loop devices for boot and filesystem partitions
>> BOOT_OFFSET=32256
>> --
>> 1.7.4.1
>>
>> _______________________________________________
>> meta-ti mailing list
>> meta-ti@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/meta-ti
>>
> _______________________________________________
> meta-ti mailing list
> meta-ti@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-ti
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sdcard_image: align partitions with flash pages
2011-10-27 21:58 ` Jason Kridner
@ 2011-10-28 2:05 ` Denys Dmytriyenko
0 siblings, 0 replies; 5+ messages in thread
From: Denys Dmytriyenko @ 2011-10-28 2:05 UTC (permalink / raw)
To: Jason Kridner; +Cc: meta-ti
On Thu, Oct 27, 2011 at 05:58:26PM -0400, Jason Kridner wrote:
> On Thu, Oct 27, 2011 at 5:39 PM, Denys Dmytriyenko <denis@denix.org> wrote:
> > On Wed, Oct 26, 2011 at 09:36:01PM -0400, Jason Kridner wrote:
> >> See
> >> http://sakoman.com/OMAP/a-script-for-partitioningformatting-a-bootable-sdmicrosd-card.html
> >
> > If I was Paul Menzel, I'd complain about non-descriptive description :)
>
> Fair enough. I thought giving the URL was better than taking the
> credit for the ideas, but I could have extracted the ideas for the
Well, giving proper credit is important, so I included Steve's and Arnd's
names (although, leaving XorA's and my names out :))
> change as well. Do you need me to resubmit? I'm comfortable with you
> adding comments into the commit.
Sounds good then, here's what I've added:
http://git.angstrom-distribution.org/cgi-bin/cgit.cgi/meta-texasinstruments/commit/?id=ed09701ebe89d4ce0802cf734aa25c29e94febe8
> Or should I apply an additional patch to put comments into the code?
>
> > BTW, Arnd Bergmann is the expert in SD card wear issues http://lwn.net/Articles/428584/
> > and, if I remember correctly, he was showing some tests abusing whole bunch of
> > SD cards at the last ELC.
>
> Yeah, I sat down with Arnd and discussed it at ELC, which is why I
> wanted to pick up the changes not only in mkcard as Steve did, but in
> this class which is more convenient for people using OE to build SD
> card images.
--
Denys
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-28 2:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27 1:36 [PATCH] sdcard_image: align partitions with flash pages Jason Kridner
2011-10-27 1:38 ` Kridner, Jason
2011-10-27 21:39 ` Denys Dmytriyenko
2011-10-27 21:58 ` Jason Kridner
2011-10-28 2:05 ` Denys Dmytriyenko
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.