diff options
author | Rod Whitby <rod@whitby.id.au> | 2005-05-05 09:05:16 +0000 |
---|---|---|
committer | Rod Whitby <rod@whitby.id.au> | 2005-05-05 09:05:16 +0000 |
commit | a86b16aa213caaa83841fb4b43940e325ca1bb82 (patch) | |
tree | 7b58b2968cd2fa1bbae3096bc65637f834ab8d2f | |
parent | ea7f5348b3fda1a0e1bf399ae7bde50b840e0cc5 (diff) |
Unslung and OpenSlug linuxrc corrections
BKrev: 4279e1ccfjKblxAjFzpCmQ50KUV4hw
-rw-r--r-- | conf/distro/openslug.conf | 2 | ||||
-rw-r--r-- | conf/distro/unslung.conf | 2 | ||||
-rw-r--r-- | packages/nslu2-binary-only/unslung-rootfs-2.3r25/linuxrc | 36 | ||||
-rw-r--r-- | packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb | 4 | ||||
-rw-r--r-- | packages/openslug-init/openslug-init-0.10/linuxrc | 146 | ||||
-rw-r--r-- | packages/openslug-init/openslug-init_0.10.bb | 2 |
6 files changed, 169 insertions, 23 deletions
diff --git a/conf/distro/openslug.conf b/conf/distro/openslug.conf index 274fdec3c9..045b7a426d 100644 --- a/conf/distro/openslug.conf +++ b/conf/distro/openslug.conf @@ -3,7 +3,7 @@ #@DESCRIPTION: OpenSlug Linux Distribution for the NSLU2 DISTRO_NAME = "OpenSlug" -DISTRO_VERSION = "1.8-beta" +DISTRO_VERSION = "1.9-beta" DISTRO_TYPE ?= "beta" TARGET_FPU_local ?= "soft" diff --git a/conf/distro/unslung.conf b/conf/distro/unslung.conf index f947f97589..c9e4d505d9 100644 --- a/conf/distro/unslung.conf +++ b/conf/distro/unslung.conf @@ -7,7 +7,7 @@ FEED_URIS += "native##http://ipkg.nslu2-linux.org/feeds/unslung/native" FEED_URIS += "oe##http://ipkg.nslu2-linux.org/feeds/unslung/oe" DISTRO_NAME = "Unslung" -DISTRO_VERSION = "4.18-alpha" +DISTRO_VERSION = "4.19-alpha" DISTRO_TYPE = "beta" TARGET_FPU = "soft" diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r25/linuxrc b/packages/nslu2-binary-only/unslung-rootfs-2.3r25/linuxrc index 3ae0b25412..38abf00502 100644 --- a/packages/nslu2-binary-only/unslung-rootfs-2.3r25/linuxrc +++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r25/linuxrc @@ -8,27 +8,27 @@ if [ -f /.ramdisk ] ; then /bin/echo "Preferred root device is /dev/ram0 (maintenence)" - mounted=/mnt/tmpmnt + mounted=/mnt prefroot=maintenence elif [ -f /.sda1root ] ; then /bin/echo "Preferred root device is /dev/sda1 (disk 1)" - mounted=/mnt/tmpmnt + mounted=/mnt prefroot=sda1 elif [ -f /.sda2root ] ; then /bin/echo "Preferred root device is /dev/sda2 (disk 1)" - mounted=/mnt/tmpmnt + mounted=/mnt prefroot=sda2 elif [ -f /.sdb1root ] ; then /bin/echo "Preferred root device is /dev/sdb1 (disk 2)" - mounted=/mnt/tmpmnt + mounted=/mnt prefroot=sdb1 elif [ -f /.sdb2root ] ; then /bin/echo "Preferred root device is /dev/sdb2 (disk 2)" - mounted=/mnt/tmpmnt + mounted=/mnt prefroot=sdb2 elif [ -f /.nfsroot ] ; then /bin/echo "Preferred root device is NFS" - mounted=/mnt/tmpmnt + mounted=/mnt prefroot=nfsroot else /bin/echo "Preferred root device is jffs2" @@ -44,12 +44,12 @@ fi if [ $prefroot = "sda1" -o $prefroot = "sda2" -o $prefroot = "sdb1" -o $prefroot = "sdb2" ] ; then /bin/echo "Sleeping 10sec while waiting for disk..." sleep 10 - /bin/mount -rt ext3 /dev/$prefroot /mnt/tmpmnt - if [ -L /mnt/tmpmnt/sbin/init -o -x /mnt/tmpmnt/sbin/init -o \ - -L /mnt/tmpmnt/bin/init -o -x /mnt/tmpmnt/bin/init ] ; then + /bin/mount -rt ext3 /dev/$prefroot /mnt + if [ -L /mnt/sbin/init -o -x /mnt/sbin/init -o \ + -L /mnt/bin/init -o -x /mnt/bin/init ] ; then /bin/echo "Root filesystem will be mounted from /dev/$prefroot ..." else - /bin/umount /mnt/tmpmnt + /bin/umount /mnt /bin/echo "Can't find valid rootfs on /dev/$prefroot, using jffs2 ..." mounted= prefroot=jffs2 @@ -59,9 +59,9 @@ fi if [ $prefroot = "maintenence" ] ; then /bin/dd if=/dev/zero of=/dev/ram0 bs=1k count=12k 2>/dev/null /usr/bin/mke2fs -m 0 /dev/ram0 12288 - /bin/mount -t ext2 /dev/ram0 /mnt/tmpmnt - ( /usr/bin/find . -print0 -mount | /usr/bin/cpio -p -0 -d -m -u /mnt/tmpmnt ) - /bin/rm -f /mnt/tmpmnt/linuxrc + /bin/mount -t ext2 /dev/ram0 /mnt + ( /usr/bin/find . -print0 -mount | /usr/bin/cpio -p -0 -d -m -u /mnt ) + /bin/rm -f /mnt/linuxrc fi if [ $prefroot = "nfsroot" ] ; then @@ -81,14 +81,14 @@ if [ $prefroot = "nfsroot" ] ; then # The nfsrootloc and nfsrootopts vars can be overridden here. . /.nfsroot - /bin/mount $nfsrootopts $nfsrootloc /mnt/tmpmnt + /bin/mount $nfsrootopts $nfsrootloc /mnt - if [ -L /mnt/tmpmnt/sbin/init -o -x /mnt/tmpmnt/sbin/init -o \ - -L /mnt/tmpmnt/bin/init -o -x /mnt/tmpmnt/bin/init ] ; then + if [ -L /mnt/sbin/init -o -x /mnt/sbin/init -o \ + -L /mnt/bin/init -o -x /mnt/bin/init ] ; then /bin/echo "Root filesystem will be mounted from an NFS root ..." - mounted=/mnt/tmpmnt + mounted=/mnt else - /bin/umount /mnt/tmpmnt + /bin/umount /mnt /bin/echo "Can't find valid NFS rootfs, using jffs2 ..." mounted= prefroot=jffs2 diff --git a/packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb b/packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb index 5c37284b0f..684a0d7cbd 100644 --- a/packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb +++ b/packages/nslu2-binary-only/unslung-rootfs_2.3r25.bb @@ -1,8 +1,8 @@ SECTION = "base" -PR = "r62" +PR = "r63" -UNSLUNG_VERSION = "4.18-alpha" +UNSLUNG_VERSION = "4.19-alpha" DEPENDS = "nslu2-linksys-libs" diff --git a/packages/openslug-init/openslug-init-0.10/linuxrc b/packages/openslug-init/openslug-init-0.10/linuxrc index e69de29bb2..47cad6be51 100644 --- a/packages/openslug-init/openslug-init-0.10/linuxrc +++ b/packages/openslug-init/openslug-init-0.10/linuxrc @@ -0,0 +1,146 @@ +#!/bin/sh + +# **** DO NOT EVEN THINK OF EDITING OR REMOVING THIS FILE **** +# **** UNLESS YOU REALLY KNOW *EXACTLY* WHAT YOU ARE DOING. **** + + +# Determine the desired rootfs based on user flag files. + +if [ -f /.ramdisk ] ; then + /bin/echo "Preferred root device is /dev/ram0 (maintenence)" + mounted=/mnt + prefroot=maintenence +elif [ -f /.sda1root ] ; then + /bin/echo "Preferred root device is /dev/sda1 (disk 1)" + mounted=/mnt + prefroot=sda1 +elif [ -f /.sda2root ] ; then + /bin/echo "Preferred root device is /dev/sda2 (disk 1)" + mounted=/mnt + prefroot=sda2 +elif [ -f /.sdb1root ] ; then + /bin/echo "Preferred root device is /dev/sdb1 (disk 2)" + mounted=/mnt + prefroot=sdb1 +elif [ -f /.sdb2root ] ; then + /bin/echo "Preferred root device is /dev/sdb2 (disk 2)" + mounted=/mnt + prefroot=sdb2 +elif [ -f /.nfsroot ] ; then + /bin/echo "Preferred root device is NFS" + mounted=/mnt + prefroot=nfsroot +else + /bin/echo "Preferred root device is jffs2" + mounted= + prefroot=jffs2 +fi + + +# Perform prepatory tasks, and determine whether the desired rootfs is viable. + +/bin/mount -t proc proc /proc + +if [ $prefroot = "sda1" -o $prefroot = "sda2" -o $prefroot = "sdb1" -o $prefroot = "sdb2" ] ; then + /bin/echo "Sleeping 10sec while waiting for disk..." + sleep 10 + /bin/mount -rt ext3 /dev/$prefroot /mnt + if [ -L /mnt/sbin/init -o -x /mnt/sbin/init -o \ + -L /mnt/bin/init -o -x /mnt/bin/init ] ; then + /bin/echo "Root filesystem will be mounted from /dev/$prefroot ..." + else + /bin/umount /mnt + /bin/echo "Can't find valid rootfs on /dev/$prefroot, using jffs2 ..." + mounted= + prefroot=jffs2 + fi +fi + +if [ $prefroot = "maintenence" ] ; then + /bin/dd if=/dev/zero of=/dev/ram0 bs=1k count=12k 2>/dev/null + /usr/bin/mke2fs -m 0 /dev/ram0 12288 + /bin/mount -t ext2 /dev/ram0 /mnt + ( /usr/bin/find . -print0 -mount | /usr/bin/cpio -p -0 -d -m -u /mnt ) + /bin/rm -f /mnt/linuxrc + /bin/cp /mnt/home/httpd/html/Management/upgrade.cgi /mnt/home/httpd/html/Management/upgrade-real.cgi + /bin/echo "#!/bin/sh" > /mnt/home/httpd/html/Management/upgrade.cgi + /bin/echo >> /mnt/home/httpd/html/Management/upgrade.cgi + /bin/echo "/bin/mount -t ramfs none /upload -o size=8196 2>/dev/null" \ + >> /mnt/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/home/httpd/html/Management/upgrade.cgi + /bin/echo "/bin/umount /upload 2>/dev/null" \ + >> /mnt/home/httpd/html/Management/upgrade.cgi + /bin/echo "exec /home/httpd/html/Management/upgrade-real.cgi" \ + >> /mnt/home/httpd/html/Management/upgrade.cgi + /bin/echo "Root filesystem will be mounted from /dev/ram0 (a copy of /dev/mtdblock4) ..." +fi + +if [ $prefroot = "nfsroot" ] ; then + + sysconflen=`/bin/dd if=/dev/mtd1 bs=4 count=1 2>/dev/null | /usr/bin/hexdump -n 6 -e '"%02d"'` + ipaddr=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep ip_addr | sed -e s/ip_addr=//` + netmask=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep netmask | sed -e s/netmask=//` + gateway=`/bin/dd if=/dev/mtd1 bs=1 count=$sysconflen skip=4 2>/dev/null | grep gateway | sed -e s/gateway=//` + + /sbin/insmod ixp400 + /sbin/insmod ixp425_eth + /sbin/ifconfig ixp0 up $ipaddr netmask $netmask + /sbin/route add default gw $gateway + + /sbin/ifconfig lo up 127.0.0.1 + + # The nfsrootloc and nfsrootopts vars can be overridden here. + . /.nfsroot + + /bin/mount $nfsrootopts $nfsrootloc /mnt + + if [ -L /mnt/sbin/init -o -x /mnt/sbin/init -o \ + -L /mnt/bin/init -o -x /mnt/bin/init ] ; then + /bin/echo "Root filesystem will be mounted from an NFS root ..." + mounted=/mnt + else + /bin/umount /mnt + /bin/echo "Can't find valid NFS rootfs, using jffs2 ..." + mounted= + prefroot=jffs2 + fi +fi + +if [ $prefroot = "jffs2" ] ; then + /bin/echo "Root filesystem will be mounted from /dev/mtdblock4 ..." + mounted= +fi + + +/bin/umount /proc + +# Pivot to the desired rootfs and run the initial executable. + +if [ -n "$mounted" ] ; then + + cd $mounted + + if [ -x ./sbin/init -o -L ./sbin/init ] ; then + runboot=/sbin/init + elif [ -x ./bin/init -o -L ./bin/init ] ; then + runboot=/bin/init + else + runboot=/bin/sh + fi + + /sbin/pivot_root . initrd + + exec /usr/sbin/chroot . $runboot < /dev/console 1> /dev/console 2> /dev/console + +else + + exec /bin/init + +fi + +/bin/echo "Can't chroot to $prefroot, using jffs2 ..." +exec /bin/init + +# Last-resort fall-back - this should never be reached. +/bin/sh diff --git a/packages/openslug-init/openslug-init_0.10.bb b/packages/openslug-init/openslug-init_0.10.bb index fe1f9d7135..3454d29aa6 100644 --- a/packages/openslug-init/openslug-init_0.10.bb +++ b/packages/openslug-init/openslug-init_0.10.bb @@ -2,7 +2,7 @@ DESCRIPTION = "Openslug initial network config via sysconf" SECTION = "console/network" LICENSE = "GPL" DEPENDS = "base-files" -PR = "r19" +PR = "r20" SRC_URI = "file://linuxrc \ file://sysconfsetup \ |