Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # petitboot |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Samuel Mendoza-Jonas | c0e5f3a | 2016-08-23 13:17:59 +1000 | [diff] [blame^] | 7 | PETITBOOT_VERSION = v1.2.3 |
Alastair D'Silva | 00e2c13 | 2016-01-15 09:45:10 +1100 | [diff] [blame] | 8 | PETITBOOT_SITE ?= $(call github,open-power,petitboot,$(PETITBOOT_VERSION)) |
Stewart Smith | 9c66bc5 | 2015-09-11 18:36:22 +1000 | [diff] [blame] | 9 | PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex lvm2 |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 10 | PETITBOOT_LICENSE = GPLv2 |
| 11 | PETITBOOT_LICENSE_FILES = COPYING |
| 12 | |
| 13 | PETITBOOT_AUTORECONF = YES |
| 14 | PETITBOOT_AUTORECONF_OPTS = -i |
| 15 | PETITBOOT_GETTEXTIZE = YES |
| 16 | PETITBOOT_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-Jonas | b515dbd | 2016-07-15 16:32:48 +1000 | [diff] [blame] | 22 | PETITBOOT_AUTORECONF_ENV += PETITBOOT_VERSION=`cat $(PETITBOOT_VERSION_FILE) | cut -d '-' -f 2-` |
| 23 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 24 | ifdef PETITBOOT_DEBUG |
| 25 | PETITBOOT_CONF_OPTS += --enable-debug |
| 26 | endif |
| 27 | |
Sam Mendoza-Jonas | af7c271 | 2016-02-10 10:27:25 +1100 | [diff] [blame] | 28 | ifeq ($(BR2_PACKAGE_PETITBOOT_MTD),y) |
| 29 | PETITBOOT_CONF_OPTS += --enable-mtd |
| 30 | PETITBOOT_DEPENDENCIES += libflash |
| 31 | PETITBOOT_CPPFLAGS += -I$(STAGING_DIR) |
| 32 | PETITBOOT_LDFLAGS += -L$(STAGING_DIR) |
| 33 | endif |
| 34 | |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 35 | ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y) |
| 36 | PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw |
| 37 | endif |
| 38 | |
| 39 | PETITBOOT_PRE_CONFIGURE_HOOKS += PETITBOOT_PRE_CONFIGURE_BOOTSTRAP |
| 40 | |
| 41 | define 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-Jonas | 61f9788 | 2016-08-08 15:27:51 +1000 | [diff] [blame] | 47 | $(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 Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 50 | $(TARGET_DIR)/etc/petitboot/boot.d/ |
Jeremy Kerr | 1e45f7e | 2015-11-02 16:24:45 +0800 | [diff] [blame] | 51 | $(INSTALL) -D -m 0755 $(@D)/utils/hooks/90-sort-dtb \ |
| 52 | $(TARGET_DIR)/etc/petitboot/boot.d/ |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 53 | |
| 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-Jonas | c775f29 | 2015-09-14 13:10:27 +1000 | [diff] [blame] | 64 | $(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 Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 68 | |
| 69 | ln -sf /usr/sbin/pb-udhcpc \ |
| 70 | $(TARGET_DIR)/usr/share/udhcpc/default.script.d/ |
Jeremy Kerr | d7af67c | 2015-09-24 15:02:03 +1000 | [diff] [blame] | 71 | |
Samuel Mendoza-Jonas | 0cd2559 | 2016-04-20 11:14:40 +1000 | [diff] [blame] | 72 | mkdir -p $(TARGET_DIR)/var/log/petitboot |
| 73 | |
Jeremy Kerr | 51ba572 | 2015-09-30 13:31:23 +0800 | [diff] [blame] | 74 | $(MAKE) -C $(@D)/po DESTDIR=$(TARGET_DIR) install |
Stewart Smith | b2bcc83 | 2015-08-20 13:38:33 +1000 | [diff] [blame] | 75 | endef |
| 76 | |
| 77 | PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL |
| 78 | |
| 79 | $(eval $(autotools-package)) |