maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2007 / Maemo 3 / Bora (https://talk.maemo.org/forumdisplay.php?f=23)
-   -   Cloning OS to SD Card: Simplified instructions (https://talk.maemo.org/showthread.php?t=8631)

qwerty12 2008-01-27 10:54

Re: Cloning OS to SD Card: Simplified instructions
 
Quote:

Originally Posted by ghoonk (Post 134326)
I think I found part of the problem.

After partitioning, i rebooted, then

sudo gainroot
sfdisk -ls

and got the following results:

/home/user # sfdisk -ls
/dev/mmcblk0: 15694336

Disk /dev/mmcblk0: 490448 cylinders, 4 heads, 16 sectors/track
Units = cylinders of 32768 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/mmcblk0p1 32 448031 448000 14336000 c W95 FAT32 (LBA)
/dev/mmcblk0p2 0+ 31 32- 1023+ 83 Linux
/dev/mmcblk0p3 448032 490447 42416 1357312 83 Linux
/dev/mmcblk0p4 0 - 0 0 0 Empty
total: 15694336 blocks


For some strange reason, the 1GB I allocated for the Linux partition for the bootspace ended up being mmcblk0p3 instead of mmcblk0p2 as I thought.

How do I designate p03 to be the default bootspace?

Personally I'd try deleting the the po3 and use p02 for conformity but if you use the bootmenu.conf.n800.example that comes with the initfs flasher and rename it to bootmenu.conf and reflash initfs, you will get the option to boot of the 3rd partition:

Quote:

Originally Posted by bootmenu.conf.n800.example
MENU_3_NAME="Internal/first MMC card, partition 3, ext2"
MENU_3_ID="mmc3"
MENU_3_DEVICE="mmcblk0p3"
MENU_3_MODULES="mbcache ext2"
MENU_3_FSTYPE="ext2"
MENU_3_FSOPTIONS="noatime"


ghoonk 2008-01-27 10:57

Re: Cloning OS to SD Card: Simplified instructions
 
How do i delete p03 and replace it with P02?

sorry i'm such a pain, but I'm getting THIS close....

qwerty12 2008-01-27 11:08

Re: Cloning OS to SD Card: Simplified instructions
 
I'm not entirely sure about replacing the partition but for deleting p03

You could try:
/dev/mmcblk0p3:448032,,0

It starts from your p03 cylinder and replaces it with an empty partition. I'm not sure that it is right but I cannot find anything on removing partitions with sfdisk.

Then just press enter when it gets to mmcblk0p4.

You could try deleting the p02 then and repartitioning the p02.

ghoonk 2008-01-27 11:16

Re: Cloning OS to SD Card: Simplified instructions
 
No luck, so I did this:

sudo gainroot
umount /media/mmc2
sfdisk /dev/mmcblk0
1,448000,0C
448032,,
reboot

That seems to have done the trick, the 1.3GB is now allocated to Linux on partition 2.

Let's try this again. Having a PITA trying to deal with tar

qwerty12 2008-01-27 11:22

Re: Cloning OS to SD Card: Simplified instructions
 
Quote:

Originally Posted by ghoonk (Post 134333)
No luck, so I did this:

sudo gainroot
umount /media/mmc2
sfdisk /dev/mmcblk0
1,448000,0C
448032,,
reboot

That seems to have done the trick, the 1.3GB is now allocated to Linux on partition 2.

Let's try this again. Having a PITA trying to deal with tar

Downloading tar worked for me fine, and I just set it to be executable but when I was in stage 3, I think tar would hang the N800, so I just force unmounted the memory card (not good) and restarted and tried 3 again. This time at stage 3, it cloned fine except I got a message at the end saying, tar:implausibly old time stamp. I ignored it and went to step 4 which worked fine. And I could boot of memory card.

ghoonk 2008-01-27 11:49

Re: Cloning OS to SD Card: Simplified instructions
 
Just tried to run

tar zxvf initfs_flasher.tgz and kept getting one error or another.

I proceeded to try to run initfs_flash anyway and it failed after the point of removing files=yes.

Maybe I need to sacrifice a goat or two to appease the hildon gods to get OS2008 booting from MMC.

qwerty12 2008-01-27 12:05

Re: Cloning OS to SD Card: Simplified instructions
 
Is your internet connection fine? (Also if you are trying to modify the archive beforehand, 7Zip corrupts it)

The way I do it (and I was doing this for 3 hours in the early morning, trying to modify the bootmenu.sh)
is to save the http://fanoush.wz.cz/maemo/initfs_flasher.tgz on the internal memory card using my computer, then:

cp /media/mmc2/initfs_flasher.tgz /home/user/MyDocs/.documents
cd /home/user/MyDocs/.documents
tar zxvf initfs_flasher.tgz
cd initfs_flasher/
./initfs_flash

The archive has to be extracted on the built in flash memory of the N800 and also I cant just zip up the files for you because the initfs flasher relies on symlinks etc which tar recreates.

Milhouse 2008-01-30 16:29

Re: Cloning OS to SD Card: Simplified instructions
 
Quote:

Originally Posted by ghoonk (Post 134213)
sudo gainroot
umount /media/mmc2
mke2fs /dev/mmcblk0p2
reboot

sudo gainroot
umount /media/mmc2
cd bin
./nupgrade.sh 0
yes
./nupgrade.sh 1
yes
./nupgrade.sh 2
yes
./nupgrade.sh 3
yes
./nupgrade.sh 4
yes
reboot

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.

bunanson 2008-02-02 14:25

Re: Cloning OS to SD Card: Simplified instructions
 
On some SDHC card, a low level formatting is required, info here, http://www.internettablettalk.com/fo...051#post137051, thread #24.

@Milhouse: Does 'wipe' include low level format?

The low level format is REQUIRED for Adata SD cards. There are few posts that people do not have to do the low level format and succeeded, this thread #264,#266, and 3 more. I am interested to know what kind of SD cards they are using. Their SD cards probably more conformed to the SD standard than Adata.

bun

qwerty12 2008-02-03 13:23

Re: Cloning OS to SD Card: Simplified instructions
 
I hope you don't mind me posting here but this stupid mobile skin wont let me make a new thread or change skin but is there a way of extracting all the needed files/root filesystem from the original os2008 n800 bin file and placing that on a partition?

I want to make an install that has only security penetration tools and if I clone my current install, i have more to remove than install...

TIA


All times are GMT. The time now is 23:19.

vBulletin® Version 3.8.8