From adc4fd66874bfdf7396f08c62518ac24fd68057b Mon Sep 17 00:00:00 2001 From: Antynea Date: Thu, 6 Aug 2015 04:35:46 +0200 Subject: [PATCH] improve layout for entries in grub --- 41_snapshots-btrfs | 49 ++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/41_snapshots-btrfs b/41_snapshots-btrfs index db1824b..c6bb6c4 100644 --- a/41_snapshots-btrfs +++ b/41_snapshots-btrfs @@ -29,8 +29,7 @@ # # # Script in progress # # to do : # -# # -# * auto-detect initramfs, custom Initramfs # +# # # # * detect partition boot separate # # # ######################################################################################################################################################### @@ -99,32 +98,30 @@ snapshots_entry() for k in "${name_kernel[@]}"; do for i in "${name_initramfs[@]}"; do echo "\ - menuentry '${2} with "${k}" & ${i}' ${CLASS} "\$menuentry_id_option" 'gnulinux-snapshots-$boot_uuid'{ - $(save_default_entry) - if [ x\$feature_all_video_module = xy ]; then - insmod all_video - fi - set gfxpayload=keep - insmod ${boot_fs} - if [ x\$feature_platform_search_hint = xy ]; then - search --no-floppy --fs-uuid --set=root ${hs_boot} ${boot_uuid} - else - search --no-floppy --fs-uuid --set=root ${boot_uuid} - fi - echo 'Loading Snapshot: ${snap_dir_name}' - echo 'Loading Kernel: "${k}" ...' - linux \"/${snap_dir_name}/boot/"${k}"\" root=UUID=${root_uuid} rw rootflags=subvol=${snap_dir_name} ${kernel_parameters} - echo 'Loading Initramfs: "${i}" ...'" + menuentry '${2} with "${k}" & "${i}"' ${CLASS} "\$menuentry_id_option" 'gnulinux-snapshots-$boot_uuid'{ + $(save_default_entry) + if [ x\$feature_all_video_module = xy ]; then + insmod all_video + fi + set gfxpayload=keep + insmod ${boot_fs} + if [ x\$feature_platform_search_hint = xy ]; then + search --no-floppy --fs-uuid --set=root ${hs_boot} ${boot_uuid} + else + search --no-floppy --fs-uuid --set=root ${boot_uuid} + fi + echo 'Loading Snapshot: ${snap_dir_name}' + echo 'Loading Kernel: "${k}" ...' + linux \"/${snap_dir_name}/boot/"${k}"\" root=UUID=${root_uuid} rw rootflags=subvol=${snap_dir_name} ${kernel_parameters} + echo 'Loading Initramfs: "${i}" ...'" if [ -f "/${snap_dir_name}/boot/${microcode}" ] ; then - echo "\ - initrd \"/${snap_dir_name}/boot/${microcode}\" initrd \"/${snap_dir_name}/boot/${i}\" - " + echo "\ + initrd \"/${snap_dir_name}/boot/${microcode}\" initrd \"/${snap_dir_name}/boot/${i}\"" else - echo "\ - initrd \"/${snap_dir_name}/boot/${i}\" - " + echo "\ + initrd \"/${snap_dir_name}/boot/${i}\"" fi - echo " }" + echo " }" done done echo " }" @@ -215,4 +212,4 @@ if [ ${choise_of_method} = "1" ] ; then list_kernels_initramfs ; gettext_printf "###### - Grub-btrfs: Auto-detect - ######\n" >&2 ; fi -### End choice of method ### +### End choice of method ### \ No newline at end of file