summaryrefslogtreecommitdiffstats
path: root/meta/classes/bootimg.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* bootimg: Fix QuotingSaul Wold2012-02-281-4/+4
| | | | | | | (From OE-Core rev: 18ad7e003e36510ff0097d71bad0378a77fabbdd) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Use the same OS files for each boot methodDarren Hart2012-02-081-7/+24
| | | | | | | | | | | | | | | | | | | | | | Fixes [YOCTO #1951] The do_bootimg code can generate hybrid efi+pcbios images (syslinux and grub-efi) to boot on platforms with both EFI and legacy BIOS options. The current implementation copies the kernel, initrd, and rootfs twice, unnecessarily bloating the image size. This is an especially egregious bug on -sato images. Update the classes to use a common install of the kernel, initrd, and rootfs to the root of the boot media. Grub-efi, syslinux, and isolinux can all reference this location explicitly with a leading slash. Tested with an EFI+PCBIOS image in both EFI and PCBIOS boot modes on two platforms. No ISO image testing was performed. (From OE-Core rev: 5209016cf4c4c8f649e37dc8857b3fbcfe8dd8c8) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Do not force FAT32 on all images, it violates the FAT specificationDarren Hart2012-02-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Fix a math thinko in the block count calculationDarren Hart2012-01-251-1/+1
| | | | | | | | | | | | | | | 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. Reported-by: Tom Zanussi <tom.zanussi@intel.com> (From OE-Core rev: b35384fa3ca96b31c63d764322215abced2066e4) Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Account for FAT filesystem overhead in image sizeDarren Hart2012-01-171-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | 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) Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Use mcopy to construct the hddimgDarren Hart2011-12-161-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Nitin A. Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Use dosfsck to clean up the generated live imageDarren Hart2011-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generated filesystem has some errors that dosfsck is able to repair: dosfsck 2.11, 12 Mar 2005, FAT32, LFN Checking file /ldlinux.sys (LDLINUX.SYS) Checking file /initrd (INITRD) Checking file /syslinux.cfg (SYSLINUX.CFG) Checking file /EFI (EFI) Checking file /vmlinuz (VMLINUZ) Checking file /rootfs.img (ROOTFS.IMG) /vmlinuz File size is 4144896 bytes, cluster chain length is > 4145152 bytes. Truncating file to 4144896 bytes. Checking file /EFI/.. (..) Checking file /EFI/BOOT (BOOT) Checking file /EFI/. (.) /EFI/.. Start (16022) does not point to .. (0) /EFI/. Start (0) does not point to parent (16022) Checking file /EFI/BOOT/.. (..) Checking file /EFI/BOOT/. (.) Checking file /EFI/BOOT/initrd (INITRD) Checking file /EFI/BOOT/grub.cfg (GRUB.CFG) Checking file /EFI/BOOT/bootia32.efi (BOOTIA32.EFI) Checking file /EFI/BOOT/vmlinuz (VMLINUZ) Checking file /EFI/BOOT/rootfs.img (ROOTFS.IMG) /EFI/BOOT/.. Start (16021) does not point to .. (16022) /EFI/BOOT/. Start (0) does not point to parent (16021) /EFI/BOOT/vmlinuz File size is 4144896 bytes, cluster chain length is > 4145152 bytes. Truncating file to 4144896 bytes. Performing changes. /build/poky/fri2/tmp/deploy/images/core-image-minimal-fri2-noemgd-20111216000605.hddimg: 12 files, 26635/26828 clusters Add a dosfsck command following the mkdosfs command to correct these. (From OE-Core rev: 5d2554ec5f1d3b15e02b1d76cc9bd2d4861969f8) Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Allow for EFI-only boot imagesDarren Hart2011-11-301-9/+40
| | | | | | | | | | | | | | Condition building PCBIOS legacy images on MACHINE_FEATURES containing "pcbios" or not containing "efi". This ensures existing BSPs will continue to get the old PCBIOS legacy-only images. New BSPs can add "efi", "pcbios", or both. The images created likewise support one or the other or both. EFI-only ISO images are untested. (From OE-Core rev: be3fc8c07e84c654f55c5d09934dfbdc7ff7e2b6) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Add grub-efi supportDarren Hart2011-11-301-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new grub-efi.bbclass and integrate it into bootimg alongside the syslinux support. This new class uses the output from the grub-efi-native recipe. Thanks goes to Josef Ahmad <josef.ahmad@intel.com> for the original build_grub_cfg() routine. The EFI features are only added to the image if MACHINE_FEATURES contains "efi". The resulting images are therefor either legacy boot only (like they were originally) or legacy boot and EFI boot. A new "dummy.bbclass" was added to allow for the conditional include of grub-efi. This makes it so if efi support is not to be built in, we don't spend time building grub-efi-native just because the include adds the dependency. There is a bug in the mkdosfs tool from the dosfstools package which causes it to crash when the directory passed with the -d parameter contains sub-directories. An /EFI/BOOT directory is required for a proper EFI installation. Until it is fixed, we install to the top level directory for the hddimg. (From OE-Core rev: be95f54495bf9e03062f86b929c66cab6e385a03) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Josef Ahmad <josef.ahmad@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Pull syslinux specific bits into syslinux.bbclassDarren Hart2011-11-301-55/+16
| | | | | | | | | | | | Working towards a more generic bootimg.bbclass, pull out all syslinux specific bits and let syslinux.bbclass manage them directly. This introduces no functional changes to the images constructed and the behavior remains unchanged. (From OE-Core rev: 1915293688d348a765aa0bcdf01168c9fecd9842) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Refactor build_hddimg and build_iso routinesDarren Hart2011-11-301-42/+43
| | | | | | | | | | | Separate the construction of the ISO image from that of the hddimg. This is part of the groundwork for creating a much more flexible live image builder. (From OE-Core rev: 2da25c7c6649757350782a939bcc7553c5c86570) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg: Create a valid boot sector for the iso imageDamien Lespiau2011-11-181-0/+2
| | | | | | | | | | | | | It's possible to create an "hybrid" iso image that you can both burn to a CD-Rom and dd to a USB key. isohybrid will create a valid boot sector for the USB key case. [YOCTO #1763] (From OE-Core rev: 321a7dc9d934f31aae27828ff8c56d6c69ecc665) Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg.bbclass: add support to disable HDD image buildingOtavio Salvador2011-10-241-21/+23
| | | | | | | | | If an image sets NOHDD = "1" the HDD image won't be build. (From OE-Core rev: 23c5a83e877efe6d86618898dd181bb75f44aa71) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg.bbclass: fix comment typoOtavio Salvador2011-10-041-1/+1
| | | | | | | (From OE-Core rev: 780685bbaf6d6f74aed77c412686592d6b9cf8e5) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: machine specific sysroots implementationDongxiao Xu2011-01-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the sysroots path to be machine specific. Changes includes: 1) STAGING_DIR_TARGET and STRAGING_DIR_HOST points to machine specific paths. 2) task stamp files. Adding ${MACHINE} info into stamp files for do_populate_sysroots and do_package tasks. Add a BB_STAMPTASK_BLACKLIST to keep native, nativesdk, crosssdk, and cross-canadian stamp unchanged. 3) siteconfig path. Separate the site config path for different machines to avoid one machine adopting the cache file of another machine. 4) sstate. Add machine name to sstate manifest file. Change relocation code for sstate paths since sysroot is machine. Keep native, nativesdk, crosssdk, and cross-canadian unchanged. 5) toolchain scripts. Change the environment path to point to machine specific sysroots in toolchain scripts bbclass. 6) Relocate la files when populating to a different machine of the same architecture. 7) Exclude STAGING_DIR_TARGET and STAGING_DIR_HOST parameter from sstate siginfo since they contain ${MACHINE} information. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
* bootimg.bbclass: Fix dependency nameRichard Purdie2010-03-251-1/+1
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bootimg/boot-directdisk.bbclass: Update afer syslinux changes, fix mbr.bin ↵Richard Purdie2010-03-251-4/+2
| | | | | | location and fix dependencies Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bootimg.bbclass: Improve documentationRichard Purdie2010-03-251-4/+18
| | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bitbake.conf/base.bbclass: Rename the staging directory to sysroots and the ↵Richard Purdie2009-11-131-5/+5
| | | | | | | | | | | | | populate_staging task to populate_sysroot This change makes the purpose of the staging directory more obvious and the taskname more true to what it now actually does. The layout version number is increased due to the change in layout but code to convert existing directories and insert a symlink for backwards compatibility is included. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* bootimg: Let mkdosfs choose between fat12 and fat16Samuel Ortiz2008-11-101-1/+1
|
* bootimg: As image size grows, we want to switch to FAT16Samuel Ortiz2008-11-061-1/+1
|
* bootimg: copy rootfs to ISO imageSamuel Ortiz2008-10-271-0/+4
| | | | We are only copying the initrd right now.
* syslinux-native: Try to make syslinux cross-compile friendly.Andrzej Zaborowski2008-10-201-3/+4
| | | | | | | | | | We only had one package for building both the bootloader and the installer, i.e. target and host code. It used always the host compiler. Split the package into syslinux and syslinux-installer-native, require both for a cd bootable image. git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5539 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg: Add symbolic links to iso and hddimgSamuel Ortiz2008-10-171-0/+9
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5535 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg.bbclass: Set nostamp for the bootimg taskRichard Purdie2008-10-011-0/+1
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5369 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg: Adding a rootfs to the disk imageSamuel Ortiz2008-09-101-1/+5
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5172 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg.bbclass: removed bootsplash task support - we do not have such oneMarcin Juszkiewicz2008-03-111-4/+1
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3989 311d38ba-8fff-0310-9ca6-ca027cbcb966
* Remove hardcoded staging layout assumptionsRichard Purdie2007-11-121-2/+2
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3117 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg.bbclass: Fix taskname referenceRichard Purdie2007-10-111-1/+1
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2867 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg.bbclass: get kernel from proper directory in stagingMarcin Juszkiewicz2007-06-111-2/+2
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1911 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg.bbclass: fixed generation of ISO & HDD imagesMarcin Juszkiewicz2007-06-081-15/+18
| | | | | | | | | | | | 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
* bootimg: reformatted againMarcin Juszkiewicz2007-06-081-5/+6
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1898 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg: reformattedMarcin Juszkiewicz2007-06-081-1/+4
| | | | git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1897 311d38ba-8fff-0310-9ca6-ca027cbcb966
* bootimg.bbclass: imported from OE, updated to recent BitBakeMarcin Juszkiewicz2007-06-081-0/+90
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1894 311d38ba-8fff-0310-9ca6-ca027cbcb966