aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts
AgeCommit message (Collapse)Author
2013-08-26checkroot.sh: check for conflicting configurationsChen Qi
In our current boot scripts, two ways are used to determine whether the rootfs is read-only or not. One by checking the READ_ONLY_ROOTFS value in /etc/default/rcS, the other by checking the /etc/fstab entry. >From a normal Linux user's point of view, the way of checking the /etc/fstab entry is preferred. However, as there are several boot scripts that need to know whether rootfs is read-only or not, checking /etc/fstab in each script brings too much overhead. Thus, these boot scripts use the READ_ONLY_ROOTFS value in /etc/default/rcS. In normal use cases, there would be no problem, as both /etc/default/rcS and the /etc/fstab are modified at rootfs time. However, if the user changes the mount option for rootfs in /etc/fstab to read-write, and he/she forgets to change the value in /etc/default/rcS, there would be unexpected results. For example, the udev-cache would still be disabled. So at a minimal, a check for conflicting configurations between /etc/fstab and /etc/default/rcS should be added in checkroot.sh so that there would be reasonable warnings if users have configured the system in a non-consistent way. [YOCTO #4880] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-20initscripts: remove obsolete device_table.txtChen Qi
device_table.txt was once used by an init script named 'devices' to create the basic files under /dev. However, it's no longer used now. The devices init script has been removed, and makedevs command has been disabled by default in busybox. Besides, considering the device managers and devtmpfs filesystem, this file is not likely to be used again. So we remove it. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-16populate-volatile.sh: use 'cp -a' to avoid potential problemChen Qi
Previously, dead links in target directory will not be copied. This is incorrect as dead links are not uncommon in our rootfs. So we use '-a' option instead. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-16populate-volatile.sh: don't spawn background process at rootfs timeChen Qi
If we're building a read-only rootfs, we'll get the following error now and then. tar: .: file changed as we read it The root cause is that we spawn background process at rootfs time. When the tar command is running, it's possible that files under rootfs are changed by background processes, thus this error. [YOCTO #4937] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-16populate-volatile.sh: use $ROOT_DIR/var/volatile/tmp as TMPDIRChen Qi
It's possible that a 'No such directory' error occurs when doing check_requirement in populate-volatile.sh at rootfs time. This is because the $ROOT_DIR/var/tmp might be a dead link. Use $ROOT_DIR/var/volatile/tmp as the TMPDIR instead to avoid this error. [YOCTO #4883] [YOCTO #4103] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-09checkroot.sh: respect the value of ENABLE_ROOTFS_FSCKChen Qi
Previously, fsck is always disabled because the value of rootcheck in the checkroot.sh script is always set to 'no'. We should respect the value of ENABLE_ROOTFS_FSCK in /etc/default/rcS to allow for filesystem check. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-09initscripts: add dmesg file to /var/logJackie Huang
We should create the /var/log/dmesg.log file as a default. If we don't then a later kernel error can flush the dmesg ring buffer, losing valuable debug information. Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-09initscripts: overwrite default hostname.shJackie Huang
/etc/init.d/hostname.sh does not have a graceful fallback if the /etc/hostname file doesn't exist. Other systems such as Ubuntu and RH will either leave the hostname in place, if a proper hostname is already set, otherwise it will set the hostname to 'localhost' when the /etc/hostname files doesn't exist. As you can see we have to add some additional handling to provide this behavior when the system's hostname command doesn't take the '-b' option. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-30initscripts: let status return 0 when proc is running wellJesse Zhang
Ensure that the status returns 0 instead of the last shell command result, otherwise the calling script can not properly detect the status of pid. Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-29base-files: add /run directory from FHS 3 draft specificationJonathan Liu
This adds the /run directory from the Filesystem Hierarchy Standard 3.0 Draft [1] and refactors the filesystem as follows: - Remove creation of /var/volatile/run - Remove creation of /var/volatile/lock - Remove symbolic link from /var/run to /var/volatile/run - Remove symbolic link from /var/lock to /var/volatile/lock - Add symbolic link from /var/run to /run - Add symbolic link from /var/lock -> /run/lock - Add /run to /etc/fstab for sysvinit compatibility [1] http://www.linuxbase.org/betaspecs/fhs/fhs.html#runRuntimeVariableData Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-24populate-volatile.sh: remove repeated leading slashes in TNAMEJonathan Liu
This avoids triple slashes in the generated /etc/volatile.cache to reduce disk usage and in the output when verbose mode is enabled. As all the paths for volatiles start with a slash, we can change TNAME=${ROOT_DIR}/${TNAME} to TNAME=${ROOT_DIR}${TNAME}. To avoid a double slash when ROOT_DIR is /, we strip the extra slash from ROOT_DIR. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-10initscripts: fix read-only-rootfs-hook.sh to start earlierPaul Eggleton
Mount /var/volatile ourselves so that we can set up the writable area first. This fixes the urandom service not starting properly when read-only-rootfs is enabled. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-10initscripts: fix read-only-rootfs-hook.sh to avoid using unionfsPaul Eggleton
Unionfs isn't available everywhere, and we can get similar results (if not quite as neatly) by using bind mounts + tmpfs and copying the data over. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26udev: move /run volatile entry to udev instead of initscriptsRoss Burton
initscripts is generally installed on systemd-using images, but because it specifies that /run is a symlink to /var/run managed by volatiles it totally breaks systemd by copying/deleting /run from underneath systemd. Deleting sockets mid-boot doesn't leave systemd in a happy place. As this volatile reference of /run was introduced by udev 182, move it's reference to the udev recipe. This way it will never be present on systemd images, as systemd manages /run as a tmpfs itself. Signed-off-by: Ross Burton <ross.burton@intel.com>
2013-03-07populate-volatile.sh: remove trailing whitespacesChen Qi
Remove trailing whitespaces. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-07populate-volatile.sh: improve the handling of link config itemsChen Qi
Previously, if there's a link config item in the config file like l root root 1777 /tmp /var/tmp and /tmp has existed, the symlink will not be created correctly. Another example is the /run directory. If /run directory has been created by some recipe or script before populate-volatile.sh runs, the symlink of /run to /var/run will not be created correctly. This patch ensures that the system creates symlinks exactly as the config file tells it. [YOCTO #3404] [YOCTO #3406] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-03-07populate-volatile.sh: add ROOT_DIR variable to support running at rootfs timeChen Qi
For populate-volatile.sh script to run correctly both at rootfs time and at system boot time, it needs to be aware of which situation it is now in. We use the ROOT_DIR variable to indicate whether it is run at rootfs time or not. ROOT_DIR being "/" indicates that this script is run at system boot time, otherwise, it is run at rootfs time. Also, we ignore failures when running this script at rootfs time. For example, if ${ROOT_DIR}/var/dir1 is symlink to /var/volatile/dir1, it's possible that the link is a dead link. So if we're going to create some file under ${ROOT_DIR}/var/dir1, it will fail. But the failure does no harm, because this script will always run at system boot time to set up the correct files and directories. [YOCTO #3406] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-08initscripts: Add status function to /etc/init.d/functionsJesse Zhang
[ CQID: WIND00388860 ] Many initscripts want a simple way to display status information. Add the 'status' function to the functions file. Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-06initiscripts: Fix populate-volatiles.sh whitespaceRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06initscripts: remove /var/cache from volatilesLaurentiu Palcu
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06initscripts: add read-only-rootfs-hook.sh scriptChen Qi
Add read-only-rootfs-hook.sh script to support a read-only rootfs. This script makes a union mount of /var/lib and /var/volatile/lib, making /var/lib directory writable. [YOCTO #3406] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-06initscripts: let populate-volatile.sh create the /tmp linkChen Qi
Previously, the /tmp link (/tmp -> /var/tmp) was created by the bootmisc.sh script. So in case of a read-only rootfs, this symlink would not be created correctly. The populate-volatile.sh script is intended to handle all directories and files related to volatile storage, so we should let it create the /tmp link. In addition, because of the improments of populate-volatile.sh, the data loss problem of bug#3404 is also resolved by this patch. [YOCTO #3406] [YOCTO #3404] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-28sysvinit & initscripts: use update-rc.dChen Qi
Update-rc.d provides a cleaner interface for creating links for init scripts. So we use update-rc.d to replace the redundant 'ln -sf xxx' statements. [YOCTO #3708] Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-01-15initscripts: remove finish.shChen Qi
Remove finish.sh from initscripts as it is no longer used. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-12-31replace portmap with rpcbind.Roy.Li
Rpcbind has more features, like ipv6 support and nfs4 support; Redhat, Fedora, debian, Ubuntu are using rpcbind by default. Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-12-19initscripts/urandom: create directory before staging into itMing Liu
/etc/init.d/urandom fails to start/stop because it tries to save random-seed into /var/lib/urandom folder which does not exist in the file system. Fixed by creating /var/lib/urandom at do_install time. [YOCTO #3518] [ CQID: WIND00384168 ] Signed-off-by: Ming Liu <ming.liu@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-10-25udev: upgrade to 182Alexandru DAMIAN
This is the final upgrade of udev. Futher upgrades will only come in conjunction with systemd. The v4l1 removal patch is deprecated as the bug is fixed inside udev. There is a new patch fixing the path for default sh interpreter. New debug binaries are generated, and udev.inc is modified to package those correctly. The install locations changed for udevd and udevadm, so the scripts are updated accordingly. (From OE-Core rev: 3cbe52b94c4d559a037347ac419fafee5af84fe6) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Conflicts: meta/recipes-core/udev/udev_164.bb sgw - Fixed up DEPENDS += and added some OECONF options that where in the meta-oe version and make sense to be included. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-24initscripts/sysfs.sh: mount debugfs if presentTom Zanussi
debugfs is another kernel virtual file system that should be mounted if configured, so if it's configured into the kernel, mount it. Signed-off-by: Tom Zanussi <tom.zanussi@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-25initscripts: don't bg mk_dirs in populate-volatileChristopher Larson
If a directory needs to be created to create something else in volatiles, there's no guarantees on ordering due to the backgrounding. We can't guarantee with certainty that the create directory commands are complete before the later ones run. This ensures that we wait for directory creations to complete before we proceed. Chris Hallinan hit an actual failure due to this back in March of last year. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-07-09initscripts: use update-alternative to handle file functionsKang Kai
lsb need a more abundant /etc/init.d/functions file to handle lsb test. Use update-alternative to install file funtions in package initscripts, when package lsbinitscripts installed the file functions of lsbinitscripts will be used. Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-13initscripts: test whether /etc/init.d/hwclock.sh existsAndreas Oberritter
* bootmisc.sh executes /etc/init.d/hwclock.sh, which is optional (depends on CONFIG_HWCLOCK in busybox). Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
2012-03-02initscripts: Create the volatiles cache atomically.James Limbouris
If a machine loses power while building the volatiles cache, it will continue to operate with an incomplete set of volatiles. Fix this by updating atomically. Signed-off-by: James Limbouris <james@digitalmatter.com.au> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-01initscripts: Properly format date when set from timestampGary Thomas
Reformat date, as stored in /etc/timestamp, to match CLI format. Signed-off-by: Gary Thomas <gary@mlbassoc.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-24initscripts: mount and unmount cifs network filesystemsAndreas Oberritter
* Added cifs to mountnfs.sh and umountnfs.sh. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23initscripts: Make /etc/timestamp consistent again.Gary Thomas
Commit cc8695 changed the way timestamps were handled and added some extra munging to be able to compare them reliably. This change makes the timestamp value the same everywhere and simplifies how the check to set the system clock based on the timestamp is done. Also, if the value stored in /etc/timestamp is newer [at all] than the current system time, set the system clock from the stored value, down to the minute, not just the day. Signed-off-by: Gary Thomas <gary@mlbassoc.com>
2012-01-24initscripts: remove space from shebang, just cosmeticsMartin Jansa
* at least in initscripts it's consistent now Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-24initscripts: add shebang where it was missing completelyMartin Jansa
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06initscripts: avoid mounting /sys if it is already mountedOtavio Salvador
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2011-12-15initscripts: fix timestamp checking at bootmisc.shLauri Hintsala
Timestamp checking has been broken by the commit 2078af333d704fd894a2dedbc19cef5775cdadbb. Currently the RTC time is always overwritten with the time from /etc/timestmap. Fix timestamp checking and clean the code. Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
2011-08-15The Skeleton initscript doesn't work on minimal imageRobert Yang
Fixes bug [YOCTO #1165] The /etc/init.d/skeleton doesn't work on minimal image, this is because of the pidofproc doesn't return "$?" correctly, so store $? in the variable status would fix it. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2011-07-01Drop PRIORITY variableRichard Purdie
As discussed on the mailing list, this variable isn't useful and if wanted would be better implemented by distros using pn-X overrides. This patch executes: find . -regex ".*\.\(bb\|inc\)$" | xargs sed -i '/^PRIORITY = ".*"$/d' against the tree removing the referenced. Thanks to Phil Blundell for the command. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-29initscript: Change some order of init scriptsDongxiao Xu
Move udev script to execute ealier since module autoload needs it to create device nodes. Also move sysfs before udev which has dependency on it. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2011-06-13initscripts: makedevs is no longer used anywhere so drop dependency. Also ↵Richard Purdie
inhibit compiler/libc dependencies as they're unused Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-18Add pidofproc to ${sysconfdir}/init.d/functionsRobert Yang
Add pidofproc to ${sysconfdir}/init.d/functions, this is used for getting the pid of the process. It uses pidof to implement currently, it may also use the pidfile or ps to implement in the future. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2011-05-18Cleanup the whitespace in functionsRobert Yang
Cleanup the whitespace in functions, replace the 4 whitespaces indent with tab. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2011-05-17Upstream-Status update for several recipesYu Ke
- modutils - module-init-tools - libacpi - keymaps - initscripts - console-tools - mesa-demos - xserver-xf86-lite Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-05-04initscripts: remove -i from halt/reboot arguments and allow overridePaul Eggleton
Introduces a variable HALTARGS which specifies the arguments sent to halt and reboot, and sets the default value to "-d -f", dropping the previous -i (shut down all network interfaces before halt/reboot, which causes a freeze with NFS root.) Fixes [YOCTO #997]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2011-04-20initscripts: Drop outdated machine specific filesRichard Purdie
2011-03-18initscripts: Make umountfs a bit more robust, bump PRTom Rini
Avoids error messages on shutdown. Imported from OE commit 072cad0100fd828e7fee8f3fa3ade23e4306b394 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2010-12-30RDEPENDS, RRECOMMENDS -> RDPEPENDS_${PN}, RRECOMMENDS_${PN}Koen Kooi
For these recipes the dependencies listed in RDEPENDS and RRECOMMENDS only apply to ${PN} Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>