Unslung: rootfs & image, cleanup root fs image, fix some startup script syntax errors
authorMike Westerhof <mwester@dls.net>
Thu, 25 May 2006 05:19:46 +0000 (05:19 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Thu, 25 May 2006 05:19:46 +0000 (05:19 +0000)
packages/meta/unslung-image.bb
packages/nslu2-binary-only/unslung-rootfs/NOTES
packages/nslu2-binary-only/unslung-rootfs/rc.samba-syntaxfix.patch [new file with mode: 0644]
packages/nslu2-binary-only/unslung-rootfs/rc.sysinit-cpbug.patch [new file with mode: 0644]
packages/nslu2-binary-only/unslung-rootfs/unsling
packages/nslu2-binary-only/unslung-rootfs_2.3r63.bb

index 4a6864e..b214332 100644 (file)
@@ -1,5 +1,5 @@
 LICENSE = MIT
-PR = "r14"
+PR = "r15"
 
 IMAGE_BASENAME = "unslung"
 
@@ -10,11 +10,15 @@ DEPENDS  = "virtual/kernel \
        ${UNSLUNG_EXTRA_DEPENDS}"
 
 RDEPENDS  = "kernel update-modules unslung-rootfs \
-       libc6-unslung slingbox ipkg cpio findutils \
+       libc6-unslung slingbox ipkg \
+       cpio \
+       findutils \
        ${UNSLUNG_EXTRA_RDEPENDS}"
 
 IPKG_INSTALL = "kernel update-modules unslung-rootfs \
-       libc6-unslung slingbox ipkg cpio findutils \
+       libc6-unslung slingbox ipkg \
+       cpio \
+       findutils \
        ${UNSLUNG_EXTRA_INSTALL}"
 
 IMAGE_PREPROCESS_COMMAND += "unslung_clean_image; "
@@ -61,6 +65,20 @@ unslung_clean_image () {
        # Strip symbols and fix permissions on the libgcc_s.so.1 library
        ${STRIP} ${IMAGE_ROOTFS}/lib/libgcc_s.so.1
        chmod ugo+x ${IMAGE_ROOTFS}/lib/libgcc_s.so.1
+
+       # We need cpio and find, but we don't need any of the other stuff in the
+       # packages (users can install the full package with ipkg after unsling).
+       # (make sure that if the package is not included (i.e. using slingbox
+       # instead) that the files are not deleted; they might be part of slingbox)
+
+       #-- these are for cpio:
+       rm -f ${IMAGE_ROOTFS}/usr/bin/mt
+       rm -rf ${IMAGE_ROOTFS}/usr/bin/libexec
+
+       #-- and these for find:
+       rm -f ${IMAGE_ROOTFS}/usr/bin/locate
+       rm -f ${IMAGE_ROOTFS}/usr/bin/updatedb
+       rm -f ${IMAGE_ROOTFS}/usr/bin/xargs
 }
 
 python () {
index 81cff3c..f4a7bf7 100644 (file)
@@ -524,3 +524,11 @@ Fix extraneous boot messages from jffs2 filesystem driver (change options
 used when building the flash jffs image).
 
 Added pl2303.c patch for TIOCMGET/MSET/MBIS/MBIC.
+
+Syntax fixes in prep for newer busybox:
+ - comments in rc.samba, "cp" in rc.sysinit
+
+Flash filesystem cleanup (regained space):
+ - replaced dupl 'date' utility with symlink, corrected 'killall' symlink
+ - removed 'mt', 'libexec' from flash
+ - adjusted 'unsling' to use common 'find' options
diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.samba-syntaxfix.patch b/packages/nslu2-binary-only/unslung-rootfs/rc.samba-syntaxfix.patch
new file mode 100644 (file)
index 0000000..fcfc273
--- /dev/null
@@ -0,0 +1,23 @@
+--- nslu2-linksys-ramdisk-2.3r63/etc/rc.d/rc.samba~    2006-05-16 14:22:33.000000000 -0500
++++ nslu2-linksys-ramdisk-2.3r63/etc/rc.d/rc.samba     2006-05-16 16:47:45.000000000 -0500
+@@ -5,16 +5,16 @@
+ if [ -n "`pidof smbd`" ] ; then
+     killall smbd 2>/dev/null
+ fi
+-if [ -n "`pidof smbd`" ] ; then
++#if [ -n "`pidof smbd`" ] ; then
+ #    killall -9 smbd 2>/dev/null
+-fi
++#fi
+ if [ -n "`pidof nmbd`" ] ; then
+     killall nmbd 2>/dev/null
+ fi
+-if [ -n "`pidof nmbd`" ] ; then
++#if [ -n "`pidof nmbd`" ] ; then
+ #    killall -9 nmbd 2>/dev/null
+-fi
++#fi
+ sleep 2
+ /usr/sbin/smbd -D; 
+ /usr/sbin/nmbd -D;
diff --git a/packages/nslu2-binary-only/unslung-rootfs/rc.sysinit-cpbug.patch b/packages/nslu2-binary-only/unslung-rootfs/rc.sysinit-cpbug.patch
new file mode 100644 (file)
index 0000000..5b90885
--- /dev/null
@@ -0,0 +1,19 @@
+--- nslu2-linksys-ramdisk-2.3r63/etc/rc.d/rc.sysinit~  2006-05-16 17:35:56.000000000 -0500
++++ nslu2-linksys-ramdisk-2.3r63/etc/rc.d/rc.sysinit   2006-05-16 17:36:10.000000000 -0500
+@@ -11,14 +11,14 @@
+ if ( [ ! -f /.sda1root ] && [ ! -f /.sda2root ] && [ ! -f /.sdb1root ] && [ ! -f /.sdb2root ] ) ; then
+   /bin/echo "Creating ramfs for /dev:"
+   /bin/mount -t ramfs ramfs /mnt/tmpmnt
+-  /bin/cp -rp /dev/* /mnt/tmpmnt/
++  /bin/cp -a /dev/* /mnt/tmpmnt/
+   /bin/mkdir -p /dev.state
+   /bin/mount -o bind /dev /dev.state
+   /bin/mount -o bind /mnt/tmpmnt /dev
+   /bin/umount /mnt/tmpmnt
+   /bin/echo "Creating ramfs for /var:"
+   /bin/mount -t ramfs ramfs /mnt/tmpmnt -o maxsize=256
+-  /bin/cp -rp /var/* /mnt/tmpmnt/
++  /bin/cp -a /var/* /mnt/tmpmnt/
+   /bin/mkdir -p /var.state
+   /bin/mount -o bind /var /var.state
+   /bin/mount -o bind /mnt/tmpmnt /var
index c8b3dc8..400c7d0 100755 (executable)
@@ -162,7 +162,7 @@ fi
 
 echo
 echo "Copying the complete rootfs from / to $targ ..."
-/usr/bin/find / -print0 -mount | /usr/bin/cpio -p -0 -d -m -u $targ
+/usr/bin/find / -xdev -print | /usr/bin/cpio -p -d -m -u $targ
 rm -rf $targ/dev ; mv $targ/dev.state $targ/dev
 rm -rf $targ/var ; mv $targ/var.state $targ/var
 
index 1c805a6..ff0172d 100644 (file)
@@ -1,6 +1,6 @@
 SECTION = "base"
 
-PR = "r12"
+PR = "r13"
 
 DEPENDS = "nslu2-linksys-libs nslu2-linksys-sambacodepages"
 
@@ -31,6 +31,7 @@ SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63-2.tar.bz2 \
           file://rc.reset_usrgrpshare-diversion.patch;patch=1 \
           file://rc.rstimezone-diversion.patch;patch=1 \
           file://rc.samba-diversion.patch;patch=1 \
+          file://rc.samba-syntaxfix.patch;patch=1 \
           file://rc.sysinit-diversion.patch;patch=1 \
           file://rc.thttpd-diversion.patch;patch=1 \
           file://rc.xinetd-diversion.patch;patch=1 \
@@ -43,6 +44,7 @@ SRC_URI = "http://nslu.sf.net/downloads/nslu2-linksys-ramdisk-2.3r63-2.tar.bz2 \
           file://mount_usbdevfs.patch;patch=1 \
           file://security-fixes.patch;patch=1 \
           file://rc.sysinit-clean_var.patch;patch=1 \
+          file://rc.sysinit-cpbug.patch;patch=1 \
           file://rc.modules-nls.patch;patch=1 \
           file://telnet-passwd.patch;patch=1 \
           file://upgrade.htm \
@@ -144,6 +146,19 @@ do_compile () {
        # 950 (Chinese BIG-5)
        rm -f ${S}/etc/samba/codepages/codepage.950
        # ISO8859-1 (Latin 1) - keep
+
+       # /bin/killall and /usr/bin/killall are both symlinks to busybox.  This
+       # is a problem if killall is ever replaced by slingbox or a native utility.
+       # Fix by making /bin/killall (the wrong place) a symlink to /usr/bin/killall.
+       rm -f ${S}/bin/killall
+       ln -s ../usr/bin/killall ${S}/bin/killall
+
+       # There are two identical binary copies of "date" on the image.  Replace
+       # the one in /usr/sbin with a symlink to the one in /bin.  This saves a
+       # bit of flash space, and makes it possible to replace the date binary with
+       # a link to busybox or slingbox at some point.
+       rm -r ${S}/usr/sbin/date
+       ln -s ../../bin/date ${S}/usr/sbin/date
 }
 
 do_install () {