wok rev 12755
busybox: handle ARCH and build for Aarmv6
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat May 12 04:20:53 2012 +0200 (2012-05-12) |
parents | 1f49cc79cf1c |
children | 24527c1a81b7 |
files | busybox/receipt |
line diff
1.1 --- a/busybox/receipt Fri May 11 14:55:49 2012 +0200 1.2 +++ b/busybox/receipt Sat May 12 04:20:53 2012 +0200 1.3 @@ -5,14 +5,19 @@ 1.4 CATEGORY="base-system" 1.5 SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities." 1.6 MAINTAINER="pascal.bellard@slitaz.org" 1.7 -DEPENDS="slitaz-base-files glibc-base ncurses-common" 1.8 -BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486" 1.9 AUFS_NOT_SUPPORTED="uclibc-cross-compiler-i486 is not compatible with aufs 8(" 1.10 TARBALL="$PACKAGE-$VERSION.tar.bz2" 1.11 WEB_SITE="http://www.busybox.net/" 1.12 WGET_URL="http://www.busybox.net/downloads/$TARBALL" 1.13 CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf /etc/httpd.conf" 1.14 1.15 +DEPENDS="slitaz-base-files glibc-base ncurses-common" 1.16 +BUILD_DEPENDS="bzip2 pam pam-dev uclibc-cross-compiler-i486" 1.17 + 1.18 +case "$ARCH" in 1.19 + arm) BUILD_DEPENDS="bzip2" ;; 1.20 +esac 1.21 + 1.22 apply_bb_patchs() 1.23 { 1.24 cd $src 1.25 @@ -39,7 +44,7 @@ 1.26 cook_tmp_toolchain() 1.27 { 1.28 { stuff=${stuff:-../stuff} 1.29 - apply_bb_patchs && 1.30 + apply_bb_patchs && 1.31 make oldconfig && 1.32 make && 1.33 make CONFIG_PREFIX=/tools install 1.34 @@ -48,37 +53,58 @@ 1.35 chmod 4755 /tools/bin/busybox 1.36 } 1.37 1.38 +# Cook Busybox 1.39 +cook_bb() 1.40 +{ 1.41 + { apply_bb_patchs && 1.42 + make oldconfig && 1.43 + make && make install 1.44 + } || return 1 1.45 +} 1.46 # Rules to configure and make the package. 1.47 compile_rules() 1.48 { 1.49 - { apply_bb_patchs && 1.50 - make oldconfig && 1.51 - make && 1.52 - make install 1.53 - } || return 1 1.54 - strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr $src/_install/bin/busybox 1.55 + case "$ARCH" in 1.56 + arm) 1.57 + export CROSS_COMPILE=$HOST_SYSTEM- 1.58 + echo "cook: CROSS_COMPILE=$CROSS_COMPILE" 1.59 + cook_bb 1.60 + chmod 4755 $src/_install/bin/busybox ;; 1.61 + x86_64) echo "TODO" ;; 1.62 + i?86) 1.63 + cook_bb 1.64 + strip --strip-unneeded \ 1.65 + -R .eh_frame -R .eh_frame_hdr \ 1.66 + $src/_install/bin/busybox 1.67 1.68 - # prepare busybox-pam package 1.69 - sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config 1.70 - make oldconfig && make || return 1 1.71 - strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox 1.72 - mv busybox busybox-pam 1.73 + # prepare busybox-pam package 1.74 + sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config 1.75 + make oldconfig && make || return 1 1.76 + strip --strip-unneeded -R .eh_frame -R .eh_frame_hdr busybox 1.77 + mv busybox busybox-pam 1.78 1.79 - # prepare busybox-static package 1.80 - cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config 1.81 - make oldconfig && make || return 1 1.82 - mv busybox busybox-static 1.83 + # prepare busybox-static package 1.84 + cp $stuff/$PACKAGE-${VERSION%.*}.config-static .config 1.85 + make oldconfig && make || return 1 1.86 + mv busybox busybox-static 1.87 1.88 - # prepare ssfs-busybox package 1.89 - rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs 1.90 - mkdir -p $rootfs/etc 1.91 - cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config 1.92 - make oldconfig && make busybox && 1.93 - make CONFIG_PREFIX=$rootfs install || return 1 1.94 - cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf 1.95 - chown -R 0.0 $rootfs/etc 1.96 - chmod 0600 $rootfs/etc/busybox.conf 1.97 - chmod 4755 $rootfs/bin/busybox 1.98 + # prepare ssfs-busybox package 1.99 + rootfs=$src/ssfs-busybox/usr/share/ssfs/rootfs 1.100 + mkdir -p $rootfs/etc 1.101 + cp $stuff/$PACKAGE-${VERSION%.*}.config-ssfs .config 1.102 + make oldconfig && make busybox && 1.103 + make CONFIG_PREFIX=$rootfs install || return 1 1.104 + cp $stuff/busybox.conf-ssfs $rootfs/etc/busybox.conf 1.105 + chown -R 0.0 $rootfs/etc 1.106 + chmod 0600 $rootfs/etc/busybox.conf 1.107 + chmod 4755 $rootfs/bin/busybox ;; 1.108 + esac 1.109 +} 1.110 + 1.111 +# Cross compilation check. 1.112 +testsuite() 1.113 +{ 1.114 + readelf -h $src/_install/bin/busybox 1.115 } 1.116 1.117 # Rules to gen a SliTaz package suitable for Tazpkg. 1.118 @@ -87,7 +113,7 @@ 1.119 cp -a $src/_install/* $fs 1.120 rm -f $fs/bin/bbconfig $fs/usr/bin/ar 1.121 mkdir -p $fs/etc/init.d $fs/var 1.122 - 1.123 + 1.124 # Busybox config files. 1.125 for f in busybox.conf dnsd.conf udhcpd.conf inetd.conf httpd.conf zcip.script 1.126 do 1.127 @@ -101,12 +127,12 @@ 1.128 cp $stuff/daemon $fs/etc/init.d 1.129 DAEMON="crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd udhcpd zcip" 1.130 for i in $DAEMON; do 1.131 - grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config && 1.132 + grep -qi config_$i=y $stuff/$PACKAGE-${VERSION%.*}.config && 1.133 ln -s daemon $fs/etc/init.d/$i 1.134 done 1.135 rm $fs/linuxrc 1.136 mkdir -p $fs/etc/modprobe.d 1.137 - 1.138 + 1.139 # Udhcpc stuff. 1.140 mkdir -p $fs/usr/share/udhcpc 1.141 cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script 1.142 @@ -116,21 +142,18 @@ 1.143 cp -a $stuff/www $fs/var 1.144 } 1.145 1.146 -# Force glibc-2.7 reinstall if 2.3.6 still in use. 1.147 +# GNU utils stuff. 1.148 pre_install() 1.149 { 1.150 local i 1.151 cp -a /etc/resolv.conf /etc/resolv.conf-busybox-install 1.152 - if grep -q 'VERSION="2.3.6"' /var/lib/tazpkg/installed/glibc-base/receipt; then 1.153 - tazpkg get-install glibc-base --forced 1.154 - fi 1.155 answer="" 1.156 for i in $(cat $1$INSTALLED/$PACKAGE/files.list); do 1.157 [ -f $1$i ] || continue 1.158 case "$i" in 1.159 - /bin/busybox) continue ;; 1.160 - *bin/*) ;; 1.161 - *) continue ;; 1.162 + /bin/busybox) continue ;; 1.163 + *bin/*) ;; 1.164 + *) continue ;; 1.165 esac 1.166 if [ -z "$answer" ]; then 1.167 echo -n "Keep installed GNU utilities ? "