View Single Post
Posts: 4,030 | Thanked: 1,633 times | Joined on Jul 2007 @ nd usa
#292
Originally Posted by Milhouse View Post
Now seems a good time to document some new options I've added to the nupgrade.sh script.

The full usage is:

Code:
nupgrade.sh 0-6|wipe|clone [internal | external] [ext2 | ext3] [sardine | herring] [yes]
where:
  • 0-6: Individual steps as described at the beginning of this thread
  • wipe: shorthand for all steps 0-4 - use only if you know you have a properly setup device. Will format the target partiion (see below)
  • clone: shorthand for all steps 1-4 - use only if you know you have a properly setup device. Will NOT format the target partiion (see below)

  • internal: Manually select the internal memory card as the target (default is to select automatically - see below)
  • external: Manually select the external memory card as the target (default is to select automatically - see below)

  • ext2: Will format the target partition using ext2 filesystem (this is the default)
  • ext3: Will format the target partition using ext3 filesystem

  • sardine: Only relevant for steps 5 and 6. Sardine is the default. Upgrade your OS to the bleeding edge development version. Rarely works.
  • herring: Only relevant for steps 5 and 6. Upgrade your OS to the most stable development version available. Rarely works.

  • yes: Surpress target partition confirmation prompt - use with caution. Default is to prompt the user

eg. to reformat and clone the OS to the automatically determined target memory card without prompting use the following command:

Code:
./nupgrade.sh wipe yes
Or to force the reformat and clone the OS to the external card using the ext3 filesystem, without prompting, use the following command:

Code:
./nupgrade.sh wipe external ext3 yes
Target Selection
The target device and partition will be automatically detected by the script based on the available memory cards and partitions present on those cards.

You will be prompted to accept the automatically determined device/partition before the script proceeds to write or modify the target in any way, unless you pass the parameter "yes" in which case there will be no prompting (so use with caution!) The default response to the prompt is "yes", and you can just press return to continue, or enter "no" or ctrl-c to abort.

The script will first check the "internal" memory card (if present) for a second partition with a filesystem type of 83 (ie. Linux). If such a partition is available it will be considered the target for the cloning process. If there is no valid partition available on the internal memory card, the external memory card will be checked for a second partition of type 83 and it will become the target if such a partition is present. If neither memory card has a valid partition, the script will abort.

The automatic internal/external device detection can be overridden by specifying the "internal" or "external" parameter - if "internal" is passed as a parameter, the script will verify the internal card is suitable before proceeding, otherwise it will abort. Likewise for "external", only the external card will be considered as the target and the internal card will be ignored.
First time tried this new receipe, worked just as advertised, totally automatic and handoff, just the way a clone script supposed to be, thank you Milhouse, again for an excellent script.

Step by step, for my own record, in case I have to do it again.

Prerequisite already satisfied, see beginning of thread, e.g., getting setup/installed becomeroot,wget,e2fsprogs,http://fanoush.wz.cz/maemo/#initfs etc done.

N810 running 2007.50-2, a 4G Adata micro/mini adapter inserted.
xterm/sudo gainroot
umount /media/mmc1
sfdisk /dev/mmcblk1 -uM
0,2100,0C
,,,
(return)
(return)
y
reboot

______(start from here, step 7 of thread #1)_________
xterm/sudo gainroot
cd ~/bin
./nupgrade.sh wipe
"Using...ext2fs
Continue? (YES/no) : " YES
it runs for 5+ minutes and ends up with
...
Committing updates and Unmounting filesystems
Done
/home/user/bin #

No error messages.

reboot, boot up from mmc2 i.e., ext SD, partition 2.

bun

Last edited by bunanson; 2008-02-15 at 23:09.