mirror of
https://github.com/Antynea/grub-btrfs.git
synced 2026-03-04 21:15:02 +08:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fb9146e5b | ||
|
|
3f56de34ec | ||
|
|
788390cc93 | ||
|
|
97dcaeae58 | ||
|
|
8602220b98 | ||
|
|
7441e573f3 | ||
|
|
e06a8e1dd8 | ||
|
|
aeff81e861 | ||
|
|
876d1c5e98 | ||
|
|
4fb1f71b17 | ||
|
|
b80c04a751 | ||
|
|
11af1f69ba | ||
|
|
5ca00a1aa2 | ||
|
|
a1b876188c | ||
|
|
50f63a9bec | ||
|
|
a10f775b8d | ||
|
|
7ebfbe05f9 | ||
|
|
eeae1d3084 |
@@ -7,16 +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=("${GRUB_BTRFS_INTEL_UCODE[@]:-intel-ucode.img}")
|
||||
|
||||
|
||||
###########################
|
||||
@@ -97,13 +100,29 @@ for kernel in ${nkernel[@]}; do
|
||||
if [ $uuid = $buuid ]; then
|
||||
echo "\
|
||||
linux /$item/boot/$kernel root=UUID=$uuid rw rootflags=subvol=$item $params
|
||||
echo 'Loading initial ramdisk ...'
|
||||
echo 'Loading initial ramdisk ...'"
|
||||
# fr: on vérifie la présence du microcode intel
|
||||
# en: Check intel microcode exist
|
||||
if [ -f /boot/$intel_ucode ]; then
|
||||
echo "\
|
||||
initrd /$item/boot/$intel_ucode /$item/boot/$init"
|
||||
else
|
||||
echo "\
|
||||
initrd /$item/boot/$init"
|
||||
fi
|
||||
else
|
||||
echo "\
|
||||
linux /$kernel root=UUID=$uuid rw rootflags=subvol=$item $params
|
||||
echo 'Loading initial ramdisk ...'
|
||||
echo 'Loading initial ramdisk ...'"
|
||||
# fr: on vérifie la présence du microcode intel
|
||||
# en: Check intel microcode exist
|
||||
if [ -f /boot/$intel_ucode ]; then
|
||||
echo "\
|
||||
initrd /$intel_ucode /$init"
|
||||
else
|
||||
echo "\
|
||||
initrd /$init"
|
||||
fi
|
||||
fi
|
||||
echo "\
|
||||
}"
|
||||
|
||||
41
README.md
41
README.md
@@ -1,4 +1,41 @@
|
||||
grub-btrfs
|
||||
==========
|
||||
### grub-btrfs
|
||||
|
||||
|
||||
This is a version 0.xx of grub-btrfs
|
||||
|
||||
#### Description
|
||||
|
||||
grub-btrfs, add support for btrfs snapshots into grub menu
|
||||
|
||||
#### What does grub-btrfs v0.xx do :
|
||||
|
||||
Simple rollback using snapshots you made previous.
|
||||
|
||||
Makes a list of all snapshots, kernels, initramfs present on the filesystem and then creates a corresponding entered with name and date of snapshots in grub.cfg, which ensures a very easy rollback.
|
||||
|
||||
#### How to use it :
|
||||
|
||||
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" )
|
||||
|
||||
* prefixentry = add a name ahead your snapshots entries ( e.g: GRUB_BTRFS_PREFIXENTRY="Snapshot" )
|
||||
|
||||
* nkernel= name kernel you use it ( e.g: GRUB_BTRFS_NKERNEL=("vmlinuz-linux") )
|
||||
|
||||
* ninit= name initramfs (ramdisk) you use it ( e.g: GRUB_BTRFS_NINIT=("initramfs-linux.img" "initramfs-linux-fallback.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 )
|
||||
|
||||
grub-btrfs automatically generates snapshots entries.
|
||||
|
||||
You will see it appear different entries, e.g : Prefixentry name of snapshot [2013-02-11 04:00:00]
|
||||
|
||||
#### Warning
|
||||
|
||||
Version 0.xx detect kernels,initramfs,intel microcode only in boot partition, not in snapshot.
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user