Skip to content

Commit

Permalink
Add Makefile (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz authored Dec 7, 2018
1 parent 73a2bd3 commit e1532c0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
13 changes: 6 additions & 7 deletions 41_snapshots-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# - Automatically detect snapper and use snapper's snapshot description if available.
#
# How to customize it:
# - Refer 41_snapshots-btrfs_config for the list of available options and their default values.
# - Place your configurations to either /etc/grub.d/41_snapshots-btrfs_config or /etc/default/grub.
# - Refer to config for the list of available options and their default values.
# - Place your configurations to /etc/default/grub-btrfs/config.
#
# - Generate grub.cfg (on Arch Linux use grub-mkconfig -o /boot/$grub_directory/grub.cfg)
#
Expand All @@ -43,15 +43,14 @@ prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
sysconfdir="/etc"
grub_btrfs_config="${sysconfdir}/grub.d/41_snapshots-btrfs_config"
grub_btrfs_config="${sysconfdir}/default/grub-btrfs/config"

. "${sysconfdir}/default/grub"
[[ -f "$grub_btrfs_config" ]] && . "$grub_btrfs_config"
. "$datarootdir/grub/grub-mkconfig_lib"

######################################
### Variables in /etc/default/grub ###
######################################
###################################################
### Variables in /etc/default/grub-btrfs/config ###
###################################################
## Disable Grub-btrfs (default=active)
grub_btrfs_disable=${GRUB_BTRFS_DISABLE:-"false"}
[[ "${grub_btrfs_disable}" == "true" ]] && exit 0
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PKGNAME ?= grub-btrfs
PREFIX ?= /usr

SHARE_DIR = $(DESTDIR)$(PREFIX)/share
LIB_DIR = $(DESTDIR)$(PREFIX)/lib

.PHONY: install

install:
@install -Dm755 -t "$(DESTDIR)/etc/grub.d/" 41_snapshots-btrfs
@install -Dm644 -t "$(DESTDIR)/etc/default/grub-btrfs/" config
@install -Dm644 -t "$(LIB_DIR)/systemd/system/" grub-btrfs.service
@install -Dm644 -t "$(LIB_DIR)/systemd/system/" grub-btrfs.path
@install -Dm644 -t "$(SHARE_DIR)/licenses/$(PKGNAME)/" LICENSE
File renamed without changes.

0 comments on commit e1532c0

Please sign in to comment.