Blame 0013-dracut.sh-add-swap-partitions-to-host-only-setup.patch
|
Harald Hoyer |
52ce14 |
From dd5875499ece9dbc90e10eafd0073ee15d0c86a4 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
52ce14 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
52ce14 |
Date: Mon, 11 Mar 2013 16:31:48 +0100
|
|
Harald Hoyer |
52ce14 |
Subject: [PATCH] dracut.sh: add swap partitions to host-only setup
|
|
Harald Hoyer |
52ce14 |
|
|
Harald Hoyer |
52ce14 |
---
|
|
Harald Hoyer |
52ce14 |
dracut.sh | 17 +++++++++++++++++
|
|
Harald Hoyer |
52ce14 |
1 file changed, 17 insertions(+)
|
|
Harald Hoyer |
52ce14 |
|
|
Harald Hoyer |
52ce14 |
diff --git a/dracut.sh b/dracut.sh
|
|
Harald Hoyer |
52ce14 |
index 8306733..bb49299 100755
|
|
Harald Hoyer |
52ce14 |
--- a/dracut.sh
|
|
Harald Hoyer |
52ce14 |
+++ b/dracut.sh
|
|
Harald Hoyer |
52ce14 |
@@ -794,6 +794,23 @@ if [[ $hostonly ]]; then
|
|
Harald Hoyer |
52ce14 |
mountpoint "$mp" >/dev/null 2>&1 || continue
|
|
Harald Hoyer |
52ce14 |
push host_devs $(readlink -f "/dev/block/$(find_block_device "$mp")")
|
|
Harald Hoyer |
52ce14 |
done
|
|
Harald Hoyer |
52ce14 |
+
|
|
Harald Hoyer |
52ce14 |
+ while read dev type rest; do
|
|
Harald Hoyer |
52ce14 |
+ [[ -b $dev ]] || continue
|
|
Harald Hoyer |
52ce14 |
+ [[ "$type" == "partition" ]] || continue
|
|
Harald Hoyer |
52ce14 |
+ while read _d _m _t _o _r; do
|
|
Harald Hoyer |
52ce14 |
+ [[ "$_d" == \#* ]] && continue
|
|
Harald Hoyer |
52ce14 |
+ [[ $_d ]] || continue
|
|
Harald Hoyer |
52ce14 |
+ [[ $_t != "swap" ]] || [[ $_m != "swap" ]] && continue
|
|
Harald Hoyer |
52ce14 |
+ [[ "$_o" == *noauto* ]] && continue
|
|
Harald Hoyer |
52ce14 |
+ [[ "$_d" == UUID\=* ]] && _d="/dev/disk/by-uuid/${_d#UUID=}"
|
|
Harald Hoyer |
52ce14 |
+ [[ "$_d" == LABEL\=* ]] && _d="/dev/disk/by-label/$_d#LABEL=}"
|
|
Harald Hoyer |
52ce14 |
+ [[ "$_d" -ef "$dev" ]] || continue
|
|
Harald Hoyer |
52ce14 |
+ push host_devs $(readlink -f $dev)
|
|
Harald Hoyer |
52ce14 |
+ break
|
|
Harald Hoyer |
52ce14 |
+ done < /etc/fstab
|
|
Harald Hoyer |
52ce14 |
+ done < /proc/swaps
|
|
Harald Hoyer |
52ce14 |
+
|
|
Harald Hoyer |
52ce14 |
fi
|
|
Harald Hoyer |
52ce14 |
|
|
Harald Hoyer |
52ce14 |
_get_fs_type() (
|