All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8][edison] bootimg and dosfstools fixes
@ 2012-04-11 17:51 Darren Hart
  2012-04-11 17:51 ` [PATCH 1/8] bootimg: Use mcopy to construct the hddimg Darren Hart
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

This is V2 for a fix for YOCTO 2138. V2 pulls in fixes to dosfstools
which address a "Boot Error" message when attempting to boot in qemu.
The dosfstools patches were cherry-picked directly from master with no
modifications.

The following changes since commit 0fbd6a161576b2cafa8583adde0ffb15347c884a:

  poky.conf: Bumping SKD_VERSION (2012-03-14 15:49:33 -0700)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib dvhart/edison/bug/2138
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dvhart/edison/bug/2138

Darren Hart (4):
  bootimg: Use mcopy to construct the hddimg
  bootimg: Account for FAT filesystem overhead in image size
  bootimg: Fix a math thinko in the block count calculation
  bootimg: Do not force FAT32 on all images, it violates the FAT
    specification

Otavio Salvador (1):
  dosfstools: update native to 2.11

Richard Purdie (1):
  dosfstools: Add patch to disable fat32 autoselection and behave as
    2.10

Saul Wold (1):
  dosfstools: Add SRC_URI Checksum

Scott Garman (1):
  dosfstools: add Upstream-Status to patches

 meta/classes/bootimg.bbclass                       |   53 ++++++++++++--
 .../dosfstools/dosfstools-native_2.10.bb           |   19 -----
 .../dosfstools/dosfstools/2.6.20-syscall.patch     |   65 -----------------
 .../dosfstools/dosfstools/alignment_hack.patch     |    4 +
 .../dosfstools/dosfstools-2.10-kernel-2.6.patch    |   74 -------------------
 .../dosfstools/dosfstools-msdos_fs-types.patch     |    7 ++
 .../dosfstools/include-linux-types.patch           |    5 ++
 .../dosfstools/dosfstools/mkdosfs-bootcode.patch   |   75 ++++++++++----------
 .../dosfstools/dosfstools/mkdosfs-dir.patch        |   67 +++++++++--------
 .../dosfstools/msdos_fat12_undefined.patch         |    7 ++
 .../dosfstools/dosfstools/nofat32_autoselect.patch |   27 +++++++
 .../recipes-devtools/dosfstools/dosfstools_2.10.bb |   21 ------
 .../recipes-devtools/dosfstools/dosfstools_2.11.bb |   12 +++-
 13 files changed, 179 insertions(+), 257 deletions(-)
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools-native_2.10.bb
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools/dosfstools-2.10-kernel-2.6.patch
 create mode 100644 meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools_2.10.bb

-- 
1.7.5.4



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

* [PATCH 1/8] bootimg: Use mcopy to construct the hddimg
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  2012-04-11 17:51 ` [PATCH 2/8] bootimg: Account for FAT filesystem overhead in image size Darren Hart
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

Fixes [YOCTO 2138]

The initial directory support (-d) added to mkdosfs has proven to be incomplete
and non-compliant with FAT. Rather than continue to maintain this feature and
work around the various issues, we can use mcopy to construct the image.

bootimg.bbclass already depends on mtools-native (although it may not have
needed to previously). No new dependencies are introduced. The image created
passes dosfsck cleanly. Remove the call to dosfsck.

mcopy reported an error with the image we were creating:
Total number of sectors (107574) not a multiple of sectors per track (32)!

Add some logic to ensure the total sector count is an integral number of sectors
per track, including forcing the logical sector size to 512 in the mkdosfs
command.

The du -bks arguments are contradictory, -b is equivalent to "--apparent-size
--block-size=1" and -k is --block-size=1K. If reordered, -kbs will report the
disk usage in bytes insteadk of 1k blocks. Eliminate the ambiguity by using:
du --apparent-size -ks

(From OE-Core rev: 92d2ea1a306354c6565a1b05b51b5719e481840f)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Nitin A. Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to poky edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/classes/bootimg.bbclass |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 49ee85e..bcae2ae 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -62,13 +62,21 @@ build_boot_bin() {
 
 	install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
 
-	# Do a little math, bash style
-	#BLOCKS=`du -s ${HDDDIR} | cut -f 1`
-	BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
-	SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`	
-
-	mkdosfs -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
-	-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE 
+	# Determine the 1024 byte block count for the final image.
+	BLOCKS=`du --apparent-size -ks ${HDDDIR} | cut -f 1`
+	SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
+
+	# Ensure total sectors is an integral number of sectors per
+	# track or mcopy will complain. Sectors are 512 bytes, and and
+	# we generate images with 32 sectors per track. This calculation
+	# is done in blocks, which are twice the size of sectors, thus
+	# the 16 instead of 32.
+	SIZE=$(expr $SIZE + $(expr 16 - $(expr $SIZE % 16)))
+
+	IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+	mkdosfs -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${SIZE}
+	# Copy HDDDIR recursively into the image file directly
+	mcopy -i ${IMG} -s ${HDDDIR}/* ::/
 
 	syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
 	chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-- 
1.7.5.4



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

* [PATCH 2/8] bootimg: Account for FAT filesystem overhead in image size
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
  2012-04-11 17:51 ` [PATCH 1/8] bootimg: Use mcopy to construct the hddimg Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  2012-04-11 17:51 ` [PATCH 3/8] bootimg: Fix a math thinko in the block count calculation Darren Hart
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

Fixes [YOCTO #1852]

The bootimg class wasn't accounting for non-trivial amount of space
required by the directory entries and FATs for the FAT filesystem.

This patch attempts to make an accurate prediction of FAT overhead and
adjusts the image size accordingly. It assumes no more than 16 directory
entries per directory (which fit in a single sector). It also assumes
8.3 filenames. With the ceiling functions rounding up to full sectors
and tracks, these assumptions seem reasonable.

In order to ensure the calculations are accurate, this patch forces the
FAT size to 32, rather than allowing mkdosfs to automatically select 12,
16, or 32 depending on the image being built.

Tested by setting BOOTIMG_EXTRA_SPACE=0 and building core-image-minimal
and core-image-sato for fri2-noemgd from meta-intel.

(From OE-Core rev: 68aa18609c10a3ae2f738930c933fa2a95ce8959)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/classes/bootimg.bbclass |   45 +++++++++++++++++++++++++++++++++--------
 1 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index bcae2ae..c2d43c8 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -62,19 +62,46 @@ build_boot_bin() {
 
 	install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys
 
-	# Determine the 1024 byte block count for the final image.
-	BLOCKS=`du --apparent-size -ks ${HDDDIR} | cut -f 1`
-	SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
+	# Calculate the size required for the final image including the
+	# data and filesystem overhead.
+	# Sectors: 512 bytes
+	#  Blocks: 1024 bytes
+
+	# Determine the sector count just for the data
+	SECTORS=$(expr $(du --apparent-size -ks ${HDDDIR} | cut -f 1) \* 2)
+
+	# Account for the filesystem overhead. This includes directory
+	# entries in the clusters as well as the FAT itself.
+	# Assumptions:
+	#   < 16 entries per directory
+	#   8.3 filenames only
+
+	# 32 bytes per dir entry
+	DIR_BYTES=$(expr $(find ${HDDDIR} | tail -n +2 | wc -l) \* 32)
+	# 32 bytes for every end-of-directory dir entry
+	DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 32))
+	# 4 bytes per FAT entry per sector of data
+	FAT_BYTES=$(expr $SECTORS \* 4)
+	# 4 bytes per FAT entry per end-of-cluster list
+	FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${HDDDIR} -type d | tail -n +2 | wc -l) \* 4))
+
+	# Use a ceiling function to determine FS overhead in sectors
+	DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
+	# There are two FATs on the image
+	FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
+	SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
+
+	# Determine the final size in blocks accounting for some padding
+	BLOCKS=$(expr $(expr $SECTORS \* 2) + ${BOOTIMG_EXTRA_SPACE})
 
 	# Ensure total sectors is an integral number of sectors per
-	# track or mcopy will complain. Sectors are 512 bytes, and and
-	# we generate images with 32 sectors per track. This calculation
-	# is done in blocks, which are twice the size of sectors, thus
-	# the 16 instead of 32.
-	SIZE=$(expr $SIZE + $(expr 16 - $(expr $SIZE % 16)))
+	# track or mcopy will complain. Sectors are 512 bytes, and we
+	# generate images with 32 sectors per track. This calculation is
+	# done in blocks, thus the mod by 16 instead of 32.
+	BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
 
 	IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-	mkdosfs -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${SIZE}
+	mkdosfs -F 32 -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
 	# Copy HDDDIR recursively into the image file directly
 	mcopy -i ${IMG} -s ${HDDDIR}/* ::/
 
-- 
1.7.5.4



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

* [PATCH 3/8] bootimg: Fix a math thinko in the block count calculation
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
  2012-04-11 17:51 ` [PATCH 1/8] bootimg: Use mcopy to construct the hddimg Darren Hart
  2012-04-11 17:51 ` [PATCH 2/8] bootimg: Account for FAT filesystem overhead in image size Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  2012-04-11 17:51 ` [PATCH 4/8] bootimg: Do not force FAT32 on all images, it violates the FAT specification Darren Hart
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

Fixes [YOCTO #1852] ... again.

The conversion from sectors to blocks was multiplying by 2 instead
of dividing by 2. Blocks are 1024 bytes, sectors are 512 bytes. The
result was images being much larger than intended.

Reported-by: Tom Zanussi <tom.zanussi@intel.com>
(From OE-Core rev: b35384fa3ca96b31c63d764322215abced2066e4)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/classes/bootimg.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index c2d43c8..489819b 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -92,7 +92,8 @@ build_boot_bin() {
 	SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
 
 	# Determine the final size in blocks accounting for some padding
-	BLOCKS=$(expr $(expr $SECTORS \* 2) + ${BOOTIMG_EXTRA_SPACE})
+	BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
+
 
 	# Ensure total sectors is an integral number of sectors per
 	# track or mcopy will complain. Sectors are 512 bytes, and we
-- 
1.7.5.4



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

* [PATCH 4/8] bootimg: Do not force FAT32 on all images, it violates the FAT specification
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
                   ` (2 preceding siblings ...)
  2012-04-11 17:51 ` [PATCH 3/8] bootimg: Fix a math thinko in the block count calculation Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  2012-04-11 17:51 ` [PATCH 5/8] dosfstools: Add SRC_URI Checksum Darren Hart
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

Fixes [YOCTO #1940]

do_bootimg was performing the FAT overhead calculations assuming FAT32 and then
forcing the use of FAT32 with "-F 32" to mkdosfs. The FAT specification is clear
on cluster count being the determining factor for FAT size (even if the fs
string is set to FAT32, go figure). Syslinux follows this spec, and rightly so,
resulting in a failure on core-image-minimal:

	syslinux: zero FAT sectors (FAT12/16)

Drop the "-F 32" from mkdosfs to allow it to select the appropriate FAT size
based on cluster count. Leave the FAT overhead calculation in FAT32. This will
result in a little extra padding for really small images, but not enough extra
to justify recalculating for FAT12 and FAT16.

Tested with a core-image-minimal build for atom-pc. do_bootimg completed
successfully, and the resulting image was FAT16.

(From OE-Core rev: 634137704dd1a205e377a1131ef708f1c981f6b2)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Backported to edison by Darren Hart.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/classes/bootimg.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index 489819b..09f5b67 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -73,6 +73,9 @@ build_boot_bin() {
 	# Account for the filesystem overhead. This includes directory
 	# entries in the clusters as well as the FAT itself.
 	# Assumptions:
+	#   FAT32 (12 or 16 may be selected by mkdosfs, but the extra
+	#   padding will be minimal on those smaller images and not
+	#   worth the logic here to caclulate the smaller FAT sizes)
 	#   < 16 entries per directory
 	#   8.3 filenames only
 
@@ -102,7 +105,7 @@ build_boot_bin() {
 	BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
 
 	IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
-	mkdosfs -F 32 -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
+	mkdosfs -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS}
 	# Copy HDDDIR recursively into the image file directly
 	mcopy -i ${IMG} -s ${HDDDIR}/* ::/
 
-- 
1.7.5.4



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

* [PATCH 5/8] dosfstools: Add SRC_URI Checksum
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
                   ` (3 preceding siblings ...)
  2012-04-11 17:51 ` [PATCH 4/8] bootimg: Do not force FAT32 on all images, it violates the FAT specification Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  2012-04-11 17:51 ` [PATCH 6/8] dosfstools: add Upstream-Status to patches Darren Hart
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

From: Saul Wold <sgw@linux.intel.com>

(From OE-Core rev: a19bfc10e60ddc7e9317654ca7565d39acbc3987)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../recipes-devtools/dosfstools/dosfstools_2.10.bb |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-devtools/dosfstools/dosfstools_2.10.bb b/meta/recipes-devtools/dosfstools/dosfstools_2.10.bb
index 1beb5dd..c23c02d 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools_2.10.bb
+++ b/meta/recipes-devtools/dosfstools/dosfstools_2.10.bb
@@ -7,7 +7,7 @@ DESCRIPTION = "DOS FAT Filesystem Utilities"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://mkdosfs/COPYING;md5=cbe67f08d6883bff587f615f0cc81aa8"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-${PV}.src.tar.gz \
 	   file://alignment_hack.patch \
@@ -15,6 +15,9 @@ SRC_URI = "ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-${PV}
            file://msdos_fat12_undefined.patch \
 	   file://include-linux-types.patch"
 
+SRC_URI[md5sum] = "59a02f311a891af8787c4c9e28c6b89b"
+SRC_URI[sha256sum] = "55a7b2f5ea4506bde935ee3145573e1773427fc72283a36796c7c2cf861dd064"
+
 do_install () {
 	oe_runmake "PREFIX=${D}" "SBINDIR=${D}${sbindir}" \
 		   "MANDIR=${D}${mandir}/man8" install
-- 
1.7.5.4



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

* [PATCH 6/8] dosfstools: add Upstream-Status to patches
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
                   ` (4 preceding siblings ...)
  2012-04-11 17:51 ` [PATCH 5/8] dosfstools: Add SRC_URI Checksum Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  2012-04-11 17:51 ` [PATCH 7/8] dosfstools: update native to 2.11 Darren Hart
  2012-04-11 17:51 ` [PATCH 8/8] dosfstools: Add patch to disable fat32 autoselection and behave as 2.10 Darren Hart
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

From: Scott Garman <scott.a.garman@intel.com>

(From OE-Core rev: 735a3e5d3399e29e4d6fa82dabbdd1687eaa29e9)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../dosfstools/dosfstools/2.6.20-syscall.patch     |    7 +++++++
 .../dosfstools/dosfstools/alignment_hack.patch     |    4 ++++
 .../dosfstools/dosfstools-msdos_fs-types.patch     |    7 +++++++
 .../dosfstools/include-linux-types.patch           |    5 +++++
 .../dosfstools/dosfstools/mkdosfs-bootcode.patch   |    7 +++++++
 .../dosfstools/dosfstools/mkdosfs-dir.patch        |    7 +++++++
 .../dosfstools/msdos_fat12_undefined.patch         |    7 +++++++
 7 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch b/meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch
index 7cf2662..4460f06 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch
@@ -1,3 +1,10 @@
+Only use the system's llseek().
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 Index: dosfstools-2.10/dosfsck/io.c
 ===================================================================
 --- dosfstools-2.10.orig/dosfsck/io.c	2007-06-07 16:15:52.000000000 +0200
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch b/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
index e15060a..b46b2db 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
@@ -8,6 +8,10 @@ memcpy into an 16bit aligned
 
     -zecke
 
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
 
 --- dosfstools/dosfsck/boot.c.orig	2003-05-15 19:32:23.000000000 +0200
 +++ dosfstools/dosfsck/boot.c	2003-06-13 17:44:25.000000000 +0200
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch b/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
index e70a3ea..35abd1a 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
@@ -1,3 +1,10 @@
+Ensure the __s8 type is properly defined.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 --- dosfstools-2.10/dosfsck/dosfsck.h.org	2006-02-21 08:36:14.000000000 -0700
 +++ dosfstools-2.10/dosfsck/dosfsck.h	2006-02-21 08:40:12.000000000 -0700
 @@ -22,6 +22,14 @@
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch b/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
index 4bbd4e7..ab5c8cf 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
@@ -5,6 +5,11 @@ include asm/types.h. To work around this patch mkdosfs.c to explicity
 include linux/types.h which will in turn pull in asm/types.h which
 defines these variables.
 
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 --- dosfstools-2.10/mkdosfs/mkdosfs.c~	2006-07-12 18:46:21.000000000 +1000
 +++ dosfstools-2.10/mkdosfs/mkdosfs.c	2006-07-12 18:46:21.000000000 +1000
 @@ -60,6 +60,7 @@
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
index 52be862..dd5cc7f 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
@@ -1,3 +1,10 @@
+Add option to read in bootcode from a file.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 diff -urN dosfstools-2.10.orig/mkdosfs/ChangeLog dosfstools-2.10/mkdosfs/ChangeLog
 --- dosfstools-2.10.orig/mkdosfs/ChangeLog	1997-06-18 03:09:38.000000000 -0700
 +++ dosfstools-2.10/mkdosfs/ChangeLog	2004-08-02 20:57:57.734939816 -0700
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
index 8f753b0..7feee0f 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
@@ -1,3 +1,10 @@
+Add -s <directory> support to populate the image.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs.c
 --- dosfstools-2.10.orig/mkdosfs/mkdosfs.c	2004-08-02 20:48:45.000000000 -0700
 +++ dosfstools-2.10/mkdosfs/mkdosfs.c	2004-08-02 20:49:44.296953792 -0700
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch b/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
index 4987aa3..11e8a75 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
@@ -1,3 +1,10 @@
+Fix a compilation error due to undefined MSDOS_FAT12.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
 --- dosfstools-2.10/dosfsck/boot.c.orig	2004-10-15 08:51:42.394725176 -0600
 +++ dosfstools-2.10/dosfsck/boot.c	2004-10-15 08:49:16.776862456 -0600
 @@ -14,6 +14,9 @@
-- 
1.7.5.4



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

* [PATCH 7/8] dosfstools: update native to 2.11
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
                   ` (5 preceding siblings ...)
  2012-04-11 17:51 ` [PATCH 6/8] dosfstools: add Upstream-Status to patches Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  2012-04-11 17:51 ` [PATCH 8/8] dosfstools: Add patch to disable fat32 autoselection and behave as 2.10 Darren Hart
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

From: Otavio Salvador <otavio@ossystems.com.br>

This unify recipes for target and native builds and also drops the the
already merged patches.

(From OE-Core rev: 3a401ddce55e185c8ccfdc43c1440fd77daff9ae)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../dosfstools/dosfstools-native_2.10.bb           |   19 -----
 .../dosfstools/dosfstools/2.6.20-syscall.patch     |   72 -------------------
 .../dosfstools/dosfstools-2.10-kernel-2.6.patch    |   74 --------------------
 .../dosfstools/dosfstools/mkdosfs-bootcode.patch   |   68 ++++++++----------
 .../dosfstools/dosfstools/mkdosfs-dir.patch        |   62 ++++++++---------
 .../recipes-devtools/dosfstools/dosfstools_2.10.bb |   24 ------
 .../recipes-devtools/dosfstools/dosfstools_2.11.bb |   11 ++-
 7 files changed, 69 insertions(+), 261 deletions(-)
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools-native_2.10.bb
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools/dosfstools-2.10-kernel-2.6.patch
 delete mode 100644 meta/recipes-devtools/dosfstools/dosfstools_2.10.bb

diff --git a/meta/recipes-devtools/dosfstools/dosfstools-native_2.10.bb b/meta/recipes-devtools/dosfstools/dosfstools-native_2.10.bb
deleted file mode 100644
index 91ff11f..0000000
--- a/meta/recipes-devtools/dosfstools/dosfstools-native_2.10.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-# dosfstools-native OE build file
-# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
-# Released under the MIT license (see packages/COPYING)
-
-require dosfstools_${PV}.bb
-
-PR="r5"
-
-SRC_URI = "ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-${PV}.src.tar.gz \
-	file://mkdosfs-bootcode.patch \
-	file://mkdosfs-dir.patch \
-	file://alignment_hack.patch \
-	file://dosfstools-2.10-kernel-2.6.patch \
-	file://msdos_fat12_undefined.patch \
-	file://dosfstools-msdos_fs-types.patch \
-	file://include-linux-types.patch \
-	file://2.6.20-syscall.patch"
-
-inherit native
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch b/meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch
deleted file mode 100644
index 4460f06..0000000
--- a/meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-Only use the system's llseek().
-
-Upstream-Status: Inappropriate [licensing]
-We're tracking an old release of dosfstools due to licensing issues.
-
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
-
-Index: dosfstools-2.10/dosfsck/io.c
-===================================================================
---- dosfstools-2.10.orig/dosfsck/io.c	2007-06-07 16:15:52.000000000 +0200
-+++ dosfstools-2.10/dosfsck/io.c	2007-06-07 16:16:06.000000000 +0200
-@@ -42,28 +42,11 @@
- /* Use the _llseek system call directly, because there (once?) was a bug in
-  * the glibc implementation of it. */
- #include <linux/unistd.h>
--#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__
- /* On alpha, the syscall is simply lseek, because it's a 64 bit system. */
- static loff_t llseek( int fd, loff_t offset, int whence )
- {
-     return lseek(fd, offset, whence);
- }
--#else
--# ifndef __NR__llseek
--# error _llseek system call not present
--# endif
--static _syscall5( int, _llseek, uint, fd, ulong, hi, ulong, lo,
--		  loff_t *, res, uint, wh );
--
--static loff_t llseek( int fd, loff_t offset, int whence )
--{
--    loff_t actual;
--
--    if (_llseek(fd, offset>>32, offset&0xffffffff, &actual, whence) != 0)
--	return (loff_t)-1;
--    return actual;
--}
--#endif
- 
- 
- void fs_open(char *path,int rw)
-Index: dosfstools-2.10/mkdosfs/mkdosfs.c
-===================================================================
---- dosfstools-2.10.orig/mkdosfs/mkdosfs.c	2007-06-07 16:15:11.000000000 +0200
-+++ dosfstools-2.10/mkdosfs/mkdosfs.c	2007-06-07 16:15:30.000000000 +0200
-@@ -116,27 +116,11 @@
- /* Use the _llseek system call directly, because there (once?) was a bug in
-  * the glibc implementation of it. */
- #include <linux/unistd.h>
--#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__
- /* On alpha, the syscall is simply lseek, because it's a 64 bit system. */
- static loff_t llseek( int fd, loff_t offset, int whence )
- {
-     return lseek(fd, offset, whence);
- }
--#else
--# ifndef __NR__llseek
--# error _llseek system call not present
--# endif
--static _syscall5( int, _llseek, uint, fd, ulong, hi, ulong, lo,
--		  loff_t *, res, uint, wh );
--static loff_t llseek( int fd, loff_t offset, int whence )
--{
--    loff_t actual;
--
--    if (_llseek(fd, offset>>32, offset&0xffffffff, &actual, whence) != 0)
--	return (loff_t)-1;
--    return actual;
--}
--#endif
- 
- #define ROUND_UP(value, divisor) (value + (divisor - (value % divisor))) / divisor
- 
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-2.10-kernel-2.6.patch b/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-2.10-kernel-2.6.patch
deleted file mode 100644
index 0c9230f..0000000
--- a/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-2.10-kernel-2.6.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
-Date: 2004-02-09
-Initial Package Version: 2.6
-Origin: Jim Gifford
-Upstream-Status: Accepted
-Description: Fixes Compile Issues with the 2.6 Kernel
- 
---- dosfstools-2.10/dosfsck/common.h.orig	2004-02-09 18:37:59.056737458 +0000
-+++ dosfstools-2.10/dosfsck/common.h	2004-02-09 18:38:18.333392952 +0000
-@@ -2,6 +2,13 @@
- 
- /* Written 1993 by Werner Almesberger */
- 
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-+       #define __KERNEL__
-+       #include <asm/types.h>
-+       #undef __KERNEL__
-+       #define MSDOS_FAT12 4084 /* maximum number of clusters in a 12 bit FAT */
-+#endif
- 
- #ifndef _COMMON_H
- #define _COMMON_H
---- dosfstools-2.10/dosfsck/file.c.orig	2004-02-09 18:40:52.016728845 +0000
-+++ dosfstools-2.10/dosfsck/file.c	2004-02-09 18:40:03.665117865 +0000
-@@ -15,6 +15,14 @@
- #define _LINUX_STAT_H		/* hack to avoid inclusion of <linux/stat.h> */
- #define _LINUX_STRING_H_	/* hack to avoid inclusion of <linux/string.h>*/
- #define _LINUX_FS_H             /* hack to avoid inclusion of <linux/fs.h> */
-+
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-+       #define __KERNEL__
-+       #include <asm/types.h>
-+       #undef __KERNEL__
-+#endif
-+
- #include <linux/msdos_fs.h>
- 
- #include "common.h"
---- dosfstools-2.10/dosfsck/dosfsck.h.orig	2004-02-09 18:57:11.022870974 +0000
-+++ dosfstools-2.10/dosfsck/dosfsck.h	2004-02-09 18:56:20.628614393 +0000
-@@ -13,6 +13,15 @@
- #define _LINUX_STAT_H		/* hack to avoid inclusion of <linux/stat.h> */
- #define _LINUX_STRING_H_	/* hack to avoid inclusion of <linux/string.h>*/
- #define _LINUX_FS_H             /* hack to avoid inclusion of <linux/fs.h> */
-+
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-+       #define __KERNEL__
-+       #include <asm/types.h>
-+       #include <asm/byteorder.h>
-+       #undef __KERNEL__
-+#endif
-+
- #include <linux/msdos_fs.h>
- 
- /* 2.1 kernels use le16_to_cpu() type functions for CF_LE_W & Co., but don't
---- dosfstools-2.10/mkdosfs/mkdosfs.c.orig	2004-02-09 18:31:41.997157413 +0000
-+++ dosfstools-2.10/mkdosfs/mkdosfs.c	2004-02-09 18:34:07.311945252 +0000
-@@ -66,6 +66,13 @@
- #include <time.h>
- #include <errno.h>
- 
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-+       #define __KERNEL__
-+       #include <asm/types.h>
-+       #undef __KERNEL__
-+#endif
-+
- #if __BYTE_ORDER == __BIG_ENDIAN
- 
- #include <asm/byteorder.h>
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
index dd5cc7f..ae21bee 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
@@ -5,9 +5,10 @@ We're tracking an old release of dosfstools due to licensing issues.
 
 Signed-off-by: Scott Garman <scott.a.garman@intel.com>
 
-diff -urN dosfstools-2.10.orig/mkdosfs/ChangeLog dosfstools-2.10/mkdosfs/ChangeLog
---- dosfstools-2.10.orig/mkdosfs/ChangeLog	1997-06-18 03:09:38.000000000 -0700
-+++ dosfstools-2.10/mkdosfs/ChangeLog	2004-08-02 20:57:57.734939816 -0700
+Index: dosfstools-2.11/mkdosfs/ChangeLog
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/ChangeLog	1997-06-18 10:09:38.000000000 +0000
++++ dosfstools-2.11/mkdosfs/ChangeLog	2011-12-06 12:14:23.634011558 +0000
 @@ -1,3 +1,14 @@
 +19th June 2003			Sam Bingner (sam@bingner.com)
 +
@@ -23,10 +24,11 @@ diff -urN dosfstools-2.10.orig/mkdosfs/ChangeLog dosfstools-2.10/mkdosfs/ChangeL
  28th January 1995		H. Peter Anvin (hpa@yggdrasil.com)
  
  	Better algorithm to select cluster sizes on large filesystems.
-diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.8 dosfstools-2.10/mkdosfs/mkdosfs.8
---- dosfstools-2.10.orig/mkdosfs/mkdosfs.8	2003-05-15 11:28:28.000000000 -0700
-+++ dosfstools-2.10/mkdosfs/mkdosfs.8	2004-08-02 20:57:57.735939664 -0700
-@@ -40,6 +40,10 @@
+Index: dosfstools-2.11/mkdosfs/mkdosfs.8
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.8	2004-02-25 19:36:07.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.8	2011-12-06 12:19:54.777888434 +0000
+@@ -44,6 +44,10 @@
  .I message-file
  ]
  [
@@ -37,7 +39,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.8 dosfstools-2.10/mkdosfs/mkdosfs
  .B \-n
  .I volume-name
  ]
-@@ -155,6 +159,18 @@
+@@ -165,6 +169,18 @@
  carriage return-line feed combinations, and tabs have been expanded.
  If the filename is a hyphen (-), the text is taken from standard input. 
  .TP
@@ -56,21 +58,22 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.8 dosfstools-2.10/mkdosfs/mkdosfs
  .BI \-n " volume-name"
  Sets the volume name (label) of the filesystem.  The volume name can
  be up to 11 characters long.  The default is no label.
-@@ -188,8 +204,9 @@
+@@ -198,8 +214,9 @@
  simply will not support it ;)
  .SH AUTHOR
  Dave Hudson - <dave@humbug.demon.co.uk>; modified by Peter Anvin
 -<hpa@yggdrasil.com>. Fixes and additions by Roman Hodek
--<Roman.Hodek@informatik.uni-erlangen.de> for Debian/GNU Linux.
+-<roman@hodek.net> for Debian/GNU Linux.
 +<hpa@yggdrasil.com> and Sam Bingner <sam@bingner.com>. Fixes and
 +additions by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
 +for Debian/GNU Linux.
  .SH ACKNOWLEDGEMENTS
  .B mkdosfs
  is based on code from
-diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs.c
---- dosfstools-2.10.orig/mkdosfs/mkdosfs.c	2003-06-14 13:07:08.000000000 -0700
-+++ dosfstools-2.10/mkdosfs/mkdosfs.c	2004-08-02 20:57:57.736939512 -0700
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2005-03-12 16:12:16.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-06 12:27:55.121886076 +0000
 @@ -24,6 +24,12 @@
     - New options -A, -S, -C
     - Support for filesystems > 2GB
@@ -84,7 +87,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
     
     Copying:     Copyright 1993, 1994 David Hudson (dave@humbug.demon.co.uk)
  
-@@ -167,6 +173,8 @@
+@@ -153,6 +159,8 @@
  #define FAT_BAD      0x0ffffff7
  
  #define MSDOS_EXT_SIGN 0x29	/* extended boot sector signature */
@@ -93,7 +96,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  #define MSDOS_FAT12_SIGN "FAT12   "	/* FAT12 filesystem signature */
  #define MSDOS_FAT16_SIGN "FAT16   "	/* FAT16 filesystem signature */
  #define MSDOS_FAT32_SIGN "FAT32   "	/* FAT32 filesystem signature */
-@@ -188,6 +196,8 @@
+@@ -175,6 +183,8 @@
  #define BOOTCODE_SIZE		448
  #define BOOTCODE_FAT32_SIZE	420
  
@@ -102,7 +105,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  /* __attribute__ ((packed)) is used on all structures to make gcc ignore any
   * alignments */
  
-@@ -215,7 +225,7 @@
+@@ -202,7 +212,7 @@
    __u16         fat_length;	/* sectors/FAT */
    __u16         secs_track;	/* sectors per track */
    __u16         heads;		/* number of heads */
@@ -111,7 +114,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
    __u32         total_sect;	/* number of sectors (if sectors == 0) */
    union {
      struct {
-@@ -298,6 +308,8 @@
+@@ -285,6 +295,8 @@
  
  /* Global variables - the root of all evil :-) - see these and weep! */
  
@@ -120,7 +123,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  static char *program_name = "mkdosfs";	/* Name of the program */
  static char *device_name = NULL;	/* Name of the device on which to create the filesystem */
  static int atari_format = 0;	/* Use Atari variation of MS-DOS FS format */
-@@ -842,6 +854,12 @@
+@@ -837,6 +849,12 @@
      vi->volume_id[2] = (unsigned char) ((volume_id & 0x00ff0000) >> 16);
      vi->volume_id[3] = (unsigned char) (volume_id >> 24);
    }
@@ -133,16 +136,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  
    if (!atari_format) {
      memcpy(vi->volume_label, volume_name, 11);
-@@ -886,7 +904,7 @@
-     printf( "Using %d reserved sectors\n", reserved_sectors );
-   bs.fats = (char) nr_fats;
-   if (!atari_format || size_fat == 32)
--    bs.hidden = CT_LE_L(0);
-+    bs.hidden = bs.secs_track;
-   else
-     /* In Atari format, hidden is a 16 bit field */
-     memset( &bs.hidden, 0, 2 );
-@@ -1358,6 +1376,32 @@
+@@ -1362,6 +1380,32 @@
     * dir area on FAT12/16, and the first cluster on FAT32. */
    writebuf( (char *) root_dir, size_root_dir, "root directory" );
  
@@ -156,9 +150,9 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
 +      seekto( 512*2, "third sector" );
 +      if (backup_boot != 0) {
 +        writebuf( template_boot_code+512*2, backup_boot*sector_size - 512*2, "data to backup boot" );
-+	seekto( backup_boot*sector_size, "backup boot sector" );
++        seekto( backup_boot*sector_size, "backup boot sector" );
 +        writebuf( template_boot_code, 3, "backup jmpBoot" );
-+	seekto( backup_boot*sector_size+0x5a, "backup boot sector boot area" );
++        seekto( backup_boot*sector_size+0x5a, "backup boot sector boot area" );
 +        writebuf( template_boot_code+0x5a, 420, "backup boot sector boot area" );
 +        seekto( (backup_boot+2)*sector_size, "sector following backup code" );
 +        writebuf( template_boot_code+(backup_boot+2)*sector_size, (reserved_sectors-backup_boot-2)*512, "remaining data" );
@@ -172,28 +166,28 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
 +    }
 +  }
 +
+   if (blank_sector) free( blank_sector );
    if (info_sector) free( info_sector );
    free (root_dir);   /* Free up the root directory space from setup_tables */
-   free (fat);  /* Free up the fat table space reserved during setup_tables */
-@@ -1371,7 +1415,7 @@
+@@ -1376,7 +1420,7 @@
  {
    fatal_error("\
  Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]\n\
 -       [-m boot-msg-file] [-n volume-name] [-i volume-id]\n\
 +       [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
         [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
-        [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
+        [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
         /dev/name [blocks]\n");
-@@ -1433,7 +1477,7 @@
+@@ -1439,7 +1483,7 @@
    printf ("%s " VERSION " (" VERSION_DATE ")\n",
  	   program_name);
  
--  while ((c = getopt (argc, argv, "AcCf:F:Ii:l:m:n:r:R:s:S:v")) != EOF)
-+  while ((c = getopt (argc, argv, "AcCf:F:Ii:l:m:n:r:R:s:S:v:B:b")) != EOF)
+-  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:h:v")) != EOF)
++  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
      /* Scan the command line for options */
      switch (c)
        {
-@@ -1494,6 +1538,51 @@
+@@ -1509,6 +1553,51 @@
  	listfile = optarg;
  	break;
  
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
index 7feee0f..3ba4711 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
+++ b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
@@ -1,13 +1,14 @@
-Add -s <directory> support to populate the image.
+Add -d <directory> support to populate the image.
 
 Upstream-Status: Inappropriate [licensing]
 We're tracking an old release of dosfstools due to licensing issues.
 
 Signed-off-by: Scott Garman <scott.a.garman@intel.com>
 
-diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs.c
---- dosfstools-2.10.orig/mkdosfs/mkdosfs.c	2004-08-02 20:48:45.000000000 -0700
-+++ dosfstools-2.10/mkdosfs/mkdosfs.c	2004-08-02 20:49:44.296953792 -0700
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2011-12-06 12:27:55.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-06 12:37:13.445950703 +0000
 @@ -18,6 +18,10 @@
     as a rule), and not the block.  For example the boot block does not
     occupy a full cluster.
@@ -26,18 +27,18 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
 +#include <libgen.h>
 +#include <dirent.h>
  
- #if __BYTE_ORDER == __BIG_ENDIAN
- 
-@@ -124,6 +130,8 @@
- }
- #endif
+ #include <linux/version.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+@@ -110,6 +116,8 @@
+  * sufficient (or even better :) for 64 bit offsets in the meantime */
+ #define llseek lseek
  
 +#define ROUND_UP(value, divisor) (value + (divisor - (value % divisor))) / divisor
 +
  /* Constant definitions */
  
  #define TRUE 1			/* Boolean constants */
-@@ -163,7 +171,6 @@
+@@ -149,7 +157,6 @@
  #define ATTR_VOLUME  8		/* volume label */
  #define ATTR_DIR     16		/* directory */
  #define ATTR_ARCH    32		/* archived */
@@ -45,7 +46,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  #define ATTR_NONE    0		/* no attribute bits */
  #define ATTR_UNUSED  (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
  	/* attribute bits that are copied "as is" */
-@@ -258,6 +265,19 @@
+@@ -245,6 +252,19 @@
    __u32		reserved2[4];
  };
  
@@ -65,7 +66,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  struct msdos_dir_entry
    {
      char	name[8], ext[3];	/* name and extension */
-@@ -306,6 +326,15 @@
+@@ -293,6 +313,15 @@
  
  #define MESSAGE_OFFSET 29	/* Offset of message in above code */
  
@@ -81,7 +82,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  /* Global variables - the root of all evil :-) - see these and weep! */
  
  static char *template_boot_code;	/* Variable to store a full template boot sector in */
-@@ -339,6 +368,9 @@
+@@ -326,6 +355,9 @@
  static int size_root_dir;	/* Size of the root directory in bytes */
  static int sectors_per_cluster = 0;	/* Number of sectors per disk cluster */
  static int root_dir_entries = 0;	/* Number of root directory entries */
@@ -89,9 +90,9 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
 +static int last_cluster_written = 0;
 +
  static char *blank_sector;		/* Blank sector - all zeros */
+ static int hidden_sectors = 0;		/* Number of hidden sectors */
  
- 
-@@ -411,7 +443,6 @@
+@@ -399,7 +431,6 @@
    }
  }
  
@@ -99,7 +100,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  /* Mark a specified sector as having a particular value in it's FAT entry */
  
  static void
-@@ -1262,6 +1293,9 @@
+@@ -1266,6 +1297,9 @@
        die ("unable to allocate space for root directory in memory");
      }
  
@@ -109,7 +110,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
    memset(root_dir, 0, size_root_dir);
    if ( memcmp(volume_name, "           ", 11) )
      {
-@@ -1310,11 +1344,11 @@
+@@ -1314,11 +1348,11 @@
    }
    
    if (!(blank_sector = malloc( sector_size )))
@@ -124,7 +125,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  /* Write the new filesystem's data tables to wherever they're going to end up! */
  
  #define error(str)				\
-@@ -1336,7 +1370,7 @@
+@@ -1340,7 +1374,7 @@
    do {							\
      int __size = (size);				\
      if (write (dev, buf, __size) != __size)		\
@@ -133,7 +134,7 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
    } while(0)
  
  
-@@ -1407,6 +1441,452 @@
+@@ -1412,6 +1446,452 @@
    free (fat);  /* Free up the fat table space reserved during setup_tables */
  }
  
@@ -586,19 +587,16 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
  
  /* Report the command usage and return a failure error code */
  
-@@ -1418,9 +1898,9 @@
+@@ -1423,7 +1903,7 @@
         [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
         [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
-        [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
+        [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
 -       /dev/name [blocks]\n");
 +       [-d directory] /dev/name [blocks]\n");
  }
--
-+	
+ 
  /*
-  * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
-  * of MS-DOS filesystem by default.
-@@ -1458,6 +1938,8 @@
+@@ -1463,6 +1943,8 @@
    int c;
    char *tmp;
    char *listfile = NULL;
@@ -607,27 +605,27 @@ diff -urN dosfstools-2.10.orig/mkdosfs/mkdosfs.c dosfstools-2.10/mkdosfs/mkdosfs
    FILE *msgfile;
    struct stat statbuf;
    int i = 0, pos, ch;
-@@ -1477,7 +1959,7 @@
+@@ -1483,7 +1965,7 @@
    printf ("%s " VERSION " (" VERSION_DATE ")\n",
  	   program_name);
  
--  while ((c = getopt (argc, argv, "AcCf:F:Ii:l:m:n:r:R:s:S:v:B:b")) != EOF)
-+  while ((c = getopt (argc, argv, "AcCd:f:F:Ii:l:m:n:r:R:s:S:v:B:b")) != EOF)
+-  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
++  while ((c = getopt (argc, argv, "AbcCd:f:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
      /* Scan the command line for options */
      switch (c)
        {
-@@ -1502,6 +1984,10 @@
+@@ -1508,6 +1990,10 @@
  	create = TRUE;
  	break;
  
-+      case 'd':
++  case 'd':
 +	dirname = optarg;
 +	break;
 +
        case 'f':		/* f : Choose number of FATs */
  	nr_fats = (int) strtol (optarg, &tmp, 0);
  	if (*tmp || nr_fats < 1 || nr_fats > 4)
-@@ -1796,8 +2282,10 @@
+@@ -1811,8 +2297,10 @@
    else if (listfile)
      get_list_blocks (listfile);
  
diff --git a/meta/recipes-devtools/dosfstools/dosfstools_2.10.bb b/meta/recipes-devtools/dosfstools/dosfstools_2.10.bb
deleted file mode 100644
index c23c02d..0000000
--- a/meta/recipes-devtools/dosfstools/dosfstools_2.10.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-# dosfstools OE build file
-# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
-# Released under the MIT license (see packages/COPYING)
-
-DESCRIPTION = "DOS FAT Filesystem Utilities"
-
-SECTION = "base"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://mkdosfs/COPYING;md5=cbe67f08d6883bff587f615f0cc81aa8"
-PR = "r3"
-
-SRC_URI = "ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-${PV}.src.tar.gz \
-	   file://alignment_hack.patch \
-	   file://dosfstools-2.10-kernel-2.6.patch \
-           file://msdos_fat12_undefined.patch \
-	   file://include-linux-types.patch"
-
-SRC_URI[md5sum] = "59a02f311a891af8787c4c9e28c6b89b"
-SRC_URI[sha256sum] = "55a7b2f5ea4506bde935ee3145573e1773427fc72283a36796c7c2cf861dd064"
-
-do_install () {
-	oe_runmake "PREFIX=${D}" "SBINDIR=${D}${sbindir}" \
-		   "MANDIR=${D}${mandir}/man8" install
-}
diff --git a/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
index 944d873..7d0080c 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
+++ b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
@@ -7,12 +7,15 @@ DESCRIPTION = "DOS FAT Filesystem Utilities"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://mkdosfs/COPYING;md5=cbe67f08d6883bff587f615f0cc81aa8"
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-${PV}.src.tar.gz \
-	   file://alignment_hack.patch \
+           file://mkdosfs-bootcode.patch \
+           file://mkdosfs-dir.patch \
+           file://alignment_hack.patch \
            file://msdos_fat12_undefined.patch \
-	   file://include-linux-types.patch"
+           file://dosfstools-msdos_fs-types.patch \
+           file://include-linux-types.patch"
 
 SRC_URI[md5sum] = "407d405ade410f7597d364ab5dc8c9f6"
 SRC_URI[sha256sum] = "0eac6d12388b3d9ed78684529c1b0d9346fa2abbe406c4d4a3eb5a023c98a484"
@@ -21,3 +24,5 @@ do_install () {
 	oe_runmake "PREFIX=${D}" "SBINDIR=${D}${sbindir}" \
 		   "MANDIR=${D}${mandir}/man8" install
 }
+
+BBCLASSEXTEND = "native"
-- 
1.7.5.4



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

* [PATCH 8/8] dosfstools: Add patch to disable fat32 autoselection and behave as 2.10
  2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
                   ` (6 preceding siblings ...)
  2012-04-11 17:51 ` [PATCH 7/8] dosfstools: update native to 2.11 Darren Hart
@ 2012-04-11 17:51 ` Darren Hart
  7 siblings, 0 replies; 9+ messages in thread
From: Darren Hart @ 2012-04-11 17:51 UTC (permalink / raw)
  To: Yocto Project, josh, josh

From: Richard Purdie <richard.purdie@linuxfoundation.org>

It appears msdos image population and fat32 images are incompatible.
This reverts to the 2.10 behaviour of defaulting to fat16 instead of
using fat32 for large images, allowing image generation to work
correctly. This is a workaround and a proper fix is really needed.

(From OE-Core rev: c2de8d41236cf1293db9e6c69d69e8d14f55ffd1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../dosfstools/dosfstools/nofat32_autoselect.patch |   27 ++++++++++++++++++++
 .../recipes-devtools/dosfstools/dosfstools_2.11.bb |    5 ++-
 2 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch

diff --git a/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch b/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
new file mode 100644
index 0000000..21ebc10
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
@@ -0,0 +1,27 @@
+FAT32 appears to be broken when used with the -d option to populate the msdos
+image. This disables the FAT32 autoselection code which means we don't get
+broken images with the -d option. It can still be enabled on the commandline
+at the users own risk. This changes us back to the 2.10 version's behaviour
+which was known to work well even with large images.
+
+Upstream Status: Inapprioriate [depends on other patches we apply]
+
+RP 2011/12/13
+
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2011-12-13 13:54:37.538509391 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-13 13:55:10.258508631 +0000
+@@ -808,10 +808,12 @@
+       bs.media = (char) 0xf8; /* Set up the media descriptor for a hard drive */
+       bs.dir_entries[0] = (char) 0;	/* Default to 512 entries */
+       bs.dir_entries[1] = (char) 2;
++/*
+       if (!size_fat && blocks*SECTORS_PER_BLOCK > 1064960) {
+ 	  if (verbose) printf("Auto-selecting FAT32 for large filesystem\n");
+ 	  size_fat = 32;
+       }
++*/
+       if (size_fat == 32) {
+ 	  /* For FAT32, try to do the same as M$'s format command:
+ 	   * fs size < 256M: 0.5k clusters
diff --git a/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
index 7d0080c..66eeb7c 100644
--- a/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
+++ b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
@@ -7,7 +7,7 @@ DESCRIPTION = "DOS FAT Filesystem Utilities"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://mkdosfs/COPYING;md5=cbe67f08d6883bff587f615f0cc81aa8"
-PR = "r1"
+PR = "r3"
 
 SRC_URI = "ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-${PV}.src.tar.gz \
            file://mkdosfs-bootcode.patch \
@@ -15,7 +15,8 @@ SRC_URI = "ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-${PV}
            file://alignment_hack.patch \
            file://msdos_fat12_undefined.patch \
            file://dosfstools-msdos_fs-types.patch \
-           file://include-linux-types.patch"
+           file://include-linux-types.patch \
+           file://nofat32_autoselect.patch "
 
 SRC_URI[md5sum] = "407d405ade410f7597d364ab5dc8c9f6"
 SRC_URI[sha256sum] = "0eac6d12388b3d9ed78684529c1b0d9346fa2abbe406c4d4a3eb5a023c98a484"
-- 
1.7.5.4



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

end of thread, other threads:[~2012-04-11 17:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 17:51 [PATCH 0/8][edison] bootimg and dosfstools fixes Darren Hart
2012-04-11 17:51 ` [PATCH 1/8] bootimg: Use mcopy to construct the hddimg Darren Hart
2012-04-11 17:51 ` [PATCH 2/8] bootimg: Account for FAT filesystem overhead in image size Darren Hart
2012-04-11 17:51 ` [PATCH 3/8] bootimg: Fix a math thinko in the block count calculation Darren Hart
2012-04-11 17:51 ` [PATCH 4/8] bootimg: Do not force FAT32 on all images, it violates the FAT specification Darren Hart
2012-04-11 17:51 ` [PATCH 5/8] dosfstools: Add SRC_URI Checksum Darren Hart
2012-04-11 17:51 ` [PATCH 6/8] dosfstools: add Upstream-Status to patches Darren Hart
2012-04-11 17:51 ` [PATCH 7/8] dosfstools: update native to 2.11 Darren Hart
2012-04-11 17:51 ` [PATCH 8/8] dosfstools: Add patch to disable fat32 autoselection and behave as 2.10 Darren Hart

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.