Pkgfile (2825B)
1 # Description : Utilities for rescue and embedded systems 2 # URL : https://www.busybox.net/ 3 # Maintainer : KRAK3N Team 4 5 name=busybox 6 version=1.37.0 7 release=3 8 source=(https://${name}.net/downloads/${name}-${version}.tar.bz2 9 0001-awk-fix-handling-of-literal-backslashes-in-replaceme.patch 10 0006-modinfo-add-k-option-for-kernel-version.patch 11 0007-nologin-Install-applet-to-sbin-instead-of-usr-sbin.patch 12 0016-ping-make-ping-work-without-root-privileges.patch 13 0031-syslogd-fix-wrong-OPT_locallog-flag-detection.patch 14 0034-adduser-remove-preconfigured-GECOS-full-name-field.patch 15 kernel-6.8-tca.patch 16 fsck-resolve-uuid.patch 17 adduser-no-setgid.patch 18 print-unicode.patch 19 modprobe-kernel-version.patch 20 busybox-suidwrapper.c 21 mdev.conf) 22 23 24 _disable() { 25 while [ "$1" ]; do 26 sed "s/^CONFIG_${1}=y/# CONFIG_${1} is not set/" -i .config 27 shift 28 done 29 } 30 31 _enable() { 32 while [ "$1" ]; do 33 sed "s/^# CONFIG_${1}.*/CONFIG_${1}=y/" -i .config 34 shift 35 done 36 } 37 38 build() { 39 cd ${name}-${version} 40 41 for p in $SRC/*.patch; do 42 patch -Np1 -i $p 43 done 44 45 make defconfig 46 47 # disable unneeded applets 48 _disable LINUX32 LINUX64 LINUXRC DPKG DPKG_DEB RPM RUN_PARTS MODPROBE_SMALL HUSH SHELL_HUSH 49 50 # enable needed applets 51 _enable STATIC FEATURE_MODUTILS_ALIAS FEATURE_MODUTILS_SYMBOLS 52 53 # workaround lxdialog not work with clang 54 #sed 's/$cc/$cc -Wno-implicit-int/' -i scripts/kconfig/lxdialog/check-lxdialog.sh 55 #make menuconfig 56 make 57 make CONFIG_PREFIX=$PKG install 58 mkdir -p $PKG/usr/share/busybox 59 cat .config > $PKG/usr/share/busybox/config 60 61 ${CC:-cc} -o $PKG/bin/busybox-suidwrapper $SRC/busybox-suidwrapper.c 62 chmod u+s $PKG/bin/busybox-suidwrapper 63 64 for i in $($PKG/bin/busybox-suidwrapper -l); do 65 [ -e /bin/$i ] && ln -svf busybox-suidwrapper $PKG/bin/$i 66 [ -e /usr/bin/$i ] && ln -svf ../../bin/busybox-suidwrapper $PKG/usr/bin/$i 67 done 68 # wall is provided by util-linux 69 rm $PKG/usr/bin/wall 70 71 # remove from package that conflict with existing packages 72 for i in chattr dmesg getopt ionice kill lsattr more mount mountpoint rev scriptreplay \ 73 setarch umount blkid blockdev depmod fdisk findfs fsck fsck.minix fstrim hwclock \ 74 insmod losetup lsmod mkdosfs mke2fs mkfs.ext2 mkfs.minix mkfs.vfat mkswap modinfo \ 75 modprobe pivot_root rmmod sulogin swapoff swapon switch_root \ 76 halt init poweroff reboot runlevel; do 77 rm $PKG/*/$i 78 done 79 for i in blkdiscard bunzip2 bzcat bzip2 cal chrt clear eject fallocate find flock getfattr \ 80 hexdump ipcrm ipcs last logger lzcat lzma man mesg nsenter patch renice reset rx \ 81 script setfattr setsid strings taskset unlzma unshare unxz xargs xz xzcat chat \ 82 fsfreeze partprobe readprofile rtcwake resize setfont chvt deallocvt fgconsole \ 83 openvt setkeycodes showkey; do 84 rm $PKG/*/*/$i 85 done 86 87 mkdir -p $PKG/etc 88 install -m644 $SRC/mdev.conf $PKG/etc/mdev.conf 89 } 90