From 788390cc932ed7ee57bd4bf2960caf9a29225ac3 Mon Sep 17 00:00:00 2001 From: penetal Date: Fri, 15 May 2015 11:17:46 +0200 Subject: [PATCH 1/2] Pull config from /etc/default/grub Added parameter substitution so variables can be changed in /etc/default/grub. This will let the script stay untouched, for easier updating. --- 41_snapshots-btrfs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/41_snapshots-btrfs b/41_snapshots-btrfs index 9d16057..077be8a 100644 --- a/41_snapshots-btrfs +++ b/41_snapshots-btrfs @@ -7,19 +7,19 @@ set -e ### variables modifiable ### ## fr: nom du sous-menu ## en: Name of the submenu -submenuname="ArchLinux Snapshots" +submenuname=${GRUB_BTRFS_SUBMENUNAME:-"ArchLinux Snapshots"} ## fr: préfixe de l'entrée ## en: Prefix entry -prefixentry="Snapshot" +prefixentry=${GRUB_BTRFS_PREFIXENTRY:-"Snapshot"} ## fr: nom(s) du ou des kernel(s) ## en: Name(s) of the kernel(s) -nkernel=("vmlinuz-linux") +nkernel=("${GRUB_BTRFS_NKERNEL[@]:-vmlinuz-linux}") ## fr: nom(s) de(s) l'init ## en: Name(s) of the init(s) -ninit=("initramfs-linux.img" "initramfs-linux-fallback.img") +ninit=("${GRUB_BTRFS_NINIT[@]:-initramfs-linux.img initramfs-linux-fallback.img}") ## fr: nom du microcode intel ## en: Name intel-ucode -intel_ucode=("intel-ucode.img") +intel_ucode=("${GRUB_BTRFS_INTEL_UCODE[@]:-intel-ucode.img}") ########################### From 9fb9146e5b189b917d8cadbcb8aaaba30516fdd3 Mon Sep 17 00:00:00 2001 From: Antynea Date: Fri, 15 May 2015 22:12:26 +0200 Subject: [PATCH 2/2] Update README.md reflects change --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 14fbac7..699361a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is a version 0.xx of grub-btrfs -#### Desciption +#### Description grub-btrfs, add support for btrfs snapshots into grub menu @@ -15,17 +15,17 @@ Makes a list of all snapshots, kernels, initramfs present on the filesystem and #### How to use it : -1. Edit 41_snapshots-btrfs file : +1. Add lines to /etc/default/grub as needed, defaults listed as examples: +2. + * submenuname = name menu appear in grub ( e.g: GRUB_BTRFS_SUBMENUNAME="ArchLinux Snapshots" ) - * submenuname = name menu appear in grub ( e.g: submenuname="ArchLinux Snapshots" ) + * prefixentry = add a name ahead your snapshots entries ( e.g: GRUB_BTRFS_PREFIXENTRY="Snapshot" ) - * prefixentry = add a name ahead your snapshots entries ( e.g: prefixentry="Snapshot" ) + * nkernel= name kernel you use it ( e.g: GRUB_BTRFS_NKERNEL=("vmlinuz-linux") ) - * nkernel= name kernel you use it ( e.g: nkernel=("vmlinuz-linux") ) + * ninit= name initramfs (ramdisk) you use it ( e.g: GRUB_BTRFS_NINIT=("initramfs-linux.img" "initramfs-linux-fallback.img") ) - * ninit= name initramfs (ramdisk) you use it ( e.g: ninit=("initramfs-linux.img" "initramfs-linux-fallback.img") ) - - * intel_ucode= name intel microcode you use it ( e.g: intel_ucode=("intel-ucode.img") ) + * intel_ucode= name intel microcode you use it ( e.g: GRUB_BTRFS_INTEL_UCODE=("intel-ucode.img") ) 2. Generate grub.cfg (on Archlinux is grub-mkconfig -o /boot/grub/grub.cfg ) @@ -39,4 +39,3 @@ Version 0.xx detect kernels,initramfs,intel microcode only in boot partition, no If kernels,initramfs,intel microcode, are present in boot partition but not in snapshot, entry will be created but not fonctional, you don't boot it. Version 1.xx will do it, release soon. -