summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-11-17 15:15:37 +0100
committerSimon Rettberg2016-11-17 15:15:37 +0100
commitaf56c27c20a0195a24bad1280a47448f4e88abab (patch)
treeb9ed7c00aeec2c3530a938d32f6f9bcb1e04b75d
parent[rfs-stage32] Support GPT for ID44 (diff)
downloadtm-scripts-af56c27c20a0195a24bad1280a47448f4e88abab.tar.gz
tm-scripts-af56c27c20a0195a24bad1280a47448f4e88abab.tar.xz
tm-scripts-af56c27c20a0195a24bad1280a47448f4e88abab.zip
[rfs-stage32] Support swap on GPT aswell
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions11
1 files changed, 7 insertions, 4 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
index c3813af9..6a353b8f 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions
@@ -118,16 +118,19 @@ get_all_with_id () {
# Check for standard swap partitions and make them available to the system
HAVE_SWAP=no
-for PART_DEV in $(get_all_with_id 82); do
- echo -e "$PART_DEV\tswap\t\tswap\t\tdefaults\t 0 0" >> "/etc/fstab"
- swapon "$PART_DEV" -p 10 && HAVE_SWAP=yes # low priority, in case we have zram swap, prefer that)
+for PART_DEV in $(get_all_with_id 82) '/dev/disk/by-partlabel/Linux\x20swap'; do
+ [ -e "$PART_DEV" ] || continue # Since Linux\x20swap is hard-coded and might not exist
+ if swapon "$PART_DEV" -p 10; then
+ HAVE_SWAP=yes # low priority, in case we have zram swap, prefer that)
+ echo -e "$PART_DEV\tswap\t\tswap\t\tdefaults\t 0 0" >> "/etc/fstab"
+ fi
done
# We use special non assigned partition type (id44) for harddisk scratch
# space, thus no normal filesystem will be incidentally deleted or
# corrupted
HAVE_TEMP=no
-for PART_DEV in $(get_all_with_id 44) "/dev/disk/by-partlabel/OpenSLX-ID44"; do
+for PART_DEV in $(get_all_with_id 44) '/dev/disk/by-partlabel/OpenSLX-ID44'; do
[ -e "$PART_DEV" ] || continue # Since OpenSLX-ID44 is hard-coded and might not exist
# check for supported filesystem and formatter
if format_disk "$PART_DEV"; then