Commit Graph

49 Commits

Author SHA1 Message Date
Pascal Jäger
04958d6e0b grub-btrfsd: Start subdaemon when --timeshift-auto
Fix #272

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-04-05 17:09:30 +02:00
Pascal Jäger
c6550d0d96 grub-btrfs: unquote snap variable
Fix #273

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-04-05 13:40:40 +02:00
Pascal Jäger
c7d4bbbe45 Makefile: don't delete temp dir after installation
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-03-26 21:50:48 +02:00
Pascal Jäger
09a2a55ee4 Makefile: make docs installation optional
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-03-26 21:39:51 +02:00
Pascal Jäger
8105a2edf7 grub-btrfsd: watch more than one snapshot dir
Fix #262

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-03-26 21:08:16 +02:00
Pascal Jäger
879bec3697 grub-btrfsd: watch snapshots directory recursively
Fix: #262

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-03-26 20:44:50 +02:00
Pascal Jäger
e2937f6bff grub-btrfs: update comments
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-03-26 19:46:23 +02:00
Pascal Jäger
ec5ff8b4bc grub-btrfs: get back the grub_btrfs_search_directory functionality
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-03-26 19:46:05 +02:00
Pascal Jäger
1556c345da grub-btrfs: Do root fs detection with btrfs progs
Fix: #266 #255

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2023-03-26 19:44:56 +02:00
Pascal J
1d33404c78 Merge branch 'master' into improve-config 2023-01-22 20:07:54 +01:00
Pascal Jäger
89ef805e81 grub-btrfsd: do no append with += to optional args
This does not work anymore, but it should be similar to the systemd
service file anyway, where things are just written in one line.

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-12-10 22:20:15 +01:00
Pascal Jäger
e03e87dd64 grub-btrfsd: Use bash as interpreter
Fix: #248

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-12-07 15:01:10 +01:00
Pascal Jäger
f131c38300 manpages: correct some minor things
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-12-06 23:10:24 +01:00
Pascal Jäger
934ab213b0 grub-btrfs: add custom kernel parameters option for snapshots
Fix #214, #160

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-12-06 22:56:44 +01:00
Pascal Jäger
f0ed56d242 grub-btrfs: Improve variable defaults
Fix #244

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-12-06 22:55:51 +01:00
Pascal Jäger
29ec43e9a6 grub-btrfsd: Fix non POSIX redirect
Squashed commit of the following:

commit d75feb59f4
Author: Pascal J <pascal.jaeger@leimstift.de>
Date:   Sun Dec 4 22:07:01 2022 +0100

    grub-btrsd: update shebang

commit a64379789c
Author: Pavin Joseph <pavinjosdev@gmail.com>
Date:   Sun Dec 4 22:52:31 2022 +0530

    Update grub-btrfsd

commit fe42568785
Author: Pavin Joseph <pavinjosdev@gmail.com>
Date:   Sun Dec 4 04:07:05 2022 +0530

    Update grub-btrfsd

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-12-04 22:11:00 +01:00
Pascal Jäger
bc167ffe00 Readme: added instructions for --timeshift-old
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-26 17:59:38 +01:00
Pascal Jäger
b661e4e03f Merge branch 'fix-snap-dir-check' 2022-11-26 17:46:45 +01:00
Pascal Jäger
f594a56232 Merge branch 'improve-version-generation' 2022-11-26 17:44:06 +01:00
Pascal Jäger
fe48642596 Merge branch 'make-prefix-configurable' 2022-11-26 17:38:15 +01:00
Pascal Jäger
bfad9dcc1d grub-btrfs: Add possibility to configure where grub-btrfs.cfg is created and searched for
Closes #187

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-26 15:14:00 +01:00
Pascal Jäger
e3d0792a74 Post release version bump
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-26 15:10:28 +01:00
Pascal Jäger
efc4657aab grub-btrfsd: fixed message about flag dependencies
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-26 15:06:44 +01:00
Pascal Jäger
9e34f53ef8 Readme: discribe new version generation
Fix #237

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-26 15:03:10 +01:00
Pascal Jäger
6f154329c7 grub-btrfsd: fix if...else in daemon
add description of feature in manpage
fix non sh compatible commands in daemon

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-26 10:06:19 +01:00
Pascal Jäger
1d760ad730 Post release version bump
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-23 16:11:45 +01:00
Pascal Jäger
02c3fbb23a Version 4.12
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-23 15:58:11 +01:00
Pascal Jäger
13b6df8e9a grub-btrfsd: Add flag for colorless output
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-23 15:57:52 +01:00
Pascal Jäger
2186d831cd Readme, Manpages: Improve structure
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-23 15:57:10 +01:00
Pascal Jäger
33810a9274 grub-btrfs: print version of the script with --version
Close #225

Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
2022-11-21 22:59:22 +01:00
Antynea
4f1aa38604 Make path of "grub-mkconfig_lib" configurable (#181)
* Make path of "grub-mkconfig_lib" configurable

  * 41_snapshots-btrfs file:
    - Remove "datarootdir" variable, is no longer used
    - Replace "$datarootdir/grub/grub-mkconfig_lib" with "${GRUB_BTRFS_MKCONFIG_LIB:-/usr/share/grub/grub-mkconfig_lib}"

  * Config file:
    - Adds new GRUB_BTRFS_MKCONFIG_LIB variable
Might be '/usr/share/grub2/grub-mkconfig_lib' on some systems (Opensuse ...)
2021-11-17 19:30:34 +01:00
Antynea
1accd5e272 Make name of "grub-script-check" configurable (#177)
41_snapshots-btrfs file:
  * Remove "grub_script_check" variable

Config file;
  * Make name of "grub-script-check" configurable
    * Might be 'grub2-script-check' on some systems (Fedora ...)
2021-11-07 14:35:17 +01:00
Antynea
9d436adf95 Reworks many things (#174)
#### Script:
* Snapper:
  - Now, the information is retrieved from the info.xml file.

* Timeshift:
  * Now, the information is retrieved from the info.json file.

* Probe informations from device:
  * Add the UUID of the root and boot subvolumes

* Show full path snapshot or only name:
  * Remove, this feature never worked correctly

* Grub-menu:
  * Now displays the following information in separate columns:
    - Date of snapshot
    - Path of snapshot
    - Type/Tags of snapshot if available (snapper/timeshift)
    - Description/Comments of snapshot if available (snapper/timeshift)
  * Possibility to display only the desired information(s) (see config file)
  *  Adds a header for the column title
  * GRUB_BTRFS_PREFIXENTRY is remove

  * Boot partition detection:
    * grub-btrfs is now able to detect if the boot folder/partition is a subvolume
    * GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION should no longer be needed for this case

  * Variables:
    * Rename some variables

  * Header:
    * Update the header to reflect the changes.

#### Config:
* GRUB_BTRFS_PREFIXENTRY:
  * Remove, no longer use

* GRUB_BTRFS_DISPLAY_PATH_SNAPSHOT:
  * Remove, no longer use

* GRUB_BTRFS_TITLE_FORMAT:
  * Shows/Hides "date" "snapshot" "type" "description" in the Grub menu, custom order available.
    Default: ("date" "snapshot" "type" "description")

* GRUB_BTRFS_IGNORE_SNAPPER_TYPE:
  * Rename to GRUB_BTRFS_IGNORE_SNAPSHOT_TYPE
    - Supports both timeshift and snapper tags/type

* GRUB_BTRFS_IGNORE_SNAPPER_DESCRIPTION:
  * Rename to GRUB_BTRFS_IGNORE_SNAPSHOT_DESCRIPTION
    - Supports both snapper and timeshift description/comments

* GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION:
  * grub-btrfs is now able to detect if the boot folder/partition is a subvolume.
  Activating this parameter should no longer be necessary for this case.

* GRUB_BTRFS_SNAPPER_CONFIG:
  * Remove, no longer use

#### Readme:
* Update "What does grub-btrfs v4.xx do" section
  * Adds support for timeshift
2021-10-25 15:47:26 +02:00
Antynea
981777d745 Add filter snapper's snapshot (#158)
- Add filter to ignore snapper's snapshot "type or description" during run "grub-mkconfig"

- Two new variables available in the config file:
# Ignore specific type of snapper's snapshot during run "grub-mkconfig".
# Type = single, pre or post.
# Default: ("")
GRUB_BTRFS_IGNORE_SNAPPER_TYPE=("")

# Ignore specific description of snapper's snapshot during run "grub-mkconfig".
# Default: ("")
GRUB_BTRFS_IGNORE_SNAPPER_DESCRIPTION=("")
2021-07-14 12:48:20 +02:00
Kriss
d68fdf5fff Adds a new config variable "GRUB_BTRFS_ROOTFLAGS" (#133)
Script:

Improves the rootflags option in the kernel command line:
- Remove "rw" flag.
- Parse fstab mountoptions and add them to rootflags:
Adds functionality to read in  snapshot specific mount flags
from the respective fstab and uses them in combination with the new 
config option, while the latter is prioritized.
Both places can, but don't need to define mount flags. If either of them
doesn't, it will simply not be taken into account.

Config file:

Adds a new config variable "GRUB_BTRFS_ROOTFLAGS":
- The new variable is used to include user-defined rootflags in the 
kernel command line of generated snapshot bootmenu entries.
See config file for more infos.
2021-01-11 13:37:40 +01:00
Antynea
a437b80a35 improves systemd service (#131)
grub-btrfs.service: remove unnecessary path for bash and grub-mkconfig command

readme.md: add warning section to systemd service section

config file: Improves the description of the variable GRUB_BTRFS_MKCONFIG
2021-01-03 14:50:34 +01:00
Antynea
d4b97415b0 Fix #116 (#118)
* Fix #116 (#118)
  * Renames variable GRUB_BTRFS_DIRNAME to GRUB_BTRFS_GRUB_DIRNAME and improves its description

  * Adds variable GRUB_BTRFS_BOOT_DIRNAME, used to detect the boot partition and the location of kernels/initrafms/microcodes
2020-10-21 19:14:05 +02:00
Antynea
3c5e741641 Modify "grub btrfs dirname" variable. (#113)
* Modify "GRUB_BTRFS_DIRNAME"
  * Full path to Grub folder is now configurable (/boot is no longer hard coded).
  * Detection of the boot partition is now based on the location of the Grub folder.
  * Warning [see](https://github.com/Antynea/grub-btrfs/pull/113#issuecomment-705916729)
2020-10-09 15:50:02 +02:00
Antynea
0fe512776a Modify the function which is used to ignore a path. (#112)
Modify the function which is used to ignore a path.
@ shouldn't be hardcoded.
Create 2 separate functions to ignore a specific path or prefix path.
In specific path, only exact paths are ignored.
In prefix path, any path starting with the specified string will be ignored.
e.g :
if specific path = @, only @ snapshot will be ignored.
if prefix path = @, all snapshots beginning with "@/..." will be ignored.
2020-10-06 23:19:41 +02:00
Antynea
6af193c47a Add new path to ignore docker subvolume
Many distributions now use "@" as the default subvolume.
Add the following path "@/var/lib/docker" to ignore the docker subvolume.
Fix: #110
2020-10-03 12:51:51 +02:00
Antynea
c9b605153b Redesign readme (#109)
* Add more information

Add more information.
Due to the redesign of the "Customization" section of the readme file.

* Redesign  customization section

Move information of customization section to config file
2020-09-29 13:39:20 +02:00
Antynea
2349282df5 Improved sorting of the subvolumes list (#107)
* Improved sorting of the subvolumes list

Add functionality to sort subvolume list by: rootid,gen,ogen,path
Default: "-rootid" means list snapshot by new ones first
See [Sorting section](https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-subvolume#SUBCOMMAND)
2020-09-16 19:16:18 +02:00
Antynea
041a9c6606 Microcode variable updated (#106)
* Microcode variable updated

* Modifying variable to reflect improved microcode detection

* Update config

Change "GRUB_BTRFS_INTEL_UCODE" to new variable "GRUB_BTRFS_CUSTOM_MICROCODE"

* Update README.md

Change "GRUB_BTRFS_INTEL_UCODE" to new variable "GRUB_BTRFS_CUSTOM_MICROCODE"
2020-09-16 18:25:11 +02:00
Antynea
44ee10f5ef Attempt to fix ignore specific path (#102)
* Attempt to fix ignore specific path

Attempt to fix ignore specific path #100

* Update config
2020-09-05 12:24:46 +02:00
Antynea
6bfdf07bbf Add password protection support for the submenu (#97)
* Add password protection support for the submenu

Grub2 supports superuser and user access using passwords. #95

-Ability to add authorized users.
-Possibility to disable password protection for the submenu.

* Update config

* Update README.md
2020-08-29 18:55:39 +02:00
Antynea
7f76eec16d Update Name appearing in the Grub menu
Name appearing in the Grub menu :
Use distribution information from /etc/os-release by default
2020-08-28 04:22:13 +02:00
Maxim Baz
9b863f027b Ignore @ by default as it is never a snapshot, fix #96, fix #90 2020-07-28 19:27:47 +02:00
Antynea
6cd13037ce Fix #74 (#77)
Improving the readme and config files.
2019-12-08 18:02:05 +01:00
Maxim Baz
e1532c0515 Add Makefile (#60) 2018-12-07 22:09:34 +01:00