Skip to content

Commit

Permalink
Update 41_snapshots-btrfs
Browse files Browse the repository at this point in the history
Update 41_snapshots-btrfs
  • Loading branch information
Antynea authored Feb 3, 2018
1 parent 55dc182 commit 358dedc
Showing 1 changed file with 57 additions and 54 deletions.
111 changes: 57 additions & 54 deletions 41_snapshots-btrfs
Original file line number Diff line number Diff line change
@@ -1,60 +1,63 @@
#! /usr/bin/env bash
#
#
#################################################################################################################################################
# Written by: Antynea #
# BTC donation address: 1Lbvz244WA8xbpHek9W2Y12cakM6rDe5Rt #
# #
# Purpose: Include btrfs snapshots at boot options (grub-menu). #
# #
# What this script does: #
# - Automatically List snapshots existing on root partition (btrfs). #
# - Automatically Detect if "/boot" is in separate partition. #
# - Automatically Detect kernel, initramfs and intel microcode in "/boot" directory on snapshots. (For custon name, see below.) #
# - Automatically Create corresponding "menuentry" in grub.cfg , which ensures a very easy rollback. #
# #
# How to use it: #
# - Add this lines to /etc/default/grub: #
# #
# * GRUB_BTRFS_SUBMENUNAME="Arch Linux snapshots" #
# (Name appearing in the Grub menu.) #
# * GRUB_BTRFS_PREFIXENTRY="Snapshot:" #
# (Add a name ahead your snapshots entries in the Grub menu.) #
# * GRUB_BTRFS_DISPLAY_PATH_SNAPSHOT="true" #
# (Show full path snapshot or only name in the Grub menu) #
# * GRUB_BTRFS_TITLE_FORMAT="p/d/n" #
# (Custom title, shows/hides p"prefix" d"date" n"name" in the Grub menu, separator "/", custom order available) #
# * GRUB_BTRFS_LIMIT="100" #
# (Limit the number of snapshots populated in the GRUB menu.) #
# * GRUB_BTRFS_SUBVOLUME_SORT="descending" #
# (Sort the found subvolumes by newest first ("descending") or oldest first ("ascending"). #
# If "ascending" is chosen then the $GRUB_BTRFS_LIMIT oldest subvolumes will populate the menu.) #
# * GRUB_BTRFS_SHOW_SNAPSHOTS_FOUND="true" #
# (Show snapshots found during run "grub-mkconfig") #
# * GRUB_BTRFS_SHOW_TOTAL_SNAPSHOTS_FOUND="true" #
# (Show Total of snapshots found during run "grub-mkconfig") #
# * GRUB_BTRFS_NKERNEL=("vmlinuz-linux") #
# (Use only if you have custom kernel name or auto-detect failed.) #
# * GRUB_BTRFS_NINIT=("initramfs-linux.img" "initramfs-linux-fallback.img") #
# (Use only if you have custom initramfs name or auto-detect failed.) #
# * GRUB_BTRFS_INTEL_UCODE=("intel-ucode.img") #
# (Use only if you have custom intel-ucode or auto-detect failed.) #
# * GRUB_BTRFS_IGNORE_SPECIFIC_PATH=("var/lib/docker" "nosnapshot") #
# (Ignore specific path during run "grub-mkconfig") #
# * GRUB_BTRFS_CREATE_ONLY_HARMONIZED_ENTRIES="false" #
# (Create entries with matching version number instead of all possible combinations of kernel and initramfs) #
# #
# - Generate grub.cfg (on Arch Linux use grub-mkconfig -o /boot/grub/grub.cfg) #
# #
# - grub-btrfs automatically generates snapshots entries. #
# - You will see it appear different entries (e.g : Snapshot: [2014-02-12 11:24:37] my snapshot name overkill) #
# #
# #
# To do: #
# #
# * Snapper support .... #
# #
#################################################################################################################################################
#########################################################################################################################################################################
# Written by: Antynea #
# BTC donation address: 1Lbvz244WA8xbpHek9W2Y12cakM6rDe5Rt #
# #
# Purpose: Include btrfs snapshots at boot options (grub-menu). #
# #
# What this script does: #
# Simple rollback using snapshots you made previously. #
# - Automatically List snapshots existing on root partition (btrfs). #
# - Automatically Detect if "/boot" is in separate partition. #
# - Automatically Detect kernel, initramfs and intel microcode in "/boot" directory on snapshots. (For custon name, see below.) #
# - Automatically Create corresponding "menuentry" in grub.cfg , which ensures a very easy rollback. #
# - Automatically detect snapper and use snapper's snapshot description if available. #
# #
# How to use it: #
# - Add this lines to /etc/default/grub: #
# #
# * GRUB_BTRFS_SUBMENUNAME="Arch Linux snapshots" #
# (Name appearing in the Grub menu.) #
# * GRUB_BTRFS_PREFIXENTRY="Snapshot:" #
# (Add a name ahead your snapshots entries in the Grub menu.) #
# * GRUB_BTRFS_DISPLAY_PATH_SNAPSHOT="true" #
# (Show full path snapshot or only name in the Grub menu) #
# * GRUB_BTRFS_TITLE_FORMAT="p/d/n" #
# (Custom title, shows/hides p"prefix" d"date" n"name" in the Grub menu, separator "/", custom order available) #
# * GRUB_BTRFS_LIMIT="100" #
# (Limit the number of snapshots populated in the GRUB menu.) #
# * GRUB_BTRFS_SUBVOLUME_SORT="descending" #
# (Sort the found subvolumes by newest first ("descending") or oldest first ("ascending"). #
# If "ascending" is chosen then the $GRUB_BTRFS_LIMIT oldest subvolumes will populate the menu.) #
# * GRUB_BTRFS_SHOW_SNAPSHOTS_FOUND="true" #
# (Show snapshots found during run "grub-mkconfig") #
# * GRUB_BTRFS_SHOW_TOTAL_SNAPSHOTS_FOUND="true" #
# (Show Total of snapshots found during run "grub-mkconfig") #
# * GRUB_BTRFS_NKERNEL=("vmlinuz-linux") #
# (Use only if you have custom kernel name or auto-detect failed.) #
# * GRUB_BTRFS_NINIT=("initramfs-linux.img" "initramfs-linux-fallback.img") #
# (Use only if you have custom initramfs name or auto-detect failed.) #
# * GRUB_BTRFS_INTEL_UCODE=("intel-ucode.img") #
# (Use only if you have custom intel-ucode or auto-detect failed.) #
# * GRUB_BTRFS_IGNORE_SPECIFIC_PATH=("var/lib/docker" "nosnapshot") #
# (Ignore specific path during run "grub-mkconfig") #
# * GRUB_BTRFS_CREATE_ONLY_HARMONIZED_ENTRIES="false" #
# (Create entries with matching version number instead of all possible combinations of kernel and initramfs) #
# #
# - Generate grub.cfg (on Arch Linux use grub-mkconfig -o /boot/grub/grub.cfg) #
# #
# - grub-btrfs automatically generates snapshots entries. #
# - You will see it appear different entries (e.g : Snapshot: [2014-02-12 11:24:37] my snapshot name overkill) #
# #
# Automatically update grub #
# If you would like grub to automatically update when Snapper timeline snapshots and cleanups occur, simply install 10-update_grub.conf in the following locations: #
# - /etc/systemd/system/snapper-timeline.service.d/ #
# - /etc/systemd/system/snapper-cleanup.service.d/ #
# Once the configuration files are in place, systemctl daemon-reload should be run to reload the units and make the changes active. # #
# #
#########################################################################################################################################################################

set -e

Expand Down

0 comments on commit 358dedc

Please sign in to comment.