]> Git Repo - buildroot-mgba.git/blob - package/petitboot/petitboot.mk
package/petitboot: add libxcrypt optional dependency
[buildroot-mgba.git] / package / petitboot / petitboot.mk
1 ################################################################################
2 #
3 # petitboot
4 #
5 ################################################################################
6
7 PETITBOOT_VERSION = 1.15
8 PETITBOOT_SOURCE = petitboot-v$(PETITBOOT_VERSION).tar.gz
9 PETITBOOT_SITE = https://github.com/open-power/petitboot/releases/download/v$(PETITBOOT_VERSION)
10 PETITBOOT_DEPENDENCIES = \
11         elfutils \
12         ncurses \
13         udev \
14         host-bison \
15         host-flex \
16         lvm2 \
17         $(if $(BR2_PACKAGE_LIBXCRYPT),libxcrypt) \
18         $(TARGET_NLS_DEPENDENCIES)
19 PETITBOOT_LICENSE = GPL-2.0
20 PETITBOOT_LICENSE_FILES = COPYING
21
22 PETITBOOT_CONF_ENV = LDFLAGS="$(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)"
23 PETITBOOT_CONF_OPTS = \
24         --enable-crypt \
25         --enable-platform-auto \
26         --disable-mtd \
27         --with-ncurses \
28         --without-signed-boot \
29         --without-twin-fbdev \
30         --without-twin-x11 \
31         $(if $(BR2_PACKAGE_BUSYBOX),--enable-busybox,--disable-busybox) \
32         HOST_PROG_KEXEC=/usr/sbin/kexec \
33         HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot
34
35 # HPA and Busybox tftp are supported. HPA tftp is part of Buildroot's tftpd
36 # package.
37 ifeq ($(BR2_PACKAGE_TFTPD),y)
38 PETITBOOT_CONF_OPTS += --with-tftp=hpa
39 else ifeq ($(BR2_PACKAGE_BUSYBOX),y)
40 PETITBOOT_CONF_OPTS += --with-tftp=busybox
41 else
42 # This actually means "autodetect", there's no way to really disable.
43 PETITBOOT_CONF_OPTS += --without-tftp
44 endif
45
46 ifeq ($(BR2_PACKAGE_DTC),y)
47 PETITBOOT_DEPENDENCIES += dtc
48 PETITBOOT_CONF_OPTS += --with-fdt
49 define PETITBOOT_POST_INSTALL_DTB
50         $(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-dtb-updates \
51                 $(TARGET_DIR)/etc/petitboot/boot.d/30-dtb-updates
52 endef
53 PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL_DTB
54 else
55 PETITBOOT_CONF_OPTS += --without-fdt
56 endif
57
58 PETITBOOT_GETTY_PORT = $(patsubst %,'%',$(call qstrip,$(BR2_PACKAGE_PETITBOOT_GETTY_PORT)))
59
60 define PETITBOOT_POST_INSTALL
61         $(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \
62                 $(TARGET_DIR)/usr/libexec/petitboot/bb-kexec-reboot
63         $(INSTALL) -D -m 0755 $(@D)/utils/hooks/01-create-default-dtb \
64                 $(TARGET_DIR)/etc/petitboot/boot.d/01-create-default-dtb
65         $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \
66                 $(TARGET_DIR)/etc/petitboot/boot.d/90-sort-dtb
67         $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/S15pb-discover \
68                 $(TARGET_DIR)/etc/init.d/S15pb-discover
69         $(INSTALL) -D -m 0755 $(PETITBOOT_PKGDIR)/pb-console \
70                 $(TARGET_DIR)/etc/init.d/pb-console
71
72         mkdir -p $(TARGET_DIR)/etc/udev/rules.d
73         for port in $(PETITBOOT_GETTY_PORT); do \
74                 printf 'SUBSYSTEM=="tty", KERNEL=="%s", RUN+="/etc/init.d/pb-console start $$name"\n' "$$port"; \
75         done > $(TARGET_DIR)/etc/udev/rules.d/petitboot-console-ui.rules
76
77         mkdir -p $(TARGET_DIR)/usr/share/udhcpc/default.script.d/
78         ln -sf /usr/sbin/pb-udhcpc \
79                 $(TARGET_DIR)/usr/share/udhcpc/default.script.d/
80 endef
81
82 PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL
83
84 $(eval $(autotools-package))
This page took 0.032685 seconds and 4 git commands to generate.