-
Notifications
You must be signed in to change notification settings - Fork 4
/
grub.Makefile
51 lines (39 loc) · 1.41 KB
/
grub.Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
BUILDDIR = $(realpath ./grub/build)
MOUNTDIR = $(BUILDDIR)/mnt
# Fedora grub prefix
GRUB_PREFIX = $(MOUNTDIR)/EFI/fedora
#GRUB_PREFIX = $(MOUNTDIR)/boot/grub2
HOST_EFI = /boot/efi
PKG_INSTALL = dnf -y install
KVERSION = $(shell find /lib/modules -mindepth 1 -maxdepth 1 -printf "%f" -quit)
BEE_VERSION ?= 1.17.2
ifeq ($(shell findmnt $(MOUNTDIR)),)
$(error No mount found at $(MOUNTDIR), run 'sudo grub/mount-image.sh' first!)
endif
dracutbasedir = $(realpath ./dracut)
all: install-grub $(GRUB_PREFIX)/grub.cfg $(MOUNTDIR)/boot/vmlinuz $(MOUNTDIR)/boot/swarm-initrd
install-grub:
@echo $(KVERSION)
$(PKG_INSTALL) grub2-efi-x64 shim-x64
cp -r $(HOST_EFI)/* $(MOUNTDIR)
$(GRUB_PREFIX)/grub.cfg: swarm.hash
mkdir -p $(GRUB_PREFIX)
grub/grub-mkconfig > $@
$(MOUNTDIR)/boot/vmlinuz:
mkdir -p $(MOUNTDIR)/boot
cp /lib/modules/$(KVERSION)/vmlinuz $@
$(MOUNTDIR)/boot/swarm-initrd: /usr/bin/bee dracut/dracut-util
mkdir -p $(MOUNTDIR)/boot
$(dracutbasedir)/dracut.sh -l \
-a "bzz network-legacy" \
-o iscsi \
--no-hostonly --no-hostonly-cmdline \
-f $@ $(KVERSION)
dracut/dracut-util: /usr/bin/gcc
sh -c "cd dracut && ./configure"
make enable_documentation=no -C dracut
install-bee: /usr/bin/bee
/usr/bin/bee: bee-$(BEE_VERSION).x86_64.rpm
-rpm -i bee-$(BEE_VERSION).x86_64.rpm
bee-$(BEE_VERSION).x86_64.rpm:
wget -nc https://github.com/ethersphere/bee/releases/download/v$(BEE_VERSION)/bee-$(BEE_VERSION).x86_64.rpm