From a773054924b88be86d0618a4eba812e759c03f2f Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Fri, 30 Sep 2016 15:50:47 +0100 Subject: [PATCH] Revert "Allow btrfs /boot partition. This is supported by grub2 and lilo." This reverts commit 841f8b754c5576f941c82bb59c78a6229059f05f. --- check.d/_numbers | 1 + check.d/no_btrfs_boot | 32 ++++++++++++++++++++++++++++++++ debian/partman-btrfs.templates | 18 ++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100755 check.d/no_btrfs_boot diff --git a/check.d/_numbers b/check.d/_numbers index c45e2be..710d9fa 100644 --- a/check.d/_numbers +++ b/check.d/_numbers @@ -1 +1,2 @@ 09 nomountpoint_btrfs +05 no_btrfs_boot diff --git a/check.d/no_btrfs_boot b/check.d/no_btrfs_boot new file mode 100755 index 0000000..ef9c180 --- /dev/null +++ b/check.d/no_btrfs_boot @@ -0,0 +1,32 @@ +#!/bin/sh +# grub and other bootloaders that read the filesystem do not support /boot +# on btrfs. (lilo should work). Detect and warn. + +. /lib/partman/lib/base.sh + +get_btrfs_root_boot () { + (for i in /lib/partman/fstab.d/*; do + [ -x "$i" ] || continue + $i + done) | + while read fs mp type options dump pass; do + if [ "$mp" = / ]; then + echo root_type=$type + elif [ "$mp" = /boot ]; then + echo boot_type=$type + fi + done +} +eval "$(get_btrfs_root_boot)" + +if [ "$boot_type" = btrfs ]; then + db_input critical partman-btrfs/btrfs_boot || true + db_go || exit 1 + exit 1 +fi + +if [ "$boot_type" = "" ] && [ "$root_type" = btrfs ]; then + db_input critical partman-btrfs/btrfs_root || true + db_go || exit 1 + exit 1 +fi diff --git a/debian/partman-btrfs.templates b/debian/partman-btrfs.templates index 6f1227d..ce178ad 100644 --- a/debian/partman-btrfs.templates +++ b/debian/partman-btrfs.templates @@ -15,3 +15,21 @@ Type: text # :sl1: # Short file system name (untranslatable in many languages) _Description: btrfs + +Template: partman-btrfs/btrfs_root +Type: error +# :sl2: +_Description: btrfs root file system not supported without separate /boot + Your root file system is a btrfs file system. This is not supported + by the boot loader used by default by this installer. + . + You should use a small /boot partition with another file system, such as ext3. + +Template: partman-btrfs/btrfs_boot +Type: error +# :sl2: +_Description: btrfs file system not supported for /boot + You have mounted a btrfs file system as /boot. This is not supported + by the boot loader used by default by this installer. + . + You should use another file system, such as ext3, for the /boot partition.