Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # petitboot |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Jeremy Kerr | e333db3 | 2019-12-04 13:01:50 +0800 | [diff] [blame] | 7 | PETITBOOT_VERSION = v1.11 |
Samuel Mendoza-Jonas | 6330437 | 2018-05-30 10:59:57 +1000 | [diff] [blame] | 8 | PETITBOOT_SOURCE = petitboot-$(PETITBOOT_VERSION).tar.gz |
Samuel Mendoza-Jonas | 4005268 | 2019-03-07 11:23:10 +1300 | [diff] [blame] | 9 | PETITBOOT_SITE ?= https://github.com/open-power/petitboot/releases/download/$(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 \ |
Samuel Mendoza-Jonas | db6ca35 | 2018-11-26 11:47:43 +1100 | [diff] [blame] | 16 | --enable-crypt \ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 17 | HOST_PROG_KEXEC=/usr/sbin/kexec \ |
| 18 | HOST_PROG_SHUTDOWN=/usr/libexec/petitboot/bb-kexec-reboot \ |
Samuel Mendoza-Jonas | 8a29117 | 2016-12-09 11:39:23 +1100 | [diff] [blame] | 19 | $(if $(BR2_PACKAGE_BUSYBOX),--with-tftp=busybox --enable-busybox) |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 20 | |
| 21 | ifdef PETITBOOT_DEBUG |
| 22 | PETITBOOT_CONF_OPTS += --enable-debug |
| 23 | endif |
| 24 | |
Sam Mendoza-Jonas | af7c271 | 2016-02-10 10:27:25 +1100 | [diff] [blame] | 25 | ifeq ($(BR2_PACKAGE_PETITBOOT_MTD),y) |
| 26 | PETITBOOT_CONF_OPTS += --enable-mtd |
| 27 | PETITBOOT_DEPENDENCIES += libflash |
| 28 | PETITBOOT_CPPFLAGS += -I$(STAGING_DIR) |
| 29 | PETITBOOT_LDFLAGS += -L$(STAGING_DIR) |
| 30 | endif |
| 31 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 32 | ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y) |
| 33 | PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw |
| 34 | endif |
| 35 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 36 | define 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 Kerr | 1e45f7e | 2015-11-02 16:24:45 +0800 | [diff] [blame] | 42 | $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \ |
| 43 | $(TARGET_DIR)/etc/petitboot/boot.d/ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 44 | |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 45 | $(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] | 46 | $(TARGET_DIR)/etc/init.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 47 | $(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] | 48 | $(TARGET_DIR)/etc/init.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 49 | $(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] | 50 | $(TARGET_DIR)/usr/sbin/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 51 | $(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] | 52 | $(TARGET_DIR)/etc/udev/rules.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 53 | $(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] | 54 | $(TARGET_DIR)/etc/udev/rules.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 55 | $(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] | 56 | $(TARGET_DIR)/etc/udev/rules.d/ |
Joel Stanley | 5ab5fdb | 2016-10-31 23:10:24 +1030 | [diff] [blame] | 57 | $(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] | 58 | $(TARGET_DIR)/etc/udev/rules.d/ |
Mamatha Inamdar | 3d3220e | 2017-05-31 15:53:07 +0530 | [diff] [blame] | 59 | $(INSTALL) -D -m 0755 $(BR2_EXTERNAL)/package/petitboot/66-add-sg-module.rules \ |
| 60 | $(TARGET_DIR)/etc/udev/rules.d/ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 61 | |
| 62 | ln -sf /usr/sbin/pb-udhcpc \ |
| 63 | $(TARGET_DIR)/usr/share/udhcpc/default.script.d/ |
Jeremy Kerr | d7af67c | 2015-09-24 15:02:03 +1000 | [diff] [blame] | 64 | |
Samuel Mendoza-Jonas | db6ca35 | 2018-11-26 11:47:43 +1100 | [diff] [blame] | 65 | 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-Jonas | 0cd2559 | 2016-04-20 11:14:40 +1000 | [diff] [blame] | 70 | |
Jeremy Kerr | 51ba572 | 2015-09-30 13:31:23 +0800 | [diff] [blame] | 71 | $(MAKE) -C $(@D)/po DESTDIR=$(TARGET_DIR) install |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 72 | endef |
| 73 | |
Arthur Heymans | ac84eb0 | 2016-10-18 17:43:08 +0200 | [diff] [blame] | 74 | define PETITBOOT_POST_INSTALL_DTB |
| 75 | $(INSTALL) -D -m 0755 $(@D)/utils/hooks/30-dtb-updates \ |
| 76 | $(TARGET_DIR)/etc/petitboot/boot.d/ |
| 77 | endef |
| 78 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 79 | PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL |
| 80 | |
Arthur Heymans | ac84eb0 | 2016-10-18 17:43:08 +0200 | [diff] [blame] | 81 | ifeq ($(BR2_PACKAGE_DTC),y) |
| 82 | PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL_DTB |
| 83 | endif |
| 84 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 85 | $(eval $(autotools-package)) |