Age | Commit message (Collapse) | Author |
|
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.
Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4dc7af6d25597ea10ea43e76c7c3d7251462c0e5)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
|
|
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>
|
|
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Drop a duplicated check for "PARTLABEL=", also change to use elif to
avoid go through all the checks for root parameter.
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
It avoids init to crash when kernel cmdline contains a string with
spaces inside, like that:
dyndbg="file drivers/usb/core/hub.c +pltf"
Signed-off-by: Christophe Guibout <christophe.guibout@st.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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).
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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.
Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Use appropriate variable name for root of partuuid.
Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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]
Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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.
Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
lvm module will initial lvm volume to support boot from
Logical Volume.
Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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.
Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
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]
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
tr is available in busybox, but not in toybox. Just use sed instead.
Signed-off-by: Andrew Bresticker <abrestic@waymo.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
nfsrootfs module mounts rootfs via nfs parsing "nfsroot" and "ip" cmdline options.
Signed-off-by: Oleksii Konoplitskyi <okonopli@cisco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
The rootfs can also be found via the partition label.
Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
This new module allow for easy execution of external scripts or
applications. It runs anything found in /exec.d directory in order and
in case of no scripts to be available, it opens a shell.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
There is no need to maintain two of the exact same files.
Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
When mdev module loads the Linux kernel modules, it can visit
directories with spaces. To allow that, we must quote the variable
otherwise it misunderstand it arguments as multiple entries.
Fixes:
,----
| Freeing unused kernel memory: 3072K (80d00000 - 81000000)
| cat: can't open '/sys/devices/platform/Vivante': No such file or directory
| cat: can't open 'GCCore/modalias': No such file or directory
`----
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
When bootparam_root was empty the if statement would resolve into
invalid syntax instead of short circuiting after the -z, causing a boot
failure.
Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Our grub and syslinux bootloaders both define root=/dev/ram0 for live
images by default. Kernel docs show that root=/dev/ram0 is just a
sentinel value for the kernel to mount the initrd as root, which then
mounts and switches to the real root. This is exactly what our scripts
do, so just check for root=/dev/ram0 as well.
See: https://www.kernel.org/doc/html/v4.11/admin-guide/initrd.html#operation
This fixes the issue where the new initramfs-framework scripts would not
boot live images that use grub or syslinux bootloaders.
Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
This causes us to fall out of the module setup/run loop in the base init
script should "root=" be defined, causing a boot failure.
Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Utilized the existing init-install-efi.sh script and renamed it to
install-efi.sh to manage the installation process of images in
initramfs-framework model. This script will be executed when
"install" option is being chosen in the grub menu and install
the image on the target platform. A new install-efi module is
being added in the recipe to handle the installation process
using initramfs-framework.
[YOCTO #10989]
Signed-off-by: Ng, Wei Tee <wei.tee.ng@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
setup-live module is a new module being introduced to integrate the
functionality of init-live.sh into new scriptlet named setup-live in
order to support the live boot image. The udev-extraconf rdepends is
being added to perform automounting. It gets to run before the rootfs
and finish module.
The setup-live scriplet include the changes for:
- Create a conditional loop for the bootparam_root variable. If it is
not set, then it will boot from ROOT_IMAGE. Else, it will boot normally
which is not from removable media.
- Gives a standard path to the original boot disk mount which can be
used to. While /media/sda is a good guess, it isn't always right, nor
is it a good assumption that only one boot disk is in the system.
- The current rootfs module has no support for rootfs images, currently
it only support for rootfs partitions for wic image. Therefore, there
is a need to assign the rootfs image for live image.
[YOCTO #11701]
Signed-off-by: Ng, Wei Tee <wei.tee.ng@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
The rootfs can be addressed also by referring to the PartUUID
value from the GPT.
This patch enables such type of reference.
Signed-off-by: Igor Stoppa <igor.stoppa@intel.com>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
On some hardware platforms (Gigabyte, qemu), detection of USB devices
by the kernel is slow enough such that it happens only after the first
attempt to mount the rootfs. We need to keep trying for a while
(default: 5s seconds, controlled by roottimeout=<seconds>) and sleep
between each attempt (default: one second, rootdelay=<seconds>).
This change intentionally splits finding the rootfs (in the new
"rootfs") and switching to it ("finish"). That is needed to keep udev
running while waiting for the rootfs, because it shuts down before
"finish" starts. It is also the direction that was discussed on the OE
mailing list for future changes to initramfs-framework (like
supporting a "live CD" module, which would replace or further augment
mounting of the rootfs).
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Depending on the module we use, the /run/lock may be required. This
creates it as part of initial setup and thus makes it available for
every sub module.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
The following error occurs when udevd startup:
udevd[146]: bind failed: No such file or directory
error binding udev control socket
udevd[146]: error binding udev control socket
Signed-off-by: Wills Wang <wills.wang@live.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
When the "boot" parameter refers to a non-existent device, the only
visible output at normal log levels was a rather confusing:
ERROR: There's no '/dev' on rootfs.
That's because the actual error, not being able to find the root
device, was only a debug message, which gets ignored in the default
mode.
Promoting the "root '$bootparam_root' doesn't exist." message from
"debug" to "msg" gives sufficient context to understand the error. A
more intrusive change would be to change also the control flow.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Due to a missing $ before the variable name, all fatal errors ended up
invoking a shell, instead of only doing that when init_fatal_sh is set
as boot parameter.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
When the init_fatal_sh boot parameter is present (i.e. used without
value) and a fatal problem occurs inside the initramfs-module, a shell
will be started instead of looping forever.
Useful for debugging.
Interestingly enough, the code was already indented to support such an
if check...
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
It can be useful for debugging to override the default /sbin/init.
This is something typically done via the init boot parameter which
then gets interpreted by the kernel. But when using an initramfs, it
is the initramfs which must react to the option.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Default is to mount the rootfs read/write. "ro" can be used to turn
that into read-only, which is useful on systems where userspace does
an fsck before remounting read-write.
Giving both "ro" and "rw" will still mount read-only regardless of the
order, because the ordering information is not preserved by the
initramfs-framework's boot param support.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
These two parameters are supported by the kernel
(https://www.kernel.org/doc/Documentation/kernel-parameters.txt). When
an initramfs is used, the kernel does not mount the rootfs and the
initramfs needs to react to them.
The boot parameters can be set both by the image creator and
by users.
Supporting these two parameters is useful:
- rootflags is needed to ensure that the rootfs is already mounted as
intended in the time between starting init and init remounting
it (as systemd does); this is critical for IMA where iversion must be
active already when system starts writing files.
- setting it correctly up-front avoids messages from the kernel ("cannot
mount ... as ext2 because ...") when trying to guess the desired type.
For example, assuming that only one of ext4/ext3/ext2 is set,
rootfstype could be set in an image recipe with:
APPEND_append = "${@''.join([' rootfstype=' + i for i in ['ext4', 'ext3', 'ext2'] if i in d.getVar('IMAGE_FSTYPES', True).split()])}"
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Kernel parameters like "uvesafb.mode_option=640x480-32" were turned
into shell variables named "bootparam_uvesafb.mode_option", which
triggered errors from the shell because the name is not valid. Now
points get replaced with underscores, leading to
bootparam_uvesafb_mode_option in this example.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Test that filter backup module files (files starting with ~)
was accidentally reversed in e6039e6e3b98d6ab91252a5012d76279b1fac6e8,
this patch restore initial behavior.
Signed-off-by: Michaël Burtin <michael.burtin@innotis.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
systemd-udevd is back in /lib, so revert this change.
This reverts commit 27bb516be433ed9dcde6fe4a17d2429951a010a0.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
As per the previous commit, systemd-udevd is now in /sbin/systemd/.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
For better or worse we need to use base_sbindir for udev's libexec dir. This
updates the initrdscripts to also cover the new location. I'd prevously assumed
that it was already covered but its not. udev internal binaries shouldn't be in
PATH so we have to do this to deal with the issue.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
In cases where other initramfs modules need to rely on
udev running (ie in my case I have to load firmware on
a device that is slow to start) there needs to be a way
to keep it running during the lifecycle of the initramfs
but still be shut down before swith_root is called. I
added a module_pre_hook that will shut down udev before
the finish module is called.
Signed-off-by: Ian Reinhart Geiser <igeiser@devonit.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
This allows use of udev daemon for different installation destinations
so allowing use of udev's from systemd code for initramfs.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
For a completely quiet boot using recent versions of utilities, the
/etc/fstab and /var/lock need to be available.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
udevd moved location and isn't in $PATH anymore, so use an absolute path to
start it.
The control socket path moved too, so mkdir the directory it's in.
Mounts the new devtmpfs on /dev device tree.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Alexandru Damian <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Provides the API and modules for a modular initramfs. The currently
included modules are:
* initramfs-module-debug adds support to dynamic debugging of
initramfs using bootparams
* initramfs-module-udev: enables udev usage
* initramfs-module-mdev: enables mdev usage
* initramfs-module-e2fs: adds support for ext4, ext3 and ext2
filesystems
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
|