From 47b40316c032234025344cbfd1593e4d21e5167d Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Mon, 12 Jul 2021 17:55:02 +0900 Subject: [PATCH 1/3] btrfs support Fail to install the ubuntu when the / volume is btrfs #24 --- script/lib/common.sh | 3 ++- script/ubuntu-kaiten-yaki.sh | 9 +++++++++ script/void-kaiten-yaki.sh | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 8fcb0ea..3f9285f 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -291,8 +291,9 @@ function para_install_msg() { function post_install() { ## Mount the target file system # ${TARGETMOUNTPOINT} is created by the GUI/TUI installer + # ${BTRFSOPTION} is defined by the caller of this function for BTRFS formated volume. echo "...Mounting /dev/mapper/${VGNAME}-${LVROOTNAME} on ${TARGETMOUNTPOINT}." - mount /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" "${TARGETMOUNTPOINT}" + mount "${BTRFSOPTION}" /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" "${TARGETMOUNTPOINT}" # And mount other directories echo "...Mounting all other dirs." diff --git a/script/ubuntu-kaiten-yaki.sh b/script/ubuntu-kaiten-yaki.sh index 96ace9b..adfbbdd 100644 --- a/script/ubuntu-kaiten-yaki.sh +++ b/script/ubuntu-kaiten-yaki.sh @@ -53,6 +53,15 @@ function main() { # Post-install stage # ******************************************************************************* + # If the target volume is formated by btrfs, Ubiquity install the root into the + # @ sub-volume. Thus, mount command inside post_install have to use special option + # to specify @ as mount target. + if lsblk -o NAME,FSTYPE | grep -i "${VGNAME}-${LVROOTNAME}" | grep -i "btrfs" > /dev/null ; then + export BTRFSOPTION="-o subvol=@" + else + export BTRFSOPTION="" + fi + # Distribution dependent finalizing. Embedd encryption key into the ramfs image. # The script is parameterized by env-variable to fit to the distribution post_install diff --git a/script/void-kaiten-yaki.sh b/script/void-kaiten-yaki.sh index 5838747..c63f906 100644 --- a/script/void-kaiten-yaki.sh +++ b/script/void-kaiten-yaki.sh @@ -74,6 +74,9 @@ function main() { # Post-install stage # ******************************************************************************* + # We don't need special option for BTRFSOPTION. + export BTRFSOPTION="" + # Distribution dependent finalizing. Embedd encryption key into the ramfs image. # The script is parameterized by env-variable to fit to the distribution post_install From 3c7691db07f623319a47c71ee7e7e4ecf873911a Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:03:36 +0900 Subject: [PATCH 2/3] Fix the blank option problem. --- script/lib/common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 3f9285f..ed5be7d 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -291,9 +291,11 @@ function para_install_msg() { function post_install() { ## Mount the target file system # ${TARGETMOUNTPOINT} is created by the GUI/TUI installer - # ${BTRFSOPTION} is defined by the caller of this function for BTRFS formated volume. + # ${BTRFSOPTION} is defined by the caller of this function for BTRFS formated volume. + # ${BTRFSOPTION} have to be NOT quoted. Otherwise, mount will receive an empty + # string as first option, when the veraible is empty. echo "...Mounting /dev/mapper/${VGNAME}-${LVROOTNAME} on ${TARGETMOUNTPOINT}." - mount "${BTRFSOPTION}" /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" "${TARGETMOUNTPOINT}" + mount ${BTRFSOPTION} /dev/mapper/"${VGNAME}"-"${LVROOTNAME}" "${TARGETMOUNTPOINT}" # And mount other directories echo "...Mounting all other dirs." From ea1a1ae7fd8f58cae297f94cd18ef84ebfb8ae2b Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Mon, 12 Jul 2021 23:12:17 +0900 Subject: [PATCH 3/3] Test OK Fail to install the ubuntu when the / volume is btrfs #24 Tested on Ubuntu and Void Linux. Btrfs and ext4. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e4e18d..e0a9874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ Record of the modification in project development. ### Deprecated ### Removed ### Fixed +- [Issue 24 : Fail to install the ubuntu when the / volume is btrfs](https://github.com/suikan4github/kaiten-yaki/issues/24) + ### Known Issue ## [1.1.0] - 2021-07-11