Commit Graph

41 Commits

Author SHA1 Message Date
Antonio Russo
471f51a61f Ship initramfs zdev hook in zfs-initramfs
Instead of in zfsutils-linux

Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
2018-10-26 12:42:30 +00:00
Antonio Russo
b981c8a4d8 Use upstream bash completion file
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
2018-10-26 12:26:38 +00:00
Aron Xu
395b0a115f Rename zfsutils path to follow the package name 2016-10-18 06:46:01 +08:00
Aron Xu
6c129e3633 Scrub all healthy pools monthly from Richard Laager 2016-04-26 17:26:36 +08:00
Aron Xu
56eda9c6ee Use upstream version of initramfs configurations 2015-11-01 22:31:59 +08:00
Aron Xu
1b3f4aa428 Move bash completion to new location 2015-11-01 13:17:22 +08:00
Turbo Fredriksson
6aca66e943 'Forget' about ghash-generic. This should be taken care of by module dependency in sun-gcm. 2013-07-14 02:31:16 +08:00
Turbo Fredriksson
e6775f9a8c Add an 'exit 0' at the end of the zfs hook. 2013-07-14 02:31:16 +08:00
Turbo Fredriksson
5c0edc8792 Make sure /boot/zfs exists before trying to copy it. 2013-07-14 02:31:16 +08:00
Aron Xu
a81c790e08 * Build udebs and optionally modules package(s) - both .deb and .udeb.
+ Find kernel source in $KSRC and kernel objects in $KOBJ.
  + linux-headers-_KVERS_ is a virtual package. Instead, depend on
    linux-headers-_KVERS_-common AND linux-headers-_KVERS_-amd64.
* Improve upon initramfs-tools scripts.
  + Try three times to import the pool and only if the last one fails,
    drop to a shell.
  + Print out the failed commands.
  + Support booting on crypted root by adding support to initramfs hook and script.
    + Only do crypto check(s) if 'zfs key -l' command is availible.
    + Don't add the list of crypto modules by default.
* Copy the zpool.cache file to the initrd.
* Update depends in zfs-initramfs.

Conflicts:
	debian/control.in
	debian/rules
2013-07-14 02:31:10 +08:00
Carlos Alberto Lopez Perez
4f9f0bb539 Fix broken initramfs hooks caused by commit 1123dc4
* The hooks were copying the required files for supporting the
   deprecated zdev.conf syntax.

 * Remove the deleted files from the list.

 * Plus: remove a trailing space.
2013-04-10 05:54:33 +02:00
Carlos Alberto Lopez Perez
2cc7293f72 Trivial commit to reflect that now /etc/hostid is created by spl-dkms 2013-04-10 05:50:55 +02:00
Carlos Alberto Lopez Perez
f983f238cf Move example for sudo from /etc/sudoers.d/zfs to dh_installexamples
* We shouldn't be providing an example file for sudo on /etc/sudoers.d
   because if the users modifies such file, and we modify the provided
   example, on the next upgrade the user will be asked what to do.

 * The right place is /usr/share/doc/$package/examples that is were we
   also ship the other examples provided by upstream.
2013-03-16 23:42:35 +01:00
Darik Horn
bccc23fcb8 Add the vdev_id udev helper to the initramfs hook.
The `/lib/udev/vdev_id` helper is superceding the `/lib/udev/zpool_id` helper,
which is deprecated and will be soon removed upstream. zfsonlinux/zfs#1183
2013-01-23 22:50:59 -06:00
Darik Horn
a809ec3061 Add a configurable sleep timer to pre_mountroot.
Add a new `/etc/default/zfs` option:

* `ZFS_INITRD_PRE_MOUNTROOT_SLEEP`, which wastes an arbitrary amount
of time in the initrd environment before wait_for_udev is called.

This option is primarily a kludge for bad mpt2sas hardware that can go dumb
during system initialization. Thirty seconds should be enough for most
affected computers, but five minutes might be required in the worst case.

Closes: dajhorn/pkg-zfs#71
2013-01-14 20:29:33 -06:00
Darik Horn
ac109ee17a Strengthen the /etc/zfs test in the zdev hook.
Double-check that /etc/zfs is a readable directory before adding it
to the initrd.
2013-01-14 19:52:59 -06:00
Darik Horn
dd37b338b1 Add /etc/default/zfs to the initrd.
Userland tunables will eventually be set in this options file.
2013-01-14 19:40:46 -06:00
Darik Horn
c421a61431 Set the execute bit on 10zvol-test for os-prober.
Run-parts in `/usr/lib/os-probes` should be chmod 644.
2012-12-20 21:25:30 -06:00
Will Rouesnel
bfe15582e6 Added call to hide Plymouth when error shell is launched.
This allows users with Plymouth to see and interact with the spawned
shell under error conditions.

Amended-by: Darik Horn <dajhorn@vanadac.com>
2012-12-15 15:42:01 -06:00
Peter Fern
2adf04221f Add os-prober test for zvols.
When `update-grub` is invoked, `os-prober` tries to mount each zvol
node, which is slow on systems with more than a few hundred volumes.

Add a device test for `os-prober` that returns early on zvols.

Closes: dajhorn/pkg-zfs#62
2012-12-09 05:53:24 -06:00
Darik Horn
29f7291b82 Update /etc/sudoers.d/zfs file.
Refresh commit 1080b6eab1.

https://groups.google.com/a/zfsonlinux.org/d/msg/zfs-discuss/cJCwJsaym-U/TOF-HuqF1JEJ
2012-11-30 23:26:54 -06:00
Darik Horn
6b6e13c78d Fix a typo in the root mountpoint seatbelt.
The `zfs set mountpoint=/ "$ZFS_BOOTFS"` command in the initramfs
script had a typo that made it a noop.

This command ensures that the root filesystem has a sensible mountpoint
property. The error wasn't noticed because most of the Solaris userland
goodies for ZFS aren't yet implmented for Linux.

Closes: dajhorn/pkg-zfs#41
2012-10-28 23:19:02 -05:00
Peter Fern
a73631bcb4 Add zdev rules to the initrd for all installations.
Always hook the udev rules that read the `/etc/zfs/zdev.conf` file into the
initrd, even if the system is not using the zfs-initramfs package.

This change ensures that `/dev/disk/zpool` device aliases are ready in time for
`mount` calls early in the init stack.

Amended-by: Darik Horn <dajhorn@vanadac.com>
Closes: dajhorn/pkg-zfs#39
Closes: zfsonlinux/zfs#811
2012-10-28 22:51:41 -05:00
Darik Horn
1080b6eab1 Add /etc/sudoers.d/zfs file.
Add Kate's sudoers part for ZoL, but disabled by default.

This file is tracked by dpkg as a configuration file if it is changed
by the administrator after installation. The installation mode can be
converted to a dpkg question sometime later.

https://groups.google.com/a/zfsonlinux.org/group/zfs-discuss/msg/7b4f30b2563898b2

  From: Kate Ward
  Date: Thu, 17 May 2012 00:20:05 +0100
  Local: Wed, May 16 2012 6:20 pm
  Subject: Re: [zfs-discuss] Re: Unable to open /dev/zfs: Permission denied.

  Rather than allow all ZFS commands to be executed without a password with
  sudo, I limit passwordless use to read-only commands with the following in
  my /etc/sudoers file. I have less fear of accidentally doing something
  willy nilly.
2012-06-01 21:44:25 -05:00
Darik Horn
ecd5e9afb9 Add libgcc_s.so.1 to the zfs-initramfs manifest.
The `zdb` utility requires pthreads for some functions, but the
necessary library is not automatically added to the initrd because
it is not detected as a dependency.

Closes: dajhorn/pkg-zfs#26
2012-03-30 18:59:04 -05:00
Darik Horn
972caf4b22 Add /sbin/blkid to the initramfs manifest.
If the root pool contains a zvol, then udev tries /sbin/blkid and
emits a warning, which is usually invisible because it happens
after GRUB changes the console mode for Plymouth.

Adding /sbin/blkid to the initramfs manifest satisfies the udev
warning and results in a small boot time improvement.
2012-01-08 11:23:57 -06:00
Darik Horn
36af17fb7a Add bash command completion to zfsutils. 2012-01-05 12:55:05 -06:00
Darik Horn
6d4e981668 Let mkinitramfs fail if the utilities are missing.
The zfs-initramfs package directly depends on the zfsutils package,
so utilities in the COPY_EXEC_LIST should always be available.

Unlike some other initramfs hooks, we aren't currently detecting
whether anything in /sbin is actually necessary to start the system,
and the earlier behavior obscured a packaging mistake.
2011-08-09 16:38:52 -05:00
Darik Horn
2247043363 Remove zpool_layout from the initramfs manifest.
The zpool_layout script is not required to boot a system with a
native ZFS root filesystem.
2011-08-09 15:37:17 -05:00
Darik Horn
41af745c17 Force root pool imports in the initramfs script.
Ubuntu Natty and Ubuntu Oneiric systems seem sensitive to a missing
or stale /etc/zfs/zpool.cache file.  The only circumstance where
these systems reliably import the root pool is when the cache is
current and all pools are automatically imported at module insertion.

Good behavior on earlier Ubuntu releases could have been accidental.

Consider inhibiting automatic zpool imports in the initramfs
environment and doing a full import in the regular system instead.
2011-07-25 20:29:01 -05:00
Darik Horn
ad9fec8c44 Remove /usr/bin/hostid from the initramfs image.
The SPL module now reads the /etc/hostid file directly.
2011-07-12 19:47:21 -05:00
Darik Horn
ab520f1343 Set the configuration prefix to root.
Promote the utilities and libraries from /usr so that they are
installed to the root filesystem, and move the udev helpers
from /usr/bin to /lib/udev.

This reflects a similar change in the upstream RPM packaging.
2011-07-12 19:46:54 -05:00
Darik Horn
246ca86bc3 Remove the gawk packaging dependency.
Per commit ad35b6a6e99a0e0962d6a33e181784cada44c3c0 in the
spl repository.  Any of gawk, nawk, or the Busybox awk are
now adequate.
2011-04-23 11:25:55 -05:00
Darik Horn
daf3069029 Print initramfs errors in a sensible order.
If the zfs script must drop into a recovery shell, then print the error message
and error number after the command invocation that failed.
2011-03-29 23:35:14 -05:00
Darik Horn
2a146a6299 Use mount.zfs instead of zfs mount in the initramfs.
Revert to mounting the root filesytem like this:

  mount -t zfs -o zfsutil "$ZFS_BOOTFS" "$rootmnt"

Ideally, the root filesystem would be mounted like this:

  zpool import -R "$rootmnt" -N "$ZFS_RPOOL"
  zfs mount -o mountpoint=/ "$ZFS_BOOTFS"

but the MOUNTPOINT prefix is preserved on descendent filesystems after the
pivot into the regular root, which later breaks things like `zfs mount -a` and
the /etc/mtab refresh.

Assuming one filesystem on the pivot and implicitly remapping it is sensible
behavior for the exec init.  Keeping the -R prefix is similarly sensible
behavior for the zfs utility.  Thus, the initramfs is probably the best place
to do something unusual.
2011-03-29 23:22:50 -05:00
Darik Horn
a1c01b895e Handle the GRUB zfs-bootfs parameter in the initramfs. 2011-03-27 22:10:24 -05:00
Darik Horn
05bac65109 Use /sbin/mount.zfs for the root mount in the initramfs. 2011-03-25 23:04:38 -05:00
Darik Horn
93da34ec50 Remove the whack-bang and execute bit from the initramfs boot script.
This change reflects the scripts/local and scripts/nfs files that
are provided by the initramfs-tools package.
2011-03-22 23:05:11 -05:00
Darik Horn
69ed3baa13 Properly strip the bootfs= and rpool= kernel command line parameters. 2011-03-22 21:05:04 -05:00
Darik Horn
309dcf0e20 Remove the init-top/hostname script and force BUSYBOX=y instead.
The pre-init script in the initramfs environment sets the hostname
if the regular /bin/hostname binary and the /etc/hostname file are
included by the hook.

The pre-init invokes `/bin/hostname -b -F /etc/hostname`, which is
incompatible with the busybox builtin because it lacks the '-b'
switch.

This commit mysteriously resolves the console corruption that
occasionally happens on systems that boot into a native ZFS root
filesystem.
2011-03-20 18:53:12 -05:00
Darik Horn
4535ff588b Initial zfs-initramfs packaging for root filesystem support. 2011-03-11 15:47:22 -06:00