Commit Graph

34 Commits

Author SHA1 Message Date
Alejandro Hernandez 2dce2648e3 gummiboot: Remove/change gummiboot references with systemd-boot
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>
2017-01-09 13:39:11 +00:00
Joe Konno 85c9b9f9c6 initrdscripts: add support for NVME target install
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>
2016-11-15 15:19:54 +00:00
Alejandro Hernandez 087c580b28 init-install: Fixes the install script failing when not finding any mmcblk 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>
2016-08-30 07:57:50 +01:00
Awais Belal 92f505b016 init-install*: /etc/mtab make a link rather than a copy
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>
2016-08-17 10:35:41 +01:00
Awais Belal 993bfb55c7 init-install*: only pick root mmc devices
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>
2016-08-17 10:35:40 +01:00
California Sullivan df6694b7c8 initrdscripts/init-install*: Add rootwait when installing to USB devices
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>
2016-08-17 10:35:39 +01:00
California Sullivan 031c2f6ced initrdscripts/init-install*: Select install target instead of looping through
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>
2016-07-21 07:47:52 +01:00
Robert Yang 1f2a01b02e init-install-efi.sh: remove all root=foo from grub.cfg
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>
2016-04-03 15:51:35 +01:00
Robert Yang 3ce7d8cdc8 init-install.sh: fix disk_size
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>
2016-04-03 15:51:35 +01:00
Ng, Mei Yeen 1781a9afc6 init-install-efi: fix script for eMMC installation
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>
2015-12-01 21:32:14 +00:00
Ng, Mei Yeen f8087475de init-install-efi: fix script for gummiboot loader
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>
2015-12-01 21:32:14 +00:00
Leonardo Sandoval 5acf99d1af init-install-efi.sh: Avoid /mnt/mtab creation if already present
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>
2015-09-18 09:05:21 +01:00
Leonardo Sandoval 445c49ce50 init-install-efi.sh: Check if an installation device is present
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>
2015-08-01 22:24:07 +01:00
Awais Belal 525ba4ce29 initrdscripts: handle mmc device as installer medium
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>
2015-07-16 15:09:19 +01:00
Ed Bartosh 2173a0ec28 init-install: Properly delete partition table
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>
2015-06-23 11:47:29 +01:00
Ed Bartosh 68d8f6d2e4 init-install: code cleanup: replace /dev/$device -> $device
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>
2015-06-23 11:47:28 +01:00
Ed Bartosh 99a7c5b50d init-install: code cleanup: Replace tabs with spaces
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>
2015-06-23 11:47:28 +01:00
Ed Bartosh a10c4481f1 init-install: Specify partition name in parted command line
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>
2015-06-23 11:47:27 +01:00
Ed Bartosh 891cdacb62 init-install: Specify filesystem type in parted command line
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>
2015-06-23 11:47:26 +01:00
Ed Bartosh 78bacee0ac init-install-efi: Implement UUID support
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>
2015-06-23 11:47:24 +01:00
Awais Belal e1de8af487 initrdscripts: make boot drive detection more generic
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>
2015-05-24 07:19:18 +01:00
Reinette Chatre fc15878af4 init-install-efi.sh: fix gummiboot entry installation
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>
2015-04-21 07:20:27 +01:00
Drew Moseley cade601651 init-install: Skip CDROM devices during probe
(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>
2014-08-02 09:26:17 +01:00
Drew Moseley 112674d9fc init-install: Strip partition number from live_dev_name
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>
2014-08-02 09:26:16 +01:00
Drew Moseley 7a81bd4c34 init-install-efi.sh: Verify /sys based files exist before displaying them
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>
2014-08-02 09:26:16 +01:00
Drew Moseley 2f7c92c4b5 init-install-efi.sh: improve hard drive searching process
(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>
2014-07-10 17:38:33 +01:00
Drew Moseley ae724e46f4 init-install-efi.sh: fix to handle the boot partition correctly
(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>
2014-07-10 17:38:33 +01:00
Chen Qi 8293f56468 initrdscripts: fix for /run/media
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>
2014-05-20 14:53:12 +01:00
Stefan Stanacar 5f05bdda0b classes: Add gummiboot class
Adds a gummiboot class similar to grub-efi class and makes the necessary
changes so it can be used for live/hddimg images as well.

One can set EFI_PROVIDER = "gummiboot" in local.conf to use gummiboot instead of grub-efi.
Gummiboot requires some kernel options that are not enabled by default, so one has to build
with KERNEL_FEATURES_append = " cfg/efi-ext".

The install scripts have been updated too, keeping the old behaviour around,
but accounting for the new boot loader config files (if they exist).
It can be argued that the installer and bootimg are a bit wierd and not necessarily correct,
but I wanted to have the exact same behviour with gummiboot.
With the default EFI_PROVIDER = "grub-efi" nothing changes, everthing should be just as before.

I've tested live boot, install and normal boot on:
    - FRI2
    - genericx86-64 on NUC
with:
  EFI_PROVIDER = "gummiboot"
  KERNEL_FEATURES_append = " cfg/efi-ext"
in local.conf.

(From OE-Core rev: b457e40fc69cc6503dc566f16495f03606e5333b)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11 09:30:14 -07:00
Darren Hart 1917544d2f init-install-efi.sh: Remove unnecessary udev rules file to avoid errors
Fixes [YOCTO #5233]

Modeled after Chen Qi's fix to [YOCTO #3924] from oe-core commit:
6b6db7b4fb7aa17b8e29076decc830149b9d35bc
init-install.sh: remove unnecessary udev rules file to avoid error messages

/etc/udev/scripts/mount.sh is removed by init-install-efi.sh, but the
udev rules file which specifies the invocation of this script is not
removed, thus causing the error message during a live install:

/etc/udev/scripts/mount.sh: No such file or directory

The /etc/udev/rules/automount.rules no longer works once the mount.sh
script is removed. Remove it to avoid the error message.

(From OE-Core rev: 1f5a2b616d902b1158e348bf8c33b6d36e21cadc)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: mihaix.lindner@linux.intel.com
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:24:14 +01:00
Darren Hart e42fefe717 init-install-efi.sh: Fix root= specification
Fixes [YOCTO #5237]

The current grub.cfg manipulation depends on an existing root=
parameter. If this doesn't exist, the correct root= parameter will not
be added.

Instead, remove any existing root= parameters and add the correct one
explicitly.

(From OE-Core rev: 14b124122c1b7d10b9a3a96fe4617c6fc1c661c5)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: mihaix.lindner@linux.intel.com
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-24 17:24:14 +01:00
Saul Wold f371626f70 Revert "initramfs-live-install*: fix the "install" boot option"
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>
2013-05-17 09:37:29 +03:00
Nitin A Kamble 1695345393 initramfs-live-install*: fix the "install" boot option
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>
2013-04-16 12:06:40 +01:00
Darren Hart 64f7feb5c3 EFI: Make installer EFI aware
[YOCTO #1919]

Create a basic EFI installer script modeled after the existing installer
and add it to a new initramfs-live-install-efi recipe. Update the
init-live.sh script to distinguish between LABEL=install and
LABEL=install-efi and select the appropriate script. Add the efi
installer to core-image-minimal-initramfs.

Update grub-efi.bbclass to use "LABEL=install-efi" when it detects a
label of "install". This is clearly not ideal, but a proper fix would
involve decoupling the LABELS assignment from the image-live.bbclass
usage of SYSLINUX_LABELS. We should be able to address that in a
follow-on clean-up series.

V2: Include missing initramfs-live-install-efi_1.0.bb
V3: Rebase after Radu's console_params fix

(From OE-Core rev: 4bce3417917a3e88ba6529db394525fba82e0699)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 17:49:48 +01:00