blob: 015d5bbb0d9578cb67f4d1b84208ec99e1f1fa4a [file] [log] [blame]
Stewart Smithb2bcc832015-08-20 13:38:33 +10001################################################################################
2#
3# petitboot
4#
5################################################################################
6
Samuel Mendoza-Jonas56548f62016-10-21 12:46:12 +11007PETITBOOT_VERSION = v1.3.2
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-Jonas56548f62016-10-21 12:46:12 +110047 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-dtb-updates \
Stewart Smithb2bcc832015-08-20 13:38:33 +100048 $(TARGET_DIR)/etc/petitboot/boot.d/
Jeremy Kerr1e45f7e2015-11-02 16:24:45 +080049 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \
50 $(TARGET_DIR)/etc/petitboot/boot.d/
Stewart Smithb2bcc832015-08-20 13:38:33 +100051
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103052 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/S14silence-console \
Stewart Smithb2bcc832015-08-20 13:38:33 +100053 $(TARGET_DIR)/etc/init.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103054 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/S15pb-discover \
Stewart Smithb2bcc832015-08-20 13:38:33 +100055 $(TARGET_DIR)/etc/init.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103056 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/kexec-restart \
Stewart Smithb2bcc832015-08-20 13:38:33 +100057 $(TARGET_DIR)/usr/sbin/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103058 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/petitboot-console-ui.rules \
Stewart Smithb2bcc832015-08-20 13:38:33 +100059 $(TARGET_DIR)/etc/udev/rules.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103060 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/removable-event-poll.rules \
Stewart Smithb2bcc832015-08-20 13:38:33 +100061 $(TARGET_DIR)/etc/udev/rules.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103062 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/63-md-raid-arrays.rules \
Samuel Mendoza-Jonasc775f292015-09-14 13:10:27 +100063 $(TARGET_DIR)/etc/udev/rules.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103064 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/65-md-incremental.rules \
Samuel Mendoza-Jonasc775f292015-09-14 13:10:27 +100065 $(TARGET_DIR)/etc/udev/rules.d/
Stewart Smithb2bcc832015-08-20 13:38:33 +100066
67 ln -sf /usr/sbin/pb-udhcpc \
68 $(TARGET_DIR)/usr/share/udhcpc/default.script.d/
Jeremy Kerrd7af67c2015-09-24 15:02:03 +100069
Samuel Mendoza-Jonas0cd25592016-04-20 11:14:40 +100070 mkdir -p $(TARGET_DIR)/var/log/petitboot
71
Jeremy Kerr51ba5722015-09-30 13:31:23 +080072 $(MAKE) -C $(@D)/po DESTDIR=$(TARGET_DIR) install
Stewart Smithb2bcc832015-08-20 13:38:33 +100073endef
74
75PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL
76
77$(eval $(autotools-package))