mirror of
https://github.com/Antynea/grub-btrfs.git
synced 2026-03-04 13:05:00 +08:00
Makefile: add an if statement for RHEL distribs based
This commit is contained in:
committed by
Pascal J
parent
1d53472569
commit
2032502e09
38
Makefile
38
Makefile
@@ -12,7 +12,8 @@ MAN_DIR = $(SHARE_DIR)/man
|
||||
|
||||
TEMP_DIR = ./temp
|
||||
|
||||
BOOT_DIR = /boot/grub
|
||||
BOOT_DIR_DEBIAN = /boot/grub
|
||||
BOOT_DIR_FEDORA = /boot/grub2
|
||||
|
||||
.PHONY: install uninstall clean help
|
||||
|
||||
@@ -65,10 +66,14 @@ install:
|
||||
@install -Dm644 -t "$(SHARE_DIR)/doc/$(PKGNAME)/" README.md
|
||||
@install -Dm644 "initramfs/readme.md" "$(SHARE_DIR)/doc/$(PKGNAME)/initramfs-overlayfs.md"
|
||||
@rm -rf "${TEMP_DIR}"
|
||||
@if command -v grub-mkconfig > /dev/null; then \
|
||||
@if command -v grub-mkconfig > /dev/null && [ -e "$(BOOT_DIR_DEBIAN)/grub.cfg" ]; then \
|
||||
echo "Updating the GRUB menu..."; \
|
||||
grub-mkconfig -o "$(BOOT_DIR)/grub.cfg"; \
|
||||
grub-mkconfig -o "$(BOOT_DIR_DEBIAN)/grub.cfg"; \
|
||||
fi
|
||||
@if command -v grub2-mkconfig > /dev/null && [ -e "$(BOOT_DIR_FEDORA)/grub.cfg" ]; then \
|
||||
echo "Updating the GRUB menu..."; \
|
||||
grub2-mkconfig -o "$(BOOT_DIR_FEDORA)/grub.cfg"; \
|
||||
fi
|
||||
|
||||
uninstall:
|
||||
@echo "Uninstalling grub-btrfs"
|
||||
@@ -100,10 +105,14 @@ uninstall:
|
||||
@rmdir --ignore-fail-on-non-empty "$(SHARE_DIR)/doc/$(PKGNAME)/" || :
|
||||
@rmdir --ignore-fail-on-non-empty "$(SHARE_DIR)/licenses/$(PKGNAME)/" || :
|
||||
@rmdir --ignore-fail-on-non-empty "$(DESTDIR)/etc/default/grub-btrfs" || :
|
||||
@if command -v grub-mkconfig > /dev/null; then \
|
||||
@if command -v grub-mkconfig > /dev/null && [ -e "$(BOOT_DIR_DEBIAN)/grub.cfg" ]; then \
|
||||
echo "Updating the GRUB menu..."; \
|
||||
grub-mkconfig -o "$(BOOT_DIR)/grub.cfg"; \
|
||||
grub-mkconfig -o "$(BOOT_DIR_DEBIAN)/grub.cfg"; \
|
||||
fi
|
||||
@if command -v grub2-mkconfig > /dev/null && [ -e "$(BOOT_DIR_FEDORA)/grub.cfg" ]; then \
|
||||
echo "Updating the GRUB menu..."; \
|
||||
grub2-mkconfig -o "$(BOOT_DIR_FEDORA)/grub.cfg"; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
@echo "Deleting ./temp"
|
||||
@@ -120,13 +129,14 @@ help:
|
||||
@echo
|
||||
@echo " parameter | type | description | defaults"
|
||||
@echo " ----------+------+--------------------------------+----------------------------"
|
||||
@echo " DESTDIR | path | install destination | <unset>"
|
||||
@echo " PREFIX | path | system tree prefix | '/usr'"
|
||||
@echo " BOOT_DIR | path | boot data location | '/boot/grub'"
|
||||
@echo " SHARE_DIR | path | shared data location | '\$$(DESTDIR)\$$(PREFIX)/share'"
|
||||
@echo " LIB_DIR | path | system libraries location | '\$$(DESTDIR)\$$(PREFIX)/lib'"
|
||||
@echo " PKGNAME | name | name of the ditributed package | 'grub-btrfs'"
|
||||
@echo " INITCPIO | bool | include mkinitcpio hook | false"
|
||||
@echo " SYSTEMD | bool | include unit files | true"
|
||||
@echo " OPENRC | bool | include OpenRc daemon | false"
|
||||
@echo " DESTDIR | path | install destination | <unset>"
|
||||
@echo " PREFIX | path | system tree prefix | '/usr'"
|
||||
@echo " BOOT_DIR_DEBIAN | path | boot data location (Debian, Ubuntu, Gentoo, Arch...) | '/boot/grub'"
|
||||
@echo " BOOT_DIR_FEDORA | path | boot data location (Fedora, RHEL, CentOS, Rocky...) | '/boot/grub2'"
|
||||
@echo " SHARE_DIR | path | shared data location | '\$$(DESTDIR)\$$(PREFIX)/share'"
|
||||
@echo " LIB_DIR | path | system libraries location | '\$$(DESTDIR)\$$(PREFIX)/lib'"
|
||||
@echo " PKGNAME | name | name of the ditributed package | 'grub-btrfs'"
|
||||
@echo " INITCPIO | bool | include mkinitcpio hook | false"
|
||||
@echo " SYSTEMD | bool | include unit files | true"
|
||||
@echo " OPENRC | bool | include OpenRc daemon | false"
|
||||
@echo
|
||||
|
||||
Reference in New Issue
Block a user