Jump to content


Photo

[MOD] [SCRIPT] Multiboot via loop file [19/12]

* * * * * 3 votes

  • Please log in to reply
394 replies to this topic

#101
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

Oh..sorry i missed that one.By the way nice solution.


Thanks, all in all the script creates four different loop files and mounts them, runs the script and then unmounts and removes all the loop files. (i could solve that by running it in one big loop file but that would take up several GB if you have larger data partitions).

The end result is a clean directory waiting for a new install and all the files moved to your /sdcard/multiboot directory. :)

  • 0

#102
gunapriyan

gunapriyan

    Enthusiast

  • Members
  • PipPipPip
  • 219 posts
  • Gender:Male
  • Devices:ZTE Blade

It works for me on CM-10-KonstaKANG from 29/8, i'm running the loop script it to upgrade to 01/09 version right now.

My exact procedure:

1. Downloaded the MakeLoopROM-Android-V4.tar from the link in my OP to the root of the sdcard (/sdcard)
2. start terminal session
3. su
4. cd /sdcard
5. tar -xvf MakeloopROM-Android-V4.tar
6. cd MakeLoopROM
7. sh makelooprom-startup

It runs and completes, all files are in /sdcard/multiboot as they are supposed to, i'll install them in a bit to make sure that works too.

One question, did you change your SU on your rom (if you installed the wraithdu su per the V6-start me up script that may be the problem)


I had followed as per your direction. But still i am facing same permission error.....

Edited by gunapriyan, 01 September 2012 - 05:11 PM.

  • 0

#103
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

I had followed as per your direction. But still i am facing same permission error.....


This is strange since i can run it just fine on CM-10-KonstaKANG (tested on both 27/8 and 1/9), CM-9-KonstaKANG, PA-1.6a, SSRLS7 and cm-7.2.0-blade (stable).

I'll ask you the same thing i asked De@n, have you fiddled with your su, like installing the v6-start me up package?

There must be something that's different because the above procedure works like a charm every single time on every single ROM i try it on.

There is absolutely NO reason why you shouldn't be able to exec a file with 0777 permission on an ext2 partition as superuser, none what so ever.

Try this for me:

1. open up a terminal session
2. su
3. whoami
4. which $SHELL
5. losetup -f

What is the response after whoami, which $SHELL and losetup -f?

  • 0

#104
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade
Err... I thought that the sdcard is mounted with noexec for security reasons isn't it? It may cause problems just like that... What about extracting to /tmp or /data/local/<subdir>?

  • 0

#105
De@n

De@n

    Addict

  • Members
  • PipPipPipPipPip
  • 556 posts
  • Gender:Male
  • Location:UK
  • Devices:Xperia S & Blade

This is strange since i can run it just fine on CM-10-KonstaKANG (tested on both 27/8 and 1/9), CM-9-KonstaKANG, PA-1.6a, SSRLS7 and cm-7.2.0-blade (stable).

I'll ask you the same thing i asked De@n, have you fiddled with your su, like installing the v6-start me up package?

There must be something that's different because the above procedure works like a charm every single time on every single ROM i try it on.

There is absolutely NO reason why you shouldn't be able to exec a file with 0777 permission on an ext2 partition as superuser, none what so ever.

Try this for me:

1. open up a terminal session
2. su
3. whoami
4. which $SHELL
5. losetup -f

What is the response after whoami, which $SHELL and losetup -f?

Whoami = root
Which $SHELL = /system/bin/sh
losetup = /dev/block/loop0

Edited by De@n, 01 September 2012 - 06:03 PM.

  • 0

#106
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

Err... I thought that the sdcard is mounted with noexec for security reasons isn't it? It may cause problems just like that... What about extracting to /tmp or /data/local/<subdir>?


Yeah but it shouldn't matter since i'm using an ext2 loop file to run it from.

It will take a total of 140MB +size of unpacked ROM + size of data and system images created, of course it can be reconfigured to run elsewhere but you still need at least 50MB free from wherever you're running it.

  • 0

#107
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

Whoami = root
Which $SHELL = /system/bin/sh
losetup = /dev/block/loop0


Yeah, that's all correct.


I'm going to try something else, can you test this new version i'm attatching to this post, just unzip it and copy it to your MakeLoopROM folder on your sdcard and see if this one works better.

Attached Files


  • 0

#108
De@n

De@n

    Addict

  • Members
  • PipPipPipPipPip
  • 556 posts
  • Gender:Male
  • Location:UK
  • Devices:Xperia S & Blade

Yeah, that's all correct.


I'm going to try something else, can you test this new version i'm attatching to this post, just unzip it and copy it to your MakeLoopROM folder on your sdcard and see if this one works better.

Downloading now :D

  • 0

#109
De@n

De@n

    Addict

  • Members
  • PipPipPipPipPip
  • 556 posts
  • Gender:Male
  • Location:UK
  • Devices:Xperia S & Blade

Yeah, that's all correct.


I'm going to try something else, can you test this new version i'm attatching to this post, just unzip it and copy it to your MakeLoopROM folder on your sdcard and see if this one works better.

Downloading now :D


No change :(

  • 0

#110
tilal6991

tilal6991

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,781 posts
  • Gender:Male
  • Devices:ZTE Skate, Huawei U8150
Another update on the app.

So I've been coding all afternoon and it's at a point where all the data is collated and it's at the final screen where all the functions are performed.

  • 1
If you like my work or if I helped, click the Plus button.

#111
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

No change :(


This is really weird...

#!/system/bin/sh

cd /sdcard

scriptloop=$(losetup -f)

dd if=/dev/zero of=scriptloop bs=1024 count=20000

losetup $scriptloop scriptloop

mke2fs -t ext2 $scriptloop

mkdir -p runscript

mount -t ext2 -w -o exec $scriptloop runscript

cp -f -r MakeLoopROM/edit-kernel runscript
cp -f MakeLoopROM/zip runscript
cp -f MakeLoopROM/perl runscript
cp -f MakeLoopROM/busybox runscript
cp -f MakeLoopROM/makelooprom-android runscript
chmod 0777 runscript
cd runscript

./makelooprom-android

Why doesn't that work on CM-10-KonstaKANG?

I realized that me testing it on the loop install of CM-10-KonstaKANG was useless since the loop install mounts the sdcard with exec permissions.

However, PA-1.6a, which i'm running on the NAND mounts the sdcard with the noexec option and the above script still works just fine on it.

Edited by Snap.IT, 01 September 2012 - 07:08 PM.

  • 0

#112
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

No change :(


Are you getting any other errors before the permission denied? There should be the printout from mke2fs (mke2fs 1.41.12 (17-May-2010) and so on) but are you getting any errors after that and before the permission denied error?

Could you or someone else test the one i'm attatching to this post, same procedure as before, just unpack and copy to your MakeLoopROM folder.

Attached Files


Edited by Snap.IT, 01 September 2012 - 07:21 PM.

  • 0

#113
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

Another update on the app.

So I've been coding all afternoon and it's at a point where all the data is collated and it's at the final screen where all the functions are performed.


'tis a lot of work but once done it should be easy to add to it. :)

Next step i'm thinking of is to run the updater-script directly after installation and install the ROM into the loop files so you don't have to go through recovery to do that, after reboot you're in your new loop room directly. :)

  • 0

#114
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995
Installing CM-10-KonstaKANG-20120901-blade to my nand right now, i'll test it and come up with a solution. :)

  • 1

#115
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade
I just tried it by curiosity, and for me it fails when it tries to create the system loop file.

'let: arith: invalid syntax: "size=190*1024"'

Obviously 190 is the size for the new /system.

  • 0

#116
De@n

De@n

    Addict

  • Members
  • PipPipPipPipPip
  • 556 posts
  • Gender:Male
  • Location:UK
  • Devices:Xperia S & Blade

Are you getting any other errors before the permission denied? There should be the printout from mke2fs (mke2fs 1.41.12 (17-May-2010) and so on) but are you getting any errors after that and before the permission denied error?

Could you or someone else test the one i'm attatching to this post, same procedure as before, just unpack and copy to your MakeLoopROM folder.


You've cracked it! :P

  • 0

#117
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

You've cracked it! :P


Sometimes... i'm awesome. :D

Nah, seriously, i forgot an -R on the chmod, i'll upload a new version in a few minutes. :D

Now i'll just restore the PA i had running before i decided i had to test it for myself, didn't actually have to do that if i had just been a bit more patient but it's great to hear that it works now. :)

  • 1

#118
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

You've cracked it! :P


Heads up on one thing though, you're going to need the new version to make makeloopgapps-startup work or you'll run into the same problem. ;)

  • 0

#119
Snap.IT

Snap.IT

    Addict

  • Members
  • PipPipPipPipPip
  • 861 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Devices:ZTE Blade 3, Alcatel OT995

I just tried it by curiosity, and for me it fails when it tries to create the system loop file.

'let: arith: invalid syntax: "size=190*1024"'

Obviously 190 is the size for the new /system.


That's a new one, never seen that before. :S

That would be in this section:

echo "What size do you want your system image to be (in MB's)?"
echo " "
echo " "

read SYSTEM_IMG_SIZE

let size=$SYSTEM_IMG_SIZE*1024

What ROM are you running it on?

  • 0

#120
Sulthekk

Sulthekk

    Addict

  • Members
  • PipPipPipPipPip
  • 619 posts
  • Devices:ZTE Blade

That's a new one, never seen that before. :S

That would be in this section:

echo "What size do you want your system image to be (in MB's)?"
echo " "
echo " "

read SYSTEM_IMG_SIZE

let size=$SYSTEM_IMG_SIZE*1024

What ROM are you running it on?


I'm running a (fairly old) cm7 kang at the moment. I'm now trying with hardcoded values... Still in progress. I also found that piece of code, but I just don't see why it fails, because setting 'somevar=4' and executing 'anothervar=$somevar*2' manually from bash works. :o

Okay, now it ran fine, although in the end it weren't able to umount the loop file and it also weren't able to remove runscript, but the zip is there, and the loops files aren't where they supposed to be. I think I can get it working with some hackin' around.

Edited by Sulthekk, 01 September 2012 - 08:52 PM.

  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users