Commit Graph

205 Commits

Author SHA1 Message Date
Alexander Kanavin
dc9faa3cdc meta: remove consecutive blank lines
Some of them were introduced by mass-removal of S = WORKDIR/git assignments;
rather than try to fix up (or redo) just these, I've run this sed command over
the whole tree:

sed -i -z -E 's/([ \t\f\v\r]*\n){3,}/\n\n/g' `find . -name *.bb -o -name *.inc`

The rationale is that more than one empty line is wasting vertical screen space, and
does nothing for readability.

(From OE-Core rev: cedc4ff7c9bcfb22a20e43e47f9759f4007a4f1a)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-20 12:07:27 +01:00
Alexander Kanavin
efb0410d38 meta: set S from UNPACKDIR in recipes that use only local files
There is no need to have two assignments; also setting S from
UNPACKDIR (and not vice versa) is more logical as unpack
task comes first, and tasks that come after unpack use S to access
unpack results.

Also adjust reference test data in selftest/recipeutils to reflect changes in test recipes.

(From OE-Core rev: f64b7e5fb3181734c8dde87b27e872a026261a74)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-06-20 12:07:26 +01:00
Christos Gavros
07b2d077c7 initramfs-framework: remove hard dependency with busybox
In 'finish'script the Switch_root command with option -c is busybox specific.
When package-core-base-utils is selected the boot is breaking with message
"Switch_root: invalid option — ‘c’.It was reproduced using qemu.
Remove -c option to make it compatible with both providers.
It is tested using qemu with busybox and package-core-base-utils. In both cases
qemu boots successfully and filesystem is accessible.
Fixes [YOCTO #15716]

CC: Yoann Congal <yoann.congal@smile.fr>
CC: Randy MacLeod <randy.macleod@windriver.com>
CC: jbk <jbk@mm-software.com>
CC: Raj Khem <raj.khem@gmail.com>
CC: Adrian Freihofer <adrian.freihofer@gmail.com>
(From OE-Core rev: 0f745024fd40518f98390008b4f613d5641df416)

Signed-off-by: Christos Gavros <gavrosc@yahoo.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-04-11 11:49:59 +01:00
Walter Schweizer
e78b72075f initrdscripts: add UBI support
Mounting the rootfs failed when it was on UBI.
This patch allows the rootfs to live on UBI.

(From OE-Core rev: 197867f854cc19493b28fcd2300179cfc407e0a6)

Signed-off-by: Walter Schweizer <walter.schweizer@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-08 12:37:20 +00:00
Hongxu Jia
deb0df0774 initramfs-module-install: remove loongarch64 from COMPATIBLE_HOST
Due to initramfs-module-install runtime depend on grub, and grub did not
support loongarch64, remove loongarch64 from COMPATIBLE_HOST

$ echo "MACHINE = 'qemuloongarch64'" >> conf/local.conf
$ bitbake world
|ERROR: Nothing RPROVIDES 'grub' (but oe-core/meta/recipes-core/initrdscripts/
initramfs-module-install_1.0.bb RDEPENDS on or otherwise requires it)
|grub was skipped: incompatible with host loongarch64-wrs-linux (not in
COMPATIBLE_HOST)
|NOTE: Runtime target 'grub' is unbuildable, removing...
|Missing or unbuildable dependency chain was: ['grub']
|ERROR: Required build target 'meta-world-pkgdata' has no buildable providers.
|Missing or unbuildable dependency chain was: ['meta-world-pkgdata',
'initramfs-module-install', 'grub']

(From OE-Core rev: 6440e1010ade2b4207879a2e8cd288bcd714a445)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-03 11:05:03 +00:00
Ulrich Ölmann
2f09eddfeb initramfs-framework: init: fix typo
Amend a small typing error.

(From OE-Core rev: c4ca9161d9de1a522a34c9088dedf6c346afbbed)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-30 17:00:51 +01:00
Ulrich Ölmann
8de3508743 initramfs-framework: fix typos
Fix typos in debugging and error messages.

(From OE-Core rev: 4995e222ebdc9b5508c2f03a11868f184e4629a0)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-25 11:50:58 +01:00
Igor Opaniuk
024205238e initramfs-framework: support force reboot if fatal error occurs
Add support for force reboot in the case of fatal error. In some cases
it's better to force reboot (especially when hw watchdog is not
engaged) instead of waiting for 3600 seconds, for example in order to
trigger some recovery procedure during next boot procedure
(after unsuccessful OTA update etc).

ALso fix indendation issues in the fatal() function implementation.

(From OE-Core rev: 6990855e91f2d5891e95995f3f4a1c3b5891c619)

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-28 09:38:23 +01:00
Richard Purdie
d6ae8d2004 recipes: Switch away from S = WORKDIR
Where recipes use S = ${WORKDIR}, change them to set UNPACKDIR to
a subdir of WORKDIR and make S point at this instead.

I've chosen not to force S into any standard UNPACKDIR we may pick in
future just so the S = UNPACKDIR case is clearly visible by the
directory naming under WORKDIR as that should aid usability.

(From OE-Core rev: d9328e3b0b062f0621de3d114584b44f384a1c02)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Richard Purdie
3288587aeb recipes: Update S = WORKDIR recipes to use ${S} correctly
Where recipes use S = ${WORKDIR}, ensure they are referencing ${S} correctly
to access files as soon we want to stop doing this in WORKDIR at which point
they would break unless corrected.

(From OE-Core rev: f25dd633fffe6560f191526d1869e657e129bad9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-02 15:15:51 +01:00
Johannes Schneider
e6047ee5e8 initramfs-framework: overlayroot: align bootparams with module name
Renaming the 'rootrw' kernel commandline parameter to
'overlayrootrwdev' to both align better with this modules name, and
point out the usage of the variable.

This patch also includes an if block to migrate the old 'rootrw'
block, should it be already used by someone.

(From OE-Core rev: a52b7f5c8ff3e50707b55843d9996983ab8efae2)

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 14:56:23 +00:00
Johannes Schneider
8a531d1990 initramfs-framework: overlayroot: fix kernel commandline clash
The initramfs-framwork takes kernel commandline options and converts
them for internal use to variables following the 'bootparam_name'
pattern. The overlayroot module uses 'bootparam_rootfstype' and
'bootparam_rootfsflags' which both collide with linux kernel
parameters 'rootfstype' and 'rootfsflags'.  This collision is solved
by putting the variables in the namespace of the initramfs-framework
module.

(From OE-Core rev: ef20ef719c699b94fc52b81c520faa0b3714efeb)

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 14:56:23 +00:00
Richard Purdie
1b94ea8b25 recipes: Drop remaining PR values from recipes
We've been removing PR values from recipes at upgrade time for a while. In general
anyone maintaining a binary distro would end up having to curate these themselves
so the values in OE-Core aren't really that useful anymore. In many ways it makes
sense to clear out the remaining ones (which are mostly for 'config' recipes that
are unlikely to increase in PV) and leave a clean slate for anyone implementing
a binary distro config.

References are left in meta-selftest since the tests there do involve them and
their removal upon upgrade.

(From OE-Core rev: d4c346e8ab8f3cae25d1b01c7331ed9f6d4f96ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-22 07:45:17 +01:00
Jialing Zhang
3edaa511b2 linuxloader/initramfs: Add support for loongarch64
Add support for loongarch64 to:

linuxloader
core-image-minimal-initramfs
initramfs-module-install

(From OE-Core rev: bed5e0fc0ff1795e80277d306bbdade0915983b6)

Signed-off-by: Jialing Zhang <zhangjialing@loongson.cn>
Signed-off-by: Qizheng Zhu <zhuqizheng@loongson.cn>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-31 16:53:04 +01:00
Muhammad Hamza
af80b23aee initramfs-framework: move storage mounts to actual rootfs
Operations such as mkfs fail on devices that are not
switched to the actual rootfs before switch_root is
called. The kernel interprets these devices as still
being used even after unmounting and errors such as
below are seen when the target is fully booted

root@v1000:~# umount /dev/sdb1
root@v1000:~# mkfs.ext4 /dev/sdb1
mke2fs 1.43.8 (1-Jan-2018)
/dev/sdb1 contains a ext4 file system
        last mounted on Wed Nov 28 07:33:54 2018
Proceed anyway? (y,N) y
/dev/sdb1 is apparently in use by the system; will not make a filesystem here!

(From OE-Core rev: ec53ffd01972d1be2d6a28de828b3f0b80dc1e61)

Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Muhammad Hamza <muhammad_hamza@mentor.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-21 18:44:27 +01:00
Richard Purdie
b5c0b44a06 udev-extraconf/initrdscripts/parted: Rename mount.blacklist -> mount.ignorelist
(From OE-Core rev: 69e486ddb3059f80ba538e1f59c2ca8a8df0faf9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-20 22:52:22 +01:00
Alejandro Hernandez Samaniego
ed323de4dc initramfs-framework: Add overlayroot module
When installed, this module mounts a read-write (RW) overlay on
top of a root filesystem, which is kept read-only (RO), free
from modifications by the user, this might prove to be useful
if we want to access or restore the original unmodified rootfs.

The existing overlay-etc.bbclass does something similar, it
mounts an overlay on top of the /etc directory, however doing
the same for root causes the original root to be inaccessible
once the system is booted, hence why this module is added to
the initramfs boot flow, allowing us to mount the RW overlay,
while keeping the original rootfs mounted at /rofs once the
system finishes booting. This script is loosely based on that
class.

This module requires rootrw=<foo> to be passed as a kernel
parameter to specify the device/partition to be used as RW by the
overlay and has a dependency on overlayfs support being present
in the running kernel.

It does not require the read-only IMAGE_FEATURE to be enabled.

The module needs to be executed after the initramfs-module-rootfs
since it relies on it to mount the filesystem at initramfs startup
but before the finish module which normally switches root.
After overlayroot is executed the usual boot flow continues from
the real init process.

If something goes wrong while running this module, the rootfs
is still mounted RO (with no overlay) and the finish module is
executed to continue booting normally.

Its worth noting that, on purpose, this isnt installed by default
on any images that use initramfs-framework to keep the boot flow
unmodified, only when a user manually requests to install it,
then it becomes functional.

(From OE-Core rev: 4f876982a856c54a8074c85346632e33caa7ef53)

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alhe@linux.microsoft.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-01 23:44:59 +00:00
Richard Purdie
95f236f668 core-image-testmaster: Rename to core-image-testcontroller
Rename the image, the test controller class/code/module and the underlying
image sentinel file to all match the controller terminology.

(From OE-Core rev: f87b32833ac5327c4659ab8c06af34e7bda83f83)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-20 16:45:25 +00:00
Justin Bronder
2040c70fcc initramfs-framework: unmount automounts before switch_root
If mounts are left lingering, then after we switch_root, attempts to
modify the block devices will result in an EBUSY with no way to unmount
them.  As we're about to switch_root anyways, there isn't much use to
keep anything mounted unless it has the new rootfs.

(From OE-Core rev: 4dc7af6d25597ea10ea43e76c7c3d7251462c0e5)

Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-12 17:05:35 +00:00
Richard Purdie
bb6ddc3691 Convert to new override syntax
This is the result of automated script conversion:

scripts/contrib/convert-overrides.py <oe-core directory>

converting the metadata to use ":" as the override character instead of "_".

(From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02 15:44:10 +01:00
Ulrich Ölmann
03876eb32b initramfs-framework/setup-live: fix shebang
(From OE-Core rev: 71f1f6bc9402ee0fad82aaf0757fffb73da4b706)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-24 16:33:46 +01:00
Ulrich Ölmann
a3bc70c3ab initramfs-framework: fix whitespace issue
(From OE-Core rev: 9eaf6f4b08144c7f5453545f2bd9fb387a2dbe2e)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-24 16:33:46 +01:00
Ming Liu
08dee904c1 initramfs-framework:rootfs: fix wrong indentions
(From OE-Core rev: cd4d76f43c6ead9f32dece1faa9c9c5da895d9cd)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-22 09:59:04 +01:00
Ming Liu
fef6805f68 initramfs-framework:rootfs: fix some conditional check
Drop a duplicated check for "PARTLABEL=", also change to use elif to
avoid go through all the checks for root parameter.

(From OE-Core rev: 29e1e2ad0b6fd0db0e099831ba331b4ffa2b094b)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-28 22:28:26 +01:00
Chee Yang Lee
d6b4d57e62 initrdscripts: init-install-efi.sh install extra files for ESP
Currently the install script copy only few hard coded item while
setting up target ESP, kernel artifacts, all .efi in EFI/BOOT,
grub & boot cfg and loader.conf.
While ESP can be much complex, eg: contain multiple initrd.

Add a ESP folder to carry any other files to setup onto ESP.

(From OE-Core rev: 6eaca9cf20c42501fba27dea3a6446bad948e859)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-09 08:56:11 +00:00
Christophe GUIBOUT
909a9f5e8e initramfs-framework: support kernel cmdline with double quotes
It avoids init to crash when kernel cmdline contains a string with
spaces inside, like that:
dyndbg="file drivers/usb/core/hub.c +pltf"

(From OE-Core rev: 88b8b94bd2d052bca29d27bd5cd00eddb0f5999d)

Signed-off-by: Christophe Guibout <christophe.guibout@st.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-12 14:49:00 +01:00
Stefan Agner
fb9c85e3bf initramfs-framework: check successful mount using mountpoint
Instead of checking for existence of /dev in the mounted file system use
mountpoint to check if a root file system has been mounted. This allows
to use the rootfs module for OSTree based rootfs as well, where the file
system rootfs does not have any of the regular directories (at least
when using the modern layout).

(From OE-Core rev: efdfd0d5dde4dde43cb67ef28a90d5f5fe3e0ac6)

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-09 13:13:59 +01:00
Stefan Eichenberger
cf2ea6cc27 initramfs-framework: fix boothang when console=null
If console=null systemd-udevd throws an assertion which prevents the
system from booting. This patch redirects stdin, stdout and stderr to
/dev/null in case that the console can't be opened so that udevd still
boots.

A systemd issue was reported here. However, they will not fix this
specific use-case:
https://github.com/systemd/systemd/issues/13332

(From OE-Core rev: dd6ee0b06cd8df6204cf600050516d15172302ea)

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-13 23:00:26 +00:00
Diego Rondini
2657837f72 initramfs-framework: support PARTLABEL option
Since commit (kernel >= 4.20):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f027c34d844013d9d6c902af8fa01a82d6e5073d
specifying rootfs by PARTLABEL is supported. This commit adds support to
specify root by GPT partition label.

(From OE-Core rev: ebc974be12c3e83e961c99c24fde267d6c8e8bfc)

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-02 10:09:47 +01:00
Diego Rondini
3c9edf9b02 initramfs-framework: fix var name
Use appropriate variable name for root of partuuid.

(From OE-Core rev: d954ddcb2a9678b3b964279b41c0ec677ea9f03a)

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-27 13:02:16 +01:00
Richard Purdie
9c22a5a8a8 initramfs-framework: support PARTLABEL option
Since commit (kernel >= 4.20):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f027c34d844013d9d6c902af8fa01a82d6e5073d
specifying rootfs by PARTLABEL is supported. This commit adds support to
specify root by GPT partition label.

RP: [Fixup to match v2 of the patch]

(From OE-Core rev: 6901b7840dd9429064003ab939ba7e5cca5dc37f)

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19 13:09:22 +01:00
Diego Rondini
4b3656a978 initramfs-framework: support PARTLABEL option
Since commit (kernel >= 4.20):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f027c34d844013d9d6c902af8fa01a82d6e5073d
specifying rootfs by PARTLABEL is supported. This commit adds support to
specify root by GPT partition label.

(From OE-Core rev: e714b8982c2decbc24598af46f44c3a94834591f)

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-19 10:54:32 +01:00
Max Kellermann
4e88b42828 initrdscripts: merge multiple "mkdir" calls
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>
2019-05-07 10:12:53 +01:00
Gianfranco Costamagna
b495e757da toolchain-shar-extract/init-install-efi-testfs: Unify question spaces
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>
2019-04-04 22:57:32 +01:00
Liwei Song
ba771bf192 initramfs-framework: add lvm module
lvm module will initial lvm volume to support boot from
Logical Volume.

(From OE-Core rev: 3a4213f014fc4aa5be05dfc0722d87e01e5ff10c)

Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-25 23:13:48 +00:00
Liwei Song
2d15516d40 initramfs-framework: mount efivarfs to make Intel VROC work well
efivafs contain some meta data about Intel VROC, which will be
used by mdadm to create raid device.

These are preparation work to support boot from Intel VROC RAID
disk.

(From OE-Core rev: b25869c76975bbcec8d2f22f680e58976ec4de5c)

Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-25 23:13:48 +00:00
Jacob Kroon
c7e4495b2c initramfs-boot: create /dev/console
The Yocto kernel expects a proper /dev/console to exist before running init,
otherwise booting will fail with the message:

  Kernel panic - not syncing: /dev/console is missing or not a character device!
  Please ensure your rootfs is properly configured

Add similar fix as was done for initramfs-framework and initramfs-live-boot
in commits

  0352841cd92f6316bcac092e2fff9d28c352b36b
  1b64664f0c388f41084f5db6e46e3e68c53fb6d9

(From OE-Core rev: 490d6fbd14805b6c72b525fbe8c9c6e08d796597)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11 10:39:09 +00:00
Anuj Mittal
e574eab500 init-install-efi.sh: improve info message
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>
2018-10-12 16:57:21 +01:00
Anuj Mittal
f13f1dd286 initramfs-framework/udev: call settle before kill
When mount command is executed in rootfs module of initrd, eudev creates
a loop0 device node, applies rules and adds a inotify watch to it. Right
after this step, we execute finish which first tries to kill any running
udevd daemon before doing a switch_root.

In some cases, it is possible that switch_root is executed before
inotify_add_watch was actually processed which would lead to errors like:

| inotify_add_watch(6, /dev/loop0, 10) failed: No such file or directory

Make sure that we process all the events in queue before actually trying
to kill udevd to prevent this race.

Fixes [YOCTO #12861]

(From OE-Core rev: a85c34d263fcf1542bbedcaf1634302466bb20cf)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-20 05:41:31 -07:00
Andrew Bresticker
6c1ed635df initramfs-framework: Don't use 'tr'
tr is available in busybox, but not in toybox. Just use sed instead.

(From OE-Core rev: 518cca6711f737f44ff74a5ac1308de8c9b49e78)

Signed-off-by: Andrew Bresticker <abrestic@waymo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-13 17:38:07 +01:00
Richard Purdie
4b41d9072a busybox/packagegroups: Break out the busybox-syslog dependency
The busybox-syslog rrecomends is proving tricky as it gets pulled in early and
there are conflicts between its use of update-alternatives and busybox needing
to provide those things.

We already have recipes using BAD_RRECOMMENDS to remove this dependency, it probably
makes sense to spell it out explicitly and allow it to be overridden more easily.

This patch does this, dropping the now unneeded BAD_RRECOMMENDS. It preserves
the dependency as a recommendation for now, further cleanup may allow simplication
of that.

This unbreaks certain build failures on the autobuilder, more as a workaround but
is a change we probably want to make anyway.

(From OE-Core rev: 544ade2d78f1375d9e93d6bf5842d857ddaf3530)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-10 12:13:07 +01:00
Oleksii Konoplitskyi
f94c0c8e6f initramfs-framework: add nfsrootfs module
nfsrootfs module mounts rootfs via nfs parsing "nfsroot" and "ip" cmdline options.

(From OE-Core rev: d1737f2dabac5e338061863c78a91b4c115365c7)

Signed-off-by: Oleksii Konoplitskyi <okonopli@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-09 22:48:39 +01:00
Arsalan H. Awan
960ab9ef8c initrdscripts/init-live.sh: fix mounts w/ spaces fail to move to real rootfs
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>
2018-06-29 11:07:45 +01:00
Catalin Enache
caffc37709 init-install: add timeout for legacy grub
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>
2018-06-04 15:14:59 +01:00
California Sullivan
21586e595a initrdscripts: init-install(-efi).sh: don't assume 20M boot partition
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>
2018-04-03 23:53:19 +01:00
Anuj Mittal
442ec58c90 initrdscripts: format rootfs partition as ext4
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>
2018-03-28 12:09:51 +01:00
California Sullivan
8451fd7139 init-install.sh: support multiple kernels and don't assume vmlinuz
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>
2018-03-06 06:35:42 -08:00
California Sullivan
93e0e5f5fc init-install-efi.sh: Update to support installing multiple kernels
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>
2018-03-06 06:35:42 -08:00
Ricardo Salveti
51c6e1d1cb initramfs-framework: rootfs: add support for LABEL
The rootfs can also be found via the partition label.

(From OE-Core rev: 037255f3c448bfc05f3e7373e1ddeee4bbea2164)

Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-16 18:05:40 +00:00
Martin Jansa
09b8b36b30 initramfs-module-install: Remove allarch and FILESEXTRAPATHS
* files is already included in default FILESPATH
* it cannot inherit allarch as it RDEPENDS on bunch of TUNE_PKGARCH packages
* use the same COMPATIBLE_HOST restrictions as grub has to prevent ERRORs in
  bitbake world
  ERROR: Nothing RPROVIDES 'grub' (but oe-core/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb RDEPENDS on or otherwise requires it)
  grub was skipped: incompatible with host arm-oe-linux-gnueabi (not in COMPATIBLE_HOST)
  grub was skipped: incompatible with host arm-oe-linux-gnueabi (not in COMPATIBLE_HOST)
  NOTE: Runtime target 'grub' is unbuildable, removing...
  Missing or unbuildable dependency chain was: ['grub']
  ERROR: Required build target 'meta-world-pkgdata' has no buildable providers.

(From OE-Core rev: ecad98a0ffe41d8cc8890d16be09e4b604a1e192)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-10 22:45:20 +00:00