From d1d77a3e4867d547ee4b9a0793d9c374e06990bc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Jul 2024 12:22:02 +0200 Subject: [PATCH] ubusquash --- live/menu/static.sh | 3 +++ live/source/boot.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/live/menu/static.sh b/live/menu/static.sh index c008b4d..dc1cd5f 100644 --- a/live/menu/static.sh +++ b/live/menu/static.sh @@ -9,5 +9,8 @@ menu_split menuentry 'bash / latest / tui' --id 'lt' { debsquash '/w/boot/bash/latest/tui' } menuentry 'bash / latest / gui' --id 'lg' { debsquash '/w/boot/bash/latest/gui' } menu_split +menuentry 'ubuntu / stable' { ubusquash '/w/boot/ubuntu/stable' } +menuentry 'ubuntu / latest' { ubusquash '/w/boot/ubuntu/latest' } +menu_split menuentry 'alma / stable' { almsquash '/w/boot/alma/stable' } menuentry 'alma / latest' { almsquash '/w/boot/alma/latest' } diff --git a/live/source/boot.sh b/live/source/boot.sh index db1e8cf..f2b8faa 100644 --- a/live/source/boot.sh +++ b/live/source/boot.sh @@ -84,3 +84,45 @@ live-media-uuid="${data_uuid}" \ echo "${initrd_path}" initrd "${initrd_path}" } +function ubusquash { + lmp="${1}" + sfs="filesystem.squashfs" + # + if [ "${check_squashfs}" == 'enforce' ] ; then + chk="(${data})${lmp}/${sfs}" + echo 'verify_detached' + echo "${chk}" + if ! verify_detached "${chk}" "${chk}.sig" ; then + grub_pause + return 1 + fi + fi + if [ -f "(${data})${lmp}/vmlinuz" ] ; then + linux_path="(${data})${lmp}/vmlinuz" + initrd_path="(${data})${lmp}/initrd.img" + else + linux_path="(squash)/vmlinuz" + initrd_path="(squash)/initrd.img" + loopback "squash" "${lmp}/${sfs}" + fi + # + echo + echo 'linux' + echo "${linux_path}" + toram='toram' + if [ "${live_from}" == 'ram' ] ; then + toram="${toram}=${sfs}" + fi + linux \ +"${linux_path}" \ +boot="live" \ +elevator="deadline" \ +live-media-path="${lmp}" \ +live-media-uuid="${data_uuid}" \ +"${toram}" + # + echo + echo 'initrd' + echo "${initrd_path}" + initrd "${initrd_path}" +}