# $Id$ PNAME="busybox" PVER="1.20.2" PBUILD="r1" PCAT="sys-apps" DESCRIPTION="BusyBox combines tiny versions of many common UNIX utilities into a single small executable." HOMEPAGE="http://www.busybox.net/" # shared busybox needs glibc DEPEND=">= virtual/glibc" PROVIDE="virtual/sed virtual/tar virtual/usbutils virtual/pciutils virtual/debianutils virtual/which virtual/wget virtual/grep virtual/bzip2 virtual/gzip virtual/syslog virtual/less virtual/net-tools virtual/inetutils virtual/kbd virtual/procps virtual/psmisc virtual/dhcp virtual/cron virtual/xz-utils" # busbox config CVS revision CFG_CVS_REV=1.15 # udhcpc client script CVS revision UDHCPC_CVS_REV=1.1 # syslogd.rc cvs revision SYSLOGD_CVS_REV=1.4 # splash.conf cvs revision SPLASHCONF_CVS_REV=1.4 # splash-functions.rc cvs revision SPLASHRC_CVS_REV=1.6 SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" MISC_PVER="0.1.8" MISC_SRCFILE="miscsplashutils-${MISC_PVER}.tar.bz2" MISC_SRCDIR="${BUILDDIR}/miscsplashutils-${MISC_PVER}" SPLASHTHEME_PVER="1.0" SPLASHTHEME_SRCFILE="alx-theme-busybox-${SPLASHTHEME_PVER}.tar.bz2" SPLASHTHEME_SRCDIR="${BUILDDIR}/alx-theme-busybox-${SPLASHTHEME_PVER}" sminclude mtools alx SRC_URI=( http://www.busybox.net/downloads/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/config-${CFG_CVS_REV} mirror://${PNAME}/udhcpc.sh-${UDHCPC_CVS_REV} mirror://${PNAME}/de.kmap.gz mirror://${PNAME}/syslogd.rc-${SYSLOGD_CVS_REV} mirror://${PNAME}/syslog.conf mirror://${PNAME}/crond.rc mirror://${PNAME}/${PNAME}-1.15.3-flags.patch mirror://${PNAME}/${PNAME}-1.20.2-tar-seamless-xz.patch mirror://${PNAME}/splash-functions.rc-${SPLASHRC_CVS_REV} mirror://${PNAME}/splash.conf-${SPLASHCONF_CVS_REV} mirror://${PNAME}/${PNAME}-1.20.2-fbsplash-tykef-1.0.patch mirror://${PNAME}/${PNAME}-1.17.4-fbsplash-reload-background-image.patch http://dev.gentoo.org/~spock/projects/gensplash/current/${MISC_SRCFILE} mirror://${PNAME}/${MISC_SRCFILE} mirror://${PNAME}/${SPLASHTHEME_SRCFILE} ) src_prepare() { munpack ${SRCFILE} || die munpack de.kmap.gz ${SRCDIR} || die munpack ${MISC_SRCFILE} || die munpack ${SPLASHTHEME_SRCFILE} || die cd ${SRCDIR} # official patches # magellan patches # remove broken cflags mpatch ${PNAME}-1.15.3-flags.patch || die # seamless xz uncompression support in tar (tar -J) mpatch ${PNAME}-1.20.2-tar-seamless-xz.patch || die # enhanced fbsplash from tykef # http://tykef.havlinda.net/programovani/fbsplash/ mpatch ${PNAME}-1.20.2-fbsplash-tykef-1.0.patch || die # fbsplash: adds 'image:' cmd to be able to reload the background image # requires the tykef patch mpatch ${PNAME}-1.17.4-fbsplash-reload-background-image.patch || die # using a custom config cp ${SOURCEDIR}/${PNAME}/config-${CFG_CVS_REV} .config || die # hotfix for glibc-2.14, rpc interface not supported anymore #sed -i 's/.*\(CONFIG_FEATURE_MOUNT_NFS\).*/#\ \1 is not set/' .config || die } src_compile() { cd ${SRCDIR} make oldconfig || die mmake || die # create a busybox.links file HOSTCC=gcc sh applets/busybox.mkll | sort > busybox.links || die # do not use ash as default sh, we want bin/bash sed -i '/bin\/sh/d' busybox.links || die # use poweroff as default halt command sed -i '/sbin\/halt/d' busybox.links || die echo -e '#!/bin/sh\n/sbin/poweroff $*' > halt.sh || die # remove some applet symlinks which are provided by other packages ### patch sed -i '/usr\/bin\/patch/d' busybox.links || die ### e2fsprogs sed -i '/sbin\/fsck/d' busybox.links || die sed -i '/sbin\/mke2fs/d' busybox.links || die sed -i '/sbin\/mkfs.ext2/d' busybox.links || die sed -i '/sbin\/tune2fs/d' busybox.links || die ### binutils sed -i '/usr\/bin\/ar/d' busybox.links || die sed -i '/usr\/bin\/strings/d' busybox.links || die ### diffutils sed -i '/usr\/bin\/cmp/d' busybox.links || die ### umount (use from util-linux, need -t option) sed -i '/bin\/umount/d' busybox.links || die # honor usr move sed -i -e 's:^/bin:/usr/bin:' -e 's:^/sbin:/usr/sbin:' busybox.links || die cd ${MISC_SRCDIR} mmake fbres || die } src_install() { cd ${SRCDIR} minstallexec busybox || die # set suid bit for suid applets like su mchmod +s /usr/bin/busybox || die minstalldir /usr/sbin || die minstallexec halt.sh /usr/sbin/halt || die minstalldir /usr/share/busybox || die minstallfile busybox.links /usr/share/busybox || die minstalldir /usr/share/busybox/keymaps || die minstallfile de.kmap /usr/share/busybox/keymaps || die minstalldir /usr/share/udhcpc || die minstallexec -s udhcpc.sh-${UDHCPC_CVS_REV} /usr/share/udhcpc/default.script || die # install syslogd rc script and config minstallrc syslogd.rc-${SYSLOGD_CVS_REV} syslogd || die minstallfile -s syslog.conf /etc/syslog.conf || die # install crond rc script and keep needed directories minstallrc crond.rc crond || die mkeepdir /var/spool/cron/crontabs || die # install splash-functions minstallrc splash-functions.rc-${SPLASHRC_CVS_REV} splash-functions || die minstalldir /etc/splash || die minstallfile -s splash.conf-${SPLASHCONF_CVS_REV} /etc/splash/splash.conf || die minstalldir /dev || die mkfifo ${BINDIR}/dev/splashfifo || die # install fbres for splash minstallexec ${MISC_SRCDIR}/fbres || die # install fbsplash theme cd ${SPLASHTHEME_SRCDIR} make DESTDIR=${BINDIR} install || die # set alx theme as default mlink alx /etc/splash/themes/default || die # disable config_protection for themes minstalldir /etc/env.d || die echo "CONFIG_PROTECT_MASK=/etc/splash/themes" > ${BINDIR}/etc/env.d/15splash || die # use vt12 for bootsplash and enable SPLASH_X11_TTY for vt03 to supress flickers sed -i 's:#SPLASH_X11_TTY=:SPLASH_X11_TTY=:' ${BINDIR}/etc/splash/splash.conf || die sed -i 's:^\(SPLASH_X11_TTY=\).*:\1"3":' ${BINDIR}/etc/splash/splash.conf || die sed -i 's:^\(SPLASH_TTY=\).*:\1"12":' ${BINDIR}/etc/splash/splash.conf || die } preinstall() { add_conf_prot_mask /etc/rc.d/init.d /etc/splash/themes /etc/splash/splash.conf /etc/env.d } postinstall() { if [ -x ${MROOT}/usr/bin/busybox ] then echo "Setting suid bit for ${MROOT}/usr/bin/busybox" chmod +s ${MROOT}/usr/bin/busybox fi if [ -f ${MROOT}/usr/share/busybox/busybox.links ] then echo "Setting up busybox links ... " local i for i in $(< ${MROOT}/usr/share/busybox/busybox.links) do ln -snf /usr/bin/busybox ${MROOT}/${i} done fi if [[ ! -p ${MROOT}/dev/splashfifo ]] then mkfifo ${MROOT}/dev/splashfifo fi # run syslogd *after* creating the busybox symlinks! mstartservice syslogd # check if intel fb quirk is required if [[ -x ${MROOT}/usr/sbin/alx-hwdetection ]] then local fbdev="$(${MROOT}/usr/sbin/alx-hwdetection intel-fb-quirk)" if [[ ${fbdev} -ge 0 ]] then sed -i "s:^\(SPLASH_DEV=\).*:\1\"/dev/fb${fbdev}\":" ${MROOT}/etc/splash/splash.conf || die fi fi } postremove() { mstopservice syslogd }