summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/mkefidisk.sh
Commit message (Collapse)AuthorAgeFilesLines
* mkefidisk.sh: Allow using a loopback mounted fileJason Wessel2013-09-301-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It should be possible to generate a disk to a file using a loopback device with mkefidisk.sh, which is useful for booting simulators. To make this possible the partitions for the loop back need to work similarly to the mmc devices. The mkfs.vfat also requires and additional argument to force it to write to something other then a real disk. Example: qemu-img create -f raw bigdisk 4G dev=`sudo losetup -f` sudo losetup $dev bigdisk mkefidisk.sh $dev tmp-eglibc/deploy/images/qemux86/core-image-minimal-qemux86.hddimg /dev/sda sudo losetup -d $dev Note: Also a bug was fixed in the mkefidisk.sh where if the disk you are writing to initially has an invalid label the size of the first partition will be computed incorrectly. For the simulator disk creation this is generally always the case, but this can happen with real hardware as well. (From OE-Core rev: 254899824900f2e8c6a34d2ad1b8cbea91acb4ae) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/contrib/mkefidisk.sh: fix bashismChen Qi2013-08-061-4/+4
| | | | | | | | | | Remove the function keyword. (From OE-Core rev: 0eb9dd29b89449e2b9a10bf57f34c09a8bed40bc) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/contrib/*: fix arithmetic bashismPaul Eggleton2013-07-181-1/+1
| | | | | | | | | | | Apparently $[...] isn't valid in dash, so use $((...)) instead for mkefidisk.sh and ddimage that both start with $!/bin/sh. (From OE-Core rev: d509739ca54e6b70f2dcc216b831fc02c64293a6) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Unmount after partitioningDarren Hart2013-05-021-11/+21
| | | | | | | | | | | | | | Some automounters are rather overzealous and like to mount things immediately after partitioning. This can happen if the disk is being reused and the partitions align exactly with the existing partitions which have already been formatted. Move the unmount code into a function and call it before and after partitioning. (From OE-Core rev: f1854e458e5e77806b1fc837033500fa91272261) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Attempt to automatically unmount target deviceDarren Hart2013-04-291-4/+9
| | | | | | | | | | | With automounters abounding it makes more sense to attempt to unmount the device rather than abort, just like ddimage does. (From OE-Core rev: f522ff19ba4b80788d66a2c58ee50b86fdfea15f) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Use msdos partition tablesDarren Hart2013-03-221-9/+7
| | | | | | | | | | | | | | | While GPT works fine when writing to actual media, it cannot be reliably used for distributing disk images as it requires the backup table to be on the last block on the device, which of course varies from device to device. Use MSDOS tables instead. Use mkfs to label the filesystems as msdos tables do not support partition labeling. (From OE-Core rev: 049ea1e0a6a1017a5020de38bd7ce93515bd62f4) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Remove startup.nshDarren Hart2013-03-221-4/+0
| | | | | | | | | | | | | | | Most firmware implementations use the EFI specified EFI/BOOT/bootia32.efi (and similar) boot paths. Only broken firmware uses different paths for removable media. In those cases, the user can add their own startup.nsh. For the compliant case, selecting "Shell" from the EFI boot menu should go to the shell. (From OE-Core rev: d031cdbf40231b8c103d78c69252bf9d584d0605) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Always use rootwait and document kernel parameters usedDarren Hart2013-03-221-8/+8
| | | | | | | | | | | | | | | | Without a reliable way of knowing if the target device with be an asyncronous block device on the target (MMC or USB), err on the side of caution of always specifcy "rootwait", ensuring the kernel will wait for the device to appear and not abort if it hasn't appeared in time for mount. Document the remaining kernel parameters added by this script on the same line as rootwait. (From OE-Core rev: 5b6a6a3872fd341cf978be40c69707223e3c29df) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Boot with ro kernel parameter instead of rwDarren Hart2013-03-221-1/+1
| | | | | | | | | | | | | | | | | There is no need to boot with "rw". Booting with "ro" will allow for fsck to be run during boot, and a proper /etc/fstab will still ensure the rootfs is "rw" by the time the user can interact with the system. Change the "rw" to "ro" in the kernel parameters specified in the generated grub.cfg file. Fixes [YOCTO 4036] mkefidisk.sh hardcodes 'rw' as root mount option (From OE-Core rev: 960f0cbf85a4124adbc74d8b2ceb09a7d39ecc04) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Cleanup comment lengthDarren Hart2013-03-221-2/+2
| | | | | | | | | | Keep comments under 80 characters in length. (From OE-Core rev: 1fbab279edd0057193900646cf9f66323698e774) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk: Always specify a root= kernel parameterDarren Hart2013-03-221-2/+4
| | | | | | | | | | | | | | | | | The current script only replaces an existing root= kernel parameter which can result images created without a root= paremeter, even though the script expects a target rootfs parameter. Rather than replacing the root= parameter, delete the root= parameter if it exists, then append an appropriate root= parameter. Fixes [YOCTO 4035] mkefidisk.sh forgets to add root= parameter (From OE-Core rev: e5dbec7e7d3bb29676280823b0337ad429c75120) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk.sh: create a proper ESPKoen Kooi2013-03-181-0/+8
| | | | | | | | | | | | | The script was creating a FAT fs with EFI files in it, but wasn't setting the GPT GUID. Using 'gummiboot install' natively failed because of the missing GPT GUID, so fix that. While we're there also set the name to "EFI System Partition". (From OE-Core rev: 203ca80ee27948e2c68aab8ea48e51ff1c1157d5) Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it.Koen Kooi2013-03-101-1/+3
| | | | | | | | | | | | | | | The script greps for 'Disk', which doesn't work when your crazy Dutch distro has parted call it 'Schijf', so force LANG=C. The second problem is that 'Disk' might be a substring in the Model entry: [root@Angstrom-F16-vm-rpm contrib] # parted /dev/sdc unit mb print Model: SanDisk SDDR-113 (scsi) Disk /dev/sdc: 3905MB (From OE-Core rev: 2e404930f6fc7d818d2f429793e84bce77163afd) Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* mkefidisk.sh: Add script to do an EFI install on the hostDarren Hart2012-09-211-0/+255
Sometimes it is convenient to prepare a bootable image from the host rather than using a live-image to install to a disk on the target. This script takes a live image as input, partitions a device, and performs the installation just as the installer would if run on the target. (From OE-Core rev: 7225c6739f9f1e51741a42437692868165aa1dfe) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>