View Single Post
Posts: 543 | Thanked: 181 times | Joined on Aug 2009 @ Universe,LocalCluster.MilkyWay.Sol.Earth.Europe.Slovenia.Ljubljana
#51
Well I've done it... only had to reflash 3 times...
This is just stupid but if MyDocs isn't vfat nothing seems to want to work. This shouldn't be so - I would consider this a bug but not sure if Nokia would or the Maemo team.

Here's the file I made:
And of course THIS CAN MAKE IT A BRICK SO BE PREPARED TO RESTORE FROM FLASHER OR ANY OTHER WAY YOU CAN THINK OF
cat repart.sh
Code:
#!/bin/bash

echo "Not for running only REFERENCE!!!"
exit

### THIS ALL APPLIES TO 42.11 ###

# backup your user
mount /dev/mmcblk1p1 /media/mmc1
cp -a /home/user /media/mmc1/

# partitioning
sfdisk -uM --no-reread /dev/mmcblk0 << FDSK
0 2048 c
2049 20544 83
22593 768 82
23361 7170 5
23362 2048 83
25410 5120 83

FDSK

# REBOOT

# do this sometime
mkfs.ext2 /dev/mmcblk0p5
mkfs.ext2 /dev/mmcblk0p2
mkfs.ext2 /dev/mmcblk0p6
mkfs.vfat /dev/mmcblk0p1
mkswap /dev/mmcblk0p3

# change /etc/event.d/rcS-late
# comment out generation of fstab
# the following sed command will add a comment character "#"
# at the start of lines 10-20 
sed "10,20s:\(.*\):#\1:" /etc/event.d/rcS-late > /etc/event.d/rcS-late.new
cp /etc/event.d/rcS-late.new /etc/event.d/rcS-late

# add mount /home/user/MyDocs
# this sed command inserts /bin/mount /home/user/MyDocs || echo 'Failed to mount' on line 23
sed "23i/bin/mount /home/user/MyDocs || echo 'Failed to mount /home/user/MyDocs partition.'" /etc/event.d/rcS-late > /etc/event.d/rcS-late.new
cp /etc/event.d/rcS-late.new /etc/event.d/rcS-late
rm /etc/event.d/rcS-late.new
# change /etc/init.d/rcS
# this sed command starts on line 197 and if it finds: load_extra_module
# it will replace it with: load_extra_module newline and a mount for usr and opt
sed "197s:load_extra_modules:load_extra_modules\nmount /usr || echo 'Failed to mount /usr'\nmount /opt || echo 'Failed to mount /opt':" /etc/init.d/rcS > /etc/init.d/rcS.new
cp /etc/init.d/rcS.new /etc/init.d/rcS
rm /etc/init.d/rcS.new
# fstab
cat << FSTAB > /etc/fstab
rootfs / rootfs defaults,errors=remount-ro,noatime 0 0
/dev/mmcblk0p6 /usr ext2 rw,noatime,nodiratime,errors=continue 0 0
/dev/mmcblk0p5 /opt ext2 rw,noatime,nodiratime,errors=continue 0 0
/dev/mmcblk0p3 none swap sw 0 0
/dev/mmcblk0p2 /home ext2 rw,noatime,nodiratime,errors=continue 0 0
/dev/mmcblk0p1 /home/user/MyDocs vfat noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir 0 0

FSTAB
mkdir /usra
mount /dev/mmcblk0p6 /usra
cp -a /usr/* /usra/
mount /home
mount /home/user/MyDocs
mount /dev/mmcblk1p1 /media/mmc1
cp -a /media/mmc1/user /home/

mkdir /tmproot
mount -o bind / /tmproot
And if it isn't obvious you need rootsh/gainroot

Last edited by ruskie; 2009-12-16 at 06:01. Reason: Added a mer detailed explanation of the sed commands
 

The Following 6 Users Say Thank You to ruskie For This Useful Post: