From 45b00bfb32234704f043cdcb579ffe7ed2fc42d9 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:00:20 +0300 Subject: [PATCH] Update postinst --- debian/postinst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/postinst b/debian/postinst index 4b00476..4a0e154 100644 --- a/debian/postinst +++ b/debian/postinst @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e @@ -25,6 +25,16 @@ ln -sf /usr/lib/x86_64-linux-gnu/libdevmapper-event.so.1.02.1 /usr/lib/libdevmap touch /etc/vconsole.conf +# Use the first crypttab entry as luks for booster (valid for calamares and probably most installers) +if cat /etc/crypttab | grep -v '^#' | head -n1 | cut -f2 | grep -i "UUID=" +then + sed -i "s#root=#rd.luks.name="$(cat /etc/crypttab | grep -v '^#' | cut -f2 | sed "s#UUID=##")"="$(cat /etc/crypttab | grep -v '^#' | cut -f1)" root=#" /boot/refind_linux.conf +else + echo -e "ERROR 1: /etc/crypttab is invalid!\nFirst crypttab entry (presumed to be root luks) is not defined via UUID\nPlease make sure to define luks for root as the first entry in /etc/crypttab via UUID (use blkid)" + exit 1 +fi + + cp -f /usr/lib/booster/update-initramfs /usr/sbin/update-initramfs chmod +x /usr/sbin/update-initramfs update-initramfs -c -k all