| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
add -n option to allow return success even if nothing was found. This is
useful for net boot, where apkovl and repositories are on network.
|
|
|
|
|
|
|
| |
kernel does not set any "DRIVER" env var in uevent from netlink so we
use kmod to find usb_storage driver.
We also reduce the timeout to 1 sec, which should be enough.
|
|
|
|
|
| |
Avoid printing error message if there are lvm devices but root is not on
any of those.
|
|
|
|
|
|
|
| |
we want print the device name that user is looking for when we prompt
for cryptsetup password instead of the devname from kernel uevent.
If user specified UUID, then we print kernel provided name.
|
|
|
|
|
| |
we want avoid lvm messages be printed after password prompt for
cryptsetup is displayed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need run cryptsetup in parallel so that keyboard drivers are loaded
while waiting for password input.
But cryptsetup will recreate the device which means that the uevent for
new device node will first be added then changed and finally will it
create the /dev/mapper/* device node. We handle the first generated
uevent and while handling, the device node might have disappeared
causeing blkid not find any UUID, and the /dev/mapper/* does not yet
exist.
This means that we need to:
- handle uevents in parallel while waiting for password input
- block uevent handling while actually setting up the crypt device
So we use libcryptsetup and add a mutex while setting up the crypt
device.
|
|
|
|
|
| |
Use a bit mask to indicate trigger thread. This is so we can have more
threads in future.
|
|
|
|
|
|
|
|
|
| |
Fix issue where /dev/vg0/lv_device is used as crypt device. We compare
the major/minor of the event with the device we are searching for. That
way we can find the device we are looking for regardless of the name it
gets.
ref #4863
|
|
|
|
|
|
|
| |
- print only once when we reset timeout
- print what the timeout was set to on exit
This helps to show if what we were looking for was found or not
|
|
|
|
|
|
|
|
| |
instead of waiting each child to run end before continuing, fork
or queue each command allowing up to CPU count concurrent childs.
this enables full use of SMP cores, and allows loading of modules
after a blocking command is started; fixing e.g. keyboard driver
to load even if crypto disk command is waiting keyboard input.
|
|
|
|
| |
just to be on the safe side
|
| |
|
|
|
|
|
|
| |
Using clearenv and setenv is slow, non-thread safe and problematic.
This makes PATH inherited from parent environment, and explicitly
constructs the rest of the environment for mdev.
|
|
|
|
| |
this is so we also can specify cryptroot=/dev/sdaX at boot prompt
|
|
|
|
|
|
|
|
|
|
| |
we want handle all the events in queue, even if we find the devices we
are looking for. This is so we load kernel module for framebuffer even
if the apkvol and bootrepo are found first.
This means that the only valid exit condition is a poll timeout and that
we can set the timeout to 0 once we found all the things we are looking
for.
|
|
|
|
|
|
| |
make sure that we dont exit before the trigger thread is complete,
regardless if we find the devices/bootrepo/apkovl we are looking for or
not.
|
| |
|
| |
|
|
|
|
|
|
|
| |
There are ~10k entries in /sys so we want be fast. Not all filesystems
supports dirent filed d_type, (iso9660 for example) so we need use lstat
to find directories. However, we know that sysfs supports it, so we can
avoid 10k lstat syscalls. This might be noticiable difference on rpi.
|
|
|
|
|
| |
usb storage need some time to settle, we increase the timeout with 2
seconds if we detext usb-storage.
|
| |
|
|
|
|
| |
retun success if anything of what we searched for was found.
|
|
|
|
|
| |
avoid allocate PATH_MAX on stack for every dir. Instead reuse the path
buffer.
|
|
|
|
|
| |
the dirent d_type is not supported on isofs apparently. Use lstat
instead.
|
|
|
|
| |
we set CLOEXEC with socket create
|
|
|
|
|
| |
We will need set optional mount options, so we better do the mount from
script.
|
|
|
|
|
| |
when both apkovl and boot repository are found, then we should have what
we need to setup up a working tmpfs root so we exit at that point.
|
| |
|
|
|
|
|
| |
add option -b OUTFILE which will create OUTFILE and add first found boot
repository
|
|
|
|
|
| |
we need a more general recurse function so we can search for boot repos
and similar.
|
| |
|
| |
|
|
|
|
| |
We recursively scan /sys and trigger the events ourselves.
|
|
nlplug-findfs is a tool that will help us to find a given filesystem
using coldplug. The only reason that initramfs exist in first place is
to set up a rootfs and switch to it. The nlplug-findfs will handle
coldplug events til a given filesystem/device is found and then mount
it.
|