Talk:NeoTool

From Openmoko

Revision as of 12:45, 22 October 2010 by ChrisPZV (Talk | contribs)

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)

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)