Age | Commit message (Collapse) | Author | Files | Lines |
|
Not all root devices are block devices, after all. Rely on mount doing
the right thing (or not).
ref: https://bugs.archlinux.org/task/45118
ref: https://bugs.archlinux.org/task/35529
|
|
ref: https://bugs.archlinux.org/task/52768
|
|
This refactors parse_cmdline into a few chunks of code, mainly to
separate the work of parsing from the handling of the actual parsed
parameters. By default, parse_cmdline_item is used as the callback for
handling the parameters, but this could be overriden by other code
sourcing init_functions if desirable.
Our test harness passes more tests, but we leave behind some expected
failures to describe the cases where it still fails. Fortunately I've
not yet been able to find any cases which warrant --expect-parse-fail.
|
|
rootfstype is handled by the kernel, so we should handle it, too.
ref: https://bugs.archlinux.org/task/45117
|
|
This allows booting from devices which have labels like LABEL=/.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Add an annoying warning in case the root device is fsck'd and about to
be mounted RO.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This allows 'quiet rd.log=kmsg' to produce a silent boot while still
logging the full output that would have been written to the console.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This introduces support for the rd.log and rd.debug kernel command line
options, which log early userspace activity to /run/initramfs/init.log.
Code is largely inspired by Dracut's implementation of early userspace
logging, but without needless complexity and redundancies.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This makes it easier to test parse_cmdline.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
It's possible, though unlikely, that someone expecting a variable of the
name, e.g. "rhs" or "lhs" to be propagated from the kernel cmdline could
be sadly let down because of the local scoping. Give our localized vars
names less likely to clash.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Adjust the test in poll_device to look for either an unset OR an empty
2nd parameter.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Start at .1 second and double the interval, capping at 1s.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
init defaults to a rootdelay of 10, but poll_device falls back on a
default of 5 if rootdelay is somehow manage during the hook run. Keep
this consistent and use 10 seconds in both places.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|