[packages] ctorrent: fix build failure on avr32
[openwrt/svn-archive/archive.git] / utils / petitboot / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=petitboot
11 PKG_VERSION:=93b2c2e0f0ca46d2a823b33cdfa44d082e9e8d10
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=git://ozlabs.org/home/jk/git/petitboot
16 PKG_SOURCE_PROTO:=git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=$(PKG_VERSION)
19
20 PKG_INSTALL=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/petitboot
25 SECTION:=boot
26 CATEGORY:=Boot Loaders
27 TITLE:=A kexec based bootloader
28 URL:=http://ozlabs.org/~jk/projects/petitboot/
29 MAINTAINER:=Geoff Levand <geoffrey.levand@am.sony.com>
30 DEPENDS:=+kexec-tools +libncurses +libtwin +udev +ps3-utils
31 endef
32
33 define Package/petitboot/description
34 Petitboot is a Linux kexec based bootloader with both
35 graphical and command-line user interfaces. The OpenWRT
36 Petitboot package has configuration options that can be
37 used to specify which Petitboot components to build, and
38 can also be used to specify that Petitboot should be run
39 automatically at system start-up.
40
41 Petitboot supports loading Linux kernel and initrd images
42 from any device that can be mounted by Linux. It can
43 handle gzipped images and can also load images from the
44 network using TFTP, NFS, HTTP, HTTPS, and SFTP. Petitboot
45 looks for bootloader config files on mountable devices in
46 the system, and also uses the boot configuration sent to
47 it from a DHCP server.
48 endef
49
50 define Package/petitboot/config
51 source "$(SOURCE)/petitboot-config.in"
52 endef
53
54 petitboot-config-args-y$(CONFIG_PETITBOOT_CUI) += --without-ncurses
55 petitboot-config-args-y$(CONFIG_PETITBOOT_GUI) += --without-twin
56 petitboot-config-args-y$(CONFIG_PETITBOOT_PS3) += --enable-ps3=no
57
58 petitboot-cppflags-$(CONFIG_PETITBOOT_DEBUG) += -DDEBUG
59 petitboot-cppflags-y$(CONFIG_PETITBOOT_DEBUG) += -DNDEBUG
60
61 petitboot-extra-bin-$(CONFIG_PETITBOOT_CUI) += /usr/sbin/pb-cui
62 petitboot-extra-bin-$(CONFIG_PETITBOOT_GUI) += /usr/sbin/pb-twin
63 petitboot-extra-data-$(CONFIG_PETITBOOT_GUI) += /usr/share/petitboot/artwork/*
64
65 # The platform inittab and/or initrun should check for /usr/sbin/petitboot
66 # and run it on startup if found.
67
68 petitboot-install-autorun-$(CONFIG_PETITBOOT_AUTORUN_CUI) = \
69 ln -sf pb-cui $(1)/usr/sbin/petitboot
70 petitboot-install-autorun-$(CONFIG_PETITBOOT_AUTORUN_GUI) = \
71 ln -sf pb-twin $(1)/usr/sbin/petitboot
72
73 CONFIGURE_ARGS += $(petitboot-config-args-y) \
74 PACKAGE_VERSION=$(shell echo ${HOSTNAME})-$(shell date +%y.%m.%d-%H.%M)
75
76 EXTRA_CPPFLAGS += $(petitboot-cppflags-y)
77
78 define Build/Prepare
79 $(call Build/Prepare/Default)
80 (cd $(PKG_BUILD_DIR) && $(BASH) -x ./bootstrap)
81 endef
82
83 define Package/petitboot/install
84 $(INSTALL_DIR) $(1)/usr/sbin
85 $(INSTALL_BIN) \
86 $(addprefix $(PKG_INSTALL_DIR),$(petitboot-extra-bin-y)) \
87 $(PKG_INSTALL_DIR)/usr/sbin/pb-discover \
88 $(PKG_INSTALL_DIR)/usr/sbin/pb-event \
89 $(1)/usr/sbin/
90
91 $(INSTALL_DIR) $(1)/usr/share/petitboot/
92 $(INSTALL_DATA) \
93 $(addprefix $(PKG_INSTALL_DIR),$(petitboot-extra-data-y)) \
94 $(1)/usr/share/petitboot/
95
96 $(INSTALL_DIR) $(1)/etc/udev/rules.d
97 $(INSTALL_DATA) \
98 $(PKG_BUILD_DIR)/utils/99-petitboot.rules \
99 $(1)/etc/udev/rules.d/
100
101 $(INSTALL_DIR) $(1)/etc/
102 $(INSTALL_DATA) -T $(PKG_BUILD_DIR)/utils/udhcpc $(1)/etc/udhcpc.user
103
104 $(INSTALL_DIR) $(1)/etc/init.d
105 $(INSTALL_BIN) \
106 ./files/petitboot.init \
107 $(1)/etc/init.d/petitboot
108
109 $(petitboot-install-autorun-y)
110 endef
111
112 $(eval $(call BuildPackage,petitboot))