summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files
Commit message (Collapse)AuthorAgeFilesLines
* initrdscripts: merge multiple "mkdir" callsMax Kellermann2019-05-071-5/+1
| | | | | | | | | | Reduce overhead. (From OE-Core rev: 31e6ea22523ded6a4e4f46472ab95ed17efe890b) Signed-off-by: Max Kellermann <max.kellermann@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* toolchain-shar-extract/init-install-efi-testfs: Unify question spacesGianfranco Costamagna2019-04-041-1/+1
| | | | | | | | | | | | unify the spacing for questions in various places e.g. before the [Y/n] there should be a space, and before "?" there should be none. Unify the questions where the system expect an answer from the end user. (From OE-Core rev: 7a3f128b19e55b751e81bc676e5946544b0c8735) Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: improve info messageAnuj Mittal2018-10-121-1/+1
| | | | | | | | | | Let users know that the installation was successful and that pressing Enter would lead to a reboot. (From OE-Core rev: a5993d9afab060d07213c14c0188422c9e258693) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts/init-live.sh: fix mounts w/ spaces fail to move to real rootfsArsalan H. Awan2018-06-291-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are spaces in the mount points of devices e.g.: a partition mounted at "/run/media/My Root Partition-sda1", the initrd fails to move such mount points over to the corresponding directories at /media under the real root filesystem, and the mount points would appear at the same location as they were mounted on when detected by initrd, for example: here: "/run/media/My Root Partition-sda1" instead of here: "/media/My Root Partition-sda1" This causes issues such as: * The disks/partitions cannot be formated with any filesystem using e.g. mkfs.ext4 or mke2fs in general. When tried to do so by making sure the device is not mounted, it failed with errors such as: > /dev/sda1 is apparently in use by the system; will not make a filesystem here! > /dev/sda1: Device or resource busy while setting up superblock * The read/write operations become extremely slow. e.g. Under testing, it took approx. 2 hours just to copy 700 MB of data to the partition, and it took more than 40 minutes to delete that data from it. Same operations took under 5 minutes on a partition that had no spaces in its mount point (or that was successfully moved to real root by initrd and appeared under /media instead of /run/media). This commit fixes such issues by quoting the arguments of failing mount move commands and by parsing OCT or HEX encoded special characters such as spaces to ASCII charecters in the mount points as kernel populates the procfs like so. (From OE-Core rev: 6f8f984ba363f764e83290b972ec31a90aad1603) Signed-off-by: Arsalan H. Awan <Arsalan_Awan@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: add timeout for legacy grubCatalin Enache2018-06-041-0/+2
| | | | | | | | | | | | | After installing an image from an iso, booting the system using the legacy boots makes the grub prompt wait for an enter. This is not desirable since many of this devices are embedded devices that should start by them self without user entry. (From OE-Core rev: f6d85426e48d458d0835d4fd3314ce53ab92bd38) Signed-off-by: Catalin Enache <catalin.enache@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: init-install(-efi).sh: don't assume 20M boot partitionCalifornia Sullivan2018-04-032-4/+26
| | | | | | | | | | | | | | | | | | | | | With multi kernel support in the installer we can exceed this limit. Calculate a sane size by checking the size of the original boot partition minus some objects we know won't be installed, plus some extra space for users. In addition, in the common case where only one small kernel is present to be installed, we actually get a smaller boot partition with less wasted space. Also add VIRTUAL-RUNTIME_base-utils to RDEPENDS where these scripts are used, as they're needed for the du command. [YOCTO #12583]. (From OE-Core rev: 2ca601bef44a07512c93b8452cf9001dce402617) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: format rootfs partition as ext4Anuj Mittal2018-03-282-6/+6
| | | | | | | | | | | Use ext4 filesystem instead of ext3 when using the live image to install on target. wic defaults to ext4 as well. (From OE-Core rev: db6c3d681807cfef098ead1db098f5268e1eb055) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install.sh: support multiple kernels and don't assume vmlinuzCalifornia Sullivan2018-03-061-3/+34
| | | | | | | | | | | | | | Since kernels will not necessarily be installed as vmlinuz anymore, don't assume that's its name for either the bootloader config or the copy of the kernel. Also, allow installing multiple kernels by searching for common kernel names. (From OE-Core rev: 5d66a4ce7f2595e75fe2af62c11ee957540ca067) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: Update to support installing multiple kernelsCalifornia Sullivan2018-03-061-5/+10
| | | | | | | | | | | | | | | We can no longer rely on the kernel having a static name of "vmlinuz". This means we can't use it as a sentinel value in our sed commands, and we can't just copy vmlinuz to the boot directory. Instead, we'll use "root=" as the sentinel value for our sed commands, and we'll search for common kernel names to copy into our boot directory. (From OE-Core rev: 3d67edb695368bfa5917dca2aab6a8dc4c437efc) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* install*.sh: add short sleep after parted commandsCalifornia Sullivan2017-12-022-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I wasn't able to install to my Optane SSD due to the following error: Formatting /dev/nvme0n1p1 to vfat... mkfs.fat 4.1 (2017-01-24) mkfs.vfat: unable to open /dev/nvme0n1p1: No such file or directory Target install-efi failed A couple lines later I see: [ 10.265401] nvme0n1: p1 p2 p3 Then looking at the device itself after booting from a USB stick: root@intel-corei7-64: ~# ls /dev/nvme0n1* /dev/nvme0n1 /dev/nvme0n1p1 /dev/nvme0n1p2 /dev/nvme0n1p3 So it looks like the parted commands return before the device node is actually created. Work around this issue by waiting for device nodes for a short duration. (From OE-Core rev: 9daafd49b448122e35d67a1637ce2212793a4dc5) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: fix grub-install commandCalifornia Sullivan2017-12-021-1/+1
| | | | | | | | | | | | | The grub_version variable was calling 'grub-install -v' (verbose) instead of 'grub-install -V' (version) causing unexpected failures. Fixes bug [YOCTO #12111]. (From OE-Core rev: 38dcbd96e82b1c40576a0514f053266429dca5d1) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-live-boot: disable systemd-update-done.service on live imagesCarlos Alberto Lopez Perez2017-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | When systemd is used, it will invoke a service on first boot that triggers a rebuild of ldconfig caches (rebuild dynamic linker cache). This is fine on the first boot of a system that has been installed, but it makes no sense on a live system. The worst part is that rebuilding this caches is slow and it causes the live system to take longer to boot. (I measured this in 30 seconds longer on a standard PC system booting core-image-sato live from an USB memory). Disable this by touching /etc/.updated and /var/.updated on the live initramfs. For more details see https://bugzilla.redhat.com/show_bug.cgi?id=1201725 and https://www.freedesktop.org/software/systemd/man/systemd-update-done.service.html (From OE-Core rev: d73493e63c506dca0e767ff183ca36bc48c2f03e) Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* gummiboot: Remove/change gummiboot references with systemd-bootAlejandro Hernandez2017-01-092-12/+12
| | | | | | | | | | | | | | | 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] (From OE-Core rev: f9a61d3400ad9068a6d83b8eb6aefe3098c58e68) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: add support for NVME target installJoe Konno2016-11-152-2/+8
| | | | | | | | | | | | | | Add awareness of /dev/nvme* block devices to install scripts. As presently written, installer knows only of /dev/sd* and /dev/mmcblk* block devices. Building upon scaffolding put in place by Awais in... 80ec9f627915 ("initrdscripts: handle mmc device as installer medium") (From OE-Core rev: b5a036ce958e3fe24690531712071abc14b48033) Signed-off-by: Joe Konno <joe.konno@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Fixes the install script failing when not finding any mmcblk ↵Alejandro Hernandez2016-08-302-4/+4
| | | | | | | | | | | | | | | | | | | | | | | devices The init-install.sh and init-install-efi.sh scripts perform a check to see which devices are available on a booted system for installation. Recently, the way we check for these devices changed on 993bfb, greping for devices found on /sys/block/, this change caused the installer to fail (at least) when not finding any mmcblk devices, due to the fact that we call sh -e to execute this script, so any command (grep) or pipeline exiting with a non-zero status causes the whole script to exit This patch throws in a harmless true exit status at the end of the pipeline(s) of the grep commands to avoid the installer script from exiting, fixing the issue. [YOCTO #10189] (From OE-Core rev: 384cf92ca9c3e66763c2c1ff2776c53d47ae25d6) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install*: /etc/mtab make a link rather than a copyAwais Belal2016-08-172-4/+4
| | | | | | | | | | | | | | | | Using a copy would only make management of devices erroneous and makes the system unstable in some scenarios as tools will have to manipulate both files separately. A link ensures that both files /proc/mounts and /etc/mtab will have the same information at all times and this is how it is handled on newer systems where there is such a need. Same is suggested by busybox. (From OE-Core rev: 9f9240d175acee274c04242fd5781094b3f5491b) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install*: only pick root mmc devicesAwais Belal2016-08-172-2/+14
| | | | | | | | | | | | | | | | Some eMMC devices show special sub-devices such as mmcblk0boot0 etc. The installation script currently pick all of them up and displays it to the user which makes some confusions because these sub-devices are pretty small and complete installation including rootfs won't be possible in most cases. We simply now drop these sub-devices and only present the user with the root of such mmc devices. (From OE-Core rev: 4b4d80306de8d8a2e3a2d784890f34e4a0ecfcf0) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts/init-install*: Add rootwait when installing to USB devicesCalifornia Sullivan2016-08-172-0/+11
| | | | | | | | | | | | | | | It can take a bit for USB devices to be detected, so if a USB device is your rootfs and you don't set rootwait you will most likely get a kernel panic. Fix this by adding rootwait to the kernel command line on installation. Fixes [YOCTO #9462]. (From OE-Core rev: 40e2d36573a7a6bce377b1f9653607065ba5ffb6) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-live-boot: Make sure we kill udev before switching root when live ↵Alejandro Hernandez2016-08-171-1/+3
| | | | | | | | | | | | | | | | | booting When live booting, we need to make sure the running udev processes are killed to avoid unexepected behavior, we do this just before switching root, once we do, a new udev process will be spawned from init and will take care of whatever work was still missing [YOCTO #9520] (From OE-Core rev: e88d9e56952414e6214804f9b450c7106d04318d) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts/init-install*: Select install target instead of looping throughCalifornia Sullivan2016-07-212-16/+28
| | | | | | | | | | | | | | Its not immediately apparent that more than one install target could be available. With this change we list the available devices up front then prompt the user for which one to use, reducing confusion. Fixes [YOCTO #9919]. (From OE-Core rev: e68774f684543fd75250e56ea88a5e0cb0a2dd0a) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: remove all root=foo from grub.cfgRobert Yang2016-04-031-1/+1
| | | | | | | | | | | | | There might be more than one root=/dev/foo in the config file which would cause unepected errros on the installed target, so remove all of them. [YOCTO #9354] (From OE-Core rev: ca402bc3bc4e9a5c3e19a6ca504017335212b2c9) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install.sh: fix disk_sizeRobert Yang2016-04-033-3/+3
| | | | | | | | | | It mis-matched "SanDisk" or "Disk Flags" before, which caused unexpected error. (From OE-Core rev: a68ac76c1b6ed4c1a2fbc944c5021c89fd26217f) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-live.sh: fix overlay fsRobert Yang2016-03-291-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The name changes from overlayfs to overlayo * The workdir is a must when mount * The updir must be a subdir of rootfs.rw This patch plus with another one which has been sent to linux-yocto can fix the error when boot iso: EXT4-fs (loop0): re-mounted. Opts: data=ordered Populating dev cache /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/rcS.d/S36udev-cache: line 73: can't create /etc/udev-cache.tar.gz: Read-only file system udev-cache: update failed! rm: can't remove '/etc/udev/cache.data': Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system rm: can't remove '/tmp': Read-only file system ln: /tmp/tmp: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system ln: /etc/resolv.conf: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system /etc/init.d/rc: /etc/rcS.d/S37populate-volatile.sh: line 1: can't create /etc/volatile.cache.build: Read-only file system (From OE-Core rev: ba918e0e36418ec6e14aef537ff4fdf45af6d8d4) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-live.sh: fix ROOT_MOUNTRobert Yang2016-03-291-1/+1
| | | | | | | | | The '/' in the end is not needed, which caused '//' in the path. (From OE-Core rev: 6b0fc87ced857763ae7e9d1012fb9f5c952c2cc8) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-live : make it easier to add custom boot targetsJérémy Rosen2016-03-201-12/+6
| | | | | | | | | | | | | | | | | | | | When booting from the live image, the label from the bootloader is passed to init.sh. init.sh uses the label to either boot a live image or call a script to take over and install the system. It is possible to add new labels to the bootloader via the LABELS family of variables, but the names in init.sh were hardcoded to install and install-efi this patch checks if a shell script with the same name as the label is available instead of using a hardcoded list. Any recipe can add such file and this provide a new boot target to the live image (From OE-Core rev: 2c10ca0fe612818cb43931b969ad2af5502f1e84) Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: fix mmc device as install targetUrs Fässler2016-02-111-7/+7
| | | | | | | | | | Installing from USB to an internal SD Card did not work with Linux 4.4 in Yocto jethro. With this patch, consistent names are used for the paritions. (From OE-Core rev: 00a45d2e50c4f044ee4099940dd7d13ca44f7187) Signed-off-by: Urs Fässler <urs.fassler@bbv.ch> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi: fix script for eMMC installationNg, Mei Yeen2015-12-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Running the install option from bootloader to install image to eMMC will fail with error: Formatting /dev/mmcblk01 to vfat... mkfs.fat 3.0.28 (2015-05-16) /dev/mmcblk01: No such file or directory This issue impacts both grub and gummiboot install option to eMMC device. The installation failure is due to the following: [1] Unable to partition eMMC as the partition prefix 'p' is not appended The condition checking failed with the additional /dev/ appended with the target device name. [2] The partition uuid for boot, root and swap partition is not captured for eMMC This fix updated the condition checking and changed the variables to reference the boot, root and swap partitions for UUID. [YOCTO #8710] (From OE-Core rev: a7d081c3db776c8b0734942df6bf96f811f15bd3) Signed-off-by: Ng, Mei Yeen <mei.yeen.ng@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi: fix script for gummiboot loaderNg, Mei Yeen2015-12-011-0/+1
| | | | | | | | | | | | | | | After running gummiboot loader install option, the installed target storage device boot parameter for root=PARTUUID is empty causing boot failure. This issue is only observed with gummiboot and not with GRUB loader. This fix assign the rootuuid of the rootfs partition for gummiboot loader. [YOCTO #8709] (From OE-Core rev: fd5fa06fe45ca1fdf20df4198ae323967244af5b) Signed-off-by: Ng, Mei Yeen <mei.yeen.ng@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: Avoid /mnt/mtab creation if already presentLeonardo Sandoval2015-09-181-1/+5
| | | | | | | | | | | | | | The base-files recipe installs /mnt/mtab (it is a softlink of /proc/mounts), so if an image includes the latter, there is no new to created it again inside the install-efi.sh script, otherwise an error may occur as indicated on the bug's site. [YOCTO #7971] (From OE-Core rev: 6c6c6528954952e1e323f5a26afd93b99913e6f2) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: Check if an installation device is presentLeonardo Sandoval2015-08-011-0/+5
| | | | | | | | | | | | In case there is no installation device present, give a better message to the user and abort installation. [YOCTO #7971] (From OE-Core rev: f1596b7169146afcb38db683eb6170a480422d73) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: handle mmc device as installer mediumAwais Belal2015-07-162-8/+32
| | | | | | | | | | | | | | | | | | Platforms which have the capability of using the MMC as an installer medium will present the same MMC device as an installation candidate. This happens because the MMC devices appear as mmcblk<X> and the current script strips up the <X> which is needed to identify an MMC device uniqely. This patch now updates the way device identifier stripping is done and handles the exclusion of installer device from installation candidates more generically. (From OE-Core rev: 80ec9f62791575de4948d7635dc6674abfac2193) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Properly delete partition tableEd Bartosh2015-06-232-2/+2
| | | | | | | | | | | Fixed deletion of the partition table by increasing amount of sectors from 2(correct for msdos PT) to 35 as GPT size is 34 sectors + 1 sector for protective MBR. (From OE-Core rev: 9be59c02901a6c9ecaaa293aea2e938edf9b122c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: code cleanup: replace /dev/$device -> $deviceEd Bartosh2015-06-232-46/+46
| | | | | | | | | Shortened code by including /dev/ prefix into variable. (From OE-Core rev: f2fe5735a2d2c5a5cbadd3486aa24a4931655526) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: code cleanup: Replace tabs with spacesEd Bartosh2015-06-232-52/+51
| | | | | | | | | Cleaned up spaces from init-install* shell scripts. (From OE-Core rev: 2cc5492a7e196adaab8bc35b48299c9e4d229ebc) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Specify partition name in parted command lineEd Bartosh2015-06-232-7/+9
| | | | | | | | | | | | | | parted allows to use names for partitions if GPT partition table is used on the device. msdos partitioning can have only partition types: 'primary', 'logical' or 'extended'. Used meaningful partition names in parted command line for GPT partitioning. (From OE-Core rev: ef2c6df7fcfd02ed45637f2e6b48f324d7a56b88) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Specify filesystem type in parted command lineEd Bartosh2015-06-232-7/+7
| | | | | | | | | | Explicitly specified filesystem type for parted mkpart command. This makes partition table to look more informative. (From OE-Core rev: 945a5172c2b996f0f307813d061250c39f77ebd2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Implement UUID supportEd Bartosh2015-06-231-6/+17
| | | | | | | | | | | | | | Used partition UUID in kernel command line to specify root partition. Searched root device by file system uuid in GRUB configuration. Used partition UUID in /etc/fstab to specify swap partition. Used filesystem UUID in /etc/fstab to specify boot partition. [YOCTO #6101] (From OE-Core rev: 4c223e0bd8770909dca1131580878eba6855e085) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Use GPT table with GRUB 2Ed Bartosh2015-06-231-12/+40
| | | | | | | | | | | | | Changed partition type from 'msdos' to 'gpt'. Added special partition for grub stage2 bootloader. NOTE: This is done only for GRUB 2 as legacy GRUB is rarely used and doesn't support GPT partitions. (From OE-Core rev: 9544ac920d65edb7ddb267482c84d6fc1b464912) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi: Implement UUID supportEd Bartosh2015-06-231-4/+7
| | | | | | | | | | | | | | | | | | | | | Using UUID in favor of device names is more reliable as UUID names are persistent. Device names can change as the order of adding device nodes is arbitrary. This sometimes results in device names switching on each boot, which can cause system fail to boot. Persistent naming solves these issues. Used partition UUID in kernel command line to specify root partition. Used partition UUID in /etc/fstab to specify swap partition. Used filesystem UUID in /etc/fstab to specify boot partition. [YOCTO #6101] (From OE-Core rev: f51b050e0df6ceaea07fbda99f54dc4aeaab334c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: make boot drive detection more genericAwais Belal2015-05-242-2/+4
| | | | | | | | | | | | | | | | | | | The init script that invokes install and install-efi scripts passes the first parameter that identifies the boot drive but in cases when this disk is labeled and kernel configurations allow disk labeling under /run/media/ this would pass the disk label. The earlier implementation considered that the drive name will be passed and in case the label is passed it fails and provides the boot drive as an option for installation driver. We now use a more generic approach to identify the boot drive which can handle both drive name as well as label if passed. (From OE-Core rev: 1964b697ddadc59e27087f9f1f6b24236f4addcc) Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: fix gummiboot entry installationReinette Chatre2015-04-211-3/+3
| | | | | | | | | | | | | | | After selecting the "install" gummiboot option of a Live image we are seeing boot failure resulting from the gummiboot entries not being installed correctly. This seems to be a problem in this init-install-efi.sh script where it incorrectly installs the gummiboot entries into the root filesystem, not the boot partition. We fix it by installing the entries in the boot partition. (From OE-Core rev: c9b06c79ed8a082d1b385e9f61721aeeda9bf1af) Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Skip CDROM devices during probeDrew Moseley2014-08-022-0/+6
| | | | | | | | (From OE-Core rev: e8ee8b765183fb3ebe5e94df6375c2fad111dcc7) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Strip partition number from live_dev_nameDrew Moseley2014-08-022-0/+2
| | | | | | | | | | | | | This is needed in case the boot disk was created with mkdiskimage. In that case the parameter passed is a variant of /dev/sda4 which includes the partition number. Without this change this install script will offer to install onto the live media. (From OE-Core rev: 9f6d7d42eaad225698de730d5c76bfe9523f4a78) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: Verify /sys based files exist before displaying themDrew Moseley2014-08-021-3/+8
| | | | | | | | | | | | Some mmc cards do not have all the data files in /sys/block populated. Check for existence before displaying the files to avoid erroring out of the install process. (From OE-Core rev: 4abe5563f61a228963e1e442ebc2df9f2d01be80) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Move boot media to /media/realroot for easy access after boot.Brian Lloyd2014-07-101-1/+9
| | | | | | | | | | | | | | | | | | | | | There are cases where software after boot may need to know the current boot disk. Under the current system, it is not guaranteed which disk is the boot. While /media/sda is a good guess, it isn't always right, nor is it a good assumption that only one boot disk is in the system. This gives a standard path to the original boot disk mount which can be used to, for instance, update the syslinux file on the boot media with a newer kernel, or updating the boot parameters to add user options for future boots. Knowing which disk is the boot media keeps from updating the non-boot disk when for instance multiple syslinux boot medias are plugged in (ie ensure correct syslinux is updated when the booted system is updated). (From OE-Core rev: 2be3b2607fd164d18498299dbfc020ff17dd2ca9) Signed-off-by: Brian Lloyd <blloyd@familyhonor.net> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: improve hard drive searching processDrew Moseley2014-07-101-32/+53
| | | | | | | | | | | | | | | | | | | | | (This patch was originally done against init-install.sh in OE-Core rev 358f0584d779825307eec08c023b5ff14e72cf9e) Previously, only unremovable hard drives are searched and are treated as candidates of target disks to intall into. However, it's possible that we're going to install the live image into a removable media such as an USB. This patch enables this possibility. In addition, this patch presents more information about the hard drives so that user may have more knowledge about which hard drive they are going to install their image into. (From OE-Core rev: 7386acf4ab63a5959e4907b29459b767f2bf2fdb) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-efi.sh: fix to handle the boot partition correctlyDrew Moseley2014-07-101-22/+25
| | | | | | | | | | | | | | | | | | | | | (This patch was originally done against init-install.sh in OE-Core rev aa67b1333b4774e1845f562085f7048df65a644f) Previously, the boot partition was created for the target hard drive but there was no corresponding entry for it in /etc/fstab. Besides, even if the boot partition was mounted, it would just result in odd directory hierarchy like /boot/boot/grub. However, what we really need is /boot/grub. This patch fixes this problem. Besides, for future maintance work, this patch also renames some of the intermediate directories. It uses more descriptive names like /tgt_root and /src_root. The name of /ssd is dropped. (From OE-Core rev: 3b1bae7ad8d36930aae840175c6a3433c1469772) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install.sh: Verify /sys based files exist before displaying themDrew Moseley2014-07-101-3/+8
| | | | | | | | | | | | Some mmc cards do not have all the data files in /sys/block populated. Check for existence before displaying the files to avoid erroring out of the install process. (From OE-Core rev: 1d73e3f9d9977382efdb0c111c556c6048bd60b4) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install-testfs.sh: add '--hotkey x' to 'test' menuentryCorneliu Stoicescu2014-07-031-1/+1
| | | | | | | | | Add a hotkey for the GRUB 'test' menuentry. This can be used by expect scripts to boot into 'test' when doing runtime hardware tests. (From OE-Core rev: 17b97fd6c724ba6e506cbadb18facdfd9c472e79) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: Try to boot if boot label is unknownDrew Moseley2014-06-291-0/+4
| | | | | | | | | | | | | The init-live.sh scripts assumes that the boot label set by the LABELS variable is either "boot", "install", or "install-efi". If that variable is overridden to something else we fall off the end of the case statement and the system locks up. If the boot label is unknown, at least attempt to boot. (From OE-Core rev: 98353862c08be2f1724aaad7aa4ed0521e3621f2) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>