Mercurial > vanilla
diff core/busybox/busybox.sh @ 1216:6710613b88b9
misc: remove build function
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 29 Sep 2021 13:49:32 +0200 |
parents | 2fafcd07edb0 |
children | 4ccc42bf0284 |
line wrap: on
line diff
--- a/core/busybox/busybox.sh Wed Jul 28 15:24:46 2021 +0200 +++ b/core/busybox/busybox.sh Wed Sep 29 13:49:32 2021 +0200 @@ -41,96 +41,93 @@ : ${SELINUX:=no} : ${STATIC:=yes} -build() -{ - rm -rf $PKGNAME-$PKGVERSION - tar xvf $PKGNAME-$PKGVERSION.tar.bz2 - cd $PKGNAME-$PKGVERSION - - # - # Allow user to specify a full config if specified, otherwise change - # package options. - # - if [ -n "$CONFIG" ] && [ -r "$CONFIG" ]; then - cp $CONFIG .config +rm -rf $PKGNAME-$PKGVERSION +tar xvf $PKGNAME-$PKGVERSION.tar.bz2 +cd $PKGNAME-$PKGVERSION - # - # When specifying a config file, force other selective options - # to a dummy value to avoid incorrect information in package - # file. - # - IPV6="" - SELINUX="" - PAM="" - STATIC="" - else - cp ../config .config - - if [ "$SELINUX" = "yes" ]; then - echo "CONFIG_SELINUX=y" >> .config - echo "CONFIG_FEATURE_TAR_SELINUX=y" >> .config - echo "CONFIG_SELINUXENABLED=y" >> .config - fi - - if [ "$PAM" = "yes" ]; then - echo "CONFIG_PAM=y" >> .config - fi - - if [ "$IPV6" != "yes" ]; then - sed -i -e "/CONFIG_FEATURE_IPV6=y/ s/y/n/" .config - sed -i -e "/CONFIG_FEATURE_IFUPDOWN_IPV6=y/ s/y/n/" .config - fi - - if [ "$STATIC" = "yes" ]; then - echo "CONFIG_STATIC=y" >> .config - fi - fi +# +# Allow user to specify a full config if specified, otherwise change +# package options. +# +if [ -n "$CONFIG" ] && [ -r "$CONFIG" ]; then + cp $CONFIG .config # - # Our start script is located in /etc/rc.init. - # Upstream: rejected a tunable option. - # - sed -i -e 's|/etc/init.d/rcS|/etc/rc.init|' init/init.c - - # - # Change the redirection limit which is too small for vpk download. - # Upstream: yes in Git. - # - sed -i -e "/redir_limit = 5/ s/5/16/" networking/wget.c - - # - # TODO: this is temporary, to build under clang. - # - # CFLAGS="": fix build under clang by removing all non-standard - # options. - # - # -O0: disable optimizations for the same reasons. - # - # See http://lists.busybox.net/pipermail/busybox/2019-October/087558.html + # When specifying a config file, force other selective options + # to a dummy value to avoid incorrect information in package + # file. # - make \ - AR="$AR" \ - AS="$AS" \ - CC="$CC" \ - CFLAGS="-DBB_GLOBAL_CONST=''" \ - HOSTCC="$CC" \ - HOSTCFLAGS="" \ - EXTRA_CFLAGS="$CFLAGS -O0" \ - EXTRA_LDFLAGS="$LDFLAGS" \ - NM="$NM" \ - OBJCOPY="$OBJCOPY" \ - OBJDUMP="$OBJDUMP" \ - STRIP="$STRIP" \ - V=1 - install -Dm0755 busybox $DESTDIR/bin/busybox - install -dm0755 $DESTDIR/share/udhcp - install -m0644 examples/udhcp/sample.* $DESTDIR/share/udhcp - install -Dm0644 examples/udhcp/udhcpd.conf $DESTDIR/etc/udhcpd.conf - install -Dm0644 ../busybox.crond $DESTDIR/etc/rc.d/busybox.crond - install -Dm0644 ../busybox.klogd $DESTDIR/etc/rc.d/busybox.klogd - install -Dm0644 ../busybox.mdev $DESTDIR/etc/rc.d/busybox.mdev - install -Dm0644 ../busybox.syslogd $DESTDIR/etc/rc.d/busybox.syslogd + IPV6="" + SELINUX="" + PAM="" + STATIC="" +else + cp ../config .config + + if [ "$SELINUX" = "yes" ]; then + echo "CONFIG_SELINUX=y" >> .config + echo "CONFIG_FEATURE_TAR_SELINUX=y" >> .config + echo "CONFIG_SELINUXENABLED=y" >> .config + fi + + if [ "$PAM" = "yes" ]; then + echo "CONFIG_PAM=y" >> .config + fi + + if [ "$IPV6" != "yes" ]; then + sed -i -e "/CONFIG_FEATURE_IPV6=y/ s/y/n/" .config + sed -i -e "/CONFIG_FEATURE_IFUPDOWN_IPV6=y/ s/y/n/" .config + fi + + if [ "$STATIC" = "yes" ]; then + echo "CONFIG_STATIC=y" >> .config + fi +fi + +# +# Our start script is located in /etc/rc.init. +# Upstream: rejected a tunable option. +# +sed -i -e 's|/etc/init.d/rcS|/etc/rc.init|' init/init.c - cd .. - rm -rf $PKGNAME-$PKGVERSION -} +# +# Change the redirection limit which is too small for vpk download. +# Upstream: yes in Git. +# +sed -i -e "/redir_limit = 5/ s/5/16/" networking/wget.c + +# +# TODO: this is temporary, to build under clang. +# +# CFLAGS="": fix build under clang by removing all non-standard +# options. +# +# -O0: disable optimizations for the same reasons. +# +# See http://lists.busybox.net/pipermail/busybox/2019-October/087558.html +# +make \ + AR="$AR" \ + AS="$AS" \ + CC="$CC" \ + CFLAGS="-DBB_GLOBAL_CONST=''" \ + HOSTCC="$CC" \ + HOSTCFLAGS="" \ + EXTRA_CFLAGS="$CFLAGS -O0" \ + EXTRA_LDFLAGS="$LDFLAGS" \ + NM="$NM" \ + OBJCOPY="$OBJCOPY" \ + OBJDUMP="$OBJDUMP" \ + STRIP="$STRIP" \ + V=1 +install -Dm0755 busybox $DESTDIR/bin/busybox +install -dm0755 $DESTDIR/share/udhcp +install -m0644 examples/udhcp/sample.* $DESTDIR/share/udhcp +install -Dm0644 examples/udhcp/udhcpd.conf $DESTDIR/etc/udhcpd.conf +install -Dm0644 ../busybox.crond $DESTDIR/etc/rc.d/busybox.crond +install -Dm0644 ../busybox.klogd $DESTDIR/etc/rc.d/busybox.klogd +install -Dm0644 ../busybox.mdev $DESTDIR/etc/rc.d/busybox.mdev +install -Dm0644 ../busybox.syslogd $DESTDIR/etc/rc.d/busybox.syslogd + +cd .. +rm -rf $PKGNAME-$PKGVERSION