175 Commits
Author SHA1 Message Date
Maxim Baz 3eb7eb7861 Support snapper 0.7.0 (#57)
Snapper changed the order of columns, ID now comes before type.
2018-10-24 00:29:06 +02:00
Nathan Parsons 35703e71c1 Make 'grub-mkconfig' command name configurable (#56)
* Make 'grub-mkconfig' command name configurable

- Use 'grub-mkconfig' as the default
- Note that some systems use 'grub2-mkconfig'
- Update 10-update_grub.conf to use the configurable grub directory name
- Refactor the systemd commands for clarity and to avoid duplicate regeneration on first run

* Update check_uuid_required() to work for partial regeneration of the GRUB menu
2018-08-15 14:02:13 +02:00
Antynea a1a48d26b7 Override boot partition detection (#55)
* Override boot partition detection

refer to #54

* Add new option

# GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION="false"  
# Change to "true" if you have a boot partition in a different subvolume

* Corrects indentation

* Update readme
GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION="false"
(Change to "true" if you have a boot partition in a different subvolume)
2018-07-09 18:55:09 +02:00
Crafter6432 13a7186aaf Add systemd.path as option to monitor for new Snapshots (#53)
* Use systemd.path to regenerate grub-btrfs.cfg

* Added option GRUB_BTRFS_DIRNAME

* Updated README
2018-06-30 14:46:30 +02:00
Antynea 9b73e0ac62 Check uuid requirement. (#52)
* detect uuid requirement

add new function to detect uuid requirement

* Reduce generation time

New function doesn't need to be called at each generation of a menu entry
2018-06-11 15:52:00 +02:00
Maxim Baz b17e7bd6a1 Add a dedicated config file (#49) 2018-04-20 18:08:37 +02:00
Antynea b8325cf134 Fix: some functions doesn't work as expected (#48)
* Fix: Title format in grub-menu

function: 
- title_format , doesn't work as expected

replace print message with default parameter (p/d/n)

* Update header

- Add Github link
- Clear up some explanations

* Fix: path to grub-mkconfig_lib

. "$pkgdatadir/grub-mkconfig_lib" doesn't work on some distribution
Replaced by . "$datarootdir/grub/grub-mkconfig_lib"

* Fix: matches kernel & initramfs

matches kernel & initramfs doesn't work as expected
2018-04-19 15:45:59 +02:00
Antynea 8508cac7d8 GRUB shouldn't break anymore (#46)
* Update 41_snapshots-btrfs

Enhanced error handling :
	- new function available: print_error
	- if btrfs-progs is not present, print a error and exit

New options in etc/default/grub 
	- disable this script
		
Enhanced menuentries:
	- menuentries is now store in new grub configfile (/boot/grub/grub.cfg)
	- use new functions for make a menuentry: make_menu_entries and entry
	- harmonize menuentry with matching version kernel&initramfs # initramfs-linux-fallback is include and not boot with intel-ucode if exist , same as original patch in GRUB for Arch Linux
	- make a menuentry in Grub menu (grub.cfg) to load our configfile

Enhanced /boot detection:
	- create two separate function for make menuentries, if /boot is on a separate partition, use function boot_separate, else, boot_bounded
	- if no kernel found, print a message and exit
	- if no initramfs found, print a message and exit

Delete function: boot_dir
No longer uses gettext_printf function of grub-mkconfig_lib

New function to detect kernel:
	- add all original standard kernel
	- verifying if kernel exist before to continue

New functionto  detect initramfs:
	- add all original standard initramfs
	- verifying if initramfs exist before to continue
	
New function to detect microcode

New counter:
	- add a counter to show a warning if the total menuentries made exceeds 250 entries

Purge some obsolete code

Size tabulation is now 4
2018-04-16 21:43:47 +02:00
Maxim Baz a5a96fad08 Set default value of GRUB_BTRFS_CREATE_ONLY_HARMONIZED_ENTRIES to true 2018-04-06 16:28:36 +02:00
Maxim Baz 66a06be198 Set default value of GRUB_BTRFS_LIMIT to 50 2018-04-06 16:28:36 +02:00
Maxim Baz c44eda0913 Skip ignored snapshots during generating entries, not after 2018-04-06 16:28:36 +02:00
Maxim Baz 773a8bfb76 Support selecting snapper's config, default to 'root' (#41) 2018-04-01 21:38:22 +02:00
Antynea 1b40cfee20 Update 41_snapshots-btrfs
Update 41_snapshots-btrfs
2018-02-03 22:59:03 +01:00
Antynea 358dedc392 Update 41_snapshots-btrfs
Update 41_snapshots-btrfs
2018-02-03 22:57:04 +01:00
Antynea 0e826391f1 Update 41_snapshots-btrfs 2018-01-26 09:19:33 +01:00
Antynea 5cfbf46c8c fix Snapper id too long #36
* fix Snapper id too long #36
2018-01-07 00:31:16 +01:00
Maxim Baz 49c64425eb Use snapper's snapshot description if available, fixes #34 (#35)
* Use snapper's snapshot description if available, fixes #34

* List snapper's snapshot from all configs

* fix: Title format in grub-menu, that didn't work as expected
2018-01-03 21:15:26 +01:00
Antynea cb4040cd24 fix issue #27
and add "Display name of microcode in menuentry when available"
2016-11-25 01:09:34 +01:00
Pierre-Alain TORET bfa42253e0 Fix typo 2016-11-18 14:23:23 +01:00
Pierre-Alain TORET 13f263ca0c Update the top-level subvolid from 0 to 5.
According to https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Subvolumes, the toplevel subvolume is 5 not 0, so I guess that's what should be used here.
Also fixed a few typos.
2016-11-18 12:10:59 +01:00
anyc 9fcdab5277 create only entries where kernel and initramfs have the same version number 2016-05-03 16:15:20 +02:00
anyc 87932d900d use safe temporary directory 2016-05-03 11:19:33 +02:00
Antynea f0c50d1d76 Fix : GRUB_BTRFS_LIMIT (Limit the number of snapshots populated in the GRUB menu.)
Fix : When a value =< 0, script stop correctly
fix : When a value => 1, script stop when the value is reached

e.g :
 - GRUB_BTRFS_LIMIT="0"
   script doesn't detect snapshot

 - GRUB_BTRFS_LIMIT"1" or "2" "etc..."
   script will stop the snapshot detection when value is reached
2016-04-22 15:29:38 +02:00
Antynea 7720cec5f9 Enhanced
- clean code
- add a option to : specific path to ignore during run grub-mkconfig
e.g :
# Found Snapshot: 2016-03-31 10:26:52 var/lib/docker/btrfs/subvolumes/74040aee4fa

docker is not a real snapshot available to boot
add : GRUB_BTRFS_IGNORE_SPECIFIC_PATH=("var/lib/docker") to your /etc/default/grub
and this path will be skip during run grub-mkconfig

Warning : copy exactly the right path (var/lib/docker , not /var/lib/docker/), do not put the full path
2016-04-19 02:18:24 +02:00
Antynea b4bd7b952c clean code 2016-04-18 17:58:57 +02:00
Antynea d469db0a2d - fix bug issue #18 :
if no snap found, menu generate correctly, and show a warning
- overhaul
- add two new custom variable to /etc/default/grub :
* GRUB_BTRFS_SHOW_TOTAL_SNAPSHOTS_FOUND="true"
(Show Total of snapshots found during run "grub-mkconfig")

* GRUB_BTRFS_SHOW_SNAPSHOTS_FOUND="true"
(Show snapshots found during run "grub-mkconfig")
2016-04-18 17:31:33 +02:00
James Barnett f820de4759 add sorting options 2016-03-19 08:19:10 -05:00
James Barnett 59164367e7 cleanup 2016-03-19 08:11:47 -05:00
James Barnett f256338074 Add GRUB_BTRFS_LIMIT
Allow user to limit the number of snapshots listed in GRUB. This also reverses
the order of the snapshots such that the more recent ones come first. That is,
if a user specifies GRUB_BTRFS_LIMIT=10, then only the 10 most recent snapshots
will be shown. The default limit is 100, which seems very large. The more
snapshots in the GRUB menu, the longer the system takes to boot.
2016-03-18 16:46:11 -05:00
Antynea 28e9524ca5 fix: incorrect detection "$boot_dir_real_path" for initramfs 2016-02-08 00:01:42 +01:00
Antynea a4db6a8870 enhanced description 2016-01-15 18:29:52 +01:00
Antynea 3db73de479 fixme : choise of method 2015-09-25 10:24:20 +02:00
Antynea 39b2d09015 Add Show full path or only name of snapshots in grub-menu 2015-09-24 08:49:59 +02:00
Antynea 9d3aa6d8a3 Update :
translation update

New option in /etc/default/grub

* GRUB_BTRFS_TITLE_FORMAT="p/d/n"
   (Custom title, shows/hides p"prefix" d"date" n"name" in grub-menu, separator "/", custom order available)
2015-09-23 02:14:46 +02:00
Antynea 25e2c16828 in progress
custom title menu
2015-09-19 04:48:45 +02:00
Antynea 14cbf60c5a in progress :
custom title menu
2015-09-19 04:31:17 +02:00
Antynea 2cf01a874f in progress
add custom title
2015-09-18 14:52:17 +02:00
Antynea 93b8ac07f5 new ideas 2015-09-11 22:46:26 +02:00
Antynea 297f539f0a fixme: boot with microcode 2015-08-31 04:55:34 +02:00
Antynea f0fb4b8e25 redundancy parameter 2015-08-31 04:20:33 +02:00
Antynea 3ebc5b494a Update description
Add few comments
2015-08-30 16:14:59 +02:00
Antynea 2e58a2b74d enhanced detect microcode 2015-08-30 03:39:15 +02:00
Antynea d598529001 fixme : detect kernesl and initramfs with spaces
fixme : detect kernel and initramfs with spaces
2015-08-30 02:23:18 +02:00
Antynea b925f639cd fixme : detect snapshot name with spaces
fixme : detect snapshot name with spaces
2015-08-30 01:19:25 +02:00
Antynea 31a0baa2b1 redundancy test
redundancy test
2015-08-30 00:15:15 +02:00
Antynea 3a7c6abece fixme : detect microcode
fixme : detect microcode
2015-08-29 23:45:32 +02:00
Antynea 5e0951d8cb Fixme : broken $boot_dir_real_path
Fixme : broken $boot_dir_real_path
2015-08-29 23:17:03 +02:00
Antynea 05fea226f9 don't create menu if snapshot is not bootable with /boot partition separate 2015-08-17 23:49:49 +02:00
Antynea 2b33b88bea don't create menu if snapshot is not bootable with /boot partition separate 2015-08-11 02:57:09 +02:00
Antynea 2773382eb5 error if /grub is in /boot/EFI 2015-08-09 17:42:56 +02:00