Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # petitboot |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Samuel Mendoza-Jonas | 168a3e9 | 2018-11-16 15:07:22 +1100 | [diff] [blame] | 7 | PETITBOOT_VERSION = 1.9.2 |
Samuel Mendoza-Jonas | 6330437 | 2018-05-30 10:59:57 +1000 | [diff] [blame] | 8 | PETITBOOT_SOURCE = petitboot-$(PETITBOOT_VERSION).tar.gz |
| 9 | PETITBOOT_SITE ?= https://github.com/open-power/petitboot/releases/download/v$(PETITBOOT_VERSION) |
Stewart Smith | 9c66bc5 | 2015-09-11 18:36:22 +1000 | [diff] [blame] | 10 | PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex lvm2 |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 11 | PETITBOOT_LICENSE = GPLv2 |
| 12 | PETITBOOT_LICENSE_FILES = COPYING |
| 13 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 14 | PETITBOOT_CONF_OPTS += --with-ncurses --without-twin-x11 --without-twin-fbdev \ |
| 15 | --localstatedir=/var \ |
| 16 | HOST_PROG_KEXEC=/usr/sbin/kexec \ |
| 17 | HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot \ |
Samuel Mendoza-Jonas | 8a29117 | 2016-12-09 11:39:23 +1100 | [diff] [blame] | 18 | $(if $(BR2_PACKAGE_BUSYBOX),--with-tftp=busybox --enable-busybox) |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 19 | |
| 20 | ifdef PETITBOOT_DEBUG |
| 21 | PETITBOOT_CONF_OPTS += --enable-debug |
| 22 | endif |
| 23 | |
Sam Mendoza-Jonas | af7c271 | 2016-02-10 10:27:25 +1100 | [diff] [blame] | 24 | ifeq ($(BR2_PACKAGE_PETITBOOT_MTD),y) |
| 25 | PETITBOOT_CONF_OPTS += --enable-mtd |
| 26 | PETITBOOT_DEPENDENCIES += libflash |
| 27 | PETITBOOT_CPPFLAGS += -I$(STAGING_DIR) |
| 28 | PETITBOOT_LDFLAGS += -L$(STAGING_DIR) |
| 29 | endif |
| 30 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 31 | ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y) |
| 32 | PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw |
| 33 | endif |
| 34 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 35 | define PETITBOOT_POST_INSTALL |
| 36 | $(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \ |
| 37 | $(TARGET_DIR)/usr/libexec/petitboot |
| 38 | $(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/petitboot/boot.d |
| 39 | $(INSTALL) -D -m 0755 $(@D)/utils/hooks/01-create-default-dtb \ |
| 40 | $(TARGET_DIR)/etc/petitboot/boot.d/ |
Jeremy Kerr | 1e45f7e | 2015-11-02 16:24:45 +0800 | [diff] [blame] | 41 | $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \ |
| 42 | $(TARGET_DIR)/etc/petitboot/boot.d/ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 43 | |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 44 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/S14silence-console \ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 45 | $(TARGET_DIR)/etc/init.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 46 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/S15pb-discover \ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 47 | $(TARGET_DIR)/etc/init.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 48 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/kexec-restart \ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 49 | $(TARGET_DIR)/usr/sbin/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 50 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/petitboot-console-ui.rules \ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 51 | $(TARGET_DIR)/etc/udev/rules.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 52 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/removable-event-poll.rules \ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 53 | $(TARGET_DIR)/etc/udev/rules.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 54 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/63-md-raid-arrays.rules \ |
Samuel Mendoza-Jonas | c775f29 | 2015-09-14 13:10:27 +1000 | [diff] [blame] | 55 | $(TARGET_DIR)/etc/udev/rules.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 56 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL_OP_BUILD_PATH)/package/petitboot/65-md-incremental.rules \ |
Samuel Mendoza-Jonas | c775f29 | 2015-09-14 13:10:27 +1000 | [diff] [blame] | 57 | $(TARGET_DIR)/etc/udev/rules.d/ |
Mamatha Inamdar | 3d3220e | 2017-05-31 15:53:07 +0530 | [diff] [blame] | 58 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/66-add-sg-module.rules \ |
| 59 | $(TARGET_DIR)/etc/udev/rules.d/ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 60 | |
| 61 | ln -sf /usr/sbin/pb-udhcpc \ |
| 62 | $(TARGET_DIR)/usr/share/udhcpc/default.script.d/ |
Jeremy Kerr | d7af67c | 2015-09-24 15:02:03 +1000 | [diff] [blame] | 63 | |
Samuel Mendoza-Jonas | 0cd2559 | 2016-04-20 11:14:40 +1000 | [diff] [blame] | 64 | mkdir -p $(TARGET_DIR)/var/log/petitboot |
| 65 | |
Jeremy Kerr | 51ba572 | 2015-09-30 13:31:23 +0800 | [diff] [blame] | 66 | $(MAKE) -C $(@D)/po DESTDIR=$(TARGET_DIR) install |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 67 | endef |
| 68 | |
Arthur Heymans | ac84eb0 | 2016-10-18 17:43:08 +0200 | [diff] [blame] | 69 | define PETITBOOT_POST_INSTALL_DTB |
| 70 | $(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-dtb-updates \ |
| 71 | $(TARGET_DIR)/etc/petitboot/boot.d/ |
| 72 | endef |
| 73 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 74 | PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL |
| 75 | |
Arthur Heymans | ac84eb0 | 2016-10-18 17:43:08 +0200 | [diff] [blame] | 76 | ifeq ($(BR2_PACKAGE_DTC),y) |
| 77 | PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL_DTB |
| 78 | endif |
| 79 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 80 | $(eval $(autotools-package)) |