Talk:NeoTool

From Openmoko

Revision as of 15:20, 16 November 2010 by Antisol (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Since I installed SHR-U from Oct. 2010 recently I thougt about ubifs support for neotool... What do you think?

Here's a patch against version 1.2 of neotool:

--- neotool.sh.cpx	2010-06-09 19:53:40.000000000 +0200
+++ neotool.sh	2010-10-22 09:45:57.000000000 +0200
@@ -493,7 +493,34 @@
 				echo Cleanup...
 				ssh root@$FRIP "umount /var/tmp/root; rmdir /var/tmp/root"
 				;;
+			"ubifs")
+			
+				ip_test
+				if [ $? != 0 ]; then
+					return
+				fi
+				
+				echo ' - Checking device for mkfs-ubifs...'
+				if [ -z "`ssh root@$FRIP 'opkg status mkfs-ubifs'`" ]; then
+					zenity --error --text 'prerequisite mkfs-ubifs is not installed on the device! \n\n do "opkg install mkfs-ubifs" and try again.'
+					return
+				fi
 
+				echo " - Mounting flash at /var/tmp/root..."
+				ssh root@$FRIP "mkdir /var/tmp/root; mount -t ubifs ubi0:om-gta02-rootfs /var/tmp/root"
+
+				echo ' - Performing backup... (this will take a while)'
+				if [ -z "`which pv 2>/dev/null`" ]; then	
+					#pv is not installed, so don't use it...
+					ssh root@$FRIP "mkfs.ubifs -r /var/tmp/root -o- -e 128KiB -m 512 -c 100 -x lzo" > $FSIMG
+				else
+					# FIXME: the mkfs.ubifs wants to have '-o <file>' option, how to pipe the data stream?
+					ssh root@$FRIP "mkfs.ubifs -r /var/tmp/root -o- -e 128KiB -m 512 -c 100 -x lzo" | pv -W > $FSIMG
+				fi
+				
+				echo Cleanup...
+				ssh root@$FRIP "umount /var/tmp/root; rmdir /var/tmp/root"
+				;;
 			"tar")
 				echo ' - Performing backup... (this will take a while)'
 				if [ -z "`which pv 2>/dev/null`" ]; then	
@@ -637,7 +664,7 @@
 
 function root_backup_type {
 		old_rootfs_type=$rootfs_type
-		rootfs_type=$(zenity --list --text "Choose rootfs backup type:\n\nIf you have modified your rootsf filename, this will reset it to the default." --column "Format" --column "Description" jffs2 "Flashable JFFS2 Image" "tar" "For SD card install")
+		rootfs_type=$(zenity --list --text "Choose rootfs backup type:\n\nIf you have modified your rootsf filename, this will reset it to the default." --column "Format" --column "Description" jffs2 "Flashable JFFS2 Image" ubifs "Flashable ubifs Image" "tar" "For SD card install")
 		if [ -z "$rootfs_type" ]; then
 			rootfs_type=$old_rootfs_type
 		fi

It does not work at the moment because the mkfs.ubifs command wants to have an output option '-o <filename>'. How to make it stream the output to stdout so we can pipe it?

To flash ubifs files nothing has to be changed, I've successfully done this using neotool v1.2.


Another feature request: Automatic installation of mkfs-jffs2/mkfs-ubifs if not found on openmoko device.

--ChrisPZV 11:45, 22 October 2010 (UTC)


Hi Chris,

Ooh! a patch! Thanks!

Sorry I haven't had a chance to get back to you, I've been meaning to check this out, but I haven't used my freerunner in nearly a year and haven't gotten around to trying out your patch. it looks OK though.

To make it send output to stdout for streaming across our ssh connection, you could try using something like '-o /dev/stdout', or you could try using a FIFO buffer using the 'mkfifo' command.

The reality of the situation is that I'm not particularly likely to add anything to NeoTool - at one time I had grand plans to rewrite it in something other than bash, but since I'm not using my FreeRunner anymore I don't see myself making any further improvements unless I have a resurgence of interest in this (terribly horribly awfully awful) device.

Having said that, I've applied your patch to the version I'm hosting (which is the 'official' download link on the wiki page - http://users.on.net/~antisol/neotool) and labelled it v1.3. If you want to play around with getting the ubifs stuff working properly and send me another patch, I'll be happy to apply it!

If you want to talk to me about neotool, probably your best option is to email me (see the bottom of the main neotool wiki page) :)

Cheers, -Dale

Personal tools

Since I installed SHR-U from Oct. 2010 recently I thougt about ubifs support for neotool... What do you think?

Here's a patch against version 1.2 of neotool:

--- neotool.sh.cpx	2010-06-09 19:53:40.000000000 +0200
+++ neotool.sh	2010-10-22 09:45:57.000000000 +0200
@@ -493,7 +493,34 @@
 				echo Cleanup...
 				ssh root@$FRIP "umount /var/tmp/root; rmdir /var/tmp/root"
 				;;
+			"ubifs")
+			
+				ip_test
+				if [ $? != 0 ]; then
+					return
+				fi
+				
+				echo ' - Checking device for mkfs-ubifs...'
+				if [ -z "`ssh root@$FRIP 'opkg status mkfs-ubifs'`" ]; then
+					zenity --error --text 'prerequisite mkfs-ubifs is not installed on the device! \n\n do "opkg install mkfs-ubifs" and try again.'
+					return
+				fi
 
+				echo " - Mounting flash at /var/tmp/root..."
+				ssh root@$FRIP "mkdir /var/tmp/root; mount -t ubifs ubi0:om-gta02-rootfs /var/tmp/root"
+
+				echo ' - Performing backup... (this will take a while)'
+				if [ -z "`which pv 2>/dev/null`" ]; then	
+					#pv is not installed, so don't use it...
+					ssh root@$FRIP "mkfs.ubifs -r /var/tmp/root -o- -e 128KiB -m 512 -c 100 -x lzo" > $FSIMG
+				else
+					# FIXME: the mkfs.ubifs wants to have '-o <file>' option, how to pipe the data stream?
+					ssh root@$FRIP "mkfs.ubifs -r /var/tmp/root -o- -e 128KiB -m 512 -c 100 -x lzo" | pv -W > $FSIMG
+				fi
+				
+				echo Cleanup...
+				ssh root@$FRIP "umount /var/tmp/root; rmdir /var/tmp/root"
+				;;
 			"tar")
 				echo ' - Performing backup... (this will take a while)'
 				if [ -z "`which pv 2>/dev/null`" ]; then	
@@ -637,7 +664,7 @@
 
 function root_backup_type {
 		old_rootfs_type=$rootfs_type
-		rootfs_type=$(zenity --list --text "Choose rootfs backup type:\n\nIf you have modified your rootsf filename, this will reset it to the default." --column "Format" --column "Description" jffs2 "Flashable JFFS2 Image" "tar" "For SD card install")
+		rootfs_type=$(zenity --list --text "Choose rootfs backup type:\n\nIf you have modified your rootsf filename, this will reset it to the default." --column "Format" --column "Description" jffs2 "Flashable JFFS2 Image" ubifs "Flashable ubifs Image" "tar" "For SD card install")
 		if [ -z "$rootfs_type" ]; then
 			rootfs_type=$old_rootfs_type
 		fi

It does not work at the moment because the mkfs.ubifs command wants to have an output option '-o <filename>'. How to make it stream the output to stdout so we can pipe it?

To flash ubifs files nothing has to be changed, I've successfully done this using neotool v1.2.


Another feature request: Automatic installation of mkfs-jffs2/mkfs-ubifs if not found on openmoko device.

--ChrisPZV 11:45, 22 October 2010 (UTC)


Hi Chris,

Ooh! a patch! Thanks!

Sorry I haven't had a chance to get back to you, I've been meaning to check this out, but I haven't used my freerunner in nearly a year and haven't gotten around to trying out your patch. it looks OK though.

To make it send output to stdout for streaming across our ssh connection, you could try using something like '-o /dev/stdout', or you could try using a FIFO buffer using the 'mkfifo' command.

The reality of the situation is that I'm not particularly likely to add anything to NeoTool - at one time I had grand plans to rewrite it in something other than bash, but since I'm not using my FreeRunner anymore I don't see myself making any further improvements unless I have a resurgence of interest in this (terribly horribly awfully awful) device.

Having said that, I've applied your patch to the version I'm hosting (which is the 'official' download link on the wiki page - http://users.on.net/~antisol/neotool) and labelled it v1.3. If you want to play around with getting the ubifs stuff working properly and send me another patch, I'll be happy to apply it!

If you want to talk to me about neotool, probably your best option is to email me (see the bottom of the main neotool wiki page) :)

Cheers, -Dale