This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
busybox.mk
74 lines (58 loc) · 2.16 KB
/
busybox.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# busybox.mk
# David Rowe May 2008
#
# Package to install busybox utilities missing from the uImage.
# Bit messy but saves a reflash of uImage for one missing
# busybox utility.
#
# usage: make -f busybox.mk busybox-package
#
# NOTES:
# 1/ make help in the busybox directory was quite helpful
# in working out how to automatically configure busybox.
# 2/ Use 'make menuconfig' to set any utilities you would
# like, then copy the .config file to file/busybox.config
# 3/ The latest msh shell looks much improved, might be work
# including this, e.g as /bin/msh.
include rules.mk
BUSYBOX_VERSION=1.10.1
BUSYBOX_DIRNAME=busybox-$(BUSYBOX_VERSION)
BUSYBOX_DIR=$(BUILD_DIR)/$(BUSYBOX_DIRNAME)
BUSYBOX_SITE=http://busybox.net/downloads/
BUSYBOX_SOURCE=busybox-$(BUSYBOX_VERSION).tar.bz2
BUSYBOX_UNZIP=bzcat
export CFLAGS = -I$(STAGING_DIR)/usr/include
export LDFLAGS = -L$(STAGING_DIR)/usr/lib
TARGET_DIR=$(BUILD_DIR)/tmp/busybox/ipkg/busybox
PKG_NAME:=busybox
PKG_VERSION:=$(BUSYBOX_VERSION)
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/tmp/busybox
$(DL_DIR)/$(BUSYBOX_SOURCE):
$(WGET) -P $(DL_DIR) $(BUSYBOX_SITE)/$(BUSYBOX_SOURCE)
$(BUSYBOX_DIR)/.unpacked: $(DL_DIR)/$(BUSYBOX_SOURCE)
$(BUSYBOX_UNZIP) $(DL_DIR)/$(BUSYBOX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
touch $(BUSYBOX_DIR)/.unpacked
$(BUSYBOX_DIR)/.configured: $(BUSYBOX_DIR)/.unpacked
cp files/busybox.config $(BUSYBOX_DIR)/.config
touch $(BUSYBOX_DIR)/.configured
busybox: $(BUSYBOX_DIR)/.configured
$(MAKE) ARCH="$(ARCH)" CROSS_COMPILE=$(TARGET_CROSS) -C "$(BUSYBOX_DIR)" busybox
mkdir -p $(TARGET_DIR)/bin
cp $(BUSYBOX_DIR)/busybox $(TARGET_DIR)/bin/busybox-extra
ln -sf busybox-extra $(TARGET_DIR)/bin/tr
ln -sf busybox-extra $(TARGET_DIR)/bin/wc
touch $(PKG_BUILD_DIR)/.built
all: busybox
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Extra busybox utilities
DESCRIPTION:=\
Additional busybox utilities not included in the default uImage. Lets \
you to install extra utilities without reflashing.
URL:=http://busybox.net/
endef
# post installation
$(eval $(call BuildPackage,$(PKG_NAME)))
busybox-package: busybox $(PACKAGE_DIR)/$(PKG_NAME)_$(VERSION)_$(PKGARCH).ipk