diff options
Diffstat (limited to 'packages/busybox')
-rw-r--r-- | packages/busybox/switchbox-1.00/defconfig | 357 | ||||
-rw-r--r-- | packages/busybox/switchbox-1.00/linuxrc | 81 | ||||
-rw-r--r-- | packages/busybox/switchbox_1.00.bb | 51 |
3 files changed, 489 insertions, 0 deletions
diff --git a/packages/busybox/switchbox-1.00/defconfig b/packages/busybox/switchbox-1.00/defconfig index e69de29bb2..222ff1338a 100644 --- a/packages/busybox/switchbox-1.00/defconfig +++ b/packages/busybox/switchbox-1.00/defconfig @@ -0,0 +1,357 @@ +# +# Automatically generated make config: don't edit +# +HAVE_DOT_CONFIG=y + +# +# General Configuration +# +# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set +CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +# CONFIG_FEATURE_VERBOSE_USAGE is not set +# CONFIG_FEATURE_INSTALLER is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_FEATURE_DEVPTS is not set +# CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_FEATURE_SUID is not set +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_SELINUX is not set + +# +# Build Options +# +CONFIG_STATIC=y +CONFIG_LFS=y +USING_CROSS_COMPILER=y +CROSS_COMPILER_PREFIX="armv5b-softfloat-linux-" +EXTRA_CFLAGS_OPTIONS="" + +# +# Installation Options +# +CONFIG_INSTALL_NO_USR=y +PREFIX="/" + +# +# Archival Utilities +# +# CONFIG_AR is not set +# CONFIG_BUNZIP2 is not set +# CONFIG_CPIO is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_GUNZIP is not set +# CONFIG_GZIP is not set +# CONFIG_RPM2CPIO is not set +# CONFIG_RPM is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_GZIP=y +# CONFIG_UNCOMPRESS is not set +# CONFIG_UNZIP is not set + +# +# Coreutils +# +# CONFIG_BASENAME is not set +# CONFIG_CAL is not set +CONFIG_CAT=y +# CONFIG_CHGRP is not set +# CONFIG_CHMOD is not set +# CONFIG_CHOWN is not set +# CONFIG_CHROOT is not set +# CONFIG_CMP is not set +CONFIG_CP=y +# CONFIG_CUT is not set +# CONFIG_DATE is not set +CONFIG_DD=y +CONFIG_DF=y +# CONFIG_DIRNAME is not set +# CONFIG_DOS2UNIX is not set +# CONFIG_DU is not set +CONFIG_ECHO=y +# CONFIG_ENV is not set +# CONFIG_EXPR is not set +# CONFIG_FALSE is not set +# CONFIG_FOLD is not set +# CONFIG_HEAD is not set +# CONFIG_HOSTID is not set +# CONFIG_ID is not set +# CONFIG_INSTALL is not set +# CONFIG_LENGTH is not set +CONFIG_LN=y +# CONFIG_LOGNAME is not set +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +CONFIG_FEATURE_AUTOWIDTH=y +CONFIG_MD5SUM=y +CONFIG_MKDIR=y +# CONFIG_MKFIFO is not set +# CONFIG_MKNOD is not set +# CONFIG_MV is not set +# CONFIG_OD is not set +# CONFIG_PRINTF is not set +# CONFIG_PWD is not set +# CONFIG_REALPATH is not set +CONFIG_RM=y +# CONFIG_RMDIR is not set +# CONFIG_SEQ is not set +# CONFIG_SHA1SUM is not set +CONFIG_SLEEP=y +# CONFIG_SORT is not set +# CONFIG_STTY is not set +# CONFIG_SYNC is not set +# CONFIG_TAIL is not set +# CONFIG_TEE is not set +CONFIG_TEST=y + +# +# test (forced enabled for use with shell) +# +# CONFIG_FEATURE_TEST_64 is not set +# CONFIG_TOUCH is not set +# CONFIG_TR is not set +# CONFIG_TRUE is not set +# CONFIG_TTY is not set +# CONFIG_UNAME is not set +# CONFIG_UNIQ is not set +# CONFIG_USLEEP is not set +# CONFIG_UUDECODE is not set +# CONFIG_UUENCODE is not set +# CONFIG_WATCH is not set +# CONFIG_WC is not set +# CONFIG_WHO is not set +# CONFIG_WHOAMI is not set +# CONFIG_YES is not set + +# +# Console Utilities +# +# CONFIG_CHVT is not set +# CONFIG_CLEAR is not set +# CONFIG_DEALLOCVT is not set +# CONFIG_DUMPKMAP is not set +# CONFIG_LOADFONT is not set +# CONFIG_LOADKMAP is not set +# CONFIG_OPENVT is not set +# CONFIG_RESET is not set +# CONFIG_SETKEYCODES is not set + +# +# Debian Utilities +# +# CONFIG_MKTEMP is not set +# CONFIG_PIPE_PROGRESS is not set +# CONFIG_READLINK is not set +# CONFIG_RUN_PARTS is not set +# CONFIG_START_STOP_DAEMON is not set +# CONFIG_WHICH is not set + +# +# Editors +# +# CONFIG_AWK is not set +# CONFIG_PATCH is not set +CONFIG_SED=y +CONFIG_VI=y +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_YANKMARK=y + +# +# Finding Utilities +# +# CONFIG_FIND is not set +# CONFIG_GREP is not set +# CONFIG_XARGS is not set + +# +# Init Utilities +# +# CONFIG_INIT is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_INITRD is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +# CONFIG_FEATURE_EXTRA_QUIET is not set +# CONFIG_HALT is not set +# CONFIG_POWEROFF is not set +CONFIG_REBOOT=y +# CONFIG_MESG is not set + +# +# Login/Password Management Utilities +# +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_ADDGROUP is not set +# CONFIG_DELGROUP is not set +# CONFIG_ADDUSER is not set +# CONFIG_DELUSER is not set +# CONFIG_GETTY is not set +# CONFIG_LOGIN is not set +# CONFIG_PASSWD is not set +# CONFIG_SU is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Miscellaneous Utilities +# +# CONFIG_ADJTIMEX is not set +# CONFIG_CROND is not set +# CONFIG_CRONTAB is not set +# CONFIG_DC is not set +# CONFIG_DEVFSD is not set +# CONFIG_LAST is not set +# CONFIG_HDPARM is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_MT is not set +CONFIG_RX=y +# CONFIG_STRINGS is not set +# CONFIG_TIME is not set +# CONFIG_WATCHDOG is not set + +# +# Linux Module Utilities +# +CONFIG_INSMOD=y +CONFIG_FEATURE_2_4_MODULES=y +CONFIG_FEATURE_2_6_MODULES=y +# CONFIG_LSMOD is not set +# CONFIG_MODPROBE is not set +# CONFIG_RMMOD is not set + +# +# Networking Utilities +# +# CONFIG_FEATURE_IPV6 is not set +# CONFIG_ARPING is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_HOSTNAME is not set +# CONFIG_HTTPD is not set +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +CONFIG_FEATURE_IFCONFIG_HW=y +# CONFIG_IFUPDOWN is not set +# CONFIG_INETD is not set +# CONFIG_IP is not set +# CONFIG_IPCALC is not set +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_NAMEIF is not set +# CONFIG_NC is not set +# CONFIG_NETSTAT is not set +# CONFIG_NSLOOKUP is not set +CONFIG_PING=y +CONFIG_ROUTE=y +# CONFIG_TELNET is not set +CONFIG_TELNETD=y +CONFIG_TFTP=y +CONFIG_FEATURE_TFTP_GET=y +# CONFIG_TRACEROUTE is not set +# CONFIG_VCONFIG is not set +CONFIG_WGET=y +CONFIG_FEATURE_WGET_STATUSBAR=y + +# +# udhcp Server/Client +# +# CONFIG_UDHCPD is not set +# CONFIG_UDHCPC is not set + +# +# Process Utilities +# +# CONFIG_FREE is not set +# CONFIG_KILL is not set +# CONFIG_PIDOF is not set +# CONFIG_PS is not set +# CONFIG_RENICE is not set +# CONFIG_TOP is not set +# CONFIG_UPTIME is not set +# CONFIG_SYSCTL is not set + +# +# Another Bourne-like Shell +# +CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_FEATURE_SH_IS_HUSH is not set +# CONFIG_FEATURE_SH_IS_LASH is not set +# CONFIG_FEATURE_SH_IS_MSH is not set +# CONFIG_FEATURE_SH_IS_NONE is not set +CONFIG_ASH=y + +# +# Ash Shell Options +# +# CONFIG_ASH_JOB_CONTROL is not set +# CONFIG_ASH_ALIAS is not set +# CONFIG_ASH_MATH_SUPPORT is not set +# CONFIG_ASH_GETOPTS is not set +# CONFIG_ASH_CMDCMD is not set +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +# CONFIG_ASH_RANDOM_SUPPORT is not set +# CONFIG_HUSH is not set +# CONFIG_LASH is not set +# CONFIG_MSH is not set + +# +# Bourne Shell Options +# +# CONFIG_FEATURE_SH_EXTRA_QUIET is not set +# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set +CONFIG_FEATURE_COMMAND_EDITING=y +CONFIG_FEATURE_COMMAND_HISTORY=63 +CONFIG_FEATURE_COMMAND_TAB_COMPLETION=y + +# +# System Logging Utilities +# +# CONFIG_SYSLOGD is not set +# CONFIG_LOGGER is not set + +# +# Linux System Utilities +# +# CONFIG_DMESG is not set +# CONFIG_FBSET is not set +# CONFIG_FDFLUSH is not set +# CONFIG_FDFORMAT is not set +# CONFIG_FDISK is not set +# FDISK_SUPPORT_LARGE_DISKS is not set +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +# CONFIG_MKFS_MINIX is not set +# CONFIG_GETOPT is not set +CONFIG_HEXDUMP=y +# CONFIG_HWCLOCK is not set +# CONFIG_LOSETUP is not set +# CONFIG_MKSWAP is not set +# CONFIG_MORE is not set +CONFIG_PIVOT_ROOT=y +# CONFIG_RDATE is not set +# CONFIG_SWAPONOFF is not set +CONFIG_MOUNT=y +# CONFIG_NFSMOUNT is not set +CONFIG_UMOUNT=y +# CONFIG_FEATURE_MOUNT_FORCE is not set + +# +# Common options for mount/umount +# +# CONFIG_FEATURE_MOUNT_LOOP is not set +# CONFIG_FEATURE_MTAB_SUPPORT is not set + +# +# Debugging Options +# +# CONFIG_DEBUG is not set diff --git a/packages/busybox/switchbox-1.00/linuxrc b/packages/busybox/switchbox-1.00/linuxrc index e69de29bb2..6361636b67 100644 --- a/packages/busybox/switchbox-1.00/linuxrc +++ b/packages/busybox/switchbox-1.00/linuxrc @@ -0,0 +1,81 @@ +#!/bin/sh + +mounted= + +/bin/mount -t proc proc /proc +/bin/echo "0x0100" > /proc/sys/kernel/real-root-dev + +if [ -z "$mounted" ] && /bin/mount -rt jffs2 /dev/mtdblock4 /mnt/tmpmnt ; then + + if [ -x /mnt/tmpmnt/sbin/init -o -x /mnt/tmpmnt/bin/init ] ; then + if [ -f /mnt/tmpmnt/.recovery ] ; then + mounted= + elif [ -f /mnt/tmpmnt/.ramdisk ] ; then + /bin/dd if=/dev/zero of=/dev/ram1 bs=1k count=10k + /bin/mkdir /lib + /bin/ln -s /mnt/tmpmnt/lib/* /lib + /bin/mkdir /usr/bin + /bin/ln -s /mnt/tmpmnt/usr/bin/mke2fs /usr/bin + /bin/ln -s /mnt/tmpmnt/usr/bin/find /usr/bin + /bin/ln -s /mnt/tmpmnt/usr/bin/cpio /usr/bin + /usr/bin/mke2fs -m 0 /dev/ram1 10240 + /bin/mkdir /mnt/tmpmnt2 + /bin/mount -t ext2 /dev/ram1 /mnt/tmpmnt2 + ( cd /mnt/tmpmnt ; /usr/bin/find . -print0 -mount | /usr/bin/cpio -p -0 -d -m -u /mnt/tmpmnt2 ) + /bin/cp /mnt/tmpmnt2/home/httpd/html/Management/upgrade.cgi /mnt/tmpmnt2/home/httpd/html/Management/upgrade-real.cgi + /bin/echo "#!/bin/sh" > /mnt/tmpmnt2/home/httpd/html/Management/upgrade.cgi + /bin/echo >> /mnt/tmpmnt2/home/httpd/html/Management/upgrade.cgi + /bin/echo "/bin/mount -t ramfs none /upload -o size=8196 2>/dev/null" \ + >> /mnt/tmpmnt2/home/httpd/html/Management/upgrade.cgi + /bin/echo "/bin/dd if=/dev/zero of=/upload/free-ram bs=1k count=8k 2>/dev/null" \ + >> /mnt/tmpmnt2/home/httpd/html/Management/upgrade.cgi + /bin/echo "/bin/umount /upload 2>/dev/null" \ + >> /mnt/tmpmnt2/home/httpd/html/Management/upgrade.cgi + /bin/echo "exec /home/httpd/html/Management/upgrade-real.cgi" \ + >> /mnt/tmpmnt2/home/httpd/html/Management/upgrade.cgi + /bin/umount /mnt/tmpmnt2 + /bin/rm -rf /mnt/tmpmnt2 + /bin/echo "Root filesystem will be mounted from /dev/ram1 (a copy of /dev/mtdblock4) ..." + /bin/echo "0x0101" > /proc/sys/kernel/real-root-dev + mounted=/mnt/tmpmnt + else + /bin/echo "Root filesystem will be mounted from /dev/mtdblock4 ..." + /bin/echo "0x1f04" > /proc/sys/kernel/real-root-dev + mounted=/mnt/tmpmnt + fi + fi + + /bin/umount /mnt/tmpmnt +fi + +if [ -z "$mounted" ] ; then + + if [ -x /mnt/tmpmnt/sbin/init -o -x /mnt/tmpmnt/bin/init ] ; then + /bin/echo "Root filesystem will be mounted from /dev/ram0 ..." + mounted=/mnt/tmpmnt + /bin/echo "0x0100" > /proc/sys/kernel/real-root-dev + fi +fi + +if [ -z "$mounted" ] ; then + /bin/echo "Root filesystem cannot be found - dropping into shell ..." + + /bin/echo "5" > /proc/sys/kernel/panic + + device=/dev/`/bin/sed -n -e 's/^\(mtd[0-9]*\): .* "FIS directory"/\1/p' /proc/mtd` + length=`/bin/dd if=$device bs=2 skip=2048 | /bin/hexdump -n 4 -e '4/1 "%02X"' $device` + + if ( [ "$length" != "FFFFFFFF" ] ); then + /bin/dd if=$device bs=2 skip=2056 | /bin/tar zxvf - + /sbin/insmod ixp400 + /sbin/insmod ixp425_eth + /sbin/ifconfig ixp0 up 192.168.1.77 netmask 255.255.0.0 + /sbin/telnetd + fi + + exec /bin/sh +fi + +/bin/umount /proc + +exit 0 diff --git a/packages/busybox/switchbox_1.00.bb b/packages/busybox/switchbox_1.00.bb index e69de29bb2..026a6ab299 100644 --- a/packages/busybox/switchbox_1.00.bb +++ b/packages/busybox/switchbox_1.00.bb @@ -0,0 +1,51 @@ +DESCRIPTION = "SwitchBox version ${PV}. \ +SwitchBox is a minimal version of BusyBox with just enough functionality \ +to switch between different root filesystem options on an Unslung NSLU2 device." +HOMEPAGE = "http://www.busybox.net" +LICENSE = "GPL" +SECTION = "base" +PRIORITY = "required" +PR = "r4" + +SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ + file://defconfig \ + file://linuxrc \ + file://switchbox.patch;patch=1 \ + file://telnetd-autologin.patch;patch=1" + +S = "${WORKDIR}/busybox-${PV}" + +python () { + # Don't build switchbox unless we're targeting an nslu2 + if bb.data.getVar("MACHINE", d, 1) != "nslu2": + raise bb.parse.SkipPackage("switchbox only builds for the Linksys NSLU2") +} + +LDFLAGS =+ "-static" + +export EXTRA_CFLAGS = "${CFLAGS}" +EXTRA_OEMAKE_append = " CROSS=${HOST_PREFIX}" + +PACKAGES = "${PN}" +FILES_${PN} = "/" +FILES_${PN}-doc = "" +FILES_${PN}-dev = "" +FILES_${PN}-locale = "" + +inherit cml1 + +do_configure () { + install -m 0644 ${WORKDIR}/defconfig ${S}/.config + cml1_do_configure +} + +do_compile () { + unset CFLAGS + base_do_compile +} + +do_install () { + oe_runmake 'PREFIX=${D}' install + install -m 0755 ${WORKDIR}/linuxrc ${D}/ + mkdir -p ${D}/proc ${D}/mnt/tmpmnt +} |