* [PATCH 0/2] Scope variables in image classes to avoid conflicts @ 2013-05-02 20:56 Jonathan Liu 2013-05-02 20:56 ` [PATCH 1/2] boot-directdisk: Scope HDDDIR and HDDIMG variables " Jonathan Liu 2013-05-02 20:56 ` [PATCH 2/2] bootimg: Scope HDDDIR and ISODIR " Jonathan Liu 0 siblings, 2 replies; 5+ messages in thread From: Jonathan Liu @ 2013-05-02 20:56 UTC (permalink / raw) To: openembedded-core Note: This depends on syslinux update to 4.06. Jonathan Liu (2): boot-directdisk: Scope HDDDIR and HDDIMG variables to avoid conflicts bootimg: Scope HDDDIR and ISODIR variables to avoid conflicts meta/classes/boot-directdisk.bbclass | 25 ++++++++++++------------- meta/classes/bootimg.bbclass | 25 +++++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) -- 1.8.2.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] boot-directdisk: Scope HDDDIR and HDDIMG variables to avoid conflicts 2013-05-02 20:56 [PATCH 0/2] Scope variables in image classes to avoid conflicts Jonathan Liu @ 2013-05-02 20:56 ` Jonathan Liu 2013-05-02 20:56 ` [PATCH 2/2] bootimg: Scope HDDDIR and ISODIR " Jonathan Liu 1 sibling, 0 replies; 5+ messages in thread From: Jonathan Liu @ 2013-05-02 20:56 UTC (permalink / raw) To: openembedded-core These variables should not be shared with other image classes. The bootimg class also has an HDDDIR variable that could be overwritten if executing concurrently in the same image recipe. Signed-off-by: Jonathan Liu <net147@gmail.com> --- meta/classes/boot-directdisk.bbclass | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass index 1506b42..a041482 100644 --- a/meta/classes/boot-directdisk.bbclass +++ b/meta/classes/boot-directdisk.bbclass @@ -28,9 +28,6 @@ do_bootdirectdisk[depends] += "dosfstools-native:do_populate_sysroot \ PACKAGES = " " EXCLUDE_FROM_WORLD = "1" -HDDDIR = "${S}/hdd/boot" -HDDIMG = "${S}/hdd.image" - BOOTDD_VOLUME_ID ?= "boot" BOOTDD_EXTRA_SPACE ?= "16384" @@ -43,14 +40,16 @@ SYSLINUX_TIMEOUT ?= "10" inherit syslinux build_boot_dd() { + HDDDIR="${S}/hdd/boot" + HDDIMG="${S}/hdd.image" IMAGE=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect - install -d ${HDDDIR} - install -m 0644 ${STAGING_KERNEL_DIR}/bzImage ${HDDDIR}/vmlinuz - install -m 0644 ${S}/syslinux.cfg ${HDDDIR}/syslinux.cfg - install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys ${HDDDIR}/ldlinux.sys + install -d $HDDDIR + install -m 0644 ${STAGING_KERNEL_DIR}/bzImage $HDDDIR/vmlinuz + install -m 0644 ${S}/syslinux.cfg $HDDDIR/syslinux.cfg + install -m 444 ${STAGING_LIBDIR}/syslinux/ldlinux.sys $HDDDIR/ldlinux.sys - BLOCKS=`du -bks ${HDDDIR} | cut -f 1` + BLOCKS=`du -bks $HDDDIR | cut -f 1` BLOCKS=`expr $BLOCKS + ${BOOTDD_EXTRA_SPACE}` # Ensure total sectors is an integral number of sectors per @@ -59,11 +58,11 @@ build_boot_dd() { # done in blocks, thus the mod by 16 instead of 32. BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16))) - mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C ${HDDIMG} $BLOCKS - mcopy -i ${HDDIMG} -s ${HDDDIR}/* ::/ + mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C $HDDIMG $BLOCKS + mcopy -i $HDDIMG -s $HDDDIR/* ::/ - syslinux ${HDDIMG} - chmod 644 ${HDDIMG} + syslinux $HDDIMG + chmod 644 $HDDIMG ROOTFSBLOCKS=`du -Lbks ${ROOTFS} | cut -f 1` TOTALSIZE=`expr $BLOCKS + $ROOTFSBLOCKS` @@ -83,7 +82,7 @@ build_boot_dd() { OFFSET=`expr $END2 / 512` dd if=${STAGING_DATADIR}/syslinux/mbr.bin of=$IMAGE conv=notrunc - dd if=${HDDIMG} of=$IMAGE conv=notrunc seek=1 bs=512 + dd if=$HDDIMG of=$IMAGE conv=notrunc seek=1 bs=512 dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512 cd ${DEPLOY_DIR_IMAGE} -- 1.8.2.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] bootimg: Scope HDDDIR and ISODIR variables to avoid conflicts 2013-05-02 20:56 [PATCH 0/2] Scope variables in image classes to avoid conflicts Jonathan Liu 2013-05-02 20:56 ` [PATCH 1/2] boot-directdisk: Scope HDDDIR and HDDIMG variables " Jonathan Liu @ 2013-05-02 20:56 ` Jonathan Liu 2013-05-02 22:33 ` Saul Wold 1 sibling, 1 reply; 5+ messages in thread From: Jonathan Liu @ 2013-05-02 20:56 UTC (permalink / raw) To: openembedded-core These variables should not be shared with other image classes. The boot-directdisk class also has an HDDDIR variable that could be overwritten if executing concurrently in the same image recipe. Signed-off-by: Jonathan Liu <net147@gmail.com> --- meta/classes/bootimg.bbclass | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass index b7ddf42..11b3294 100644 --- a/meta/classes/bootimg.bbclass +++ b/meta/classes/bootimg.bbclass @@ -29,9 +29,6 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ PACKAGES = " " EXCLUDE_FROM_WORLD = "1" -HDDDIR = "${S}/hddimg" -ISODIR = "${S}/iso" - BOOTIMG_VOLUME_ID ?= "boot" BOOTIMG_EXTRA_SPACE ?= "512" @@ -76,13 +73,15 @@ populate() { } build_iso() { + ISODIR="${S}/iso" + # Only create an ISO if we have an INITRD and NOISO was not set if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then bbnote "ISO image will not be created." return fi - populate ${ISODIR} + populate $ISODIR if [ "${PCBIOS}" = "1" ]; then syslinux_iso_populate @@ -95,12 +94,12 @@ build_iso() { mkisofs -V ${BOOTIMG_VOLUME_ID} \ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \ - ${MKISOFS_OPTIONS} ${ISODIR} + ${MKISOFS_OPTIONS} $ISODIR else bbnote "EFI-only ISO images are untested, please provide feedback." mkisofs -V ${BOOTIMG_VOLUME_ID} \ -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ - -r ${ISODIR} + -r $ISODIR fi isohybrid ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso @@ -111,9 +110,11 @@ build_iso() { } build_hddimg() { + HDDDIR="${S}/hddimg" + # Create an HDD image if [ "${NOHDD}" != "1" ] ; then - populate ${HDDDIR} + populate $HDDDIR if [ "${PCBIOS}" = "1" ]; then syslinux_hddimg_populate @@ -128,7 +129,7 @@ build_hddimg() { # Blocks: 1024 bytes # Determine the sector count just for the data - SECTORS=$(expr $(du --apparent-size -ks ${HDDDIR} | cut -f 1) \* 2) + 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. @@ -140,13 +141,13 @@ build_hddimg() { # 8.3 filenames only # 32 bytes per dir entry - DIR_BYTES=$(expr $(find ${HDDDIR} | tail -n +2 | wc -l) \* 32) + 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)) + 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)) + 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) @@ -173,7 +174,7 @@ build_hddimg() { IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS} # Copy HDDDIR recursively into the image file directly - mcopy -i ${IMG} -s ${HDDDIR}/* ::/ + mcopy -i ${IMG} -s $HDDDIR/* ::/ if [ "${PCBIOS}" = "1" ]; then syslinux_hddimg_install -- 1.8.2.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] bootimg: Scope HDDDIR and ISODIR variables to avoid conflicts 2013-05-02 20:56 ` [PATCH 2/2] bootimg: Scope HDDDIR and ISODIR " Jonathan Liu @ 2013-05-02 22:33 ` Saul Wold 2013-05-02 22:55 ` Jonathan Liu 0 siblings, 1 reply; 5+ messages in thread From: Saul Wold @ 2013-05-02 22:33 UTC (permalink / raw) To: Jonathan Liu; +Cc: openembedded-core On 05/02/2013 01:56 PM, Jonathan Liu wrote: > These variables should not be shared with other image classes. > The boot-directdisk class also has an HDDDIR variable that could be > overwritten if executing concurrently in the same image recipe. > > Signed-off-by: Jonathan Liu <net147@gmail.com> > --- > meta/classes/bootimg.bbclass | 25 +++++++++++++------------ > 1 file changed, 13 insertions(+), 12 deletions(-) > > diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass > index b7ddf42..11b3294 100644 > --- a/meta/classes/bootimg.bbclass > +++ b/meta/classes/bootimg.bbclass > @@ -29,9 +29,6 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ > PACKAGES = " " > EXCLUDE_FROM_WORLD = "1" > > -HDDDIR = "${S}/hddimg" > -ISODIR = "${S}/iso" > - NAK! What about the usage of these in grub-efi.bbclass and syslinux.bbclass? Both are used in those classes via inherits of either the EFI_CLASS or PCBIOS_CLASS. Sau! > BOOTIMG_VOLUME_ID ?= "boot" > BOOTIMG_EXTRA_SPACE ?= "512" > > @@ -76,13 +73,15 @@ populate() { > } > > build_iso() { > + ISODIR="${S}/iso" > + > # Only create an ISO if we have an INITRD and NOISO was not set > if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then > bbnote "ISO image will not be created." > return > fi > > - populate ${ISODIR} > + populate $ISODIR > > if [ "${PCBIOS}" = "1" ]; then > syslinux_iso_populate > @@ -95,12 +94,12 @@ build_iso() { > mkisofs -V ${BOOTIMG_VOLUME_ID} \ > -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ > -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \ > - ${MKISOFS_OPTIONS} ${ISODIR} > + ${MKISOFS_OPTIONS} $ISODIR > else > bbnote "EFI-only ISO images are untested, please provide feedback." > mkisofs -V ${BOOTIMG_VOLUME_ID} \ > -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ > - -r ${ISODIR} > + -r $ISODIR > fi > > isohybrid ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso > @@ -111,9 +110,11 @@ build_iso() { > } > > build_hddimg() { > + HDDDIR="${S}/hddimg" > + > # Create an HDD image > if [ "${NOHDD}" != "1" ] ; then > - populate ${HDDDIR} > + populate $HDDDIR > > if [ "${PCBIOS}" = "1" ]; then > syslinux_hddimg_populate > @@ -128,7 +129,7 @@ build_hddimg() { > # Blocks: 1024 bytes > > # Determine the sector count just for the data > - SECTORS=$(expr $(du --apparent-size -ks ${HDDDIR} | cut -f 1) \* 2) > + 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. > @@ -140,13 +141,13 @@ build_hddimg() { > # 8.3 filenames only > > # 32 bytes per dir entry > - DIR_BYTES=$(expr $(find ${HDDDIR} | tail -n +2 | wc -l) \* 32) > + 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)) > + 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)) > + 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) > @@ -173,7 +174,7 @@ build_hddimg() { > IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg > mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS} > # Copy HDDDIR recursively into the image file directly > - mcopy -i ${IMG} -s ${HDDDIR}/* ::/ > + mcopy -i ${IMG} -s $HDDDIR/* ::/ > > if [ "${PCBIOS}" = "1" ]; then > syslinux_hddimg_install > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] bootimg: Scope HDDDIR and ISODIR variables to avoid conflicts 2013-05-02 22:33 ` Saul Wold @ 2013-05-02 22:55 ` Jonathan Liu 0 siblings, 0 replies; 5+ messages in thread From: Jonathan Liu @ 2013-05-02 22:55 UTC (permalink / raw) To: Saul Wold; +Cc: openembedded-core@lists.openembedded.org I guess it is enough to scope just the variables in boot-directdisk for now then. Regards, Jonathan On 03/05/2013, at 8:33 AM, Saul Wold <sgw@linux.intel.com> wrote: > On 05/02/2013 01:56 PM, Jonathan Liu wrote: >> These variables should not be shared with other image classes. >> The boot-directdisk class also has an HDDDIR variable that could be >> overwritten if executing concurrently in the same image recipe. >> >> Signed-off-by: Jonathan Liu <net147@gmail.com> >> --- >> meta/classes/bootimg.bbclass | 25 +++++++++++++------------ >> 1 file changed, 13 insertions(+), 12 deletions(-) >> >> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass >> index b7ddf42..11b3294 100644 >> --- a/meta/classes/bootimg.bbclass >> +++ b/meta/classes/bootimg.bbclass >> @@ -29,9 +29,6 @@ do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ >> PACKAGES = " " >> EXCLUDE_FROM_WORLD = "1" >> >> -HDDDIR = "${S}/hddimg" >> -ISODIR = "${S}/iso" >> - > NAK! > > What about the usage of these in grub-efi.bbclass and syslinux.bbclass? > > Both are used in those classes via inherits of either the EFI_CLASS or PCBIOS_CLASS. > > Sau! > > >> BOOTIMG_VOLUME_ID ?= "boot" >> BOOTIMG_EXTRA_SPACE ?= "512" >> >> @@ -76,13 +73,15 @@ populate() { >> } >> >> build_iso() { >> + ISODIR="${S}/iso" >> + >> # Only create an ISO if we have an INITRD and NOISO was not set >> if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then >> bbnote "ISO image will not be created." >> return >> fi >> >> - populate ${ISODIR} >> + populate $ISODIR >> >> if [ "${PCBIOS}" = "1" ]; then >> syslinux_iso_populate >> @@ -95,12 +94,12 @@ build_iso() { >> mkisofs -V ${BOOTIMG_VOLUME_ID} \ >> -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ >> -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} -r \ >> - ${MKISOFS_OPTIONS} ${ISODIR} >> + ${MKISOFS_OPTIONS} $ISODIR >> else >> bbnote "EFI-only ISO images are untested, please provide feedback." >> mkisofs -V ${BOOTIMG_VOLUME_ID} \ >> -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \ >> - -r ${ISODIR} >> + -r $ISODIR >> fi >> >> isohybrid ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso >> @@ -111,9 +110,11 @@ build_iso() { >> } >> >> build_hddimg() { >> + HDDDIR="${S}/hddimg" >> + >> # Create an HDD image >> if [ "${NOHDD}" != "1" ] ; then >> - populate ${HDDDIR} >> + populate $HDDDIR >> >> if [ "${PCBIOS}" = "1" ]; then >> syslinux_hddimg_populate >> @@ -128,7 +129,7 @@ build_hddimg() { >> # Blocks: 1024 bytes >> >> # Determine the sector count just for the data >> - SECTORS=$(expr $(du --apparent-size -ks ${HDDDIR} | cut -f 1) \* 2) >> + 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. >> @@ -140,13 +141,13 @@ build_hddimg() { >> # 8.3 filenames only >> >> # 32 bytes per dir entry >> - DIR_BYTES=$(expr $(find ${HDDDIR} | tail -n +2 | wc -l) \* 32) >> + 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)) >> + 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)) >> + 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) >> @@ -173,7 +174,7 @@ build_hddimg() { >> IMG=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg >> mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${IMG} ${BLOCKS} >> # Copy HDDDIR recursively into the image file directly >> - mcopy -i ${IMG} -s ${HDDDIR}/* ::/ >> + mcopy -i ${IMG} -s $HDDDIR/* ::/ >> >> if [ "${PCBIOS}" = "1" ]; then >> syslinux_hddimg_install >> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-02 23:13 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-05-02 20:56 [PATCH 0/2] Scope variables in image classes to avoid conflicts Jonathan Liu 2013-05-02 20:56 ` [PATCH 1/2] boot-directdisk: Scope HDDDIR and HDDIMG variables " Jonathan Liu 2013-05-02 20:56 ` [PATCH 2/2] bootimg: Scope HDDDIR and ISODIR " Jonathan Liu 2013-05-02 22:33 ` Saul Wold 2013-05-02 22:55 ` Jonathan Liu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox