summaryrefslogtreecommitdiffstats
path: root/init
AgeCommit message (Collapse)AuthorFilesLines
2011-02-01Remove some obsolete 'export'sThomas Bächler1-10/+9
2010-12-06mount: forbid suid,exec,dev from /proc and /sysTom Gundersen1-2/+2
This is the counterpart to a similar patch to initscripts, making sure that the change applies regardless of whether initrd is used. Thanks to David Reisner for pointing out that this was needed.
2010-06-10Create /dev/{null,zero,mem,console} devices when devtmpfs is missingThomas Bächler1-0/+6
These devices used to be present because they were added in the image. Since we now mount {dev,}tmpfs early in initramfs, the devices from the image will be invisible. In the tmpfs-case, create the devices manually so everything will be in order until udev is started, or if udev isn't used at all.
2010-06-03Mount tmpfs or (if supported) devtmpfs on /dev, move it into the real root ↵Thomas Bächler1-0/+6
before switch_root
2010-06-03Do not umount /proc and /sys before switch_root, but mount --move them into ↵Thomas Bächler1-2/+2
the real root
2010-02-21poll_device: do not wait for a device to appear if udevd is not runningThomas Bächler1-0/+3
Devices will never "magically" appear when udevd is not running. Thus, poll_device now exits instantly when a device when udevd is not running. The return value is unchanged, just the delay is removed. Assuming that the drive is available just after loading the module is unsafe. However, "fast" devices like most (all?) pata/sata seem to work this way for many people. On "slow" devices like USB, we still have to wait - those will not work without udev.
2010-02-17Improve sanity check: ${init} must be executableThomas Bächler1-1/+1
2010-02-16When use stat -c %D instead of stat -f -c %i for testing if /new_root is a ↵Thomas Bächler1-1/+1
mount point The old check couldn't distinguish different tmpfs mounts and failed to work with aufs (archiso). This check is actually the same one that busybox/switch_root uses to determine where to stop deleting files. If this check fails and we still launch switch_root it may start deleting data.
2010-02-16Make indentation in two code blocks consistentThomas Bächler1-13/+13
2010-02-16Remove the special handling for the default mount procedure, move it into a ↵Thomas Bächler1-70/+3
mount handler (default_mount_handler)
2010-02-16Introduce mount handlersThomas Bächler1-9/+5
Instead of having special NFS code in /init, make it possible for a hook to register a mount handler When a hook sets the mount_handler environment variable, the normal mount code will be skipped and the handler will be called with the path to mount point as the first and only argument.
2010-02-15Do not kill -9 udevd, instead kill -15 and wait for all processes to ↵Thomas Bächler1-2/+4
terminate before continuing
2010-02-15If we could not mount the real root device, or the init program did not ↵Thomas Bächler1-1/+18
exist on it, bail out instead of panicing In these cases, we will exec /bin/sh, such that manual recovery is still possible as sh has PID 1 An expert might be able to mount and switch_root manually. In any case, this is less scary than a panic and a useless trace.
2010-02-14Kill udev after mounting file systems, not beforeThomas Bächler1-9/+10
Slow devices like USB devices will be detected after we kill udev, thus booting will fail. Kill udev as the last step, directly before we umount /proc and /sys and run switch_root.
2010-02-14Filesystem type detection: Change message to the way it should have been, ↵Thomas Bächler1-1/+1
stupid me
2010-02-14If filesystem type detection fails, print an error and instructionsThomas Bächler1-0/+13
2010-02-09Honor the "rw" command line flag, but still make "ro" the default if nothing ↵Thomas Bächler1-1/+8
is specified
2010-02-09Remove the comment about 'reboot': busybox reboot requires init to run, thus ↵Thomas Bächler1-2/+0
typing reboot is ineffective
2010-02-09Add support for mounting root filesystem over NFS.Simon Boulay1-2/+9
2010-02-09Fix path when looking at /sys/block for rootdevGerardo Exequiel Pozzi1-1/+1
otherwise will access to /sys/block//sys/block/sda/sda1/dev (for example) Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2010-02-07udev: Do not try to resolve any group/user namesThomas Bächler1-1/+1
There is no nss library or user/group database in initramfs, so tell udev to not try to resolve any names
2010-02-07Honor the rootflags= command line optionThomas Bächler1-1/+1
This fixes FS#18213.
2010-02-07Settle remaining uevents before killing udevdThomas Bächler1-0/+2
2010-02-05Respect rootfstype command line parameterThomas Bächler1-1/+5
2010-01-29Nicer shell prompt in the break/emergency shellThomas Bächler1-2/+2
2010-01-12Replace custom minips with busybox pidofThomas Bächler1-1/+1
2010-01-12Fix a small oops in the sed usageThomas Bächler1-2/+2
2010-01-12Replace the custom 'replace' tool with 'sed'Thomas Bächler1-11/+12
2010-01-10Remove kinit usage from /init: Implement parseblock and kinit in shell code, ↵Thomas Bächler1-36/+55
use busybox/switch_root for the final step. TODO: NFS
2010-01-10Do not mount /proc before busybox --install - this requires ↵Thomas Bächler1-3/+2
CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox" in busybox
2010-01-05Start moving from klibc to glibc+busyboxThomas Bächler1-5/+5
Remove klibc-isms from base and init (except kinit, which will be done in a later commit) Install busybox to the initramfs and change /init so it can be used with busybox
2009-12-13added done message to udevd startupTobias Powalowski1-0/+1
2009-12-13start udevd in init to solve the firmware loading bugTobias Powalowski1-0/+7
2009-10-08Skip options starting with a digit, sh variables must not start with a digit.Thomas Bächler1-0/+1
2009-09-30rootdelay check: Fix compatibility with other sh implementations than dash ↵Thomas Bächler1-1/+1
and make it more reliable The old implementation failed on bash and failed on both if rootdelay was not a number. The logic is now as follows: If "$rootdelay"="", then [ -z "${rootdelay}" ] is true If not, then the part after the || is executed - if ${rootdelay} is not a number, or is <0, then [ ${rootdelay} -ge 0 ] fails, and the test will return true due to the !. The previous implementation failed here, because [ ! ${rootdelay} -ge 0 ] returns false on error, while ! [ ${rootdelay} -ge 0 ] returns true on error.
2009-08-05Do not rely on -L test; use -h instead.Loui Chang1-1/+1
See `man dash` Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-07Always use rootdelay when polling a device, set it earlier in the init file0.5.25Thomas Bächler1-7/+7
2009-06-07Pass arguments to init properlyThomas Bächler1-3/+4
2009-06-07Don't only check for block devices, but also for symbolic links.Thomas Bächler1-1/+1
If we have a symlink, we don't check further if it points to a block device, partially due to klibc's readlink being broken.
2009-06-07Fix an 'elif' that should have been an 'if'Thomas Bächler1-1/+1
2009-06-06Rework the root device detection / creation stageThomas Bächler1-36/+34
- Set rootdelay to 10 by default - Skip the whole detection stage if we use root on nfs - Use the new poll_device function to wait for at most $rootdelay seconds - Always pass rootdelay=0 to kinit, as we ensure the existence of the root device - Don't reboot after the fallback. This allows a user to fix a problem and continue booting - Rely on kinit to detect the root filesystem type. The rootfstype= option can still be used to override Our old method would have failed as well, as the code for filesystem detection is the same
2009-06-06Add a new file init_functions that contains common functions used in /init ↵Thomas Bächler1-2/+1
and the hooks
2009-02-04Silence errors when killing udevdGerardo Exequiel Pozzi1-1/+1
udev forks some processes, and sometimes minips returns multiple PIDs. The error messages are annoying, so we'll simply remove them Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-03-16Fix various coding style issuesThomas Bächler1-11/+11
2008-03-15Use the new -s= option of replaceThomas Bächler1-12/+2
2008-01-04Allow init=??? syntax againAaron Griffin1-0/+2
Using an explicit set of params passed to kinit is annoying, because we forget things like this. Add init=??? syntax again, for i.e. init=/bin/bash to recover a root password Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-08-11Coding style change, use -n and -z for variable testsAaron Griffin1-5/+5
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@209 880c04e9-e011-0410-abf7-b926e227c9cd
2007-05-12- adjusted all hooks for new modprobe pathThomas Bächler1-2/+2
- added compatibility symlink /bin/modprobe - 0.5.14 release git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@206 880c04e9-e011-0410-abf7-b926e227c9cd
2007-05-12- fix init for users that use neither udev nor filesystemsThomas Bächler1-10/+27
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@205 880c04e9-e011-0410-abf7-b926e227c9cd
2007-05-12- fix a bug with BINARIES= (also accept shared objects, not only executables)Thomas Bächler1-8/+6
- fix some bugs introduced by phrakture (could you be more careful?) git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@204 880c04e9-e011-0410-abf7-b926e227c9cd