summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/files/init-install.sh
Commit message (Collapse)AuthorAgeFilesLines
* init-install.sh: fix disk_sizeRobert Yang2016-09-271-1/+1
| | | | | | | | | | | | | | It mis-matched "SanDisk" or "Disk Flags" before, which caused unexpected error. (From OE-Core rev: 346b6ef31253789d7d6664a19297b6deec9d27a0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a68ac76c1b6ed4c1a2fbc944c5021c89fd26217f) [YOCTO #10333] Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: handle mmc device as installer mediumAwais Belal2015-07-161-4/+16
| | | | | | | | | | | | | | | | | | 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-231-1/+1
| | | | | | | | | | | 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-231-27/+27
| | | | | | | | | 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-231-27/+27
| | | | | | | | | 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-231-4/+6
| | | | | | | | | | | | | | 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-231-4/+4
| | | | | | | | | | 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>
* initrdscripts: make boot drive detection more genericAwais Belal2015-05-241-1/+2
| | | | | | | | | | | | | | | | | | | 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: Skip CDROM devices during probeDrew Moseley2014-08-021-0/+3
| | | | | | | | (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-021-0/+1
| | | | | | | | | | | | | 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.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>
* oe-core/init-install.sh: do not overwrite /etc/mtab if the link already existShan Hai2014-06-101-1/+3
| | | | | | | | | | | | | | | 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 (From OE-Core rev: 26a5121e966f465386da4ead40cc558fd877ce2b) Signed-off-by: Shan Hai <shan.hai@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-live-install: avoid using grub.d/40_customRobert Yang2014-05-271-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 8ae89d08454c11035eb2826a06e2243c9f2568b4) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: fix for /run/mediaChen Qi2014-05-201-2/+2
| | | | | | | | | | | | | | 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. (From OE-Core rev: be0327b6a900be5434b6b1f08277faf2f65d5da8) 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>
* init-install.sh: fix to handle the boot partition correctlyChen Qi2013-08-201-33/+29
| | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: aa67b1333b4774e1845f562085f7048df65a644f) 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>
* init-install.sh: improve hard drive searching processChen Qi2013-08-201-43/+55
| | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 358f0584d779825307eec08c023b5ff14e72cf9e) 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>
* Revert "initramfs-live-install*: fix the "install" boot option"Saul Wold2013-05-171-0/+1
| | | | | | | | | | | | | | | 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. (From OE-Core rev: 7d50133dd5c955d97193cc26458ebbf84dbfe0a4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-live-install*: fix the "install" boot optionNitin A Kamble2013-04-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: f8663eac872882e94d956b1b604304e92b865766) Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install.sh: remove unnecessary udev rules file to avoid error messagesChen Qi2013-03-291-0/+1
| | | | | | | | | | | | | | | | | /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] (From OE-Core rev: 6b6db7b4fb7aa17b8e29076decc830149b9d35bc) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* install: Look for grub2 files on the initramfs, not rootfsDarren Hart2013-02-221-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 8756a19bd24045d41ad20abb581e7872d0fc9ee6) 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>
* Add console kernel optionsRadu Moisan2012-07-191-0/+1
| | | | | | | | | | | | | 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] (From OE-Core rev: e18c59eb5a61f265b9cad6de68359fa1430b0e58) Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Clean up partition alignmentDarren Hart2012-07-091-4/+4
| | | | | | | | | | | | | | | | 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. (From OE-Core rev: 8aac6ecc5194c734dfd3d677017ab3ea045b2339) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Correct ext2->ext3 typo in loggingDarren Hart2012-07-091-1/+1
| | | | | | | | | | We create both the boot and root partitions as ext3 now, update the logging accordingly. (From OE-Core rev: 4436639eed57d818992596d6f0f7b53d3bbd4800) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install: Use swap_ratio in the calulation of swap_sizeDarren Hart2012-07-091-1/+1
| | | | | | | | | | | 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. (From OE-Core rev: 2678ce668499af0e90994b9da8c518e85de56651) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: Update install.sh to work with mmc devicesDarren Hart2012-05-061-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: bf403680d72e360c7382f540ea25cfdcbe77b4e5) 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>
* initrdscripts: add sleep to avoid kernel messages before install messageSaul Wold2011-12-081-0/+3
| | | | | | | | | | | As suggested by Darren Hart [YOCTO #725] (From OE-Core rev: ed76654c613d38095f085640acb6591b9739a60e) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Set an explicit path for the initrd scriptsDarren Hart2011-09-161-0/+2
| | | | | | | | | | | | | | | | 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 (From OE-Core rev: 4617ae0f433876037c2c9a0dfdb5e373e7a5c77b) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-live-install: add support for grub2Tom Zanussi2011-09-151-6/+25
| | | | | | | | | | | | 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. (From OE-Core rev: c67d03eb3684acab89e5972609e397087727e74e) Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* init-install.sh: Fix make partition and make file system issuesMei Lei2011-08-121-3/+3
| | | | | | | | | | | | | | | | [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. (From OE-Core rev: 67c9804e0416defb7c3f69bd02bbae3710e5be0a) Signed-off-by: Mei Lei <lei.mei@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Further cleanup of various poky referencesRichard Purdie2011-04-211-2/+2
| | | | | | (From OE-Core rev: fe73ea8c510877fe4e3c117985e8f3d0b79ddf1b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: remove the incorrect moblin message (Bug 368)Yu Ke2010-09-301-1/+1
| | | | | | | | | | 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>
* Major layout change to the packages directoryRichard Purdie2010-08-271-0/+170
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>