blob: 2952cb6b49f48bf6741d3d39ce600a0d2dd71064 [file] [log] [blame]
Stewart Smithb2bcc832015-08-20 13:38:33 +10001################################################################################
2#
3# petitboot
4#
5################################################################################
6
Samuel Mendoza-Jonasc0e5f3a2016-08-23 13:17:59 +10007PETITBOOT_VERSION = v1.2.3
Alastair D'Silva00e2c132016-01-15 09:45:10 +11008PETITBOOT_SITE ?= $(call github,open-power,petitboot,$(PETITBOOT_VERSION))
Stewart Smith9c66bc52015-09-11 18:36:22 +10009PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex lvm2
Stewart Smithb2bcc832015-08-20 13:38:33 +100010PETITBOOT_LICENSE = GPLv2
11PETITBOOT_LICENSE_FILES = COPYING
12
13PETITBOOT_AUTORECONF = YES
14PETITBOOT_AUTORECONF_OPTS = -i
15PETITBOOT_GETTEXTIZE = YES
16PETITBOOT_CONF_OPTS += --with-ncurses --without-twin-x11 --without-twin-fbdev \
17 --localstatedir=/var \
18 HOST_PROG_KEXEC=/usr/sbin/kexec \
19 HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot \
20 $(if $(BR2_PACKAGE_BUSYBOX),--with-tftp=busybox)
21
Samuel Mendoza-Jonasb515dbd2016-07-15 16:32:48 +100022PETITBOOT_AUTORECONF_ENV += PETITBOOT_VERSION=`cat $(PETITBOOT_VERSION_FILE) | cut -d '-' -f 2-`
23
Stewart Smithb2bcc832015-08-20 13:38:33 +100024ifdef PETITBOOT_DEBUG
25PETITBOOT_CONF_OPTS += --enable-debug
26endif
27
Sam Mendoza-Jonasaf7c2712016-02-10 10:27:25 +110028ifeq ($(BR2_PACKAGE_PETITBOOT_MTD),y)
29PETITBOOT_CONF_OPTS += --enable-mtd
30PETITBOOT_DEPENDENCIES += libflash
31PETITBOOT_CPPFLAGS += -I$(STAGING_DIR)
32PETITBOOT_LDFLAGS += -L$(STAGING_DIR)
33endif
34
Stewart Smithb2bcc832015-08-20 13:38:33 +100035ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
36PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
37endif
38
39PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP
40
41define PETITBOOT_POST_INSTALL
42 $(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \
43 $(TARGET_DIR)/usr/libexec/petitboot
44 $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/petitboot/boot.d
45 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/01-create-default-dtb \
46 $(TARGET_DIR)/etc/petitboot/boot.d/
Samuel Mendoza-Jonas61f97882016-08-08 15:27:51 +100047 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-add-offb \
48 $(TARGET_DIR)/etc/petitboot/boot.d/
49 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/80-set-stdout \
Stewart Smithb2bcc832015-08-20 13:38:33 +100050 $(TARGET_DIR)/etc/petitboot/boot.d/
Jeremy Kerr1e45f7e2015-11-02 16:24:45 +080051 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \
52 $(TARGET_DIR)/etc/petitboot/boot.d/
Stewart Smithb2bcc832015-08-20 13:38:33 +100053
54 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/S14silence-console \
55 $(TARGET_DIR)/etc/init.d/
56 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/S15pb-discover \
57 $(TARGET_DIR)/etc/init.d/
58 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/kexec-restart \
59 $(TARGET_DIR)/usr/sbin/
60 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/petitboot-console-ui.rules \
61 $(TARGET_DIR)/etc/udev/rules.d/
62 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/removable-event-poll.rules \
63 $(TARGET_DIR)/etc/udev/rules.d/
Samuel Mendoza-Jonasc775f292015-09-14 13:10:27 +100064 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/63-md-raid-arrays.rules \
65 $(TARGET_DIR)/etc/udev/rules.d/
66 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/65-md-incremental.rules \
67 $(TARGET_DIR)/etc/udev/rules.d/
Stewart Smithb2bcc832015-08-20 13:38:33 +100068
69 ln -sf /usr/sbin/pb-udhcpc \
70 $(TARGET_DIR)/usr/share/udhcpc/default.script.d/
Jeremy Kerrd7af67c2015-09-24 15:02:03 +100071
Samuel Mendoza-Jonas0cd25592016-04-20 11:14:40 +100072 mkdir -p $(TARGET_DIR)/var/log/petitboot
73
Jeremy Kerr51ba5722015-09-30 13:31:23 +080074 $(MAKE) -C $(@D)/po DESTDIR=$(TARGET_DIR) install
Stewart Smithb2bcc832015-08-20 13:38:33 +100075endef
76
77PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL
78
79$(eval $(autotools-package))