aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-install.sh
AgeCommit message (Collapse)Author
2018-06-03init-install: add timeout for legacy grubCatalin Enache
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. Signed-off-by: Catalin Enache <catalin.enache@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-03initrdscripts: init-install(-efi).sh: don't assume 20M boot partitionCalifornia Sullivan
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]. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-28initrdscripts: format rootfs partition as ext4Anuj Mittal
Use ext4 filesystem instead of ext3 when using the live image to install on target. wic defaults to ext4 as well. Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-03-06init-install.sh: support multiple kernels and don't assume vmlinuzCalifornia Sullivan
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. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-02install*.sh: add short sleep after parted commandsCalifornia Sullivan
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. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-02init-install: fix grub-install commandCalifornia Sullivan
The grub_version variable was calling 'grub-install -v' (verbose) instead of 'grub-install -V' (version) causing unexpected failures. Fixes bug [YOCTO #12111]. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-15initrdscripts: add support for NVME target installJoe Konno
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") Signed-off-by: Joe Konno <joe.konno@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-30init-install: Fixes the install script failing when not finding any mmcblk ↵Alejandro Hernandez
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] Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-17init-install*: /etc/mtab make a link rather than a copyAwais Belal
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. Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17init-install*: only pick root mmc devicesAwais Belal
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. Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-17initrdscripts/init-install*: Add rootwait when installing to USB devicesCalifornia Sullivan
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]. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-21initrdscripts/init-install*: Select install target instead of looping throughCalifornia Sullivan
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]. 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>
2016-04-01init-install.sh: fix disk_sizeRobert Yang
It mis-matched "SanDisk" or "Disk Flags" before, which caused unexpected error. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11initrdscripts: fix mmc device as install targetUrs Fässler
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. Signed-off-by: Urs Fässler <urs.fassler@bbv.ch> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16initrdscripts: handle mmc device as installer mediumAwais Belal
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. Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-23init-install: Properly delete partition tableEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-23init-install: code cleanup: replace /dev/$device -> $deviceEd Bartosh
Shortened code by including /dev/ prefix into variable. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-23init-install: code cleanup: Replace tabs with spacesEd Bartosh
Cleaned up spaces from init-install* shell scripts. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-23init-install: Specify partition name in parted command lineEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-23init-install: Specify filesystem type in parted command lineEd Bartosh
Explicitly specified filesystem type for parted mkpart command. This makes partition table to look more informative. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-23init-install: Implement UUID supportEd Bartosh
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] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-23init-install: Use GPT table with GRUB 2Ed Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-05-23initrdscripts: make boot drive detection more genericAwais Belal
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. Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-08-02init-install: Skip CDROM devices during probeDrew Moseley
Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-08-02init-install: Strip partition number from live_dev_nameDrew Moseley
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. Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-07-10init-install.sh: Verify /sys based files exist before displaying themDrew Moseley
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. Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-06-10oe-core/init-install.sh: do not overwrite /etc/mtab if the link already existShan Hai
Overwriting of /etc/mtab would fail as below if the /etc/mtab link already exist during installation phase, this patch fix this problem by checking existance of the link before try to overwrite it. Error message during installation if the /etc/mtab exists: "cat: /proc/mounts: input file is output file Signed-off-by: Shan Hai <shan.hai@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-05-23initramfs-live-install: avoid using grub.d/40_customRobert Yang
We have this in recipes-bsp/grub/grub/40_custom: [snip] menuentry "Linux" { set root=(hd0,1) linux /vmlinuz root=__ROOTFS__ rw __CONSOLE__ __VIDEO_MODE__ __VGA_MODE__ quiet } [snip] These lines are only for initrdscripts/files/init-install.sh, the side effect is that it would make the target's grub-mkconfig doesn't work well since the 40_custom will be installed to /etc/grub.d/40_custom, the grub-mkconfig will run the 40_custom, and there will always be a 'menuentry "Linux"' menu in grub.cfg no matter it is valid or not, we can do this in init-install.sh rather than grub to fix the problem, which is also much simpler. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-05-20initrdscripts: fix for /run/mediaChen Qi
mount.sh in udev-extraconf was modified to use /run/media instead of /media. Unfortunately, our scripts in initrdscripts have some dependency on the auto-mounting mechanism proviced by udev-extraconf. So these scripts should also be fixed to use /run/media instead /media, otherwise, our live image cannot work correctly. 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>
2013-08-20init-install.sh: fix to handle the boot partition correctlyChen Qi
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. [YOCTO #5018] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-20init-install.sh: improve hard drive searching processChen Qi
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. [YOCTO #5018] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-17Revert "initramfs-live-install*: fix the "install" boot option"Saul Wold
This was not the correct fix for this issues, it turns out that base-files package was getting installed un-intentionally when rpm-postinsts was split out. The base-files recipe lays down the link that caused the cat failure. [YOCTO #4504] This reverts commit 45e460d0846f0f660128dc06064b597ce40282b3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-16initramfs-live-install*: fix the "install" boot optionNitin A Kamble
The install boot option was giving the following error when one tried to install the live image on a permanent storage of a BSP. cat: write error Invalid argument Installation image failed sh: can't access tty: job control turned off Further digging into the issue, found out that the install script was trying to do this: cat /proc/mounts > /etc/mtab And in the base-files recipe the /etc/mtab is made soft link to /proc/mounts. So the cat command was failing to write on /etc/mtab. As the contents of the /proc/mounts is already reflected in the /etc/mtab file due to the symlink-ing, there is no need for this step to recreate /etc/mtab in the install script. So just removing this unnecessary step, which solves the install issue of the live images. Fixes this bug: [YOCTO #4229] Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29init-install.sh: remove unnecessary udev rules file to avoid error messagesChen Qi
/etc/udev/scripts/mount.sh is removed by init-install.sh, but the udev rules file which specifies the invocation of this script is not removed, thus causing the error message '/etc/udev/scripts/mount.sh: No such file or directory' shown at a live install. The /etc/udev/rules/automount.rules no longer works once the mount.sh script is removed. So we remove it to avoid the error message. [YOCTO #3924] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-22install: Look for grub2 files on the initramfs, not rootfsDarren Hart
Fixes [YOCTO #3870] atom-pc - cannot boot image on netbook after install The problem here is that grub2 is installed but a grub 1 menu.lst is created at install time. At boot, grub2 doesn't find a grub.cfg file and drops to the grub shell. This happens because the installer is looking for 40_custom (a grub2 file) on the rootfs, but grub2 isn't installed on the rootfs. It exists in the initramfs. Patching the installer to look on the initramfs resolves the problem. Note that the problem may have occurred if grub2 used to be installed on the rootfs but was later removed. In any case, the installer is HORRIBLE and really needs to be completely redesigned as part of the deployment effort. For now, this should get the live image installer limping along again. Tested on a Toshiba NB-305. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: alexandru.c.georgescu@intel.com Cc: sgw@linux.intel.com Cc: ross.burton@intel.com Cc: richard.purdie@intel.com Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19Add console kernel optionsRadu Moisan
Live image installer did not preserve BSP specified console= kernel parameter. This patch updates the init scripts that are responsible for grub.cfg creation so that options like console= are passed allong from installer to installed img [YOCTO #2426] Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09init-install: Clean up partition alignmentDarren Hart
The current partitioning scheme leaves a 1MB gap between all the generated partitions by adding a 1 to the end of the last partition to use as the start of the next. parted is smart enough to not overlap start and end positions of the same value. This avoids the 1 MB gaps. Rather than pad the disk with 1MB in the beginning and cut it off at the MB boundary on the end, we can use 0% and 100% to allow parted to do the required math and use as much of the disk as possible. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2012-07-09init-install: Correct ext2->ext3 typo in loggingDarren Hart
We create both the boot and root partitions as ext3 now, update the logging accordingly. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2012-07-09init-install: Use swap_ratio in the calulation of swap_sizeDarren Hart
swap_size currently uses a hard coded percentage and ignores the swap_ratio variable. Fortunately they are the same value currently. Make the calculation use the variable to avoid problems in the future. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2012-05-06initrdscripts: Update install.sh to work with mmc devicesDarren Hart
Fixes [YOCTO #2385] The installer only searches for hd[ab] sd[ab]. Some newer BSPs have mmcblk devices that should be used as the install target. These devices also have a partition prefix (mmcblk0p1 instead of mmcblk01). As they are detected asynchronously, it is necessary to add the rootwait kernel parameter to avoid a race condition trying to mount the root device. As BSPs like the FRI2 and the sys940x have mmc devices and will have a 1.2 release, we should push this to 1.2.1. The changes are perfectly contained and easily verified. Test for an mmcblk device and add the p partition prefix if necessary. Add the rootwait kernel parameter when an mmcblk device is detected. Replace the series of explicit umount commands with a single umount using a wildcard. This will find all the partitions and will not try to unmount non-existant devices. Avoid copy and paste errors by replacing /dev/${device}${pX} references with the previously assigned rootfs, bootfs, and swap variables. These changes have been tested on the FRI2 Sato image which installed to /dev/mmcblk0 as well as the N450 Sato image which installed to /dev/sda. Both were successful. Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-08initrdscripts: add sleep to avoid kernel messages before install messageSaul Wold
As suggested by Darren Hart [YOCTO #725] Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-09-16Set an explicit path for the initrd scriptsDarren Hart
If we don't set PATH, then the shell will specify one for us. Busybox adds the sbin dirs, but bash does not. I hit an issue where bash (among other things) ended up in my initrd and the boot scripts failed due to a bad default PATH. While that is a separate issue, we should not be at the mercy of the shell's default PATH. Update the initrdscripts to all specify: PATH=/sbin:/bin:/usr/sbin:/usr/bin Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-15initramfs-live-install: add support for grub2Tom Zanussi
grub2 needs a different set of install steps from grub 0.97. This adds them to init-install.sh and adds an install-time check that determines which version is being used and which steps to use depending on the version of grub selected. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
2011-08-12init-install.sh: Fix make partition and make file system issuesMei Lei
[YOCTO #1151] Change the offset from the beginning of the disk to aligne the blocks. In this script, we use mkfs.ext3 to create file system after partition, but we use mkpartfs to create file system repeatly, and get some warnings about choose another specific tools to create file system for reliability. So use mkpart instead of mkpartfs and only use mkfs.ext3 to create file system. Signed-off-by: Mei Lei <lei.mei@intel.com>
2011-04-21Further cleanup of various poky referencesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2010-09-30initrdscripts: remove the incorrect moblin message (Bug 368)Yu Ke
When install the live image into netbook/emenlow, the install tool prompt: # Found drive at /dev/sda. Do you want to install moblin there ? [y/n] The "moblin" here should be replaced by "poky". Fix [BUGID #368] Signed-off-by: Yu Ke <ke.yu@intel.com>
2010-08-27Major layout change to the packages directoryRichard Purdie
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>