aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/contrib/mkefidisk.sh
AgeCommit message (Collapse)Author
2017-01-09gummiboot: Remove/change gummiboot references with systemd-bootAlejandro Hernandez
After systemd-boot was introduced, its been tested for a while with no major issues being found until now, this patch completely replaces all gummiboot instances with systemd-boot ones, taking the next step into cleaning up systemd-boot/gummiboot. [YOCTO #10332] Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-06mkefidisk.sh: add deprecation warning to the outputEd Bartosh
mkefidisk.sh will soon be deprecated in favor of .wic images. Added deprecation warning to the script to inform users that this script will soon be removed from the codebase. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-19mkefidisk.sh: mount images as read-onlyRaymond Tan
Mount the hddimg and rootfs.img as read-only when creating the bootable image on the medium. Otherwise, the md5 checksum values of the hddimg will be altered. As this changed checksum value might cause issue for users whom would reuse the hddimg. Signed-off-by: Raymond Tan <raymond.tan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-07mkefidisk.sh: add boot log on consoleTrevor Woerner
Hooking up a serial console is a "developer mode", the chances are pretty good developers are interested in watching the kernel boot log on the console so they can spot any problems or diagnose any failed boots (e.g. can't find root fs). Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-07mkefidisk.sh: add startup script for automated bootTrevor Woerner
Regardless of which image is built using which layers, try to ensure the image on the SD device being prepared is the one that is booted automatically when the board is powered. Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-16mkefidisk: Create interactive menu for the scriptBruno Bottazzini
If it is passed only the image parameter, it will show some interactive options to help to conclude the script. With this patch it will detect devices available in the machine, asking to choose what it is wanted to be flashed. it will suggest the target device. If it is a SD card the suggestion is /dev/mmcblk0. If it is a pendrive it will suggest to use /dev/sda. Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-04-27mkefidisk.sh: be more explicit with device errorPaul Eggleton
* Specify whether the device can't be found or can't be written to * Give a hint to use sudo Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27mkefidisk.sh: fix hanging on non-writeable devicePaul Eggleton
If cleanup() is called early on, as happens when the device isn't writeable, then none of the mount point variables are set; thus the script was calling grep with only one argument and appeared to hang since it was waiting for input on stdin. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27mkefidisk.sh: use script mode when running partedPaul Eggleton
This avoids parted showing prompts and thus effectively hanging the script in in the case of initially malformed disks. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23mkefidisk.sh: Add signal handlingDarren Hart
Add basic signal handling to unmount and remove any temporary files. Correct a quoting issue with the die() function caught testing signal handling. Fix a minor typo in "formatting" output. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23mkefidisk.sh: Fix redirection to 1Darren Hart
The current script intends to redirect stderr to stdout, but instead redirects to a file named 1. No doubt a regex replace error. Replace all instances of 2>1 with 2>&1. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23mkefidisk.sh: Remove initrd entry for gummibootDarren Hart
My previous patch adding gummiboot support was missing the line to remove the initrd line from the boot config. This was an oversight in copying over the grub setup to gummiboot. Add the necessary logic to remove it. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Reduce output and add verbose flagDarren Hart
Remove superfluous output from commands, add a -v verbose flag, and cleanup output. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Make the rootfs copy the last stepDarren Hart
Copying the rootfs is the most time intensive task. Move it last so if we are to encounter other errors, we do so quickly and error out. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Add die() and cleanup() routinesDarren Hart
Currently the script will attempt to continue even after a fatal error. Add a die() routine which will abort in the case of a fatal error and call a cleanup() routine to unmount any images or devices and remove the TMPDIR. Move the variable assignment and directory creation earlier in the script, making it more obvious what we need to clean up. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Improve loggingDarren Hart
Add logging functions: error, warn, info, and success, using tput to add color highlighting. Use these routines throughout the script, replacing echo statements and adding "|| error" in several places to eliminate silent failures. Add a simple exit block which checks for issues encountered while running. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Copy the EFI dir recursivelyDarren Hart
Rather than only copying the EFI/BOOT dir, copy the entire EFI dir recursively. This allows for custom configurations to be enabled implicitly with no extra work required. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Add gummiboot supportDarren Hart
Fixes [YOCTO 6295] Add gummiboot support for images built using: EFI_PROVIDER="gummiboot" Add conditional configuration for GRUB and gummiboot. Provide some messaging about which is being performed. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Add mount error checkingDarren Hart
Provide reasonable feedabck if the mount commands fail. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-19mkefidisk.sh: Use all caps for volume namesDarren Hart
Avoid some mkfs warnings by using all caps in the volume names. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-24mkefidisk.sh: Allow symlink for deviceDarren Hart
Allow the user to specify a symlink as the host device. If a link is used, mkefidisk will now dereference it and use the link target when looking for sysfs information. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-30mkefidisk.sh: Allow using a loopback mounted fileJason Wessel
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. 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>
2013-08-05scripts/contrib/mkefidisk.sh: fix bashismChen Qi
Remove the function keyword. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-18scripts/contrib/*: fix arithmetic bashismPaul Eggleton
Apparently $[...] isn't valid in dash, so use $((...)) instead for mkefidisk.sh and ddimage that both start with $!/bin/sh. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-02mkefidisk: Unmount after partitioningDarren Hart
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. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-29mkefidisk: Attempt to automatically unmount target deviceDarren Hart
With automounters abounding it makes more sense to attempt to unmount the device rather than abort, just like ddimage does. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-22mkefidisk: Use msdos partition tablesDarren Hart
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. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-22mkefidisk: Remove startup.nshDarren Hart
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. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-22mkefidisk: Always use rootwait and document kernel parameters usedDarren Hart
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. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-22mkefidisk: Boot with ro kernel parameter instead of rwDarren Hart
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 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>
2013-03-22mkefidisk: Cleanup comment lengthDarren Hart
Keep comments under 80 characters in length. 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>
2013-03-22mkefidisk: Always specify a root= kernel parameterDarren Hart
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 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>
2013-03-18mkefidisk.sh: create a proper ESPKoen Kooi
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". 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>
2013-03-09mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it.Koen Kooi
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 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-20mkefidisk.sh: Add script to do an EFI install on the hostDarren Hart
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. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>