mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 09:49:33 +02:00
bootimg.bbclass: fixed generation of ISO & HDD images
bootimg.bbclass supported creation of FAT filesystem images for usage with syslinux (kernel and initrd in /boot/) and creation of ISO images with kernel and initrd on it. ISO images contained also not needed /boot/ directory from FAT image. Now still two files are created as result but both contain only needed files. git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1899 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
@@ -17,40 +17,43 @@ do_rootfs[depends] += "dosfstools-native:do_populate_staging \
|
|||||||
mtools-native:do_populate_staging \
|
mtools-native:do_populate_staging \
|
||||||
cdrtools-native:do_populate_staging"
|
cdrtools-native:do_populate_staging"
|
||||||
|
|
||||||
BDIR = "${WORKDIR}/boot"
|
PACKAGES = " "
|
||||||
ISODIR = "${IMAGE_ROOTFS}/isolinux/"
|
|
||||||
|
HDDDIR = "${S}/hdd/boot"
|
||||||
|
ISODIR = "${S}/cd/isolinux"
|
||||||
|
|
||||||
BOOTIMG_VOLUME_ID ?= "oe"
|
BOOTIMG_VOLUME_ID ?= "oe"
|
||||||
BOOTIMG_EXTRA_SPACE ?= "64"
|
BOOTIMG_EXTRA_SPACE ?= "64"
|
||||||
|
|
||||||
# Get the build_syslinux_cfg() function from the syslinux class
|
# Get the build_syslinux_cfg() function from the syslinux class
|
||||||
|
|
||||||
SYSLINUXCFG = "${BDIR}/syslinux.cfg"
|
SYSLINUXCFG = "${HDDDIR}/syslinux.cfg"
|
||||||
SYSLINUXMENU = "${BDIR}/menu"
|
SYSLINUXMENU = "${HDDDIR}/menu"
|
||||||
|
|
||||||
inherit syslinux
|
inherit syslinux
|
||||||
|
|
||||||
build_boot_bin() {
|
build_boot_bin() {
|
||||||
install -d ${BDIR}
|
install -d ${HDDDIR}
|
||||||
install -m 0644 ${STAGING_KERNEL_DIR}/bzImage \
|
install -m 0644 ${STAGING_KERNEL_DIR}/bzImage \
|
||||||
${BDIR}/vmlinuz
|
${HDDDIR}/vmlinuz
|
||||||
|
|
||||||
if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
|
if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
|
||||||
install -m 0644 ${INITRD} ${BDIR}/initrd
|
install -m 0644 ${INITRD} ${HDDDIR}/initrd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install -m 444 ${STAGING_DIR}/${BUILD_SYS}/share/syslinux/ldlinux.sys \
|
install -m 444 ${STAGING_DIR}/${BUILD_SYS}/share/syslinux/ldlinux.sys \
|
||||||
${BDIR}/ldlinux.sys
|
${HDDDIR}/ldlinux.sys
|
||||||
|
|
||||||
# Do a little math, bash style
|
# Do a little math, bash style
|
||||||
#BLOCKS=`du -s ${BDIR} | cut -f 1`
|
#BLOCKS=`du -s ${HDDDIR} | cut -f 1`
|
||||||
BLOCKS=`du -bks ${BDIR} | cut -f 1`
|
BLOCKS=`du -bks ${HDDDIR} | cut -f 1`
|
||||||
SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
|
SIZE=`expr $BLOCKS + ${BOOTIMG_EXTRA_SPACE}`
|
||||||
|
|
||||||
mkdosfs -F 12 -n ${BOOTIMG_VOLUME_ID} -d ${BDIR} \
|
mkdosfs -F 12 -n ${BOOTIMG_VOLUME_ID} -d ${HDDDIR} \
|
||||||
-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-boot.bin $SIZE
|
-C ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg $SIZE
|
||||||
|
|
||||||
syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}-boot.bin
|
syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
|
||||||
|
chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
|
||||||
|
|
||||||
#Create an ISO if we have an INITRD
|
#Create an ISO if we have an INITRD
|
||||||
if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
|
if [ -n "${INITRD}" ] && [ -s "${INITRD}" ] && [ "${NOISO}" != "1" ] ; then
|
||||||
@@ -63,7 +66,7 @@ build_boot_bin() {
|
|||||||
|
|
||||||
# Install the configuration files
|
# Install the configuration files
|
||||||
|
|
||||||
cp ${BDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
|
cp ${HDDDIR}/syslinux.cfg ${ISODIR}/isolinux.cfg
|
||||||
|
|
||||||
if [ -f ${SYSLINUXMENU} ]; then
|
if [ -f ${SYSLINUXMENU} ]; then
|
||||||
cp ${SYSLINUXMENU} ${ISODIR}
|
cp ${SYSLINUXMENU} ${ISODIR}
|
||||||
@@ -79,7 +82,7 @@ build_boot_bin() {
|
|||||||
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
|
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
|
||||||
-b isolinux/isolinux.bin -c isolinux/boot.cat -r \
|
-b isolinux/isolinux.bin -c isolinux/boot.cat -r \
|
||||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||||
${IMAGE_ROOTFS}
|
${S}/cd/
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user