Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Artox/4f996e7b0e0c51f98e4beb18c76440c5 to your computer and use it in GitHub Desktop.
Save Artox/4f996e7b0e0c51f98e4beb18c76440c5 to your computer and use it in GitHub Desktop.
FreeBSD crochet: hack for reserved partitions
From f8abae90b2ad76d070ad59d8c1399e126dd45078 Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua.mayer97@gmail.com>
Date: Sun, 13 May 2018 15:43:25 +0000
Subject: [PATCH 1/2] HACK: Do not try to mount a reserved partition
Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
---
lib/board.sh | 2 ++
lib/disk.sh | 3 +++
2 files changed, 5 insertions(+)
diff --git a/lib/board.sh b/lib/board.sh
index ec6861c..c5aa30f 100644
--- a/lib/board.sh
+++ b/lib/board.sh
@@ -251,6 +251,8 @@ board_mountpoint ( ) {
MOUNTPOINT_PREFIX=${BOARD_BOOT_MOUNTPOINT_PREFIX}
elif board_is_freebsd_partition ${ABSINDEX}; then
MOUNTPOINT_PREFIX=${BOARD_FREEBSD_MOUNTPOINT_PREFIX}
+ elif [ $TYPE == "RESERVED" ]; then
+ MOUNTPOINT_PREFIX=/dev/null
else
MOUNTPOINT_PREFIX=`eval echo \\$BOARD_${TYPE}_MOUNTPOINT_PREFIX`
fi
diff --git a/lib/disk.sh b/lib/disk.sh
index 6bd9bbd..ff815f8 100644
--- a/lib/disk.sh
+++ b/lib/disk.sh
@@ -460,6 +460,9 @@ disk_mount ( ) {
UFS)
disk_ufs_mount ${MOUNTPOINT} ${RELINDEX}
;;
+ RESERVED)
+ # just don't do anything
+ ;;
*)
echo "Attempt to mount ${TYPE} partition ${RELINDEX} at ${MOUNTPOINT} failed."
echo "Do not know how to mount partitions of type ${TYPE}."
--
2.16.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment