diff options
author | Saul Wold <sgw@linux.intel.com> | 2012-03-26 22:42:57 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-27 13:26:36 +0100 |
commit | 337fbed7345ad8d2c39dab1f4353ed0524c0d906 (patch) | |
tree | 4199adafab85cffb50093115ea44932e6b3ac2cd | |
parent | d2e7d49c0ddccf58b20010046bc4fe135a06f2cb (diff) | |
download | poky-337fbed7345ad8d2c39dab1f4353ed0524c0d906.tar.gz |
boot-directdisk: Fix Block Calcuation
This also changes the timeout to be settable
The block calcuation was not correctly rounding, see comment
Thanks to Darren Hart for fixing this.
Cc: Darren Hart <dvhart@linux.intel.com>
(From OE-Core rev: 53ae1737611e10e7fef815e8fde9e22165aa1047)
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/boot-directdisk.bbclass | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass index 893164f853..e9e1ba30db 100644 --- a/meta/classes/boot-directdisk.bbclass +++ b/meta/classes/boot-directdisk.bbclass | |||
@@ -37,9 +37,8 @@ BOOTDD_EXTRA_SPACE ?= "16384" | |||
37 | # Get the build_syslinux_cfg() function from the syslinux class | 37 | # Get the build_syslinux_cfg() function from the syslinux class |
38 | 38 | ||
39 | AUTO_SYSLINUXCFG = "1" | 39 | AUTO_SYSLINUXCFG = "1" |
40 | LABELS = "boot" | ||
41 | SYSLINUX_ROOT ?= "root=/dev/sda2" | 40 | SYSLINUX_ROOT ?= "root=/dev/sda2" |
42 | SYSLINUX_TIMEOUT = "10" # 1 second | 41 | SYSLINUX_TIMEOUT ?= "10" |
43 | 42 | ||
44 | SYSLINUXCFG = "${HDDDIR}/syslinux.cfg" | 43 | SYSLINUXCFG = "${HDDDIR}/syslinux.cfg" |
45 | SYSLINUXMENU = "${HDDDIR}/menu" | 44 | SYSLINUXMENU = "${HDDDIR}/menu" |
@@ -55,15 +54,23 @@ build_boot_dd() { | |||
55 | install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys | 54 | install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys |
56 | 55 | ||
57 | BLOCKS=`du -bks ${HDDDIR} | cut -f 1` | 56 | BLOCKS=`du -bks ${HDDDIR} | cut -f 1` |
58 | SIZE=`expr $BLOCKS + ${BOOTDD_EXTRA_SPACE}` | 57 | BLOCKS=`expr $BLOCKS + ${BOOTDD_EXTRA_SPACE}` |
58 | |||
59 | # Ensure total sectors is an integral number of sectors per | ||
60 | # track or mcopy will complain. Sectors are 512 bytes, and we | ||
61 | # generate images with 32 sectors per track. This calculation is | ||
62 | # done in blocks, thus the mod by 16 instead of 32. | ||
63 | BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16))) | ||
64 | |||
65 | mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C ${HDDIMG} $BLOCKS | ||
66 | mcopy -i ${HDDIMG} -s ${HDDDIR}/* ::/ | ||
59 | 67 | ||
60 | mkdosfs -n ${BOOTDD_VOLUME_ID} -d ${HDDDIR} -C ${HDDIMG} $SIZE | ||
61 | syslinux ${HDDIMG} | 68 | syslinux ${HDDIMG} |
62 | chmod 644 ${HDDIMG} | 69 | chmod 644 ${HDDIMG} |
63 | 70 | ||
64 | ROOTFSBLOCKS=`du -Lbks ${ROOTFS} | cut -f 1` | 71 | ROOTFSBLOCKS=`du -Lbks ${ROOTFS} | cut -f 1` |
65 | TOTALSIZE=`expr $SIZE + $ROOTFSBLOCKS` | 72 | TOTALSIZE=`expr $BLOCKS + $ROOTFSBLOCKS` |
66 | END1=`expr $SIZE \* 1024` | 73 | END1=`expr $BLOCKS \* 1024` |
67 | END2=`expr $END1 + 512` | 74 | END2=`expr $END1 + 512` |
68 | END3=`expr \( $ROOTFSBLOCKS \* 1024 \) + $END1` | 75 | END3=`expr \( $ROOTFSBLOCKS \* 1024 \) + $END1` |
69 | 76 | ||