All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Dmytriyenko <denis@denix.org>
To: Jason Kridner <jdk@ti.com>
Cc: meta-ti@yoctoproject.org
Subject: Re: [PATCH] sdcard_image: align partitions with flash	pages
Date: Thu, 27 Oct 2011 17:39:12 -0400	[thread overview]
Message-ID: <20111027213912.GO15391@denix.org> (raw)
In-Reply-To: <1319679361-13741-1-git-send-email-jdk@ti.com>

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
> 


  parent reply	other threads:[~2011-10-27 21:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-10-27 21:58   ` Jason Kridner
2011-10-28  2:05     ` Denys Dmytriyenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111027213912.GO15391@denix.org \
    --to=denis@denix.org \
    --cc=jdk@ti.com \
    --cc=meta-ti@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.