summaryrefslogtreecommitdiffstats
path: root/init
AgeCommit message (Collapse)AuthorFilesLines
2011-11-15init: create /run/initramfs after mounting /runDave Reisner1-0/+1
We'll use this as a channel to communicate with later userspace. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-11-15init: don't tell the kernel about the path to modprobeDave Reisner1-2/+0
Remove this ancient relic. It's not been needed in a very long time. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-22install/base: include new_root as part of build processDave Reisner1-1/+0
We always need this in early userspace, so add it as part of the build process instead of forking at runtime. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-20install/udev: relocate udevd for udev 174Dave Reisner1-2/+2
- usb_id and path_id are now builtin functionality of udevadm - /sbin/udevd moves to /lib/udev/udevd - update dev PKGBUILD to reflect version requirement Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-16init: refer to busybox by full path on --installDave Reisner1-1/+1
This is required for busybox 1.19. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-09[mkinitcpio] Remove early redirection 2>/dev/null such node does not exists.Gerardo Exequiel Pozzi1-1/+1
An empty file will be created in any case, does not cause any harm, but for correctness. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-10-01init: allow /run to be mounted with exec permsDave Reisner1-1/+1
This is already done in initscripts so we mirror it here. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-01init: support breaks before and after mounting rootDave Reisner1-2/+8
Add in 'premount' and 'postmount' as trigger conditions, but also leave in the old 'y' value as a synonym for premount. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-07-02Trim leading spaces in MODULES and earlymodules to prevent error messages ↵Thomas Bächler1-3/+4
when one is set to " "
2011-06-25init: remove unnecessary variable declarationsDave Reisner1-7/+2
These don't really serve a purpose and might actually munge a test for an unset var. Declare vars as we need them, substituing with default expansions where possible. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-25init: declare PATH, remove absolute pathsDave Reisner1-17/+19
We were never very consistent about this anyways. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-25install/base: cleanup and simplifyDave Reisner1-1/+1
* Create only the directories that are necessary. If others are needed, they'll be created along the way. As part of this, we create /new_root sooner in init, so it's less jarring to the user if they request a break. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-25remove support for -m to add a startup messageDave Reisner1-4/+0
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-16use consistent vim modelinesDave Reisner1-0/+2
This also adds a /bin/bash shebang to functions. While not technically necessary, this ensures that vim gives us the correct syntax highlight file. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-16init: don't attempt modprobe if $MODULES is emptyDave Reisner1-1/+1
This is harmless when it fails, but it might alarm users. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-07default_mount_handler: Only try to manually create the root device if ↵Thomas Bächler1-0/+2
devtmpfs is not used.
2011-06-07init: purge environment before leaving early userspaceDave Reisner1-1/+1
We preserve TERM, but everything else can be destroyed from the environment. Without preserving TERM, the value is reset to 'dumb' in userspace, and we get false readings by the initscripts on terminal capabilities. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-07init: load all earlymodules at onceDave Reisner1-3/+1
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-07init: remove support for disablemodulesDave Reisner1-13/+1
This is no longer supported, as m-i-t supports modprobe.blacklist= syntax on the kernel cmdline. We load all modules from the config at once with --all and --use-blacklist flags in order to honor the cmdline blacklisting. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-05-14Cleanly stop udev >= 168 as recommended by upstream.Gerardo Exequiel Pozzi1-9/+4
>From udev NEWS: The running udev daemon can now cleanly shut down with: udevadm control --exit Udev in initramfs should clean the state of the udev database with: udevadm info --cleanup-db which will remove all state left behind from events/rules in initramfs. If initramfs uses --cleanup-db and device-mapper/LVM, the rules in initramfs need to add OPTIONS+="db_persist" for all dm devices. This will prevent removal of the udev database for these devices. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-05-14/run: restrict write access to rootTom Gundersen1-1/+1
This brings it in line with initscripts (and systemd), there should be no need for everyone to have write access to the /run folder. Reported-by: Pierre Schmitz <pierre@archlinux.de> Signed-off-by: Tom Gundersen <teg@jklm.no>
2011-05-01Drop deprecated /proc/sys/kernel/hotplugGerardo Exequiel Pozzi1-1/+0
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2011-04-10Fix problems in parsing the kernel command lineThomas Bächler1-23/+2
The kernel command line allows quoted strings with whitespace in them. Until now, such parameters would crash /init and cause a kernel panic. Move parsing into a function and use the 'set' builtin to split /proc/cmdline into arguments. Fixes FS#13900 and FS#22080.
2011-04-10Allow initramfs to be completely silent:Thomas Bächler1-12/+11
- Remove ":: Loading initramfs" message - Start udev after command line parsing, so quiet will be respected
2011-04-08Introduce /runThomas Bächler1-1/+2
Mount /run as a 10MB tmpfs with 1777 permissions early. Move it to /new_root when switching.
2011-04-08init: Unify/improve mount --move handlingThomas Bächler1-3/+7
- Loop over dev, sys, proc instead of repeating the same command. - If the target directory does not exist, umount instead of moving.
2011-04-05Fix broken command line parsing due to insufficient quoting introduced in ↵Thomas Bächler1-1/+1
42e8dba5dce4879e4a372c5c2fb5446b4e8bb16c.
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