sys-kernel/dracut: crypt-ssh work in progress

This commit is contained in:
Stefan Reimer 2013-04-01 23:11:58 -07:00
parent 372d2f2460
commit 77813e2a43
8 changed files with 605 additions and 3 deletions

View File

@ -0,0 +1,3 @@
AUX dracut-crypt-ssh.patch 2180 SHA256 49d84ae8fb580cd1df940c2bfa7560b2474bd444e6ff4d9715fb18fe8db72c62 SHA512 45125ef6b0525a56affb26a03c002470a646bbc495737c1d56abca7f41d58e7011d5f2d4e4df82a2ebda891a8573dc810654af4aed0c0ebfb3fce9b720e99ebc WHIRLPOOL 28d843636c5c00ba8d65b7695027a534ce0f26c7c6ef11de06bfca75da3b8fcf8288a517755fb7b70fdafd847bba1497c208191d75a0a9a0996f268ce3049bce
DIST dracut-026.tar.bz2 249079 SHA256 1b3b25350dbf71c9d92dd6fd0cd128db13453e200e89b649ec3753e6f92438f7 SHA512 6484645df118ce2337920f6da574e04ede8131c4f5ae2986008cba527b591fde2274c3cbf8cacf20e3dcd765adab7f6afaffd2e1cdbd5a5a021193f328a844cf WHIRLPOOL 87934eb5d7d118be61a609aebbec94a4e70df58a883f0c856f90e8e8b011c695a23d5b00a120bcd74e0644f06f54038712b1ca620d8182c1fcffb4f3f5ea8ec2
EBUILD dracut-026-r1.ebuild 8744 SHA256 8eed0f808a673df1a92cf6a616af3655c71ad9ae6e6289705a435dd20d4cd5a3 SHA512 4af03359c242ff4716c26f5a0ef809f81e96b67c52a886b6347acc95976ef6fb2789e5192141dd27dd32cd9a4298e8da04f8ac2a206f3b952f0a1241cfc93746 WHIRLPOOL 373616bf27f74e24ded61c14e2535c40ccfda2a5f3dd1c97c530892f3f7c36bad07fcaebf8fed838a214cf9d0ed87bcabc8c8f418d758794b3a61181bc9cf823

View File

@ -0,0 +1,37 @@
From 76e3d3ac2d753f17c59dfe9758ea36897bedaddf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
Date: Sun, 6 Jan 2013 13:35:01 +0100
Subject: [PATCH 1/3] dracut-functions.sh: support for alternative udev dirs -
udevaltdirs
It is required for Gentoo which moves udev from / to /usr and supports
both /lib/udev and /usr/lib/udev for compatibility with other packages.
Credits go to Alexander Tsoy <alexander@tsoy.me>.
---
dracut-functions.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 2a84d17..a6a609c 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -955,6 +955,15 @@ inst_rules() {
inst_dir "$_target"
for _rule in "$@"; do
if [ "${_rule#/}" = "$_rule" ]; then
+ for r in ${udevaltdirs}; do
+ [[ "$r" = "${udevdir}" ]] && continue
+ if [[ -f $r/rules.d/$_rule ]]; then
+ _found="$r/rules.d/$_rule"
+ inst_rule_programs "$_found"
+ inst_rule_group_owner "$_found"
+ inst_simple "$_found" "${udevdir}/rules.d/${_found##*/}"
+ fi
+ done
for r in ${udevdir}/rules.d /etc/udev/rules.d; do
if [[ -f $r/$_rule ]]; then
_found="$r/$_rule"
--
1.8.1.4

View File

@ -0,0 +1,30 @@
From f4bfd74c673c5f4d01cf9855f2e4f58c59f5b658 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
Date: Sun, 16 Dec 2012 20:02:48 +0100
Subject: [PATCH 2/3] gentoo.conf: let udevdir= be handled by pkg-config and
use udevaltdirs
To avoid need of rebuild after udev update/downgrade let udevdir= be set
dynamically with pkg-config. Use udevaltdirs to search for rules both
in old and new locations.
---
dracut.conf.d/gentoo.conf.example | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
index 1361a30..b78e5c6 100644
--- a/dracut.conf.d/gentoo.conf.example
+++ b/dracut.conf.d/gentoo.conf.example
@@ -1,7 +1,8 @@
# /etc/dracut.conf.d/gentoo.conf
# dracut config file customized for Gentoo Base System release 2
-udevdir=/lib/udev
+udevdir=
+udevaltdirs="/lib/udev /usr/lib/udev"
ro_mnt=yes
#
--
1.8.1.4

View File

@ -0,0 +1,55 @@
From a6b0fde8f776d28988a9ab4e5bf09f78fa858744 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
Date: Sun, 10 Mar 2013 13:31:02 +0100
Subject: [PATCH 3/3] Revert "crypt, dmraid, mdraid: use
for_each_host_dev_and_slaves_all()"
This reverts commit cf24ac8c19b803e6f5c0576f2d7e78187331cf02.
---
modules.d/90crypt/module-setup.sh | 2 +-
modules.d/90dmraid/module-setup.sh | 2 +-
modules.d/90mdraid/module-setup.sh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 2b4456b..93b996c 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -25,7 +25,7 @@ check() {
}
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves_all check_crypt || return 1
+ for_each_host_dev_fs check_crypt || return 1
}
return 0
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
index c315961..eb949dc 100755
--- a/modules.d/90dmraid/module-setup.sh
+++ b/modules.d/90dmraid/module-setup.sh
@@ -38,7 +38,7 @@ check() {
}
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves_all check_dmraid || return 1
+ for_each_host_dev_fs check_dmraid || return 1
}
return 0
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
index 0efffbb..a2b9ac2 100755
--- a/modules.d/90mdraid/module-setup.sh
+++ b/modules.d/90mdraid/module-setup.sh
@@ -27,7 +27,7 @@ check() {
}
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves_all check_mdraid || return 1
+ for_each_host_dev_fs check_mdraid || return 1
}
return 0
--
1.8.1.4

View File

@ -0,0 +1,42 @@
From f6e0e5653fac1f856192bfafdcb2fbd86ed8a22a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Sun, 10 Mar 2013 14:44:32 +0100
Subject: [PATCH 3/5] lsinitrd.sh: fix for default initrd not found, but image
given
---
lsinitrd.sh | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lsinitrd.sh b/lsinitrd.sh
index 7a09423..4b8a7e2 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -54,16 +54,17 @@ if [[ "$1" ]]; then
usage
exit 1
fi
-fi
-
-[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
-
-if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
- image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
- image="/boot/initramfs-${KERNEL_VERSION}.img}"
+ [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
+
+ if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
+ image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
+ else
+ image="/boot/initramfs-${KERNEL_VERSION}.img}"
+ fi
fi
+
if ! [[ -f "$image" ]]; then
{
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
--
1.8.1.4

View File

@ -0,0 +1,25 @@
From bf7a572d8f978e16d92385ebf36e2f837fc2f3d1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 11 Mar 2013 15:46:37 +0100
Subject: [PATCH 4/5] lsinitrd.sh: removed trailing "}"
---
lsinitrd.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lsinitrd.sh b/lsinitrd.sh
index 4b8a7e2..5cd8c2a 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -60,7 +60,7 @@ else
if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
- image="/boot/initramfs-${KERNEL_VERSION}.img}"
+ image="/boot/initramfs-${KERNEL_VERSION}.img"
fi
fi
--
1.8.1.4

View File

@ -0,0 +1,409 @@
From 86152848ed452bf1a01d0bea25c47ea54884a4fd Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 11 Mar 2013 16:32:16 +0100
Subject: [PATCH 5/5] make host_fs_types a hashmap
This requires bash >= 4, but hash maps are so much more comfortable
---
dracut-functions.sh | 14 +++---------
dracut.sh | 23 +++++++++----------
modules.d/90btrfs/module-setup.sh | 6 ++---
modules.d/90crypt/module-setup.sh | 39 +++++++++++++++++++--------------
modules.d/90dmraid/module-setup.sh | 34 ++++++++++++++++------------
modules.d/90lvm/module-setup.sh | 36 +++++++++++++++++-------------
modules.d/90mdraid/module-setup.sh | 45 +++++++++++++++++++++-----------------
modules.d/95cifs/module-setup.sh | 2 +-
modules.d/95nfs/module-setup.sh | 6 ++---
modules.d/95virtfs/module-setup.sh | 4 ++--
10 files changed, 112 insertions(+), 97 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index a6a609c..52a1781 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -450,23 +450,15 @@ find_mp_fstype() {
find_root_block_device() { find_block_device /; }
# for_each_host_dev_fs <func>
-# Execute "<func> <dev> <filesystem>" for every "<dev>|<fs>" pair found
+# Execute "<func> <dev> <filesystem>" for every "<dev> <fs>" pair found
# in ${host_fs_types[@]}
for_each_host_dev_fs()
{
local _func="$1"
local _dev
- local _fs
local _ret=1
- for f in ${host_fs_types[@]}; do
- OLDIFS="$IFS"
- IFS="|"
- set -- $f
- IFS="$OLDIFS"
- _dev="$1"
- [[ -b "$_dev" ]] || continue
- _fs="$2"
- $_func $_dev $_fs && _ret=0
+ for _dev in "${!host_fs_types[@]}"; do
+ $_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0
done
return $_ret
}
diff --git a/dracut.sh b/dracut.sh
index 28ed4f1..15e66f3 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -744,11 +744,13 @@ trap 'exit 1;' SIGINT
# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"
+declare -A host_fs_types
+
for line in "${fstab_lines[@]}"; do
set -- $line
#dev mp fs fsopts
push host_devs "$1"
- push host_fs_types "$1|$3"
+ host_fs_types["$1"]="$3"
done
for f in $add_fstab; do
@@ -791,28 +793,27 @@ fi
_get_fs_type() (
[[ $1 ]] || return
if [[ -b $1 ]] && get_fs_env $1; then
- echo "$(readlink -f $1)|$ID_FS_TYPE"
+ echo "$(readlink -f $1) $ID_FS_TYPE"
return 1
fi
if [[ -b /dev/block/$1 ]] && get_fs_env /dev/block/$1; then
- echo "$(readlink -f /dev/block/$1)|$ID_FS_TYPE"
+ echo "$(readlink -f /dev/block/$1) $ID_FS_TYPE"
return 1
fi
if fstype=$(find_dev_fstype $1); then
- echo "$1|$fstype"
+ echo "$1 $fstype"
return 1
fi
return 1
)
for dev in "${host_devs[@]}"; do
- unset fs_type
- for fstype in $(_get_fs_type $dev) \
- $(check_block_and_slaves _get_fs_type $(get_maj_min $dev)); do
- if ! strstr " ${host_fs_types[*]} " " $fstype ";then
- push host_fs_types "$fstype"
- fi
- done
+ while read key val; do
+ host_fs_types["$key"]="$val"
+ done < <(
+ _get_fs_type $dev
+ check_block_and_slaves_all _get_fs_type $(get_maj_min $dev)
+ )
done
[[ -d $udevdir ]] \
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
index 0f79f5e..4a7c01d 100755
--- a/modules.d/90btrfs/module-setup.sh
+++ b/modules.d/90btrfs/module-setup.sh
@@ -9,12 +9,10 @@ check() {
type -P btrfs >/dev/null || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
- local _found
for fs in ${host_fs_types[@]}; do
- strstr "$fs" "\|btrfs" && _found="1"
+ [[ "$fs" == "btrfs" ]] && return 0
done
- [[ $_found ]] || return 1
- unset _found
+ return 255
}
return 0
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 2b4456b..b76f6ae 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -7,8 +7,30 @@ check() {
# if cryptsetup is not installed, then we cannot support encrypted devices.
type -P cryptsetup >/dev/null || return 1
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ for fs in "${host_fs_types[@]}"; do
+ [[ $fs = "crypto_LUKS" ]] && return 0
+ done
+ return 255
+ }
+
+ return 0
+}
+
+depends() {
+ echo dm rootfs-block
+ return 0
+}
+
+installkernel() {
+ instmods dm_crypt =crypto
+}
+
+install() {
+
check_crypt() {
local dev=$1 fs=$2
+
[[ $fs = "crypto_LUKS" ]] || return 1
ID_FS_UUID=$(udevadm info --query=property --name=$dev \
| while read line; do
@@ -24,23 +46,8 @@ check() {
return 0
}
- [[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves_all check_crypt || return 1
- }
-
- return 0
-}
-
-depends() {
- echo dm rootfs-block
- return 0
-}
-
-installkernel() {
- instmods dm_crypt =crypto
-}
+ for_each_host_dev_fs check_crypt
-install() {
dracut_install cryptsetup rmdir readlink umount
inst_script "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
inst_script "$moddir"/probe-keydev.sh /sbin/probe-keydev
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
index c315961..76daa4a 100755
--- a/modules.d/90dmraid/module-setup.sh
+++ b/modules.d/90dmraid/module-setup.sh
@@ -8,9 +8,27 @@ check() {
# in trying to support it in the initramfs.
type -P dmraid >/dev/null || return 1
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ for fs in "${host_fs_types[@]}"; do
+ [[ $fs = *_raid_member ]] && return 0
+ done
+ return 255
+ }
+
+ return 0
+}
+
+depends() {
+ echo dm rootfs-block
+ return 0
+}
+
+install() {
+ local _i
+
check_dmraid() {
local dev=$1 fs=$2 holder DEVPATH DM_NAME
- [[ "$fs" = "${fs%%_raid_member}" ]] && return 1
+ [[ "$fs" != *_raid_member ]] && return 1
DEVPATH=$(udevadm info --query=property --name=$dev \
| while read line; do
@@ -37,20 +55,8 @@ check() {
return 0
}
- [[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves_all check_dmraid || return 1
- }
+ for_each_host_dev_fs check_dmraid
- return 0
-}
-
-depends() {
- echo dm rootfs-block
- return 0
-}
-
-install() {
- local _i
dracut_install dmraid
dracut_install -o kpartx
inst $(command -v partx) /sbin/partx
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index e0e4043..22186f4 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -7,22 +7,11 @@ check() {
# No point trying to support lvm if the binaries are missing
type -P lvm >/dev/null || return 1
- check_lvm() {
- local DM_VG_NAME DM_LV_NAME DM_UDEV_DISABLE_DISK_RULES_FLAG
- eval $(udevadm info --query=property --name=/dev/block/$1|egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
- [[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
- [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
- if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
- if ! [[ $kernel_only ]]; then
- echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
- fi
- push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
- fi
- return 0
- }
-
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves_all check_lvm || return 1
+ for fs in "${host_fs_types[@]}"; do
+ [[ $fs = LVM*_member ]] && return 0
+ done
+ return 255
}
return 0
@@ -38,6 +27,23 @@ install() {
local _i
inst lvm
+ check_lvm() {
+ local DM_VG_NAME DM_LV_NAME DM_UDEV_DISABLE_DISK_RULES_FLAG
+
+ eval $(udevadm info --query=property --name=$1 | egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
+ [[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
+ [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
+ if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
+ if ! [[ $kernel_only ]]; then
+ echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
+ fi
+ push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
+ fi
+ return 0
+ }
+
+ for_each_host_dev_fs check_lvm
+
inst_rules "$moddir/64-lvm.rules"
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
index 0efffbb..70c27dd 100755
--- a/modules.d/90mdraid/module-setup.sh
+++ b/modules.d/90mdraid/module-setup.sh
@@ -7,27 +7,11 @@ check() {
# No mdadm? No mdraid support.
type -P mdadm >/dev/null || return 1
- check_mdraid() {
- local dev=$1 fs=$2 holder DEVPATH MD_UUID
- [[ "$fs" = "${fs%%_raid_member}" ]] && return 1
-
- MD_UUID=$(/sbin/mdadm --examine --export $dev \
- | while read line; do
- [[ ${line#MD_UUID} = $line ]] && continue
- eval "$line"
- echo $MD_UUID
- break
- done)
-
- [[ ${MD_UUID} ]] || return 1
- if ! [[ $kernel_only ]]; then
- echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
- fi
- return 0
- }
-
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for_each_host_dev_and_slaves_all check_mdraid || return 1
+ for fs in "${host_fs_types[@]}"; do
+ [[ "$fs" == *_raid_member ]] && return 0
+ done
+ return 255
}
return 0
@@ -48,6 +32,27 @@ install() {
inst $(command -v partx) /sbin/partx
inst $(command -v mdadm) /sbin/mdadm
+ check_mdraid() {
+ local dev=$1 fs=$2 holder DEVPATH MD_UUID
+ [[ "$fs" != *_raid_member ]] && return 1
+
+ MD_UUID=$(/sbin/mdadm --examine --export $dev \
+ | while read line; do
+ [[ ${line#MD_UUID} = $line ]] && continue
+ eval "$line"
+ echo $MD_UUID
+ break
+ done)
+
+ [[ ${MD_UUID} ]] || return 1
+ if ! [[ $kernel_only ]]; then
+ echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
+ fi
+ return 0
+ }
+
+ for_each_host_dev_fs check_mdraid
+
inst_rules 64-md-raid.rules
# remove incremental assembly from stock rules, so they don't shadow
# 65-md-inc*.rules and its fine-grained controls, or cause other problems
diff --git a/modules.d/95cifs/module-setup.sh b/modules.d/95cifs/module-setup.sh
index 1c7d0be..bf0eddf 100755
--- a/modules.d/95cifs/module-setup.sh
+++ b/modules.d/95cifs/module-setup.sh
@@ -8,7 +8,7 @@ check() {
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do
- strstr "$fs" "\|cifs" && return 0
+ [[ "$fs" == "cifs" ]] && return 0
done
return 255
}
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 38ee5d7..7c3a64d 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -9,9 +9,9 @@ check() {
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do
- strstr "$fs" "\|nfs" && return 0
- strstr "$fs" "\|nfs3" && return 0
- strstr "$fs" "\|nfs4" && return 0
+ [[ "$fs" == "nfs" ]] && return 0
+ [[ "$fs" == "nfs3" ]] && return 0
+ [[ "$fs" == "nfs4" ]] && return 0
done
return 255
}
diff --git a/modules.d/95virtfs/module-setup.sh b/modules.d/95virtfs/module-setup.sh
index 0b961a8..12bd354 100755
--- a/modules.d/95virtfs/module-setup.sh
+++ b/modules.d/95virtfs/module-setup.sh
@@ -5,9 +5,9 @@
check() {
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do
- strstr "$fs" "\|9p" && return 0
+ [[ "$fs" == "9p" ]] && return 0
done
- return 1
+ return 255
}
if type -P systemd-detect-virt >/dev/null 2>&1; then
--
1.8.1.4

View File

@ -54,11 +54,12 @@ index 0000000..d5e1342
+ +
+install() { +install() {
+ #Install dropbear incl. keys + #Install dropbear incl. keys
+ [ -r /etc/dropbear/dropbear_dss_host_key ] || /usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key + mkdir -p /etc/dropbear
+ [ -r /etc/dropbear/dropbear_rsa_host_key ] || /usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key + [ -r /etc/dropbear/dropbear_dss_host_key ] || /usr/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key > /dev/null
+ [ -r /etc/dropbear/dropbear_rsa_host_key ] || /usr/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key > /dev/null
+ +
+ inst /usr/sbin/dropbear "/usr/sbin/dropbear" + inst /usr/sbin/dropbear "/usr/sbin/dropbear"
+ inst /etc/dropbear/dropbear_dss_host_key "/etc/dropbear/dropbear_dss_host_key" + inst /etc/dropbear/dropbear_dss_host_key "/etc/dropbear/dropbear_dss_host_key"
+ inst /etc/dropbear/dropbear_rsa_host_key "/etc/dropbear/dropbear_rsa_host_key" + inst /etc/dropbear/dropbear_rsa_host_key "/etc/dropbear/dropbear_rsa_host_key"
+ [ -r /root/.ssh/authorized_keys ] && inst /root/.ssh/authorized_keys "/root/.ssh/authorized_keys" + [ -r /root/.ssh/authorized_keys ] && inst /root/.ssh/authorized_keys "/etc/dropbear/authorized_keys"
+} +}