summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts
AgeCommit message (Collapse)Author
2022-02-25init-system-helpers: upgrade 1.60 -> 1.62wangmy
Changelog: ========= * use fakechroot instead of unsharing the mount namespace and mounting tmpfs * deb-systemd-invoke: systemctl --machine @<UID> is now available in v249.10. Adjust the version check accordingly * Skip build-time tests if DEB_BUILD_OPTIONS=nocheck is set * Fix typos found by Lintian * Set Rules-Requires-Root: no Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-20meta/meta-selftest/meta-skeleton: Update LICENSE variable to use SPDX ↵Richard Purdie
license identifiers An automated conversion using scripts/contrib/convert-spdx-licenses.py to convert to use the standard SPDX license identifiers. Two recipes in meta-selftest were not converted as they're that way specifically for testing. A change in linux-firmware was also skipped and may need a more manual tweak. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30meta: Add explict branch to git SRC_URIsRichard Purdie
There is uncertainty about the default branch name in git going forward. To try and cover the different possible outcomes, add branch names to all git:// and gitsm:// SRC_URI entries. This update was made with the script added to contrib in this patch which aims to help others convert other layers. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30Convert to new override syntaxRichard Purdie
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 "_". Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-24initscripts: fix creation order for /var/log with VOLATILE_LOG_DIR=trueMatthias Schiffer
Create the /var/log symlink directly after /var/volatile/log, so /var/log is available for the creation of /var/log/wtmp a few lines later. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-24initscripts: populate-volatile.sh: run create_file synchronouslyMatthias Schiffer
The behavior of running create_file in the background was introduced in d44816bedade ("initscripts: Populate volatile from existing file") without further explanation. Besides its questionable benefit, this causes actual issues: - Not all create_file processes may have finished by the time the initscript exits (or when it moves /etc/volatile.cache.build !) - By making the order of commands nondeterminstic, it could hide dependency issues where it was attempted to create files before their containing directories Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-24initscripts: populate-volatile.sh: do not log to tty0Matthias Schiffer
tty0 may not be the intended console for log messages, or it may not exist at all in kernel configurations without CONFIG_VT. Just use the default stdout/stderr instead. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-30init-system-helpers: upgrade 1.58 -> 1.60Alexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-20initscripts: Use initctl on sysvinit onlyKhem Raj
Check if init system is sysvinit to recreate initctl, this ensures that it can be used with busybox init system as well Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Sinan Kaya <okaya@kernel.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-20initscripts: use quotes for shell variable comparisionKhem Raj
Helps to execute it with busybox shell Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-06initscripts: Change execution order between checkroot and modutilsDiego Sueiro
When '/' is first mounted as read-only, we want to have the checkroot.sh initscript (which then remounts '/' as rw if allowed) running before the modutils.sh. This is because modutils.sh initscript might need to run depmod depending on the status of the modules.dep file to update it and the '/' needs to be writable. Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-27initscripts: Fix populate-volatile.sh bug when file/dir existsAndrei Gherzan
The blocks which test for entry exitence (file or directory) use a `A && B || C` syntax. This form is not behaving as a if-then-else block even the code logic assumes that. C may run when A is true which breaks the case where VERBOSE is 'no' but the file/directory exists. Along with fixing these specific issues, this patch fixes the other instances where blocks of form `A && B || C` are used as if-then-else. Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-27initscripts: Fix various shellcheck warnings in populate-volatile.shAndrei Gherzan
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-18init-system-helpers: upgrade 1.57 -> 1.58Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-30initscripts: update postinstChangqing Li
in container image, it don't have init system, install package initscripts will report error: systemctl: command not found fix by use same way as systemd.bbclass to decide if systemctl mask will run Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-08init-system-helpers: use https for fetchingAlexander Kanavin
git:// protocol seems to be down. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-04init-system-helpers: avoid superfluous update-rc.dJens Rehsack
Debians init-system-helpers bundle an own, perl written update-rc.d which doesn't fulfill embedded/cross-build requirements as our own in meta/recipes-core/update-rc.d does. To avoid unnecessary conflicts or questions, do not bundle it by default. Whoever wants it is invited to have an .bbappend. Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-04initscripts/init-system-helpers: fix mountnfs.sh dependencyJens Rehsack
With commit c9fc9110be33fe0f24bc3a7c242b584a4ca33e04 Author: Yue Tao <Yue.Tao@windriver.com> Date: Fri May 25 10:48:08 2018 +0800 initscripts: Avoid starting rpcbind daemon twice Check the status before start it to avoid duplicates. the use of a script {/usr/sbin/}service is introduced - maybe earlier provided by systemd, nowadays mostly by init-system-helpers from debian project. For the very first shot, maybe discussions and improvements based on that script collection, use just the init-system-helpers-service in initscripts/mountnfs.sh to avoid problems mounting NFS in later boot stage. Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-10initscripts/sysfs.sh: Mount /sys/firmware/efi/efivars when possibleHaris Okanovic
Without this change, efibootmgr is unable to recover BootOrder if lost during a previous write operation, e.g. exceeded storage capacity. This is problematic using EFI to manage boot flow from Linux (E.g. via RAUC). https://www.kernel.org/doc/Documentation/filesystems/efivarfs.txt Signed-off-by: Haris Okanovic <haris.okanovic@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-18initscripts: enable alignment.sh init script for big endian ARMAndre McCurdy
Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-27initscripts: remove warnings on read-only-rootfs (again)Martin Hundebøll
When the populate-volatile.sh initscript tests if a configured symlink is already in place, it uses readlink with the '-f' (follow) option: > [ "$(readlink -f $source)" = "$dest" ] If the test fails, it proceeds to delete the exisiting folder/file, and create the configured symlink. However, the '-f' option to readlink makes it follow symlinks pointing at symlinks. If the $dest argument is a symlink, the above test fails, and warnings are printed due to changing a read-only rootfs. This is the case for /tmp, and /etc/resolv.conf: > /tmp -> /var/tmp -> /var/volatile/tmp > /etc/resolv.conf -> /var/run/resolv.conf -> /run/resolv.conf Fix the warnings by removing the '-f' option, so that the test matches the configuration. [ YOCTO #10814 ] Signed-off-by: Martin Hundebøll <martin@geanix.com> Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-04initscripts: Add support for /etc/default/timestampJeroen Hofstee via Openembedded-core
Source /etc/default/timestamp if present. This allows the rootfs to be read-only / store the file in a persistant location if the whole rootfs is updated. Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-19initscripts: Update volatiles documentation to include bindsJoshua Watt
Volatiles processing now handles bind mounts, so update the comment in the core file to indicate this. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-06meta: Use double colon for chown OWNER:GROUPKosta Zertsekel
Rationale - excerp from `info chown` ==================================== OWNER‘:’GROUP If the OWNER is followed by a colon and a GROUP (a group name or numeric group ID), with no spaces between them, the group ownership of the files is changed as well (to GROUP). Some older scripts may still use ‘.’ in place of the ‘:’ separator. POSIX 1003.1-2001 (*note Standards conformance::) does not require support for that, but for backward compatibility GNU ‘chown’ supports ‘.’ so long as no ambiguity results. New scripts should avoid the use of ‘.’ because it is not portable, and because it has undesirable results if the entire OWNER‘.’GROUP happens to identify a user whose name contains ‘.’. Signed-off-by: Kosta Zertsekel <zertsekel@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-13initscripts: populate-volatiles: Speed up processingJoshua Watt
Checking the requirements for each volatiles file in the populate-volatiles script can be very slow when there are a large number of volatiles files, easily consuming over 80% of the processing time. These checks don't usually uncover any problems so concatenate all the volatiles files together and process them as one large file for a "fast path" option. This ensures that the penalty for checking the requirements is only incurred once. In the event that checking the requirements for the unified file fails, fall back to the slow process of checking each one individually so that the offending one can be skipped. The core file is handled separately because it is responsible for creating the temp directory used by check_requirements and thus must always run first and without having its requirements checked. [YOCTO #12949] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-12initscripts: read-only-rootfs-hook: Use overlay if availableJoshua Watt
Copying files from the read-only /var/lib to tmpfs can be slow and waste memory. If the kernel supports the overlay file system, use it to mount a writable tmpfs on top of the read-only /var/lib and avoid the file copy. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-29initscripts: Avoid starting rpcbind daemon twiceYue Tao
Check the status before start it to avoid duplicates. Signed-off-by: Yue Tao <Yue.Tao@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Jeff Polk <jeff.polk@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-02initscripts: rrecommend initscripts-functionsMarkus Lehtonen
In order to make that the default provider for initd-functions. [YOCTO #10944] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2017-12-02initscripts: don't use update-alternativesMarkus Lehtonen
Stop using update-alternatives for managing /etc/init.d/functions. Also, make the initscripts-functions subpackage to (runtime) conflict with lsbinitscripts. [YOCTO #10944] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2017-09-21initscripts: Add HOMEPAGE info into recipe file.Huang Qiyu
Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-23initscripts: split sushell into sub packageJackie Huang
* sushell is required by systemd service debug-shell when selinux is enabled, but it doesn't make sense to make systemd depend on initscripts, so split sushell into sub package initscripts-sushell. * The bash dependency has been removed by: ''' 4917e36a77bd6821b45db52caa43939d344d92f6 initscripts: Fix regression for requiring /bin/bash ''' so remove bash from RDEPENDS when selinux is enabled. Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-17initscripts: support persistent /var/logChen Qi
Respect VOLATILE_VAR_LOG variable so that if it's set to any valid boolean false value, we could have persistent /var/log on the final image. [YOCTO #6132] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-21initscripts: start bootmisc.sh at 36 instead of 55David Vincent
bootmisc.sh is responsible for setting the system date to a sane default. Currently, it is the last script to be run from the rcS runlevel. Problem is that the files created before appear to have been created on 1/1/1970. Most notably, /var/log/dmesg created in dmesg.sh cannot be properly rotated with logrotate which does not consider it a valid date and stops processing. There is no blocker on moving this script right before populating volatiles because it just requires the local and virtual filesystems to be mounted to work. Signed-off-by: David Vincent <freesilicon@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-05initscripts: Populate volatile from existing fileDavid Vincent
In some cases, it may be useful to populate a volatile file from an existing one, e.g. a file in a read-only rootfs that may be edited in a read-write destination. To provide this behavior, creation of volatile files has been updated to copy a file which has been given in the <linksource> field. If set to none, the current behavior is preserved. Signed-off-by: David Vincent <freesilicon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01initscripts/sysfs.sh: mount configfs if presentMike Looijmans
configfs is another kernel virtual file system that should be mounted if configured, so if it's configured into the kernel, mount it. It is used to configure e.g. USB gadget mode and devicetree overlays. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-01-19initscripts: Add PACKAGE_WRITE_DEPS for postinstRichard Purdie
The postinstall needs systemd-systemctl-native, mark the dependency Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22initscripts: populate-volatile: suppress read-only-rootfs warningsAndré Draszik
rm: can't remove '/etc/resolv.conf': Read-only file system ln: /etc/resolv.conf: File exists /etc/default/volatiles contains an entry: l root root 0644 /etc/resolv.conf /var/run/resolv.conf which causes populate-volatile.sh to execute the following in link_file(): if [ -L \"$2\" ]; then [ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; elif [ -d \"$2\" ]; then ... At the time the image is created, /etc/resolv.conf is already a symlink to /var/run/resolv.conf, but at boot time when populate-volatiles.sh is run, /var/run/resolv.conf doesn't exist, causing it to try to rm -f and ln -sf which of course fails due to the read-only filesystem. [YOCTO #10814] Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-22initscripts: populate-volatile: don't run commands in backgroundMans Rullgard
If commands are run asynchronously they may be completed out of order causing problems if later entries depend on earlier ones. Signed-off-by: Mans Rullgard <mans@mansr.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13initscripts: populate-volatile: improve config file parsingMans Rullgard
This improves the config file parsing to permit blank lines and comments following an entry or preceeded by whitespace. Signed-off-by: Mans Rullgard <mans@mansr.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-03initscripts: Start devpts at 06 instead of 38Mike Looijmans
For example bootlogd needs devpts to be running, but bootlogd starts at 07. Starting bootlogd early makes perfect sense, so the best option here is to move devpts up to 06 to prevent this error message at boot: cannot allocate pseudo tty: No such file or directory Systems that have CONFIG_LEGACY_PTYS in the kernel will not see this message. Since it is called "LEGACY" for a reason, fixing this in userspace appears to be the better option here. The devpts script does not need anything except a mounted "/dev" which has been arranged in "S02sysfs.sh" already. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23initscripts: Check for logrotate in dmesg.shOvidiu Vancea
Autodetect previously hardcoded logrotate location because it can be installed in multiple places like /usr/bin/logrotate which is very common besides /usr/sbin Signed-off-by: Ovidiu Vancea <ovidiu.vancea@ni.com> Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-30initscripts: check if swapon/swapoff exists before executing themMing Liu
Not all built images contain swapon/swapoff, for instance, it is configurable with or without them in busybox. So it'd better to check if they exist or not before executing them. Redirecting the potential errors to /dev/null is not good enough, which might suppress the *real* errors. Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-13initscripts: start urandom after populate-volatilesJens Rehsack
In case of read-only rootfs, populoate-volatiles might be used to create some links (or bind-mounts) required for having a writable /var/lib. Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-13initscripts: populate-volatiles.sh: add mount-bind featureJens Rehsack
Add ability to run "mount --bind" to populate-volatiles. Since several programs use realpath to determine several full qualified file names, there is no symlink to be resolved. So when speccing /run/lock - that's the location - not /var/run/lock because of the program is smarter than the operator/distributor. See https://github.com/rehsack/meta-jens/blob/jethro/recipes-core/initscripts/initscripts/volatiles for an example how to use the "b" feature. Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01initscripts: hide the error in case system is not writeableMing Liu
To avoid reporting errors for /etc/timestamp is not writeable in a readonly system. Reported-by: Niklas Soderlund <niklas.soderlund@external.atlascopco.com> Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-10-24initscripts/sysfs.sh: Mount devtmpfs on /dev/ if neededMike Looijmans
When booting from an initrd disk, or when the kernel config option DEVTMPFS_MOUNT isn't provided, /dev/ will not be mounted at boot. This small addition will check if /dev/ is "useful", and if not, will mount devtmpfs if the kernel provides it. With this change, it is possible to set an initscripts style image type to "cpio.gz" and boot it as initrd. Without this change, the image won't work properly because of the missing devices. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-09initscripts: Fix regression for requiring /bin/bashJason Wessel
It is not possible to create a rootfs with only busybox + initscipts. This is a result of a regression from commit a4b53872a8a9a2743299acbff015f7f2750a69d6 (initscripts: add /sbin/sushell for systemd service debug-shell). The /sbin/sushell should just use /bin/sh else you end up with a problem when creating the end image with a failed smart transaction shown below: ERROR: Unable to install packages. Command '/proj/bitbake_build/tmp/sysroots/x86_64-linux/usr/bin/smart --quiet --data-dir=/proj/bitbake_build/tmp/work/qemuarma9-wrs-linux-gnueabi/wrlinux-image-glibc-small/1.0-r1/rootfs/var/lib/smart install -y dropbear@armv7at2_vfp hac@armv7at2_vfp run-postinsts@all kernel-modules@qemuarma9 packagegroup-core-boot@qemuarma9' returned 1: error: Can't install initscripts-1.0-r155.0@armv7at2_vfp: no package provides /bin/bash Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31initscripts: urandom: respect ${localstatedir} instead of hardcoding /varAndré Draszik
Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-08initscripts: add /sbin/sushell for systemd service debug-shellKai Kang
Add file /sbin/sushell for systemd service debug-shell which starts with /bin/sushell when SELinux is enabled. Copy and add sushell file from Fedora 22. Add runtime dependency bash as well when systemd is enabled to eliminate QA warning: WARNING: QA Issue: /sbin/sushell_initscripts contained in package initscripts requires /bin/bash, but no providers found in its RDEPENDS [file-rdeps] Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-20initscripts: Remove /etc/volatile.cache on upgradeBryan Evenson
/etc/volatile.cache is a cached copy of a script (which is generated by /etc/init.d/populate-volatile.sh) that generates the volatile filesystem directories. Since volatile.cache is a generated file, it is not necessarily changed if populate-volatile.sh is updated. As a result, the stale script can add/remove the wrong directories on the next system boot. If initscripts is being upgraded, make sure volatile.cache gets deleted. Signed-off-by: Bryan Evenson <bevenson@melinkcorp.com>