From 5eccfb8fa47f3bb6a55252bbe4cc7e108f9c410d Mon Sep 17 00:00:00 2001 From: Rod Whitby Date: Wed, 4 Jan 2006 12:08:04 +0000 Subject: unslung: Usability updates for Unslung 6.x - ipkg prints message when booted on flash, motd prints at login indicating status of on-disk or on-flash, status appears on home page in web interface, unsling now asks for root password, and some additional checks are made by unsling to avoid known problems that can prevent a successful unsling, added new unslung logo. --- conf/distro/unslung.conf | 8 +- packages/linux/unslung-kernel_2.4.22.l2.3r25.bb | 34 ------ packages/meta/unslung-image.bb | 40 +++++-- .../nslu2-linksys-firmware_2.3r25.bb | 24 ---- .../nslu2-binary-only/nslu2-linksys-libs_2.3r25.bb | 23 ---- .../nslu2-binary-only/nslu2-linksys-libs_2.3r63.bb | 4 +- .../nslu2-linksys-ramdisk_2.3r25.bb | 20 ---- .../nslu2-linksys-ramdisk_2.3r63.bb | 4 +- .../unslung-rootfs-2.3r63/ipkg-fl | 11 ++ .../unslung-rootfs-2.3r63/linuxrc | 10 +- .../unslung-rootfs-2.3r63/motd-fl | 11 ++ .../unslung-rootfs-2.3r63/motd-un | 4 + .../unslung-rootfs-2.3r63/unsling | 132 +++++++++++++++++++-- .../unslung-rootfs/rc.1-diversion.patch | 2 +- .../unslung-rootfs/rc.halt-diversion.patch | 2 +- .../unslung-rootfs/rc.optware-start | 27 +++++ .../unslung-rootfs/rc.optware-stop | 27 +++++ .../unslung-rootfs/rc.reboot-diversion.patch | 2 +- .../unslung-rootfs/rc.unslung-start | 27 ----- .../unslung-rootfs/rc.unslung-stop | 27 ----- .../nslu2-binary-only/unslung-rootfs/unslung.gif | Bin 0 -> 4854 bytes .../nslu2-binary-only/unslung-rootfs_2.3r25.bb | 117 ------------------ .../nslu2-binary-only/unslung-rootfs_2.3r63.bb | 53 +++++---- 23 files changed, 282 insertions(+), 327 deletions(-) delete mode 100644 packages/linux/unslung-kernel_2.4.22.l2.3r25.bb delete mode 100644 packages/nslu2-binary-only/nslu2-linksys-firmware_2.3r25.bb delete mode 100644 packages/nslu2-binary-only/nslu2-linksys-libs_2.3r25.bb delete mode 100644 packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r25.bb create mode 100755 packages/nslu2-binary-only/unslung-rootfs-2.3r63/ipkg-fl create mode 100644 packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-fl create mode 100644 packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-un create mode 100755 packages/nslu2-binary-only/unslung-rootfs/rc.optware-start create mode 100755 packages/nslu2-binary-only/unslung-rootfs/rc.optware-stop delete mode 100755 packages/nslu2-binary-only/unslung-rootfs/rc.unslung-start delete mode 100755 packages/nslu2-binary-only/unslung-rootfs/rc.unslung-stop create mode 100644 packages/nslu2-binary-only/unslung-rootfs/unslung.gif delete mode 100644 packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb diff --git a/conf/distro/unslung.conf b/conf/distro/unslung.conf index 1777135a0d..5a88ac9c72 100644 --- a/conf/distro/unslung.conf +++ b/conf/distro/unslung.conf @@ -3,7 +3,7 @@ #@DESCRIPTION: Unslung Linux Distribution for the NSLU2 DISTRO_NAME = "Unslung" -DISTRO_VERSION = "6.2-alpha" +DISTRO_VERSION = "6.5-alpha" DISTRO_TYPE = "beta" FEED_URIS = "cross##http://ipkg.nslu2-linux.org/feeds/optware/nslu2/cross/stable" @@ -39,11 +39,7 @@ UNSLUNG_DEVICE_TABLE = "${@bb.which(bb.data.getVar('BBPATH', d, 1), 'files/devic EXTRA_IMAGECMD_jffs2 = "--pad --big-endian --eraseblock=0x20000 -D ${UNSLUNG_DEVICE_TABLE}" UNSLUNG_EXTRA_DEPENDS ?= "" -UNSLUNG_EXTRA_RDEPENDS ?= "\ -kernel-module-usbnet \ -kernel-module-pegasus kernel-module-kaweth \ -kernel-module-usbserial \ -kernel-module-pl2303 kernel-module-ftdi-sio" +UNSLUNG_EXTRA_RDEPENDS ?= "" UNSLUNG_EXTRA_INSTALL ?= "${UNSLUNG_EXTRA_RDEPENDS}" diff --git a/packages/linux/unslung-kernel_2.4.22.l2.3r25.bb b/packages/linux/unslung-kernel_2.4.22.l2.3r25.bb deleted file mode 100644 index 99bf69abf8..0000000000 --- a/packages/linux/unslung-kernel_2.4.22.l2.3r25.bb +++ /dev/null @@ -1,34 +0,0 @@ -SECTION = "kernel" - -include nslu2-linksys-kernel_2.4.22.bb - -DESCRIPTION = "Unslung kernel for the Linksys NSLU2 device" -MAINTAINER = "NSLU2 Linux " -PR = "r19" - -KERNEL_SUFFIX = "unslung" - -CMDLINE_ROOT = "root=/dev/mtdblock4 rootfstype=jffs2 rw init=/linuxrc mem=32M@0x00000000" - -UNSLUNG_KERNEL_EXTRA_SRC_URI ?= - -SRC_URI += "file://limit1gb.patch;patch=1 \ - file://gl811e.patch;patch=1 \ - file://ext3flash-on-disk1.patch;patch=1 \ - file://usbnet.patch;patch=1 \ - file://missing-usb-ioctls.patch;patch=1 \ - file://anonymiser.patch;patch=1 \ - file://ppp_mppe.patch;patch=1 \ - file://nfs-blocksize.patch;patch=1 \ - file://pl2303.patch;patch=1 \ - ${UNSLUNG_KERNEL_EXTRA_SRC_URI}" - -FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/unslung-kernel', '${FILE_DIRNAME}/nslu2-linksys-kernel-2.4.22', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}" - -python () { - # Don't build unslung kernel unless we're targeting an nslu2 - mach = bb.data.getVar("MACHINE", d, 1) - dist = bb.data.getVar("DISTRO", d, 1) - if mach != 'nslu2' or dist != 'unslung': - raise bb.parse.SkipPackage("Unslung only builds for the Linksys NSLU2") -} diff --git a/packages/meta/unslung-image.bb b/packages/meta/unslung-image.bb index f9fda0aedc..265986be50 100644 --- a/packages/meta/unslung-image.bb +++ b/packages/meta/unslung-image.bb @@ -1,5 +1,5 @@ LICENSE = MIT -PR = "r7" +PR = "r11" IMAGE_BASENAME = "unslung" @@ -7,13 +7,11 @@ IMAGE_LINGUAS = "" USE_DEVFS = "1" DEPENDS = "unslung-kernel unslung-rootfs \ - glibc slingbox ipkg wget cpio findutils portmap-unslung \ - devio \ + glibc slingbox ipkg cpio findutils \ ${UNSLUNG_EXTRA_DEPENDS}" IPKG_INSTALL = "unslung-rootfs \ - libc6-unslung slingbox ipkg wget cpio findutils portmap-unslung \ - devio \ + libc6-unslung slingbox ipkg cpio findutils \ ${UNSLUNG_EXTRA_INSTALL}" IMAGE_PREPROCESS_COMMAND += "unslung_clean_image; " @@ -31,10 +29,10 @@ unslung_clean_image () { rm -f ${IMAGE_ROOTFS}/${sysconfdir}/version # Tidy up some thing which are in the wrong place mv ${IMAGE_ROOTFS}${libdir}/libipkg* ${IMAGE_ROOTFS}/lib/ - # Remove the /lib/*.dat files cause they are too big - rm -f ${IMAGE_ROOTFS}/lib/*.dat # Remove the ipkg symlink - unsling puts it back in rm -f ${IMAGE_ROOTFS}${bindir}/ipkg + # and make the ipkg symlink point to the ipkg-fl utility instead. + ln -s ipkg-fl ${IMAGE_ROOTFS}${bindir}/ipkg # Hack out the modutils stuff - it's too hard to make it work rm -f ${IMAGE_ROOTFS}${libdir}/ipkg/info/update-modules.postinst rm -rf ${IMAGE_ROOTFS}/etc/rcS.d @@ -44,6 +42,34 @@ unslung_clean_image () { echo "#!/bin/sh" > ${IMAGE_ROOTFS}/sbin/depmod echo "exit 0" >> ${IMAGE_ROOTFS}/sbin/depmod chmod ugo+x ${IMAGE_ROOTFS}/sbin/depmod + ${STRIP} ${IMAGE_ROOTFS}/lib/libgcc_s.so.1 + chmod ugo+x ${IMAGE_ROOTFS}/lib/libgcc_s.so.1 + + # Remove some of the Samba codepages to make space + # 437 (USA) - keep + # 737 (Greek) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.737 + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/unicode_map.737 + # 850 (Latin1) - keep + # 852 (Latin2) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.852 + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/unicode_map.852 + # 861 (Iceland) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.861 + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/unicode_map.861 + # 866 (Russian) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.866 + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/unicode_map.866 + # 932 (Japanese Shift-JIS) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.932 + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/unicode_map.932 + # 936 (Simplified Chinese) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.936 + # 949 (Korean) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.949 + # 950 (Chinese BIG-5) + rm -f ${IMAGE_ROOTFS}/etc/samba/codepages/codepage.950 + # ISO8859-1 (Latin 1) - keep } python () { diff --git a/packages/nslu2-binary-only/nslu2-linksys-firmware_2.3r25.bb b/packages/nslu2-binary-only/nslu2-linksys-firmware_2.3r25.bb deleted file mode 100644 index afbb782252..0000000000 --- a/packages/nslu2-binary-only/nslu2-linksys-firmware_2.3r25.bb +++ /dev/null @@ -1,24 +0,0 @@ -SECTION = "base" -DEPENDS = "slugimage-native unzip-native" -PACKAGES = "" -LICENSE = "GPL" -INHIBIT_DEFAULT_DEPS = "1" -PR = "r3" - -SRC_URI = "ftp://ftp.linksys.com/pub/network/nslu2-fw-2.3r25.zip" -S = "${WORKDIR}" - -python () { - # Don't build unless we're targeting an nslu2 - if bb.data.getVar("MACHINE", d, 1) != "nslu2": - raise bb.parse.SkipPackage("NSLU2 firmware only builds for the Linksys NSLU2") -} - -do_compile () { - slugimage -u -i NSLU2_V23R25.bin -b RedBoot -s SysConf -r ramdisk.ext2.gz -t Trailer - install -d ${STAGING_LIBDIR}/nslu2-binaries - install -m 0755 RedBoot ${STAGING_LIBDIR}/nslu2-binaries/ - install -m 0755 SysConf ${STAGING_LIBDIR}/nslu2-binaries/ - install -m 0755 ramdisk.ext2.gz ${STAGING_LIBDIR}/nslu2-binaries/ - install -m 0755 Trailer ${STAGING_LIBDIR}/nslu2-binaries/ -} diff --git a/packages/nslu2-binary-only/nslu2-linksys-libs_2.3r25.bb b/packages/nslu2-binary-only/nslu2-linksys-libs_2.3r25.bb deleted file mode 100644 index b9fd20ac49..0000000000 --- a/packages/nslu2-binary-only/nslu2-linksys-libs_2.3r25.bb +++ /dev/null @@ -1,23 +0,0 @@ -DESCRIPTION = "Linksys NSLU2 Stock Firmware Libraries." -PACKAGE_ARCH = "nslu2" -SECTION = "base" -PRIORITY = "required" -PR = "r2" - -SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r25.tar.bz2" - -S = "${WORKDIR}/nslu2-linksys-ramdisk-2.3r25" - -do_install () { - ( cd ${S} ; rm -rf bin dev home mnt proc sbin share tmp upload usr var ) - ( cd ${S} ; tar cvf - . ) | ( cd ${D} ; tar xvf - ) -} - -PACKAGES = "${PN}" -FILES_${PN} = "/lib" - -python () { - # Don't build unless we're targeting an nslu2 - if bb.data.getVar("MACHINE", d, 1) != "nslu2": - raise bb.parse.SkipPackage("NSLU2 stock firmware libraries only builds for the Linksys NSLU2") -} diff --git a/packages/nslu2-binary-only/nslu2-linksys-libs_2.3r63.bb b/packages/nslu2-binary-only/nslu2-linksys-libs_2.3r63.bb index 2955f19ad0..1843de069c 100644 --- a/packages/nslu2-binary-only/nslu2-linksys-libs_2.3r63.bb +++ b/packages/nslu2-binary-only/nslu2-linksys-libs_2.3r63.bb @@ -2,9 +2,9 @@ DESCRIPTION = "Linksys NSLU2 Stock Firmware Libraries." PACKAGE_ARCH = "nslu2" SECTION = "base" PRIORITY = "required" -PR = "r1" +PR = "r2" -SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63.tar.bz2" +SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63-2.tar.bz2" S = "${WORKDIR}/nslu2-linksys-ramdisk-2.3r63" diff --git a/packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r25.bb b/packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r25.bb deleted file mode 100644 index f20a2779a3..0000000000 --- a/packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r25.bb +++ /dev/null @@ -1,20 +0,0 @@ -DESCRIPTION = "Linksys NSLU2 Stock Firmware Ramdisk." -PACKAGE_ARCH = "nslu2" -SECTION = "base" -PRIORITY = "required" -PR = "r1" - -SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r25.tar.bz2" - -do_install () { - ( cd ${S} ; tar cvf - . ) | ( cd ${D} ; tar xvf - ) -} - -PACKAGES = "${PN}" -FILES_${PN} = "/" - -python () { - # Don't build unless we're targeting an nslu2 - if bb.data.getVar("MACHINE", d, 1) != "nslu2": - raise bb.parse.SkipPackage("NSLU2 ramdisk only builds for the Linksys NSLU2") -} diff --git a/packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r63.bb b/packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r63.bb index 0fa7d69d54..007b19cbb2 100644 --- a/packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r63.bb +++ b/packages/nslu2-binary-only/nslu2-linksys-ramdisk_2.3r63.bb @@ -2,9 +2,9 @@ DESCRIPTION = "Linksys NSLU2 Stock Firmware Ramdisk." PACKAGE_ARCH = "nslu2" SECTION = "base" PRIORITY = "required" -PR = "r1" +PR = "r2" -SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63.tar.bz2" +SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63-2.tar.bz2" do_install () { ( cd ${S} ; tar cvf - . ) | ( cd ${D} ; tar xvf - ) diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/ipkg-fl b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/ipkg-fl new file mode 100755 index 0000000000..514ccd4ec8 --- /dev/null +++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/ipkg-fl @@ -0,0 +1,11 @@ +#! /bin/sh +echo +echo "Error: The ipkg command cannot currently be used because this" +echo "system is running from its internal flash; it is not currently" +echo "\"uNSLUng\" to an external disk or flash device." +echo +echo "Please complete the process of \"unslinging\" this system, or" +echo "resolve the issues that did not permit it to boot from the" +echo "external device before installing any ipkg packages or updates." +echo +exit 1 diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/linuxrc b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/linuxrc index cc53d447c3..d8a0e5d06c 100755 --- a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/linuxrc +++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/linuxrc @@ -15,8 +15,8 @@ cnt=20 while [ $cnt -gt 0 ] ; do echo -ne "\r$cnt " sleep 1 - [ -f /proc/hdd_sdb ] && cnt=0 - [ -f /proc/hdd_sda ] && cnt=0 + [ -e /.sda1root -a -f /proc/hdd_sda ] && cnt=0 + [ -e /.sdb1root -a -f /proc/hdd_sdb ] && cnt=0 cnt=`expr $cnt - 1` done echo @@ -25,10 +25,10 @@ sleep 5 mounted= -for prefroot in sdb1 sda1 ; do - if [ -z "$mounted" ] ; then +for prefroot in sda1 sdb1 ; do + if [ -z "$mounted" -a -e /.${prefroot}root ] ; then if /bin/mount -rt ext3 /dev/$prefroot /mnt ; then - if [ -x /mnt/bin/init ] ; then + if [ -e /mnt/.${prefroot}root -a -x /mnt/bin/init ] ; then /bin/echo "Root filesystem will be mounted from /dev/$prefroot ..." mounted=/mnt else diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-fl b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-fl new file mode 100644 index 0000000000..aafcd21cb5 --- /dev/null +++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-fl @@ -0,0 +1,11 @@ + +Welcome to Unslung @v@ + + -------- NOTE: RUNNING FROM INTERNAL FLASH -------- + +This system is currently running from the internal flash memory, +it has NOT booted up into "unslung" mode from an external drive. + +In this mode, very few services are running, and available disk +space is extremely limited. This mode is normally only used +for initial installation, and system maintenance and recovery. diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-un b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-un new file mode 100644 index 0000000000..5439b08be6 --- /dev/null +++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/motd-un @@ -0,0 +1,4 @@ + +Welcome to Unslung @v@ + + ---------- NOTE: THIS SYSTEM IS CURRENTLY UNSLUNG ---------- diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling index bed1789a6f..3c25316751 100755 --- a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling +++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling @@ -1,23 +1,30 @@ #!/bin/sh -usage="Usage: $0 disk1|disk2" - -# Set target disk +usage="Usage: $0 [-nopw] disk1|disk2" +nopw=0 if [ $# -gt 1 ] ; then - echo $usage - exit 1 + if [ "$1" = "-nopw" ] ; then + nopw=1 + shift + fi fi +# Set target disk + if [ $# -eq 1 ] ; then if [ "$1" = "disk1" ] ; then mtch="/dev/sdb1 /share/hdd/data ext3 rw 0 0" targ=/share/hdd/data - flag=.sda1root + targconf=/share/hdd/conf + flag=.sdb1root + htmlinfo="disk1, /dev/sdb1" elif [ "$1" = "disk2" ] ; then mtch="/dev/sda1 /share/flash/data ext3 rw 0 0" targ=/share/flash/data - flag=.sdb1root + targconf=/share/flash/conf + flag=.sda1root + htmlinfo="disk2, /dev/sda1" else echo $usage exit 1 @@ -27,13 +34,57 @@ else exit 1 fi +# Check that we can unsling at all! An unsling operation creates a new +# rootfs, but it also marks the flash rootfs (with a flag file such as +# ".sda1root") so that subsequent boots do not create the "var.state" +# and "dev.state" mounts. Without those mounts, though, an attempt to +# unsling will write a new rootfs on the target with an empty /dev +# directory, which doesnt' work really well. So this check is all about +# making sure that we are in a state in which we are capable of +# performing the unsling operation. + +echo "Checking if able to unsling..." +echo +m1="/dev/root /dev.state jffs2 rw 0 0" +m2="/dev/root /var.state jffs2 rw 0 0" +if ! grep "$m1" /proc/mounts >/dev/null 2>&1 || ! grep "$m2" /proc/mounts >/dev/null 2>&1 ; then + echo "Error: This system is unable to properly unsling because certain" + echo "required mounts (dev.state and/or var.state) are not available." + echo "This is most probably because you have already unslung this system." + echo + + if [ -f /.sda1root ] ; then + rm -f /.sda1root + elif [ -f /.sdb1root ] ; then + rm -f /.sdb1root + elif [ -f /.sda2root ] ; then + rm -f /.sda2root + elif [ -f /.sdb2root ] ; then + rm -f /.sdb2root + else + echo "However, in this case, the flags that indicate an already-unslung" + echo "system seem to be missing. Try restarting your NSLU2 to correct," + echo "but if the problem persists, try re-flashing your NSLU2." + exit 1 + fi + echo "The flags that indicate an already-unslung system have now been" + echo "removed and the required mounts should now become present after" + echo "reboot of the NSLU2." + echo + echo "1) Please unplug all drives from the NSLU2," + echo "2) reboot," + echo "3) and retry the unslinging process." + exit 1 +fi + # Check it's a real mount point -echo "Waiting for $targ" +echo "Waiting for $targ ..." CNT=120 while [ $CNT -gt 0 ] do if grep "$mtch" /proc/mounts >/dev/null 2>&1 ; then + echo echo "Target disk is $targ" CNT=-1 else @@ -43,10 +94,52 @@ do fi done if [ $CNT -eq 0 ] ; then - echo "Error: $targ is not a mounted disk" + echo + echo "Error: $targ ($htmlinfo) is not a mounted disk" exit 1 fi +# Do a quick sanity check to make sure we're unslinging to a disk that's been +# formatted by the Linksys code. + +echo "Checking that $targ has been properly formatted..." +if ! [ -d $targ/public ] || ! [ -f $targconf/.dongle ] || ! [ -f $targconf/passwd ] ; then + echo + echo "Error: $targ does not appear to have been formatted by the" + echo "Linksys formatting utility. Please go to the web interface," + echo "and format the drive before unslinging." + exit 1 +fi + +echo "Checking that $targ is clean..." +if [ -f $targ/.unslung ] ; then + echo + echo "Error: $targ appears to have already been unslung to:" + cat $targ/.unslung + echo "Please go to the web interface, and format the drive before" + echo "unslinging." + echo + echo "(Or, if you wish to unsling without removing the current root" + echo "filesystem, simply remove the file $targ/.unslung and retry" + echo "the unsling -- but beware, you enter uncharted territory!)" + exit 1 +fi + +# Change the root password +if [ "$nopw" = 0 ] ; then + echo + echo "Please enter the new root password. This will be the new root" + echo "password used when the NSLU2 boots up with or without disks" + echo + passwd + if [ $? != 0 ] ; then + echo "Error setting password." + exit 1 + fi + cp /etc/passwd /usr/local/passwd + cp /etc/passwd $targconf/passwd +fi + # Start at the root directory cd / @@ -60,7 +153,8 @@ fi # Copy the complete rootfs to the target. -echo "Copying the complete rootfs from / to $targ." +echo +echo "Copying the complete rootfs from / to $targ ..." /usr/bin/find / -print0 -mount | /usr/bin/cpio -p -0 -d -m -u $targ rm -rf $targ/dev ; mv $targ/dev.state $targ/dev rm -rf $targ/var ; mv $targ/var.state $targ/var @@ -75,6 +169,16 @@ fi echo "Linking /usr/bin/ipkg executable on target disk." rm -f $targ/usr/bin/ipkg ; ln -s /usr/bin/ipkg-cl $targ/usr/bin/ipkg +echo "Linking /etc/motd to the unslung motd on target disk." +rm -f $targ/etc/motd ; ln -s /etc/motd-un $targ/etc/motd + +echo "Updating /home/httpd/html/home.htm with target disk info." +sedcommand="s#Running.from.Internal.Flash#Unslung to $htmlinfo#" +rm -f $targ/home/httpd/html/home.htm_bak +cp $targ/home/httpd/html/home.htm $targ/home/httpd/html/home.htm_bak +sed "$sedcommand" $targ/home/httpd/html/home.htm_bak > $targ/home/httpd/html/home.htm +chmod 644 $targ/home/httpd/html/home.htm + # Create the boot flag file. rm -f /.sd??root $targ/.sd??root @@ -83,4 +187,12 @@ echo "Creating /$flag to direct switchbox to boot from $targ." echo > /$flag echo > $targ/$flag +# Done + +echo +echo "Unsling complete." +echo +echo "Leave the device $htmlinfo plugged in, and reboot" +echo "in order to boot this system up into unslung mode." + exit 0 diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.1-diversion.patch b/packages/nslu2-binary-only/unslung-rootfs/rc.1-diversion.patch index 8d9f1f6353..35015d6c82 100644 --- a/packages/nslu2-binary-only/unslung-rootfs/rc.1-diversion.patch +++ b/packages/nslu2-binary-only/unslung-rootfs/rc.1-diversion.patch @@ -12,7 +12,7 @@ /bin/echo "Starting Crond :"; . /etc/rc.d/rc.crond /bin/echo "Starting Rest Task :"; . /etc/rc.d/rc.local -+/bin/echo "Starting UNSLUNG Packages:"; ( . /etc/rc.d/rc.unslung-start ) ++/bin/echo "Starting Optware Packages:"; ( . /etc/rc.d/rc.optware-start ) + /usr/bin/Set_Led ready /usr/bin/Set_Led beep1 diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.halt-diversion.patch b/packages/nslu2-binary-only/unslung-rootfs/rc.halt-diversion.patch index 4723dfad82..3702c3d137 100644 --- a/packages/nslu2-binary-only/unslung-rootfs/rc.halt-diversion.patch +++ b/packages/nslu2-binary-only/unslung-rootfs/rc.halt-diversion.patch @@ -5,7 +5,7 @@ + +if ( [ -r /unslung/rc.halt ] && . /unslung/rc.halt ) ; then return 0 ; fi + -+/bin/echo "Stopping UNSLUNG Packages:"; ( . /etc/rc.d/rc.unslung-stop ) ++/bin/echo "Stopping Optware Packages:"; ( . /etc/rc.d/rc.optware-stop ) + /bin/killall -2 upnpd &>/dev/null /bin/killall nmbd &>/dev/null diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.optware-start b/packages/nslu2-binary-only/unslung-rootfs/rc.optware-start new file mode 100755 index 0000000000..53fe7e8262 --- /dev/null +++ b/packages/nslu2-binary-only/unslung-rootfs/rc.optware-start @@ -0,0 +1,27 @@ +#!/bin/sh + +if ( [ -f /unslung/rc.optware-start ] && . /unslung/rc.optware-start ) ; then return 0 ; fi + +# Start all init scripts in /opt/etc/init.d +# executing them in numerical order. +# +for i in /opt/etc/init.d/S??* ;do + + # Ignore dangling symlinks (if any). + [ ! -f "$i" ] && continue + + case "$i" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + set start + . $i + ) + ;; + *) + # No sh extension, so fork subprocess. + $i start + ;; + esac +done diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.optware-stop b/packages/nslu2-binary-only/unslung-rootfs/rc.optware-stop new file mode 100755 index 0000000000..3668aaf351 --- /dev/null +++ b/packages/nslu2-binary-only/unslung-rootfs/rc.optware-stop @@ -0,0 +1,27 @@ +#!/bin/sh + +if ( [ -f /unslung/rc.optware-stop ] && . /unslung/rc.optware-stop ) ; then return 0 ; fi + +# Stop all init scripts in /opt/etc/init.d +# executing them in numerical order. +# +for i in /opt/etc/init.d/K??* ;do + + # Ignore dangling symlinks (if any). + [ ! -f "$i" ] && continue + + case "$i" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + set stop + . $i + ) + ;; + *) + # No sh extension, so fork subprocess. + $i stop + ;; + esac +done diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.reboot-diversion.patch b/packages/nslu2-binary-only/unslung-rootfs/rc.reboot-diversion.patch index 2b8bf64c76..3e73b941c1 100644 --- a/packages/nslu2-binary-only/unslung-rootfs/rc.reboot-diversion.patch +++ b/packages/nslu2-binary-only/unslung-rootfs/rc.reboot-diversion.patch @@ -5,7 +5,7 @@ + +if ( [ -r /unslung/rc.reboot ] && . /unslung/rc.reboot ) ; then return 0 ; fi + -+/bin/echo "Stopping UNSLUNG Packages:"; ( . /etc/rc.d/rc.unslung-stop ) ++/bin/echo "Stopping Optware Packages:"; ( . /etc/rc.d/rc.optware-stop ) + /bin/killall -2 upnpd 2>/dev/null sleep 4 diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.unslung-start b/packages/nslu2-binary-only/unslung-rootfs/rc.unslung-start deleted file mode 100755 index f738761644..0000000000 --- a/packages/nslu2-binary-only/unslung-rootfs/rc.unslung-start +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -if ( [ -f /unslung/rc.unslung-start ] && . /unslung/rc.unslung-start ) ; then return 0 ; fi - -# Start all init scripts in /opt/etc/init.d -# executing them in numerical order. -# -for i in /opt/etc/init.d/S??* ;do - - # Ignore dangling symlinks (if any). - [ ! -f "$i" ] && continue - - case "$i" in - *.sh) - # Source shell script for speed. - ( - trap - INT QUIT TSTP - set start - . $i - ) - ;; - *) - # No sh extension, so fork subprocess. - $i start - ;; - esac -done diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.unslung-stop b/packages/nslu2-binary-only/unslung-rootfs/rc.unslung-stop deleted file mode 100755 index cf5c6ede67..0000000000 --- a/packages/nslu2-binary-only/unslung-rootfs/rc.unslung-stop +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -if ( [ -f /unslung/rc.unslung-stop ] && . /unslung/rc.unslung-stop ) ; then return 0 ; fi - -# Stop all init scripts in /opt/etc/init.d -# executing them in numerical order. -# -for i in /opt/etc/init.d/K??* ;do - - # Ignore dangling symlinks (if any). - [ ! -f "$i" ] && continue - - case "$i" in - *.sh) - # Source shell script for speed. - ( - trap - INT QUIT TSTP - set stop - . $i - ) - ;; - *) - # No sh extension, so fork subprocess. - $i stop - ;; - esac -done diff --git a/packages/nslu2-binary-only/unslung-rootfs/unslung.gif b/packages/nslu2-binary-only/unslung-rootfs/unslung.gif new file mode 100644 index 0000000000..998beeda50 Binary files /dev/null and b/packages/nslu2-binary-only/unslung-rootfs/unslung.gif differ diff --git a/packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb b/packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb deleted file mode 100644 index d80da29d46..0000000000 --- a/packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb +++ /dev/null @@ -1,117 +0,0 @@ -SECTION = "base" - -PR = "r66" - -UNSLUNG_VERSION = "4.21-beta" - -DEPENDS = "nslu2-linksys-libs" - -SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r25.tar.bz2 \ - file://README \ - file://NOTES \ - file://unsling \ - file://resling \ - file://slingover \ - file://linuxrc \ - file://nsswitch.conf \ - file://rc.unslung-start \ - file://rc.unslung-stop \ - file://rc-diversion.patch;patch=1 \ - file://rc.1-diversion.patch;patch=1 \ - file://rc.crond-diversion.patch;patch=1 \ - file://rc.halt-diversion.patch;patch=1 \ - file://rc.local-diversion.patch;patch=1 \ - file://rc.modules-diversion.patch;patch=1 \ - file://rc.network-diversion.patch;patch=1 \ - file://rc.quickset-diversion.patch;patch=1 \ - file://rc.quota-diversion.patch;patch=1 \ - file://rc.reboot-diversion.patch;patch=1 \ - file://rc.reset_usrgrpshare-diversion.patch;patch=1 \ - file://rc.rstimezone-diversion.patch;patch=1 \ - file://rc.samba-diversion.patch;patch=1 \ - file://rc.sysinit-diversion.patch;patch=1 \ - file://rc.thttpd-diversion.patch;patch=1 \ - file://rc.xinetd-diversion.patch;patch=1 \ - file://root-passwd.patch;patch=1 \ - file://tmp-handling.patch;patch=1 \ - file://create-ramdisks.patch;patch=1 \ - file://remount-noatime.patch;patch=1 \ - file://initialise-mtab.patch;patch=1 \ - file://wait-for-quotacheck.patch;patch=1 \ - file://mount_usbdevfs.patch;patch=1 \ - file://maintmode.cgi file://upgrade-maint.htm \ - file://upgrade-nomaint.htm file://upgrade-inhibit.htm \ - file://rc.bootbin \ - " - -S = "${WORKDIR}/nslu2-linksys-ramdisk-2.3r25" - -python () { - # Don't build unslung images unless we're targeting an nslu2 - mach = bb.data.getVar("MACHINE", d, 1) - dist = bb.data.getVar("DISTRO", d, 1) - if mach != 'nslu2' or dist != 'unslung': - raise bb.parse.SkipPackage("Unslung only builds for the Linksys NSLU2") -} - -do_compile () { - echo "V2.3R25-uNSLUng-${UNSLUNG_VERSION}" > ${S}/.unslung - - sed -i -e s/@version#/@version#-uNSLUng-${UNSLUNG_VERSION}/ ${S}/home/httpd/html/home.htm - sed -i -e 's|> <|>Unslung Doco<|' \ - ${S}/home/httpd/html/manhead.htm - - # Somehow these two slipped through - this is easier than updating the tar file. - rm -f ${S}/etc/rc.orig - rm -f ${S}/etc/rc.d/rc.1.orig - - install -m 755 ${WORKDIR}/linuxrc ${S}/linuxrc - - # Allow rc.bootbin to be diverted. - mv ${S}/etc/rc.d/rc.bootbin ${S}/sbin/rc.bootbin - install -m 755 ${WORKDIR}/rc.bootbin ${S}/etc/rc.d/rc.bootbin - - install -d ${S}/initrd - - install -m 755 ${WORKDIR}/unsling ${S}/sbin/unsling - install -m 755 ${WORKDIR}/resling ${S}/sbin/resling - install -m 755 ${WORKDIR}/slingover ${S}/sbin/slingover - install -m 755 ${WORKDIR}/rc.unslung-start ${S}/etc/rc.d/rc.unslung-start - install -m 755 ${WORKDIR}/rc.unslung-stop ${S}/etc/rc.d/rc.unslung-stop - - install -m 644 ${WORKDIR}/nsswitch.conf ${S}/etc/nsswitch.conf - - install -d ${S}/opt/doc - install -m 755 ${WORKDIR}/README ${S}/opt/doc/README - install -m 755 ${WORKDIR}/NOTES ${S}/opt/doc/NOTES - ln -s /opt/doc ${S}/home/httpd/html/Unslung - - # Add the diversion script directory - install -d ${S}/unslung - - # Remove the libraries, because they are in nslu2-linksys-libs now - rm -rf ${S}/lib - - # Install maintenance mode files - install -m 755 ${WORKDIR}/maintmode.cgi ${S}/home/httpd/html/Management - install -m 644 ${WORKDIR}/upgrade-maint.htm ${S}/home/httpd/html/Management/upgrade-maint.htm - install -m 644 ${WORKDIR}/upgrade-nomaint.htm ${S}/home/httpd/html/Management/upgrade-nomaint.htm - install -m 644 ${WORKDIR}/upgrade-inhibit.htm ${S}/home/httpd/html/Management/upgrade-inhibit.htm - install -m 644 ${WORKDIR}/upgrade-nomaint.htm ${S}/home/httpd/html/Management/upgrade.htm - sed -i -e s/@ds_sw_version#/@ds_sw_version#-uNSLUng-${UNSLUNG_VERSION}/ \ - ${S}/home/httpd/html/Management/upgrade-maint.htm - sed -i -e s/@ds_sw_version#/@ds_sw_version#-uNSLUng-${UNSLUNG_VERSION}/ \ - ${S}/home/httpd/html/Management/upgrade-nomaint.htm - sed -i -e s/@ds_sw_version#/@ds_sw_version#-uNSLUng-${UNSLUNG_VERSION}/ \ - ${S}/home/httpd/html/Management/upgrade-inhibit.htm - sed -i -e s/@ds_sw_version#/@ds_sw_version#-uNSLUng-${UNSLUNG_VERSION}/ \ - ${S}/home/httpd/html/Management/upgrade.htm -} - -do_install () { - ( cd ${S} ; tar -c -v -f - --exclude '.pc' . ) | ( cd ${D} ; tar xvf - ) -} - -PACKAGES = "${PN}" -FILES_${PN} = "/" -RDEPENDS_${PN} = "nslu2-linksys-libs" diff --git a/packages/nslu2-binary-only/unslung-rootfs_2.3r63.bb b/packages/nslu2-binary-only/unslung-rootfs_2.3r63.bb index 7749db06d5..d45e4103b8 100644 --- a/packages/nslu2-binary-only/unslung-rootfs_2.3r63.bb +++ b/packages/nslu2-binary-only/unslung-rootfs_2.3r63.bb @@ -1,19 +1,23 @@ SECTION = "base" -PR = "r4" +PR = "r8" DEPENDS = "nslu2-linksys-libs" -SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63.tar.bz2 \ +SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63-2.tar.bz2 \ file://README \ file://NOTES \ + file://ipkg-fl \ + file://motd-fl \ + file://motd-un \ file://unsling \ file://resling \ file://slingover \ file://linuxrc \ + file://unslung.gif \ file://nsswitch.conf \ - file://rc.unslung-start \ - file://rc.unslung-stop \ + file://rc.optware-start \ + file://rc.optware-stop \ file://rc-diversion.patch;patch=1 \ file://rc.1-diversion.patch;patch=1 \ file://rc.crond-diversion.patch;patch=1 \ @@ -54,9 +58,31 @@ python () { do_compile () { echo "V2.3R63-uNSLUng-${DISTRO_VERSION}" > ${S}/.unslung - sed -i -e s/@version#/@version#-uNSLUng-${DISTRO_VERSION}/ ${S}/home/httpd/html/home.htm + install -m 644 ${WORKDIR}/unslung.gif ${S}/home/httpd/html/linksys.gif + + sed -i -e 's/@version#+@public_2# | \  Manage Telnet+' \ + ${S}/home/httpd/html/home.htm + sed -i -e 's+  +
uNSLUng status: \  Running from Internal Flash
+' \ + ${S}/home/httpd/html/home.htm + sed -i -e 's|> <|>Unslung Doco<|' \ ${S}/home/httpd/html/manhead.htm + install -d ${S}/opt/doc + install -m 755 ${WORKDIR}/README ${S}/opt/doc/README + install -m 755 ${WORKDIR}/NOTES ${S}/opt/doc/NOTES + rm -f ${S}/home/httpd/html/Unslung + ln -s /opt/doc ${S}/home/httpd/html/Unslung install -m 755 ${WORKDIR}/linuxrc ${S}/linuxrc @@ -69,29 +95,16 @@ do_compile () { install -m 755 ${WORKDIR}/unsling ${S}/sbin/unsling install -m 755 ${WORKDIR}/resling ${S}/sbin/resling install -m 755 ${WORKDIR}/slingover ${S}/sbin/slingover - install -m 755 ${WORKDIR}/rc.unslung-start ${S}/etc/rc.d/rc.unslung-start - install -m 755 ${WORKDIR}/rc.unslung-stop ${S}/etc/rc.d/rc.unslung-stop + install -m 755 ${WORKDIR}/rc.optware-start ${S}/etc/rc.d/rc.optware-start + install -m 755 ${WORKDIR}/rc.optware-stop ${S}/etc/rc.d/rc.optware-stop install -m 644 ${WORKDIR}/nsswitch.conf ${S}/etc/nsswitch.conf - install -d ${S}/opt/doc - install -m 755 ${WORKDIR}/README ${S}/opt/doc/README - install -m 755 ${WORKDIR}/NOTES ${S}/opt/doc/NOTES - ln -s /opt/doc ${S}/home/httpd/html/Unslung - # Add the diversion script directory install -d ${S}/unslung # Remove the libraries, because they are in nslu2-linksys-libs now rm -rf ${S}/lib - - # Install upgrade mode files -# mv ${S}/home/httpd/html/Management/upgrade.htm ${S}/home/httpd/html/Management/upgrade-old.htm -# mv ${S}/home/httpd/html/Management/upgrade.cgi ${S}/home/httpd/html/Management/upgrade-old.cgi -# install -m 644 ${WORKDIR}/upgrade.htm ${S}/home/httpd/html/Management -# install -m 755 ${WORKDIR}/upgrade.cgi ${S}/home/httpd/html/Management - sed -i -e s/@ds_sw_version#/@ds_sw_version#-uNSLUng-${DISTRO_VERSION}/ \ - ${S}/home/httpd/html/Management/upgrade.htm } do_install () { -- cgit 1.2.3-korg