[W-I-P][DEVELOPMENT] Dual / Multi Boot Project: Devs Only - XPERIA X10 Android Development

{ LONG POST WARNING }
{ NOT FULLY WORKING YET}
{ NEEDS A LOT OF FURTHER DEVELOPMENT }
Hey everyone I had thought of making this Dual Booting system work along side recovery… because initially (with FreeX10-alpha) it was not possible to have both recovery & dual boot...
Thank you zdzihu & jerpelea for your great work on FreeX10-alpha, which booted off SDCARD… I got inspiration to try and make this work for FreeX10-beta4 based on the amazing work that u guys did! Thank you jerpelea for all your feedback on my repeated messages when I was testing this a few months back (hope I didn’t bother u too much with questions )...
zdzihu & jerpelea u are truly LEGENDS!!!
[This is just my personal opinion] Really hoping that some devs can take interest in this to provide compatible files (ramdisks, system files) for this to work… may be as an add-on to their main roms… please don’t keep bothering devs to create ramdisks for booting off SDCARD… they are already very busy trying to make our X10 better with faster and stable ROMS/MODS/etc… this is just an additional feature…
The basic idea was to use the chargemon booting scripts provided in FreeX10-alpha and to try and make FreeX10-beta4 to boot off SDCARD…
Initially I used the img files which came with FreeX10-alpha and wiped the image to then put FreeX10-beta4 on it… while doing so I realized that all of the symbolic links were not getting copied correctly (obviously)… so I started from scratch with blank ext2fs images…
Later I thought of using clean/base nandroid/recovery backups as they are already working/preconfigured system of FreeX10-beta4…
Following is a small How-To on converting NANDROID/RECOVERY images (with yaffs fs) to ext2 fs images keeping the symlinks intact!!
I have used Ubuntu for these steps.
I have attached blank_files.7z which contains precompiled ext2fs images:
system.img [size: 256 MB]
data.img [size: 512 MB]
cache.img [size: 128 MB]
To resize or create newer ext2fs images:
[APP] Windows: Create Your Own Data.img Maker Application, +/- From Existing data.img
U can use the commands provided there even in linux to create/resize these images...
We will keep the NANDROID images at:
Code:
/home/user/nandroid_imgs/test1/
and EXT2 FS images at:
Code:
/home/user/ext2fs_imgs/test1/
while temporary mounts points will be made at:
Code:
/home/user/mntpts/
We will be using unyaffs from here:
[How-To] Extracting/Accessing Recovery/Nandroid backup (.img) files
Extracting files from the nandroid/recovery backups:
Code:
cd /home/user/nandroid_imgs/test1
mv system.img /home/user/nandroid_imgs/test1/system/
cd /home/user/nandroid_imgs/test1/system/
sudo unyaffs system.img
mv system.img ../.
mv data.img /home/user/nandroid_imgs/test1/data/.
cd /home/user/nandroid_imgs/test1/data/
sudo unyaffs data.img
mv data.img ../.
mv cache.img /home/user/nandroid_imgs/test1/cache/
cd /home/user/nandroid_imgs/test1/cache/
sudo unyaffs cache.img
mv cache.img ../.
Loop mounting ext2 fs files:
Code:
sudo mount -t ext2 -o loop,rw,noatime,nodiratime /home/user/ext2fs_imgs/test1/system.img /home/user/mntpts/system/
sudo mount -t ext2 -o loop,rw,noatime,nodiratime,nosuid,nodev /home/user/ext2fs_imgs/test1/data.img /home/user/mntpts/data/
sudo mount -t ext2 -o loop,rw,noatime,nodiratime,nosuid,nodev /home/user/ext2fs_imgs/test1/cache.img /home/user/mntpts/cache/
Recursively copy all files (preserving symlinks) from extracted yaffs images to mount points
Code:
sudo cp -r -p /home/user/nandroid_imgs/test1/system/* /home/user/mntpts/system/.
sudo cp -r -p /home/user/nandroid_imgs/test1/data/* /home/user/mntpts/data/.
sudo cp -r -p /home/user/nandroid_imgs/test1/cache/* /home/user/mntpts/cache/.
Unmount the mounts:
Code:
sudo umount /home/user/mntpts/system/
sudo umount /home/user/mntpts/data/
sudo umount /home/user/mntpts/cache/
Ok now that the ext2fs iamges are populated with working files copy them onto SDCARD…
I have placed it at:
Code:
/sdcard/FreeX10
lets move on to the chargemon script...
This is, as of now, based off xRecovery chargemon (modified from FreeX10-alpha)
Code:
#!/system/bin/busybox sh
# modified chargemon for recovery + dual boot from NAND/SDCARD
/system/bin/charger
cat /dev/input/event2 > /dev/keycheck&
sleep 3
kill -9 $!
# intact recovery
if [ -s /dev/keycheck ]
then
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /data
umount -l /cache
# Extract recovery
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount system
umount -l /system
chroot / /init
fi
echo "check if reboot into SDCARD OS was called"
if [ -e /data/local/tmp/rebootsdcardos ]
then
echo "Booting from SDCARD!"
# FreeX10-alpha code follows with slight modifications!!!
# remount rootfs rw
mount -o remount,rw rootfs /
busybox chmod 0777 /dev -R
busybox chown 0.2000 /dev/oncrpc -R
rm -r /sdcard
cd /
mkdir sd
chmod 777 sd
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/sdcardos_ramdisk.tar
# Umount system,data,cache
umount -l /system
umount -l /data
umount -l /cache
# Check and mount SD Card
dosfsck -y /dev/block/mmcblk0p1
sleep 5
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sd
sleep 5
# Mount system and data ext2 images
losetup /dev/block/loop1 /sd/FreeX10/system.img
sleep 5
losetup /dev/block/loop2 /sd/FreeX10/data.img
sleep 5
losetup /dev/block/loop3 /sd/FreeX10/cache.img
sleep 5
e2fsck -y /dev/block/loop1
e2fsck -y /dev/block/loop2
e2fsck -y /dev/block/loop3
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
sleep 5
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache
sleep 5
# zdzihu: hack-fix
if [ -e /data/data/com.android.providers.telephony/databases/telephony.db ]; then
/system/bin/chroot / /init
exit
fi
# Chroot :)
chroot / /init
# jump out of chargemon to skip NAND booting
exit
fi
echo "Booting from NAND!"
# remount rw
mount -o remount,rw rootfs /
cd /
rm -r /sdcard
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# zdzihu: hack-fix
if [ -e /data/data/com.android.providers.telephony/databases/telephony.db ]; then
/system/bin/chroot / /init
exit
fi
chroot / /init
Recovery is intact so u can get into recovery the normal way… (press/tap back key after seeing SE text logo)
OS on NAND (normal system on MTD) will boot by default…
To reboot into OS on SDCARD issue the following commands in terminal emulator/adb shell:
Code:
touch /data/local/tmp/rebootsdcardos
reboot
NOW the OS should start booting off the SDCARD…
It completes commands in chargemon and then BootAnimation can be seen…
BUT HERE IS THE PROBLEM!
Check LOGCAT here: http://www.mediafire.com/?phxm3uqzp0dzzhb
here is wht J had to say:
jerpelea said:
as you can see in logcat
1.your prelink is not ok
2.you don't have something ok in initrd
3.you dont have all permisions ok on data
Click to expand...
Click to collapse
From my limited understanding we yet have to make a proper ramdisk (sdcardos_ramdisk.tar)… I feel the init.rc file has to be changed especially the following line (based off FreeX10-beta4 ramdisk):
Code:
mount yaffs2 [email protected] /system rw remount
mount yaffs2 [email protected] /data nosuid nodev
mount yaffs2 [email protected] /cache nosuid nodev
As for Multi-Booting:
We can keep adding different sections to chargmeon:
Code:
/data/local/tmp/rebootsdcardos1
/data/local/tmp/rebootsdcardos2
etc…
OR
possible solution for having both recovery and dual boot
and similarly keep adding ramdisks in NAND /system:
Code:
sdcardos1_ramdisk.tar
sdcardos2_ramdisk.tar
etc
So we can have as many OS/ROMs on SDCARD as u have free space… though we need to make specific ramdisks for each…
Hope this was slightly useful… and waiting for feedback from advance users on how we can get this working....

Lol, you're working very hard Doom! Keep going!

Doom! You are making enormous progress and helping a lot with Other Devs.
A Combination of a good rom and one of these additional Dual Boot would make x10 better than any Android mobile SE could deliver.
Thank you and I really pray to give SE a run for their money!

for someone thats always saying hes not a developer you sure as hell seem to know what your doing!
Keep up the great work, i hope to see this working flawlessly that would be awesome to be able to dual boot.
Whats the next steps in the project?

BULL3TPR00F said:
for someone thats always saying hes not a developer you sure as hell seem to know what your doing!
Keep up the great work, i hope to see this working flawlessly that would be awesome to be able to dual boot.
Whats the next steps in the project?
Click to expand...
Click to collapse
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting

DooMLoRD said:
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
Click to expand...
Click to collapse
You may not be a rom developer but your an amazing commited x10 modder
Sent from my X10i TripNMiUI using XDA App

DooMLoRD said:
well i am not exactly a ROM developer and dont know much about how to compile libs/sources/etc...
next step is that we need to make compatible system files & ramdisk (init.rc) for dual booting
Click to expand...
Click to collapse
I am also excited buddy..... Once i get through my experiments i will surely like to focus on this as this will allow us to have more then one version of ROM on one machine.

Based on your first post
all i can get is we are getting the boot animation but not going after that.
i would suggest following things based on my experiments with ubuntu work.
use loops above 10 coz i suspect some loops are already in use during my ubuntu boot i am watching that loop7 is already created so i would suggest avoiding it.
also as we have been adding debug "we have reached here" style code can we do the same here that might help us.
also can we find any debug-able place i mean place where we can track the progress to get the position inside the rom so that we can understand except logcat where we are.

any progress or hurdles buddy.....
i am eager to test this .....

anantshri said:
any progress or hurdles buddy.....
i am eager to test this .....
Click to expand...
Click to collapse
sorry man havent had time to do any further testing for this... have been very busy with some personal work and kernel manager scripts...

DooMLoRD said:
sorry man havent had time to do any further testing for this... have been very busy with some personal work and kernel manager scripts...
Click to expand...
Click to collapse
Keep up the good Work Doom. ! and thx for your work

Sorry if its no help but there's a thread in the x10 mini pro section
http://forum.xda-developers.com/showthread.php?t=1084555
Sent from my SEX10 using XDA App

These are great news, keep on developing!
sent from my x10i with wolfbreaks CM 6.1.3 v006 undervolted, bb67

rtblittlebrown said:
Sorry if its no help but there's a thread in the x10 mini pro section
http://forum.xda-developers.com/showthread.php?t=1084555
Sent from my SEX10 using XDA App
Click to expand...
Click to collapse
they have posted exactly the same thing!
read my 1st post in this thread and then read the first few posts there

Ohk so since we now have one more option in Xrecovery i am back to my old suggestion.
however this time i will post my thought out in open so that if someone has required skills and time then they can work on .
I have an idea of using xrecovery as a boot menu.
process would be
1) Xrecovery to start everytime. (this needs some consideration.)
2) To have a timeout value if any key pressed before that then remain in menu otherwise boot to the os.
3) inside menu we should have options of all O.S. / ROM (os coz my intention are to run linux off dualboot) available with selection options.
4) ON selection it will just be the same procedure as already using in xrecovery 1.0 to handover the command to a script. and let it load.
5) boot menu if possible could be controlled by an outside file which we can edit just like grub.conf in linux.
Note : This will requires good understanding of booting process of X10i and c skills as xrecovery is written in complete c.

anantshri said:
Ohk so since we now have one more option in Xrecovery i am back to my old suggestion.
however this time i will post my thought out in open so that if someone has required skills and time then they can work on .
I have an idea of using xrecovery as a boot menu.
process would be
1) Xrecovery to start everytime. (this needs some consideration.)
2) To have a timeout value if any key pressed before that then remain in menu otherwise boot to the os.
3) inside menu we should have options of all O.S. / ROM (os coz my intention are to run linux off dualboot) available with selection options.
4) ON selection it will just be the same procedure as already using in xrecovery 1.0 to handover the command to a script. and let it load.
5) boot menu if possible could be controlled by an outside file which we can edit just like grub.conf in linux.
Note : This will requires good understanding of booting process of X10i and c skills as xrecovery is written in complete c.
Click to expand...
Click to collapse
point no.1 is easy... not an issue..
abt point 2 i think that too would be possible... a while loop with sleep function & wait for input/keppress
pt3 the newer xrecovery v1.0.0 already has something similar may be we can look into it to add "Boot NAND system" as first option
point no. 5 if possible WILL BE BRILLIANT!!!
@anantshri
dude may be these guys can help us:
http://forum.xda-developers.com/showpost.php?p=14354231&postcount=49

DooMLoRD said:
they have posted exactly the same thing!
read my 1st post in this thread and then read the first few posts there
Click to expand...
Click to collapse
Oops sorry..
Sent from my SEX10 using XDA App

rtblittlebrown said:
Oops sorry..
Sent from my SEX10 using XDA App
Click to expand...
Click to collapse
no dude thanks for the info... i have already contacted those guys for help... lets see may be they can help us out to get this working!!!

dual boot hint by Z
http://forum.xda-developers.com/showthread.php?t=1107111
something related

Related

Debian on the X10

[MESSAGE TO MODS, I could not include urls so have added spaces to pass spam filter.. please change?]
Well now we finally have root on our shiny devices I decided to crack open
the beers and get to work getting debian running on the X10..
the process is actually pretty straight-forward.
(as it turns out the x10's kernel already has support for most things needed
such as the ext2 filesystem)
-- step 1--
firstly we need to create a debian image for the phone, there are a few already out there but you can use the following to create your own
Code:
apt-get install debootstrap
dd if=/dev/zero of=debian.img seek=749999999 bs=1 count=1
mke2fs -F debian.img
mkdir debian
mount -o loop debian.img debian
debootstrap --verbose --arch armel --foreign lenny debian [ht]tp:[//]ftp. de. debian. org/debian
umount debian
how ever if you would prefer to use a ready built one (recomended for less techies ) you can get one from: rapidshare. com/files/161776007/debian-armel-750.img.bz2
(had to include spaces in the url to pass spam filter, could a mod please change this?)
now copy this too the root of your sdcard and make sure its called debian.img
-- step 2 --
I have created a script to do most of the other work for you:
Code:
alias b=busybox
export PATH=/data/local/bin:/usr/bin:/usr/sbin:/bin:$PATH
b mknod /dev/loop0 b 7 0
b mount -o loop,noatime /sdcard/debian.img /data/local/mnt
echo 'nameserver 4.2.2.2' >data/local/mnt/etc/resolv.conf
b chroot /data/local/mnt
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab
put this in your sdcard to.
-- step 3 --
Finally in any terminal emulator cd to the location of the startdeb.sh file
and do the following:
Code:
chmod 777 ./startdeb.sh
./startdeb.sh
!! and your done !!
you should now be within the debian system.. i suggest running
Code:
apt-get update
and installing what ever apps you want
(my first choices were gcc, python and tightvncserver)
[ EXTRA ]
now your on debian you can use
Code:
apt-get install tightvncserver
to get the xwindow system and the vnc server
now set both your HOME and USER variables
Code:
export HOME=/root
export USER=root
(or what ever user you choose)
and run
Code:
tightvncserver
(your also gonna have to download lxde and do a few other bits of setup
have a look around for X11 "Ported" to android post on these forums)
you could also change the config so that the desktop is displayed
at the right size for the screen
just use a vnc client from the market to connect to your GUI
Kool. I had ubuntu running on my htc touch pro once but wasnt really worth having apart from the cool factor. This looks promising.............. ill wait a while till I play around, the rooting factor is still new and I dont see the major gain to root yet.
Way awesome, thanks for the guide.
Nice work, will give this a try after I get the R2B rooted on my phone.
Next step for me would be to get the arm cross compilation toolchain and start porting goodies for the android....
wow this looks sooooo awesome!! any screen shots? don't make me google
when i try mounting debian.img using ur cmd i got following error
Code:
Usage: mount [-r] [-w] [-o options] [-t type] device directory
seems my mount requires -t parameters, so i try again, but still having error
Code:
mount -o loop,noatime -t ext2 /sdcard/debian.img /data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy
please help thanks!
aget1 said:
when i try mounting debian.img using ur cmd i got following error
Code:
Usage: mount [-r] [-w] [-o options] [-t type] device directory
seems my mount requires -t parameters, so i try again, but still having error
Code:
mount -o loop,noatime -t ext2 /sdcard/debian.img /data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy
please help thanks!
Click to expand...
Click to collapse
Are you running the script as root? If you not you might wanna try that.
This may sound kind of noobish, but would this be a dual-boot (I.e. running both android and debian on different boots of the phone, or would this be debian, until you reset the phone to be android again.
Sent from my X10a using XDA App
ddewbofh said:
Are you running the script as root? If you not you might wanna try that.
Click to expand...
Click to collapse
Still the same
Code:
whoami
whoami: unknown uid 0
mount -o loop,noatime -t ext2 /sdcard/debian.img /data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy
aget1 said:
Still the same
Code:
whoami
whoami: unknown uid 0
mount -o loop,noatime -t ext2 /sdcard/debian.img /data/local/mnt
ioctl LOOP_SET_FD failed: Device or resource busy
Click to expand...
Click to collapse
And I assume you're either running the script or doing those commands manually? Including the mknod part?
ddewbofh said:
And I assume you're either running the script or doing those commands manually? Including the mknod part?
Click to expand...
Click to collapse
i run the script and found no luck, so i type in both adb and console, of coz mknod is done, either mkdir /data/local/mnt is done or not gives the same result, tried also mounting without loop,noatime and gives
Code:
mount: Block device required
would it be rooting problem or mount problem?
also tried losetup -d /dev/loop0, no luck
Code:
losetup: /dev/loop0: Device or resource busy
Keegan_P said:
This may sound kind of noobish, but would this be a dual-boot (I.e. running both android and debian on different boots of the phone, or would this be debian, until you reset the phone to be android again.
Sent from my X10a using XDA App
Click to expand...
Click to collapse
i see this to be a remounting of debian system on your phone, no modification on your phone so no, no dual boot
anybody can post a video tutorial please?
and the debian and android works together or just debian?
thx
A video tutorial would be amazing.
Sent from my X10a using XDA App
I will upload a video tutorial asap but at the moment I am having to use a 3G dongle for my internet (just moved out, am poor.. all donations to [email protected] on paypal ;-)) also this runs along side (or on top of) android so you'll still be able to get your texts and calls.. finally there are already a lot of debian apps compiled for ARM systems so have a look to see if the app you want is on apt (make sure you've run apt-get update first) please pm me if you have any problems
Thanks,
Sam Aldis
I tried to run it on the latest firmware and it seems loop device kernel module is not available in it.
Also the script is not fully functional :
you need to 'mkdir /data/local/mnt/'
also it's '/data/local' instead of 'data/local'
I haven't spend much time on this, so it's not working for now on my phone.
So help is welcome
Quick question:
Has anyone at all gotten this to work?
nope. I doubt it.
mod edit:..
sorry for stupid me, i don't know i can create loop device more than loop 0
i create loop0,loop1,loop2,loop7 and try mounting again, it success this time
so here is my script:
Code:
#!/system/bin/bash
export PATH=/data/local/bin:/usr/bin:/usr/sbin:/bin:$PATH
if [ ! -d /data/local/mnt ]
then
mkdir /data/local/mnt
fi
if [ ! -b /dev/loop2 ]
then
mknod /dev/loop0 b 7 0
mknod /dev/loop1 b 7 0
mknod /dev/loop2 b 7 0
mknod /dev/loop7 b 7 0
fi
if [ ! -d /data/local/mnt/bin ]
then
mount -o loop,noatime /sdcard/debian.img /data/local/mnt
fi
echo "nameserver 4.2.2.2" >data/local/mnt/etc/resolv.conf
chroot /data/local/mnt
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
rm -f /etc/mtab
ln -s /proc/mounts /etc/mtab
Edited:
I just brick my device after some more work, every command even ls do no output, reboot machine freezes at sony ericsson logo, now i am re rooting the device......
Edited 2:
Should be not the problem of debian, seems working fine.

[MULTIBOOT] Mini pro All-in-one recovery pack

STILL TESTING!
This is made by nobodyAtall, ported to work on mini pro, and added features
Guys, so this is a new attempt to multiboot. I need testers from all kind of SD's
Features
*Multiboot (More info) - CM6 & CM7 Only (I think, but it's possible...)
*Dual Recovery (More info) - All ROM's
*Data encryption (More info) - CM6 & CM7 Only
How to install
1. Flash .zip for AIO recovery pack (CWM recovery)
2. Go to CWM recovery (back button, middle button (home) it's for xrecovery) and choose Multiboot
3. Select Create boot option from zip
4. Choose any ROM that can be installed with CWM recovery (Needed 400MB on SD for this)
5. Choose Flash Zip to boot option, and flash the correspondent multiboot package (ROM's devs need to provide this)
6. Choose select default boot option, and select your last created
7. Choose boot into selected option, and enjoy!
NOTE: For multiboot with CyaNoComb, you can flash this, till I get our ramdisk good for multiboot. Credits to nAa for the ramdisk.
Cheers, D4.
Dev Info:
Final Chargemon
Code:
#!/system/bin/busybox sh
#
# Unified X10 mini pro multiboot script / dualrecovery
# Devs who worked on this project:
# D4rKn3sSyS, DooMLoRD, nobodyAtall, Owain94, Slade87, puppet13th
#
# keychecks
cat /dev/input/event0 > /dev/keycheck&
sleep 3
kill -9 $!
keypressed=`cat /dev/keycheck`
if [ "$keypressed" != "${keypressed/ž/}" ]
then
echo "recovery" > /data/local/tmp/bootrecovery
else
if [ "$keypressed" != "${keypressed/f/}" ]
then
echo "xrecovery" > /data/local/tmp/bootrecovery
fi
fi
# DualRecovery
if [ -s /data/local/tmp/bootrecovery ]
then
boot=`cat /data/local/tmp/bootrecovery`
rm -f /data/local/tmp/bootrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/"$boot".tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# offline charging
/system/bin/charger
rm -f /data/multiboot.log
# nobodyAtall - Multiboot hack
if [ -h /system/bin/multiboot_default ]
then
echo "Multiboot on" >> /data/multiboot.log
mkdir -p /sdcard
/system/bin/fsck_msdos -y /dev/block/mmcblk0p1
if [ $? -ne 0 ]
then
/system/bin/fsck_msdos -y /dev/block/mmcblk0p1
fi
mount -t vfat -o rw,noatime,nodiratime /dev/block/mmcblk0p1 /sdcard
if [ $? -eq 0 ] && [ -f /system/bin/multiboot_default/system.img ] && [ -f /system/bin/multiboot_default/data.img ] && [ -f /system/bin/multiboot_default/cache.img ]
then
echo "Good to multiboot" >> /data/multiboot.log
losetup /dev/block/loop1 /system/bin/multiboot_default/system.img
losetup /dev/block/loop2 /system/bin/multiboot_default/data.img
losetup /dev/block/loop3 /system/bin/multiboot_default/cache.img
if [ -f /system/bin/e2fsck ]
then
/system/bin/e2fsck -y /dev/block/loop1
/system/bin/e2fsck -y /dev/block/loop2
/system/bin/e2fsck -y /dev/block/loop3
fi
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount -l /dev/block/mtdblock3
umount -l /dev/block/mtdblock1
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
if [ -f /system/bin/ramdisk.tar ]
then
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Reboot Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
umount -l /system
umount -l /cache
umount -l /data
sleep 1
rmdir /system /data /cache /mnt
mkdir -p /minicm/system /minicm/data /minicm/cache
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /minicm/system
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /minicm/data
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /minicm/cache
sleep 1
chroot /minicm /init
else
umount -l /system
umount -l /cache
umount -l /data
sleep 1
mount -t ext2 -o rw,noatime,nodiratime /dev/block/loop1 /system
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop2 /data
mount -t ext2 -o rw,noatime,nodiratime,nosuid,nodev /dev/block/loop3 /cache
sleep 1
/system/bin/qmuxd &
sleep 1
exit
fi
fi
fi
echo "Multiboot off" >> /data/multiboot.log
# CM & Stock compatibility
if [ -f /system/etc/CHANGELOG-CM.txt ]; then
# for cyanogenmod
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
# nobodyAtall - Fix
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
sync
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
# Mount /system to /minicm/system
/sbin/mount_system
sleep 1
chroot /minicm /init
else
#for stock
# Continue booting
exit
fi
Changelog:
29th July 2011
First release, for testing
I will test as soon as I'm home as I'm away now and only have limited net I am ona 4gb card not sure of the class is the only available rom to multiboot cyanocomb so I could have slades cm7 as main and cyanocomb as secondary?
Sent from my U20i using XDA App
First attempt bricked but boot without sd will boot back into main not sure if it is because my SD is only class 2 would that explain being on SE screen for a while?
Sent from my U20i using XDA App
x10man said:
First attempt bricked but boot without sd will boot back into main not sure if it is because my SD is only class 2 would that explain being on SE screen for a while?
Sent from my U20i using XDA App
Click to expand...
Click to collapse
Same what happened to mine but I never took out the sd card to see if it boots back to original state. Im using 4gb class 2.
Sent from my U20i using XDA Premium App
Also when choosing the boot into selected option option my phone. Shuts down then when I boot again it boots my internal cm7 v15
Sent from my U20i using XDA App
Yes, it seems to be incompatible with some SD cards, that's why i need testers
F*ck u man! Ur awesome I still wonder why u didnt get thats recognised developer tag!
how to know class of SD card ?
its not writen any where on card
If you don't know the class it may be class 0 which was before there were classes the default card is class 2 I will try the default card when I'm home and find it
Sent from my U20i using XDA App
galvic said:
F*ck u man! Ur awesome I still wonder why u didnt get thats recognised developer tag!
Click to expand...
Click to collapse
I think I got it galvik show me how later on facebook
kormatoes said:
I think I got it galvik show me how later on facebook
Click to expand...
Click to collapse
Sure but i'm still looking for a class 10 sdcard, u know that my sdcard has 0kb free and lol i'm tired of deleting my music
galvic said:
Sure but i'm still looking for a class 10 sdcard, u know that my sdcard has 0kb free and lol i'm tired of deleting my music
Click to expand...
Click to collapse
I was looking in town today and they all said they did not know what I mean so is there a certin make to look out for
kormatoes said:
I was looking in town today and they all said they did not know what I mean so is there a certin make to look out for
Click to expand...
Click to collapse
If i'm not worng then better the class better will be the result of multiboot!
x10man said:
First attempt bricked but boot without sd will boot back into main not sure if it is because my SD is only class 2 would that explain being on SE screen for a while?
Sent from my U20i using XDA App
Click to expand...
Click to collapse
Booting will take longer on lower SD class, that's the why on SE screen.
tomorow i will test this with sandisk class 4
maybe you could add in first post that is recommended to have minimum 400MB free space on SD card
and great work
So... Let's say I have installed stock in internal, next step is to install CyaNoComb in SD and boot it and afterwards exactly install ramdisk patch? When we boot from SD the Recoverys are booted from SD ROM too and any changes (regarding system and data) affect only SD? I am kinda confused, please heeeeelp!
leajian said:
So... Let's say I have installed stock in internal, next step is to install CyaNoComb in SD and boot it and afterwards exactly install ramdisk patch? When we boot from SD the Recoverys are booted from SD ROM too and any changes (regarding system and data) affect only SD? I am kinda confused, please heeeeelp!
Click to expand...
Click to collapse
No, recovery will keep being main ROM recovery. in fact ROM's on SD, don't need chargemon or recoverys. I think. Anyway I haven't tested this myself, because my SD don't like multiboot.
EDIT: Corrected info, CyaNoComb should multiboot right
Btw, my new SD it's coming soon, so I could test this, and fix isues if exist.
D4rKn3sSyS said:
No, recovery will keep being main ROM recovery. in fact ROM's on SD, don't need chargemon or recoverys. I think. Anyway I haven't tested this myself, because my SD don't like multiboot.
EDIT: Corrected info, CyaNoComb should multiboot right
Btw, my new SD it's coming soon, so I could test this, and fix isues if exist.
Click to expand...
Click to collapse
Lighter rom+better sdclass=perfect multiboot throw some light on how to create multiboot package, i'll try with GingEricsson...

[Q] To devs... How to extract System.img

Hi guys..
Sorry If I'm posting this in the wrong section...
But can anyone guide me how to extract System.img from a Stock ROM as I'm planning to cook a custom ROM
If you would like to see some of my previous work for SGS1 look at my signature
You can try unyaffs in a cygwin environment or wunyaffs which is for windows.
For some reason I get access violation errors with stock roms for the Tab.
With HTC roms it was possible to dump the system.img with magiciso. Again with Tab roms this no longer works.
In CWM, after mounting /system:
make_ext4fs -l 568m -s /sdcard/system.img /system
This gives you a sparse system.img which you can turn into a Linux-mountable ext4 image with simg2img
Sorry i writed on wrong thread
In Linux you can do
mkdir tmp
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system/
sudo umount ./tmp
Sent from my Samsung Galaxy Tab 10.1 using Tapatalk
jamezelle said:
In Linux you can do
mkdir tmp
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system/
sudo umount ./tmp
Sent from my Samsung Galaxy Tab 10.1 using Tapatalk
Click to expand...
Click to collapse
I'm getting an error
Code:
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Nokia7Vista said:
I'm getting an error
Code:
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Click to expand...
Click to collapse
See the message I posted up above? You have to run the system.img through simg2img to make it mountable.
Sent from my Samsung Galaxy Tab 10.1
mabalito said:
See the message I posted up above? You have to run the system.img through simg2img to make it mountable.
Sent from my Samsung Galaxy Tab 10.1
Click to expand...
Click to collapse
oh ok,, Thanks
Nokia7Vista said:
oh ok,, Thanks
Click to expand...
Click to collapse
Hope this helps and welcome to the GT10.1 forum
Sent from my Samsung Galaxy Tab 10.1
You could always create a regular (non-sparse) image file using dd then mount it.
Command should be similar to ****, though I'm not sure if the busybox version of dd accepts bs=1M, it may require bs=1048576. (That's MB converted to B) And count is the number of MB you want the image to be.
Code:
dd if=/dev/zero of=squeeze.img bs=1M count=512
Then mount it like this:
Code:
mount -o loop,noatime -t ext4 /sdcard/debian/squeeze.img /data/local/debian/
*Pulled from a thread I wrote awhile back, you may be able to get away without using the "noatime" option.

[Q] System.img Editing Dev Help

Hi all,
im working on making a ROM for the Asus Transformer and im struggling a bit. im totall new to Linux, using mint and just getting used to it.
Basically im just trying to take a stock ROM and add root but adding superuser.apk and SU binary but im running into problems.
Asus Roms are a bit unusual, packed into blob files, ive unpacked that no problem, the system image is called blob.APP but its just the same as system.img just the name as i understand it.
ok so what ive done:
Code:
mkdir system
sudo mount -t ext4 -o loop blob.APP system/
so this mounts the ext4 fs as a loop device and allows me to copy the contents out
Code:
sudo cp -ar system new_system
then ive copied superuser.apk to /app and SU binary to /dev with drop and drag.
then make the filesystem image
Code:
sudo ./make_ext4fs -l 512m -a system blob.APP new_system/system
then just pack it up and flash it, flashing works fine, no errors but when i go to reboot it warns that theres no OS so somethings not worked. ive tried everything i can find googeling!
i just started learning linux on weds so go easy on me
any advice or help would be really great. thanks!
mkdir system here you will mount the old system
mkdir system_new here you will mount the new system
we now create the actual image
dd if=/dev/zero of=system_new.img bs=4k count=60000
bs=4k is the block size
count=60000 the number of blocks of 4kb size
so is something like 60000*4= 240000 which is actually 240 Mb
so it depends to you how big you want the image.
now we format the system.img in ext4
mkfs.ext4 system_new.img
Proceed anyway? (y,n) y
now we override the filesystem check
tune2fs -c0 -i0 system_new.img
Now we mount the the 2 directories that we created in the first step
mount -o loop system_new.img system_new/
mount -o loop system_new.img system/
Now we copy the contet of the old image to the new one with all the perimissions
cp -v -r -p system/* system_new/
We sinc the files
sync
We unmount the partitions
umount system_new/
umount system/
And voila, the system.img in ext4 is created.
Tips: you will need superuser acces.
if you will copy new files besides the ones from the old system you will have to set by hand all the permissions.
If you are using ubuntu just type
sudo su
and you will be root and no more sudo at each command.
Thank u so much for your guide this is exactly what I'm looking for so massive thanks!
So to add root I.can drop and drag superuser.apk and the binary into the new image?
Also do I need to worry about the android mountpoint?
Sent from my HTC Sensation Z710e using xda premium
yes you can do that, as long as you set the permissions right. (you can google for them)
and from what i remeber you will have to set also the ownership of the su, and superusers files
you need to do tests first, and then try
the mountpoint should be ok as it is now.
globula_neagra said:
mkdir system here you will mount the old system
mkdir system_new here you will mount the new system
we now create the actual image
dd if=/dev/zero of=system_new.img bs=4k count=60000
bs=4k is the block size
count=60000 the number of blocks of 4kb size
so is something like 60000*4= 240000 which is actually 240 Mb
so it depends to you how big you want the image.
now we format the system.img in ext4
mkfs.ext4 system_new.img
Proceed anyway? (y,n) y
now we override the filesystem check
tune2fs -c0 -i0 system_new.img
Now we mount the the 2 directories that we created in the first step
mount -o loop system_new.img system_new/
mount -o loop system_new.img system/
Now we copy the contet of the old image to the new one with all the perimissions
cp -v -r -p system/* system_new/
We sinc the files
sync
We unmount the partitions
umount system_new/
umount system/
And voila, the system.img in ext4 is created.
Tips: you will need superuser acces.
if you will copy new files besides the ones from the old system you will have to set by hand all the permissions.
If you are using ubuntu just type
sudo su
and you will be root and no more sudo at each command.
Click to expand...
Click to collapse
U said, we have to set permissions by ourselves. So what are the permissions that needs to be set when I add a new folder with an APK in it?
Sudo chmod 777 filepath/filename.apk
Sudo chmod a-rwx filepatch/filename.apk.
This is what I remember from top of my head. Google it a bit if it does not work from the first try as I have not used this like in 5 years.
If you allready have root you can you a file manager and just copy the file/folder where you want and set the permissions via thw file manager or using terminal commanda or via adb.
From what remember you can t make a folder in the apk folder as you won t be able to run the apk.

[Q] [SOLVED] Is there kernel loop support for our device ?

Hi,
As the title says, Is there Kernel loop support for our LG Optimus L9 ?
I'm trying to mount a loop file created on debian on the device, but I get the error
ioctl LOOP_SET_FD failed: Device or resource busy
Click to expand...
Click to collapse
.
This is what I did --
Loop file created on debian and formatted with ext4.
On Optimus L9 with CM10.1, in terminal emulator,
$su
#losetup /dev/block/loop0 /storage/sdcar1/file
#mount -o remount,rw /system
#mkdir /system/temp
#mount -rw -o loop -t ext4 /dev/block/loop0 /system/temp/
ioctl LOOP_SET_FD failed: Device or resource busy
#
Click to expand...
Click to collapse
Is our kernel having loop support. If yes, am I doing anything wrong? The file gets successfully mounted in Debian.
EDIT:
using "busybox mount" solved the issue.
Tried adding busybox to the mount command and voila it worked.
#busybox mount -rw -o loop -t ext4 /dev/block/loop0 /system/temp/
Click to expand...
Click to collapse
You just taught me something new, thanks.
Can you upload your img, I would really like to check this out, or can you direct me to a thread so I can learn some more.
Sent from my LGMS769 using xda app-developers app
kuma82 said:
You just taught me something new, thanks.
Can you upload your img, I would really like to check this out, or can you direct me to a thread so I can learn some more.
Sent from my LGMS769 using xda app-developers app
Click to expand...
Click to collapse
The one I created is over 100MB. I had a html tutorial containing 12,000 files. I don't want to put those files on sdcard and mess it up. So, I used this block device.
I have created a sample "temp.img" file with a size of 500KB. It contains a single text file. I'm attaching it and you can check it out.
Below is the way i created and mounted it.
Code:
# "temp.img" md5 b97642fed817fa3f1a0cc6dc64b6c40d
# remount rootfs rw.
mount -o remount,rw /
# create mount point.
mkdir /mnt/temp
# chmod mountpoint.
chmod 777 /mnt/temp
# create block file.
dd if=/dev/zero of=/storage/sdcard0/temp.img bs=1024 count=500
# this creates 500 KB file. I can't seem
# to get bs=1M argument working on android.
# so bs1024 x count = target file size (=count times in KB).
# query free loop device. (will be /dev/block/loopx)
losetup -f
#attach block file with free loop.
losetup /dev/block/loop0 /storage/sdcard0/temp.img
#create file system.
mke2fs -T ext2 /dev/block/loop0
# And finally mount it
busybox mount -o loop -t ext2 -rw /dev/block/loop0 /mnt/temp
# For unmounting
busybox umount /mnt/temp
And it isn't encrypted. I don't need encryption, and i can't even seem to figure out how to encrypt it.

Categories

Resources