slugos-init: Updated turnup, sysconf and reflash scripts to handle the root partition...
authorRod Whitby <rod@whitby.id.au>
Tue, 26 Jun 2007 08:12:50 +0000 (08:12 +0000)
committerRod Whitby <rod@whitby.id.au>
Tue, 26 Jun 2007 08:12:50 +0000 (08:12 +0000)
packages/slugos-init/files/reflash
packages/slugos-init/files/sysconf
packages/slugos-init/files/turnup
packages/slugos-init/slugos-init_0.10.bb

index 131f0b6..22a18bb 100644 (file)
@@ -146,7 +146,7 @@ then
                        then
                                imgksize="$size"
                                imgkoffset="$base"
-                       elif test "$name" = "$ffspart"
+                       elif test "$name" = "$ffspart" -o "$name" = "rootfs"
                        then
                                imgffssize="$size"
                                imgffsoffset="$base"
@@ -320,6 +320,8 @@ ffssize=0
 if test -n "$ffsfile"
 then
        ffsdev="$(mtblockdev $ffspart)"
+       [ -n "$ffsdev" ] || \
+       ffsdev="$(mtblockdev rootfs)"
        test -n "$ffsdev" -a -b "$ffsdev" || {
                echo "reflash: $ffspart($ffsdev): cannot find $ffspart mtd partition." >&2
                echo "  check /proc/mtd, either the partition does not exist or there is no" >&2
index d91c184..84a14af 100644 (file)
@@ -8,7 +8,6 @@
 # to load these functions!)
 test "$1" != sysconf && . /etc/default/functions
 
-# NSLU2 flash layout is non-standard.
 case "$(machine)" in
 nslu2)
        kpart="Kernel"
@@ -493,6 +492,8 @@ sysconf_test_restore(){
 sysconf_save(){
        local sysdev ffsdev ffsdir saved list size status
        ffsdev="$(mtblockdev $ffspart)"
+       [ -n "$ffsdev" ] || \
+       ffsdev="$(mtblockdev rootfs)"
        sysdev="$(mtblockdev $syspart)"
        status=1
        if test -n "$sysdev" -a -b "$sysdev" -a -n "$ffsdev" -a -b "$ffsdev"
@@ -622,6 +623,8 @@ sysconf_restore(){
        test "$1" = auto && sysconf_noninteractive=1
 
        ffsdev="$(mtblockdev $ffspart)"
+       [ -n "$ffsdev" ] || \
+       ffsdev="$(mtblockdev rootfs)"
        sysdev="$(mtblockdev $syspart)"
        status=1
        if test -n "$sysdev" -a -b "$sysdev" -a -n "$ffsdev" -a -b "$ffsdev" &&
index 10bccb8..761e078 100644 (file)
@@ -159,7 +159,7 @@ fsoptions() {
 # get_flash <directory> {mount options}
 #  mount the flash device, writeable, on the given directory
 get_flash() {
-       local ffsdir ffsdev
+       local ffsdir ffspart ffsdev
 
        ffsdir="$1"
        shift
@@ -169,9 +169,12 @@ get_flash() {
        }
 
        case "$(machine)" in
-       nslu2)  ffsdev="$(mtblockdev Flashdisk)";;
-       *)      ffsdev="$(mtblockdev filesystem)";;
+       nslu2)  ffspart="Flashdisk";;
+       *)      ffspart="filesystem";;
        esac
+       ffsdev="$(mtblockdev $ffspart)"
+       [ -n "$ffsdev" ] || \
+       ffsdev="$(mtblockdev rootfs)"
        umountflash "$ffsdev" &&
        mountflash "$ffsdev" "$ffsdir" "$@"
 }
index 77e1efb..4afe433 100644 (file)
@@ -4,7 +4,7 @@ PRIORITY = "required"
 LICENSE = "GPL"
 DEPENDS = "base-files devio"
 RDEPENDS = "busybox devio"
-PR = "r84"
+PR = "r85"
 
 SRC_URI = "file://boot/flash \
           file://boot/disk \