aboutsummaryrefslogtreecommitdiff
path: root/repos/core/busybox/abuild
blob: 5303573880614982501456196e45f420fb287e6f (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name=busybox
version=1.36.1
release=3
source="https://${name}.net/downloads/${name}-${version}.tar.bz2
	config
	mdev.conf
	fsck-resolve-uuid.patch
	0016-ping-make-ping-work-without-root-privileges.patch
	install-fix-chown.patch
	adduser-no-setgid.patch
	lineedit-Handle-SIGWINCH-gracefully.patch
	lsusb-vendor-product.patch
	print-unicode.patch
	modprobe-kernel-version.patch
	0007-nologin-Install-applet-to-sbin-instead-of-usr-sbin.patch
	acpid.run
	crond.run
	ntpd.run
	syslogd.run
	tty1.run
	tty2.run
	tty3.run
	tty4.run
	tty5.run
	ttyS0.run
	pause.c
	pause.1"
sv="acpid.run
    crond.run
    ntpd.run
    syslogd.run
    tty1.run
    tty2.run
    tty3.run
    tty4.run
    tty5.run
    ttyS0.run"

build() {
	if [ "$BOOTSTRAP" ]; then
		_opt="ARCH=$CARCH CROSS_COMPILE=$CTARGET-"
	fi

	cp $SRC/config .config
	#make menuconfig
	make $_opt
	make $_opt CONFIG_PREFIX=$PKG install
	mkdir -p $PKG/usr/share/busybox
	cat .config > $PKG/usr/share/busybox/config
	
	BIN="$BIN xzcat xz unxz unlzma lzcat lzma" #xz
	#BIN="$BIN zcat gunzip gzip" #gzip
	BIN="$BIN strings" #binutils
	BIN="$BIN clear reset" #ncurses
	BIN="$BIN patch" #patch
	BIN="$BIN bzcat bunzip2 bzip2" #bzip2
	BIN="$BIN setfattr" #attr
	BIN="$BIN chattr lsattr mke2fs findfs mkfs.ext2 blkid" #e2fsprogs
	BIN="$BIN mkdosfs mkfs.vfat " #dosfstools
	
	# XXX
	for i in $BIN; do
		rm $PKG/*/$i || true
		rm $PKG/*/*/$i || true
	done
	
	cp $PKG/bin/busybox $PKG/bin/busybox-suid
	chmod u+s $PKG/bin/busybox-suid
	
	for a in bin/mount \
		bin/umount \
		bin/su \
		bin/ping ; do
		rm $PKG/$a
		ln -sv busybox-suid $PKG/$a
	done
	
	for a in usr/bin/crontab \
		usr/bin/passwd \
		usr/bin/traceroute \
		usr/bin/traceroute6 \
		usr/bin/vlock; do
		rm $PKG/$a
		ln -sv ../../bin/busybox-suid $PKG/$a
	done
	
	mkdir -p $PKG/etc
	install -m644 $SRC/mdev.conf $PKG/etc/mdev.conf
	
	rm $PKG/usr/bin/diff
	ln -s busybox $PKG/bin/diff
	
	${CC:-gcc} ${CFLAGS} $SRC/pause.c -o $PKG/usr/bin/pause
	install -d $PKG/usr/share/man/man1
	install -m644 $SRC/pause.1 $PKG/usr/share/man/man1/pause.1	
}