summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/initramfs-framework
Commit message (Collapse)AuthorAgeFilesLines
* initramfs-framework: Allow directories with spacesOtavio Salvador2017-09-121-2/+2
| | | | | | | | | | | | | | | | | | | 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 `---- (From OE-Core rev: afc73dd6346325de0a39997a3045b6659f9658b5) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework/setup-live: quote bootparam_root variableCalifornia Sullivan2017-08-241-1/+1
| | | | | | | | | | | When bootparam_root was empty the if statement would resolve into invalid syntax instead of short circuiting after the -z, causing a boot failure. (From OE-Core rev: dcd129504ea64986652e2e5907d9badf9373e367) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework/setup-live: also boot live image if root=/dev/ram0California Sullivan2017-08-191-1/+1
| | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: a30f8f60017d566d845ee5d3a8cfc338017211b0) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework/setup-live: remove superfluous breakCalifornia Sullivan2017-08-091-2/+0
| | | | | | | | | | | 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. (From OE-Core rev: 4f109da34a080c0d7cb86eaea1f7b6dfef3d04cb) 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>
* initramfs-framework: include install-efi module in recipe for installationNg, Wei Tee2017-07-271-0/+276
| | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 41b34441c22143cbabace3d794ead05801afb7a0) Signed-off-by: Ng, Wei Tee <wei.tee.ng@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: module to support boot live imageNg, Wei Tee2017-07-271-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 4d3300e85a8e65207a415b9cf84c9fa1f71b0406) Signed-off-by: Ng, Wei Tee <wei.tee.ng@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: Add support for PartUUIDsIgor Stoppa2016-07-081-0/+5
| | | | | | | | | | | | | The rootfs can be addressed also by referring to the PartUUID value from the GPT. This patch enables such type of reference. (From OE-Core rev: 1ab2ca141d3defe4b80212e28ac7c3f2271e2515) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: add retry loop for slow boot devices (like USB)Patrick Ohly2016-07-082-33/+57
| | | | | | | | | | | | | | | | | | | | | | 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). (From OE-Core rev: 2a50bb9ee8838e3d026c82dc09aaccb880a264f4) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: base: Ensures /run/lock is availableOtavio Salvador2016-06-231-2/+2
| | | | | | | | | | | | 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. (From OE-Core rev: 1cf288a0514ae9365fe55a0ff90b5abe35042cef) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: create directory /var/runWills Wang2015-12-081-0/+1
| | | | | | | | | | | | | 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 (From OE-Core rev: 4db089f10a379bc9a4df287bd657153eb4b94c45) Signed-off-by: Wills Wang <wills.wang@live.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: better error reporting for invalid root boot parameterPatrick Ohly2015-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 71d7803e5b13e26fd8001e87cfbac68114ddaa30) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: fix "support dropping into shell on failure"Patrick Ohly2015-09-231-1/+1
| | | | | | | | | | | | 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. (From OE-Core rev: 2a4335eae4b31ea9451a665dad2ba33ae4967670) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: support dropping into shell on failurePatrick Ohly2015-09-121-0/+4
| | | | | | | | | | | | | | | | | 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... (From OE-Core rev: 1d3dc681e809846dba7cae4f81566045a3f8c205) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: support init boot parameterPatrick Ohly2015-09-121-1/+1
| | | | | | | | | | | | | 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. (From OE-Core rev: dfd6d4c765924f472ac2df724342547b5c15249a) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: support ro boot parameterPatrick Ohly2015-09-121-0/+6
| | | | | | | | | | | | | | | | 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. (From OE-Core rev: a09f10f9360862c16fb68972ac041d474d6e3a64) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: support rootflags and rootfstype boot parameterPatrick Ohly2015-09-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()])}" (From OE-Core rev: b8ea1c61b4b8071edf70f5d42119c54ea84de330) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: handle kernel parameters with . insidePatrick Ohly2015-09-061-1/+2
| | | | | | | | | | | | | 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. (From OE-Core rev: de81e804f0654092d20ccb8e6e40f4ff614c4b09) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: fix test that filter backup module filesMichaël Burtin2013-10-231-1/+1
| | | | | | | | | | | Test that filter backup module files (files starting with ~) was accidentally reversed in e6039e6e3b98d6ab91252a5012d76279b1fac6e8, this patch restore initial behavior. (From OE-Core rev: b2eb846ee12989add7a7ca8bbf45f293a3a7e56d) Signed-off-by: Michaël Burtin <michael.burtin@innotis.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "initrdscripts: look for new systemd-udevd location"Ross Burton2013-09-171-1/+1
| | | | | | | | | | | | systemd-udevd is back in /lib, so revert this change. This reverts commit 27bb516be433ed9dcde6fe4a17d2429951a010a0. (From OE-Core rev: 3f6324a86cb8c1c253af06a1033ac71fa61c58d3) 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>
* initramfs-framework: fix bashismChen Qi2013-08-062-8/+10
| | | | | | | | (From OE-Core rev: e6039e6e3b98d6ab91252a5012d76279b1fac6e8) 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>
* initrdscripts: look for new systemd-udevd locationRoss Burton2013-04-131-1/+1
| | | | | | | | | As per the previous commit, systemd-udevd is now in /sbin/systemd/. (From OE-Core rev: ff0fd25206c3c75921d51cb80bcb6c94ca47b405) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: Add udev sbin based libexec pathRichard Purdie2013-04-101-1/+1
| | | | | | | | | | | 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. (From OE-Core rev: 7e17cba75c20ad820d30128d9b4b0132e7b924a8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramds-framework: add shutdown hook for udevIan Reinhart Geiser2013-02-041-2/+10
| | | | | | | | | | | | | | | 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. (From OE-Core rev: ce690659ef797bd26dc2be59167aa01744841510) Signed-off-by: Ian Reinhart Geiser <igeiser@devonit.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initramfs-framework: udev: Handle alternative binary pathsOtavio Salvador2012-12-031-5/+20
| | | | | | | | | | | This allows use of udev daemon for different installation destinations so allowing use of udev's from systemd code for initramfs. (From OE-Core rev: 96daf1b3105e17a67acb5027d0418b2ac28b6820) 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>
* initramfs-framework: init: Stop mount warnings during bootOtavio Salvador2012-12-031-2/+5
| | | | | | | | | | For a completely quiet boot using recent versions of utilities, the /etc/fstab and /var/lock need to be available. (From OE-Core rev: d7a8154d575f918a0a20cb0e3a8f65d02ed32f30) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* initrdscripts: fix udevd in the live boot init scriptsRoss Burton2012-11-121-3/+3
| | | | | | | | | | | | | | | 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. (From OE-Core rev: 543606e5dc379497c34196d004a214e847f5db2d) 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>
* initramfs-framework: provides a modular initramfsOtavio Salvador2011-12-086-0/+344
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 (From OE-Core rev: 7b69ad2167a1f0e57db82817b98a0cbcb70a0dd3) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>