Skip to contentSkip to conversation

bootimg and dosfstools fixes

PATCH New Darren Hart 1 participant 9 messages Apr 11, 2012

lore
Share & tools
lore
#0 lore raw

cover bootimg and dosfstools fixes

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
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/8 bootimg: Use mcopy to construct the hddimg

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)

Backported to poky edison by Darren Hart.

---
 meta/classes/bootimg.bbclass |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)
meta/classes/bootimg.bbclass +15 -7
index 49ee85e..bcae2ae 100644
@@ -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
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/8 bootimg: Account for FAT filesystem overhead in image size

In reply to Darren Hart

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)

Backported to edison by Darren Hart.

---
 meta/classes/bootimg.bbclass |   45 +++++++++++++++++++++++++++++++++--------
 1 files changed, 36 insertions(+), 9 deletions(-)
meta/classes/bootimg.bbclass +36 -9
index bcae2ae..c2d43c8 100644
@@ -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}/* ::/
 
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 3/8 bootimg: Fix a math thinko in the block count calculation

In reply to Darren Hart

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.

(From OE-Core rev: b35384fa3ca96b31c63d764322215abced2066e4)

Backported to edison by Darren Hart.

---
 meta/classes/bootimg.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
meta/classes/bootimg.bbclass +2 -1
index c2d43c8..489819b 100644
@@ -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
Signature · 1 line
1.7.5.4
#4 lore raw

PATCH 4/8 bootimg: Do not force FAT32 on all images, it violates the FAT specification

In reply to Darren Hart

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)

Backported to edison by Darren Hart.

---
 meta/classes/bootimg.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
meta/classes/bootimg.bbclass +4 -1
index 489819b..09f5b67 100644
@@ -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}/* ::/
 
Signature · 1 line
1.7.5.4
#5 lore raw

PATCH 5/8 dosfstools: Add SRC_URI Checksum

In reply to Darren Hart

From: Saul Wold <[email protected]>

(From OE-Core rev: a19bfc10e60ddc7e9317654ca7565d39acbc3987)

---
 .../recipes-devtools/dosfstools/dosfstools_2.10.bb |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
meta/recipes-devtools/dosfstools/dosfstools_2.10.bb +4 -1
index 1beb5dd..c23c02d 100644
@@ -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
Signature · 1 line
1.7.5.4
#6 lore raw

PATCH 6/8 dosfstools: add Upstream-Status to patches

In reply to Darren Hart

From: Scott Garman <[email protected]>

(From OE-Core rev: 735a3e5d3399e29e4d6fa82dabbdd1687eaa29e9)

---
 .../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(-)
meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch +7 -0
index 7cf2662..4460f06 100644
@@ -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 <[email protected]>
+
 Index: dosfstools-2.10/dosfsck/io.c
 ===================================================================
 --- dosfstools-2.10.orig/dosfsck/io.c	2007-06-07 16:15:52.000000000 +0200
meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch +4 -0
index e15060a..b46b2db 100644
@@ -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 <[email protected]>
 
 --- 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
meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch +7 -0
index e70a3ea..35abd1a 100644
@@ -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 <[email protected]>
+
 --- 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 @@
meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch +5 -0
index 4bbd4e7..ab5c8cf 100644
@@ -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 <[email protected]>
+
 --- 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 @@
meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch +7 -0
index 52be862..dd5cc7f 100644
@@ -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 <[email protected]>
+
 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
meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch +7 -0
index 8f753b0..7feee0f 100644
@@ -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 <[email protected]>
+
 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
meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch +7 -0
index 4987aa3..11e8a75 100644
@@ -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 <[email protected]>
+
 --- 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 @@
Signature · 1 line
1.7.5.4
#7 lore raw

PATCH 7/8 dosfstools: update native to 2.11

In reply to Darren Hart

From: Otavio Salvador <[email protected]>

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

(From OE-Core rev: 3a401ddce55e185c8ccfdc43c1440fd77daff9ae)

---
 .../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
meta/recipes-devtools/dosfstools/dosfstools-native_2.10.bb deleted +0 -19
deleted file mode 100644
index 91ff11f..0000000
@@ -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
meta/recipes-devtools/dosfstools/dosfstools/2.6.20-syscall.patch deleted +0 -72

72 lines not on this page · raw message

meta/recipes-devtools/dosfstools/dosfstools/dosfstools-2.10-kernel-2.6.patch deleted +0 -74

74 lines not on this page · raw message

meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch +31 -37

166 lines not on this page · raw message

meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch +30 -32

165 lines not on this page · raw message

meta/recipes-devtools/dosfstools/dosfstools_2.10.bb deleted +0 -24
deleted file mode 100644
index c23c02d..0000000
@@ -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
-}
meta/recipes-devtools/dosfstools/dosfstools_2.11.bb +8 -3
index 944d873..7d0080c 100644
@@ -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"
Signature · 1 line
1.7.5.4
#8 lore raw

PATCH 8/8 dosfstools: Add patch to disable fat32 autoselection and behave as 2.10

In reply to Darren Hart

From: Richard Purdie <[email protected]>

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)

---
 .../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
meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch new file +27 -0
new file mode 100644
index 0000000..21ebc10
@@ -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
meta/recipes-devtools/dosfstools/dosfstools_2.11.bb +3 -2
index 7d0080c..66eeb7c 100644
@@ -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"
Signature · 1 line
1.7.5.4