From e6422b1d826efac988347e9a526470c2bda5fe35 Mon Sep 17 00:00:00 2001 From: user Date: Mon, 7 Aug 2023 08:28:05 +0200 Subject: [PATCH] optimize grub snapshot generation --- configs/grub.d/40_snapshots | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configs/grub.d/40_snapshots b/configs/grub.d/40_snapshots index 285e141..7510fb8 100755 --- a/configs/grub.d/40_snapshots +++ b/configs/grub.d/40_snapshots @@ -10,13 +10,14 @@ if [ -f "/etc/grub-snapshot" ]; then echo "submenu 'Snapshot options for SpectreOS' \$menuentry_id_option 'gnulinux-snapshot-$boot_device_id' {" is_top_level=false snapshotanzahl="$(expr $(wc -l /etc/grub-snapshot | awk '{print $1}') + 1)" + grub_output=$(/etc/grub.d/10_linux) while (( "$(expr $snapshotanzahl - 1)" )); do snapshotanzahl=`expr ${snapshotanzahl} - 1` SNAPSHOTNAME="$(cat /etc/grub-snapshot | sed ''$snapshotanzahl'!d')" SNAPSHOT="rootflags=subvol=${SNAPSHOTNAME}" export GRUB_CMDLINE_LINUX="${SNAPSHOT} ${GRUB_CMDLINE_LINUX#* }" - /etc/grub.d/10_linux | python /usr/bin/extract-menuentry.py "Snapshot ${SNAPSHOT#*@}" + echo "$grub_output" | python /usr/bin/extract-menuentry.py "Snapshot ${SNAPSHOT#*@}" done echo '}' fi