summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>2015-07-15 16:56:59 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-23 08:48:40 +0100
commitfbea156fffb846551e2f878ad3353db8f95d35cc (patch)
treeb4023c949ffb4efed87497f99baa65c9747be4c9
parent50b51863317da8396c4a7751a5ae68db6e1497ea (diff)
downloadpoky-fbea156fffb846551e2f878ad3353db8f95d35cc.tar.gz
bootimg: remove previous FATIMG before creating a new one
Since version 3.0.0 of dosfstools, mkdosfs opens the to-be-filesystem file with O_EXCL. Since the filesystem is also opened with O_CREAT, the -C option of mkdosfs can only succeed if FATIMG does not exists. Thus, delete any previous FATIMG file. The file can be safely deleted as we are inside build_fat_img because we want to create an new FATIMG. (From OE-Core rev: a0d4511d358d427e5271420a74c26cc862c5ed74) Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/bootimg.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index dbbf046d3a..ebc927edc7 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -227,6 +227,12 @@ build_fat_img() {
227 FATSIZE="-F 32" 227 FATSIZE="-F 32"
228 fi 228 fi
229 229
230 # mkdosfs will fail if ${FATIMG} exists. Since we are creating an
231 # new image, it is safe to delete any previous image.
232 if [ -e ${FATIMG} ]; then
233 rm ${FATIMG}
234 fi
235
230 if [ -z "${HDDIMG_ID}" ]; then 236 if [ -z "${HDDIMG_ID}" ]; then
231 mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${FATIMG} \ 237 mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${FATIMG} \
232 ${BLOCKS} 238 ${BLOCKS}