blob: e0015173879e79bbc00ca432cf59ffde6e6045ce [file] [log] [blame]
Stewart Smithb2bcc832015-08-20 13:38:33 +10001################################################################################
2#
3# petitboot
4#
5################################################################################
6
Jeremy Kerre333db32019-12-04 13:01:50 +08007PETITBOOT_VERSION = v1.11
Samuel Mendoza-Jonas63304372018-05-30 10:59:57 +10008PETITBOOT_SOURCE = petitboot-$(PETITBOOT_VERSION).tar.gz
Samuel Mendoza-Jonas40052682019-03-07 11:23:10 +13009PETITBOOT_SITE ?= https://github.com/open-power/petitboot/releases/download/$(PETITBOOT_VERSION)
Stewart Smith9c66bc52015-09-11 18:36:22 +100010PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex lvm2
Stewart Smithb2bcc832015-08-20 13:38:33 +100011PETITBOOT_LICENSE = GPLv2
12PETITBOOT_LICENSE_FILES = COPYING
13
Stewart Smithb2bcc832015-08-20 13:38:33 +100014PETITBOOT_CONF_OPTS += --with-ncurses --without-twin-x11 --without-twin-fbdev \
15 --localstatedir=/var \
Samuel Mendoza-Jonasdb6ca352018-11-26 11:47:43 +110016 --enable-crypt \
Stewart Smithb2bcc832015-08-20 13:38:33 +100017 HOST_PROG_KEXEC=/usr/sbin/kexec \
18 HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot \
Samuel Mendoza-Jonas8a291172016-12-09 11:39:23 +110019 $(if $(BR2_PACKAGE_BUSYBOX),--with-tftp=busybox --enable-busybox)
Stewart Smithb2bcc832015-08-20 13:38:33 +100020
21ifdef PETITBOOT_DEBUG
22PETITBOOT_CONF_OPTS += --enable-debug
23endif
24
Sam Mendoza-Jonasaf7c2712016-02-10 10:27:25 +110025ifeq ($(BR2_PACKAGE_PETITBOOT_MTD),y)
26PETITBOOT_CONF_OPTS += --enable-mtd
27PETITBOOT_DEPENDENCIES += libflash
28PETITBOOT_CPPFLAGS += -I$(STAGING_DIR)
29PETITBOOT_LDFLAGS += -L$(STAGING_DIR)
30endif
31
Stewart Smithb2bcc832015-08-20 13:38:33 +100032ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
33PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
34endif
35
Stewart Smithb2bcc832015-08-20 13:38:33 +100036define PETITBOOT_POST_INSTALL
37 $(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \
38 $(TARGET_DIR)/usr/libexec/petitboot
39 $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/petitboot/boot.d
40 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/01-create-default-dtb \
41 $(TARGET_DIR)/etc/petitboot/boot.d/
Jeremy Kerr1e45f7e2015-11-02 16:24:45 +080042 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \
43 $(TARGET_DIR)/etc/petitboot/boot.d/
Stewart Smithb2bcc832015-08-20 13:38:33 +100044
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103045 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/S14silence-console \
Stewart Smithb2bcc832015-08-20 13:38:33 +100046 $(TARGET_DIR)/etc/init.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103047 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/S15pb-discover \
Stewart Smithb2bcc832015-08-20 13:38:33 +100048 $(TARGET_DIR)/etc/init.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103049 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/kexec-restart \
Stewart Smithb2bcc832015-08-20 13:38:33 +100050 $(TARGET_DIR)/usr/sbin/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103051 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/petitboot-console-ui.rules \
Stewart Smithb2bcc832015-08-20 13:38:33 +100052 $(TARGET_DIR)/etc/udev/rules.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103053 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/removable-event-poll.rules \
Stewart Smithb2bcc832015-08-20 13:38:33 +100054 $(TARGET_DIR)/etc/udev/rules.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103055 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/63-md-raid-arrays.rules \
Samuel Mendoza-Jonasc775f292015-09-14 13:10:27 +100056 $(TARGET_DIR)/etc/udev/rules.d/
Joel Stanley5ab5fdb2016-10-31 23:10:24 +103057 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/65-md-incremental.rules \
Samuel Mendoza-Jonasc775f292015-09-14 13:10:27 +100058 $(TARGET_DIR)/etc/udev/rules.d/
Mamatha Inamdar3d3220e2017-05-31 15:53:07 +053059 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/66-add-sg-module.rules \
60 $(TARGET_DIR)/etc/udev/rules.d/
Stewart Smithb2bcc832015-08-20 13:38:33 +100061
62 ln -sf /usr/sbin/pb-udhcpc \
63 $(TARGET_DIR)/usr/share/udhcpc/default.script.d/
Jeremy Kerrd7af67c2015-09-24 15:02:03 +100064
Samuel Mendoza-Jonasdb6ca352018-11-26 11:47:43 +110065 mkdir -p $(TARGET_DIR)/home/petituser
66 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/shell_profile \
67 $(TARGET_DIR)/home/petituser/.profile
68 $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/shell_config \
69 $(TARGET_DIR)/home/petituser/.shrc
Samuel Mendoza-Jonas0cd25592016-04-20 11:14:40 +100070
Jeremy Kerr51ba5722015-09-30 13:31:23 +080071 $(MAKE) -C $(@D)/po DESTDIR=$(TARGET_DIR) install
Stewart Smithb2bcc832015-08-20 13:38:33 +100072endef
73
Arthur Heymansac84eb02016-10-18 17:43:08 +020074define PETITBOOT_POST_INSTALL_DTB
75 $(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-dtb-updates \
76 $(TARGET_DIR)/etc/petitboot/boot.d/
77endef
78
Stewart Smithb2bcc832015-08-20 13:38:33 +100079PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL
80
Arthur Heymansac84eb02016-10-18 17:43:08 +020081ifeq ($(BR2_PACKAGE_DTC),y)
82 PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL_DTB
83endif
84
Stewart Smithb2bcc832015-08-20 13:38:33 +100085$(eval $(autotools-package))