summaryrefslogtreecommitdiff
path: root/dracut.sh
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-03-11 16:31:48 +0100
committerHarald Hoyer <harald@redhat.com>2013-03-11 18:58:32 +0100
commitdd5875499ece9dbc90e10eafd0073ee15d0c86a4 (patch)
tree070be9e5f091ac6bd9b02d122444da653321dd70 /dracut.sh
parentd351541ee625f8a1b42446448214f200f19c2631 (diff)
downloaddracut-dd5875499ece9dbc90e10eafd0073ee15d0c86a4.tar.gz
dracut-dd5875499ece9dbc90e10eafd0073ee15d0c86a4.tar.bz2
dracut-dd5875499ece9dbc90e10eafd0073ee15d0c86a4.zip
dracut.sh: add swap partitions to host-only setup
Diffstat (limited to 'dracut.sh')
-rwxr-xr-xdracut.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/dracut.sh b/dracut.sh
index 83067335..bb492992 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -794,6 +794,23 @@ if [[ $hostonly ]]; then
mountpoint "$mp" >/dev/null 2>&1 || continue
push host_devs $(readlink -f "/dev/block/$(find_block_device "$mp")")
done
+
+ while read dev type rest; do
+ [[ -b $dev ]] || continue
+ [[ "$type" == "partition" ]] || continue
+ while read _d _m _t _o _r; do
+ [[ "$_d" == \#* ]] && continue
+ [[ $_d ]] || continue
+ [[ $_t != "swap" ]] || [[ $_m != "swap" ]] && continue
+ [[ "$_o" == *noauto* ]] && continue
+ [[ "$_d" == UUID\=* ]] && _d="/dev/disk/by-uuid/${_d#UUID=}"
+ [[ "$_d" == LABEL\=* ]] && _d="/dev/disk/by-label/$_d#LABEL=}"
+ [[ "$_d" -ef "$dev" ]] || continue
+ push host_devs $(readlink -f $dev)
+ break
+ done < /etc/fstab
+ done < /proc/swaps
+
fi
_get_fs_type() (