All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] zaurus-updater: add support for home partition reflashing
@ 2008-11-29  0:48 Dmitry Baryshkov
  2008-11-29 20:32 ` Stanislav Brabec
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Baryshkov @ 2008-11-29  0:48 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Dmitry Baryshkov

Sometimes one needs to clean/reflash the home partition.
Add support for flashing home.bin/HOME.BIN files onto "home" mtd
device.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
---
 packages/zaurus-updater/zaurus-updater.bb         |    2 +-
 packages/zaurus-updater/zaurus-updater/updater.sh |   38 +++++++++++++++++++-
 2 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/packages/zaurus-updater/zaurus-updater.bb b/packages/zaurus-updater/zaurus-updater.bb
index 56f067c..6ed1c5f 100644
--- a/packages/zaurus-updater/zaurus-updater.bb
+++ b/packages/zaurus-updater/zaurus-updater.bb
@@ -1,7 +1,7 @@
 DESCRIPTION = "Encrypted shellscript for the Zaurus ROM update"
 DEPENDS = "encdec-updater-native"
 LICENSE = "zaurus-updater"
-PR = "r21"
+PR = "r22"
 
 PACKAGES = ""
 PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/packages/zaurus-updater/zaurus-updater/updater.sh b/packages/zaurus-updater/zaurus-updater/updater.sh
index 22d4b39..f195aff 100644
--- a/packages/zaurus-updater/zaurus-updater/updater.sh
+++ b/packages/zaurus-updater/zaurus-updater/updater.sh
@@ -42,6 +42,9 @@
 #
 # 2007.12.25 Matthias 'CoreDump' Hentges
 # -Add support for installing / updating u-boot
+#
+# 2008.11.23 Dmitry 'lumag' Baryshkov
+# - Add support for reflashing home partitions
 
 # Set to "yes" to enable
 ENABLE_UBOOT_UPDATER="no"
@@ -53,6 +56,7 @@ TMPHEAD=$TMPPATH/tmphead.bin
 
 FLASHED_KERNEL=0
 FLASHED_ROOTFS=0
+FLASHED_HOMEFS=0
 UNPACKED_ROOTFS=0   # spitz only
 
 RO_MTD_LINE=`cat /proc/mtd | grep "root" | tail -n 1`
@@ -63,6 +67,14 @@ RO_MTD_NO=`echo $RO_MTD_LINE | cut -d: -f1 | cut -dd -f2`
 RO_MTD=/dev/mtd$RO_MTD_NO
 ROOTFS_SIZE=`echo $RO_MTD_LINE | cut -d" " -f2`
 
+RW_MTD_LINE=`cat /proc/mtd | grep "home" | tail -n 1`
+if [ "$RW_MTD_LINE" = "" ]; then
+    RW_MTD_LINE=`cat /proc/mtd | grep "\<NAND\>.*\<2\>" | tail -n 1`
+fi
+RW_MTD_NO=`echo $RW_MTD_LINE | cut -d: -f1 | cut -dd -f2`
+RW_MTD=/dev/mtd$RW_MTD_NO
+HOMEFS_SIZE=`echo $RO_MTD_LINE | cut -d" " -f2`
+
 LOGOCAL_MTD=/dev/mtd1
 
 VERBLOCK=0x48000
@@ -381,7 +393,7 @@ mkdir -p $TMPPATH > /dev/null 2>&1
 
 cd $DATAPATH/
 
-for TARGETFILE in u-boot.bin U-BOOT.BIN zimage zImage zImage.bin zimage.bin ZIMAGE ZIMAGE.BIN initrd.bin INITRD.BIN hdimage1.tgz HDIMAGE1.TGZ
+for TARGETFILE in u-boot.bin U-BOOT.BIN zimage zImage zImage.bin zimage.bin ZIMAGE ZIMAGE.BIN initrd.bin INITRD.BIN hdimage1.tgz HDIMAGE1.TGZ home.bin HOME.BIN
 do
     if [ ! -e $TARGETFILE ]
     then
@@ -438,6 +450,28 @@ do
         FLASH_TYPE=""
         ;;
 
+    home.bin)
+        if [ $FLASHED_HOMEFS != 0 ]
+        then
+            continue
+        fi
+        echo 'home file system'
+        FLASHED_HOMEFS=1
+        ISLOGICAL=0
+        ADDR=0
+        ISFORMATTED=0
+        MTD_PART_SIZE="0x$HOMEFS_SIZE"
+        ADDR=0
+        ISFORMATTED=0
+        TARGET_MTD=$RW_MTD
+        DATAPOS=0
+        ONESIZE=1048576
+        FLASH_TYPE="home"
+        /sbin/bcut -s 16 -o $TMPHEAD $TARGETFILE
+        do_flashing
+        FLASH_TYPE=""
+        ;;
+
     hdimage1.tgz)
         if [ $UNPACKED_ROOTFS = 0 ]
         then
@@ -446,7 +480,7 @@ do
         ;;
     
     u-boot.bin)
-    	if [ FLASHED_UBOOT != 1 ]
+        if [ $FLASHED_UBOOT != 1 ]
 	then
 		update_uboot "$TARGETFILE"
 		FLASHED_UBOOT="1"
-- 
1.5.6.5




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] zaurus-updater: add support for home partition reflashing
  2008-11-29  0:48 [PATCH] zaurus-updater: add support for home partition reflashing Dmitry Baryshkov
@ 2008-11-29 20:32 ` Stanislav Brabec
  2008-12-01  2:10   ` Dmitry
  0 siblings, 1 reply; 5+ messages in thread
From: Stanislav Brabec @ 2008-11-29 20:32 UTC (permalink / raw)
  To: openembedded-devel; +Cc: dbaryshkov

Dne Sat, 29 Nov 2008 03:48:48 +0300
Dmitry Baryshkov <dbaryshkov@gmail.com> napsal(a):

> Sometimes one needs to clean/reflash the home partition.
> Add support for flashing home.bin/HOME.BIN files onto "home" mtd
> device.

Somebody may found it useful (e. g. for initial setup).

Note that on models with HDD it will not do what is expected.
It will format 2nd NAND partition, but /home is on /dev/hda2.

When you are discussing updater, I would like to discuss few additional
changes:

1. Decrease number of reserved sectors while formatting the HDD. 5% is
far too much of space unusable for packages installation. I have 5%
free, but unable to run applications using /tmp. I propose 0% (or only
a few blocks).

2. Support for langpacks. OE does not create langpack yet, but it would
be nice to be able to flash localized system.

3. I am using post-flash customization using a combination of additional
files and patches. It would be nice to have something like that
directly as an updater feature.

-- 
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] zaurus-updater: add support for home partition reflashing
  2008-11-29 20:32 ` Stanislav Brabec
@ 2008-12-01  2:10   ` Dmitry
  2008-12-01 10:15     ` Stanislav Brabec
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry @ 2008-12-01  2:10 UTC (permalink / raw)
  To: Stanislav Brabec; +Cc: openembedded-devel

2008/11/29 Stanislav Brabec <utx@penguin.cz>:
> Dne Sat, 29 Nov 2008 03:48:48 +0300
> Dmitry Baryshkov <dbaryshkov@gmail.com> napsal(a):
>
>> Sometimes one needs to clean/reflash the home partition.
>> Add support for flashing home.bin/HOME.BIN files onto "home" mtd
>> device.
>
> Somebody may found it useful (e. g. for initial setup).
>
> Note that on models with HDD it will not do what is expected.
> It will format 2nd NAND partition, but /home is on /dev/hda2.

I don't know what it will format actually. Does the NAND have the "home"-labeled
partition on those devices?

>
> When you are discussing updater, I would like to discuss few additional
> changes:
>
> 1. Decrease number of reserved sectors while formatting the HDD. 5% is
> far too much of space unusable for packages installation. I have 5%
> free, but unable to run applications using /tmp. I propose 0% (or only
> a few blocks).

You can use tune2fs at any time, IIRC, can't you?

> 2. Support for langpacks. OE does not create langpack yet, but it would
> be nice to be able to flash localized system.

As a Russian user, it's definitely +1.

> 3. I am using post-flash customization using a combination of additional
> files and patches. It would be nice to have something like that
> directly as an updater feature.

It may be nice to have smth. like:

[snip]
if [ -x post-updater-hook.sh ]
then
  . post-updater-hook.sh
fi
[snip]

However I dunno if other developers will agree on this?

-- 
With best wishes
Dmitry



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] zaurus-updater: add support for home partition reflashing
  2008-12-01  2:10   ` Dmitry
@ 2008-12-01 10:15     ` Stanislav Brabec
  2008-12-01 10:44       ` Koen Kooi
  0 siblings, 1 reply; 5+ messages in thread
From: Stanislav Brabec @ 2008-12-01 10:15 UTC (permalink / raw)
  To: Dmitry; +Cc: openembedded-devel

Dmitry wrote:
> 2008/11/29 Stanislav Brabec wrote:
> >
> > Note that on models with HDD it will not do what is expected.
> > It will format 2nd NAND partition, but /home is on /dev/hda2.
> 
> I don't know what it will format actually. Does the NAND have the "home"-labeled
> partition on those devices?

On SL-C3000 it probably does not.
On SL-C3100 it has and int contains Sharp ROM /home.
On SL-C3200 it has and it is broken due to bad partitioning table in
kernel. Not easy to fix, as kernel cannot differentiate between SL-C3100
and SL-C3200 yet.

Imaging tool just now creates two images: flash and HDD. HDD
uses /dev/hda2 as /home, flash uses NAND as /home. AFAIK nobody tests
flash image.

> > 1. Decrease number of reserved sectors while formatting the HDD. 5% is
> > far too much of space unusable for packages installation. I have 5%
> > free, but unable to run applications using /tmp. I propose 0% (or only
> > a few blocks).
> 
> You can use tune2fs at any time, IIRC, can't you?

Yes, you can. This operation is possible even on mounted device. But
tune2fs is not part of the default image, and you need additional
reboot. I guess that reserved sectors don't have a real meaning on
Zaurus.

> > 2. Support for langpacks. OE does not create langpack yet, but it would
> > be nice to be able to flash localized system.
> 
> As a Russian user, it's definitely +1.

Its support would be only a first step. Creating them is a more
complicated task.

> > 3. I am using post-flash customization using a combination of additional
> > files and patches. It would be nice to have something like that
> > directly as an updater feature.
> 
> It may be nice to have smth. like:
> 
> [snip]
> if [ -x post-updater-hook.sh ]
> then
>   . post-updater-hook.sh
> fi
> [snip]

Yes, it looks flexible. If the hook script will return 1, shell can be
launched.


________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] zaurus-updater: add support for home partition reflashing
  2008-12-01 10:15     ` Stanislav Brabec
@ 2008-12-01 10:44       ` Koen Kooi
  0 siblings, 0 replies; 5+ messages in thread
From: Koen Kooi @ 2008-12-01 10:44 UTC (permalink / raw)
  To: openembedded-devel

On 01-12-08 11:15, Stanislav Brabec wrote:
> Dmitry wrote:
>> 2008/11/29 Stanislav Brabec wrote:

>>> 2. Support for langpacks. OE does not create langpack yet, but it would
>>> be nice to be able to flash localized system.
>> As a Russian user, it's definitely +1.
>
> Its support would be only a first step. Creating them is a more
> complicated task.

As a first step angstrom is now generating feed config files for the 
locale feeds:

http://cgit.openembedded.net/cgit.cgi?url=openembedded/commit/&id=bb668b9e99edea043a0c321109d76ca16c5e453f

regards,

Koen




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-01 10:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-29  0:48 [PATCH] zaurus-updater: add support for home partition reflashing Dmitry Baryshkov
2008-11-29 20:32 ` Stanislav Brabec
2008-12-01  2:10   ` Dmitry
2008-12-01 10:15     ` Stanislav Brabec
2008-12-01 10:44       ` Koen Kooi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.