Age | Commit message (Collapse) | Author | Files | Lines |
|
Abstract this out to the init_functions file, and allow this function
take 2+ parameters -- the hook name to be run, a user friendly short
description, and then the list of hook files to source from. While we're
at it, take advantage of the fact that hooks are now installed with
executable perms. If a hook isn't marked excutable, we skip it, thereby
removing our eval hack.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
devtmpfs is no longer supported elsewhere, so this is essentially dead
code.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
libblkid (and thus blkid) gain support for this in util-linux 2.22. This
block gets refactored slightly to cut out the monotony.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Since 3b18c9cd we have a blank /etc/fstab in the image. This is also
forward thinking for the next release of util-linux (2.22), where fsck
complains loudly about my filthy hack of using /dev/null as /etc/fstab.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
The combination of the udev+mdadm hooks plus a tag based root= would
cause resolve_device to fail because it immediately looked for a udev
symlink which would never be created. The proper fix is to get rid of
the mdadm hook and to always use mdadm_udev (which should be merged into
mdadm), but this might come back and bite us again.
The new solution doesn't assume that udev rules exist and tries blkid
first. If the device doesn't (yet) exist fall back on a udev symlink if
udevd is running.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Possible options are 'skip' and 'force' which are synonyms for fastboot
and forcefsck, respectively.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
I don't want to make a habit of treating cmdline opts as special if they
don't need to be, and this is a case where some simple PE magic can be
substituted.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Applies to both the real root and any device that's mounted on /usr
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Relying on blkid to do tag resolution will fail when the root device
doesn't yet exist. This is, of course, bad for USB root devices.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Move this logic inside fsck_device as well, so that fastboot skips a
possible fsck on the /usr partition as well.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
our fsck_ret function would always return true when passed 0, which
clearly isn't what we want. Use a simple string compare instead.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is cosmetic change, but using rootfs is more correct than ramfs.
[Rootfs is a special instance of ramfs or tmpfs, if that is enabled]
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
|
|
Fixes FS#27385
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
I think this error is more confusing to most people than it needs to be,
and it's not really accurate any longer. Generalize the message and
inform the user that we simply couldn't find the root device.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Do variable name validation via the case labels rather than via PEs.
This frees up the fallthrough case to simply ignore things we don't
understand (and not exist).
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This adds support for fsck'ing root at bootstrap if the fsck binary and
necessary helpers are included.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Rather than immediately defaulting to /dev/root, attempt to resolve the
major/minor pair back to a block device. If we can't do this properly,
then fallback to /dev/root.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This allows a caller to pass in a device by name and get a /dev node
returned. Note that this is heavily limited in that only the root device
can be identified by major:minor.
This might break init's API, if such a thing exists.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Providing this means we no longer need blkid for FS detection, as mount
will do this for us. Adds a slight bloat to the image, in exchange for a
huge convenience. Messaging is changed to assume that /bin/mount will
provide useful feedback for us on failure.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Beyond stylistic cleanup, add a conditional to ensure that we don't
show the 'waiting for device' message if it already exists.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
* Directly assign ro or rw to the rwopt rather than using readwrite as an
intermediary
* Use a default expansion to cut out an if block in determining the root
fstype.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
If we encounter a BOOT_IMAGE var taken from grub2, the first character
could be a '(' which will throw off busybox's parser and error out.
Reverse the comparison so that the LHS is always a constant, which can
be compared to anything (including nothing at all).
Fixes FS#26119.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
syntax errors in a later mount command
Fixes FS#24969.
|
|
We were never very consistent about this anyways.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
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>
|
|
devtmpfs is not used.
|
|
/sys/class/block contains all of our block devices, including the
partitions of each parent block device, so directly check for the
existance of the dev file rather than looping.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
use blkid to resolve a tag name to a block device.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
This should properly handle all ugly characters in values,
omit settings any forbidden variable names and take care
of double-quoted values with spaces in them.
This should finally fix FS#23467, FS#22080 and FS#13900.
|
|
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.
|
|
Fixes FS#21314
|
|
This reverts commit 9ef825cedd8228957f9bdd8df7ae543afd7e0001.
The introduced change was inconsistent with the standard 'mount' behaviour and
caused lots of confusion among LVM users.
|
|
It seems ash follows symlinks with -b.
|
|
If a symlink such as /dev/disk/by-uuid/xxxxx is provided on the kernel cmdline,
resolve it and mount that device instead of the symlink. This prevents some
ugliness in the output of commands such as mount or df.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
remove more eval hacks
|
|
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.
|
|
|
|
rootdev variable
This is nicer and more explicit than before, based on a patch by Benjamin Richter
|
|
|
|
|
|
|
|
|
|
mount handler (default_mount_handler)
|
|
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.
|
|
|
|
|