Jump to content

[Q] OC kernel for GPU or CPU


Guest djfnz
 Share

Recommended Posts

I could use some init.d support.  I'm running out of room and could do with mounting an ext partition as data

You don't need to touch kernel or even ramdisk for that. There's already plenty of scripts that are run on init. E.g. you could add your stuff to /system/etc/init.qcom.post_boot.sh or even make it run scripts from init.d folder.

Link to comment
Share on other sites

Ah thanks.  I'll have a play.  I tried using apps to add init'd support. I guess they just attempt do your latter suggestion of enabling init.d from another auto running location but said apps didn't work.  I shall try doing it myself. :)

Link to comment
Share on other sites

  • 1 month later...

Nah, I can't get anywhere with this.  I don't know why.  It looks easy!

 

I can't get post boot to run another script.  Either the init.d folder or even a specific script.

I have an init.d test program that creates a log file and nothing happens when I try to call it from post boot.

If however, I copy the contents into post boot then the log is created so the test file works.

 

If I copy the int2ext script into post boot, nothing happens.  And the way I figure it, if I can't diagnose why I can't get one script to execute another, I sure as heck can't debug an entire Ext script!

 

I'm great at Windows but I don't have much of a clue at Linux so when the various instructions over at XDA don't work for no good reason - I'm kinda stuck!

Edited by targetbsp
Link to comment
Share on other sites

Probably a case of the blind leading the blind here, but what did you do, put your script into system/etc/init.d?

 

So far as I can see, that folder doesn't exist in the stock ROM, which means that there's probably nothing to execute anything in there on boot. For example, often part of the ramdisk (init.rc) is responsible for running whatever scripts it finds in init.d.  As the stock ROM doesn't even have such a folder, I'd imagine the kernel doesn't have any code to attempt to execute scripts in there.

 

So you either need to find somewhere else to run the script from, or modify the kernel.  Alternatively, I think there are "autostart" apps that you could use?

Edited by shiftyc
Link to comment
Share on other sites

As konstaT suggested earlier in the thread, I was attempting to call the script from the post boot script (init.qcom.post_boot.sh ).  There are plenty of examples of doing this on XDA and it seems really easy (like 1 line) but I just couldn't get it to work. eg http://forum.xda-developers.com/showthread.php?t=1710980

 

Based on other examples I also tried busybox run-parts and directly naming the script I wanted to run.

 

The example script made the init.d folder and set the permissions for me.

Edited by targetbsp
Link to comment
Share on other sites

I'm not exactly clear what you're trying to execute from init.qcom.post_boot.sh, but adding a command to the bottom of that script worked for me.  I just added a "touch" to create /data/test.log and the file appears after I reboot.

 

I suspect it's something to do with permissions, presumably you're mounting system as r/w in the script before you try to create anything?

Link to comment
Share on other sites

I can get commands to work direct like you have.  I cannot get it to run another script containing those same commands (in effect creating init.d support) the same way the XDA link shows (or various other ways I found)

 

Now, because I could get commands to work directly from post boot - I could theoretically post the script onto the end.  But it doesn't work.  And the fact that if I can't get something as simple as running another script to work, then I sure as heck can't debug a 150 line script.  I can do Windows but don't have much of a clue at Linux!

 

The goal is to add Ext partition support because Data is too small.

Edited by targetbsp
Link to comment
Share on other sites

I tried the XDA article you linked and it didn't work, but that was because the "00test" script in the init.d folder didn't have execute permission.  I changed permissions to owner execute and it worked fine.

Link to comment
Share on other sites

I tried the XDA article you linked and it didn't work, but that was because the "00test" script in the init.d folder didn't have execute permission.  I changed permissions to owner execute and it worked fine.

Can you make tutorial & upload the files?

Link to comment
Share on other sites

There's nothing to upload.  Just follow the steps in the linked article then use a file manager of your choice to change /system/etc/init.d/00test to have permissions of -rwxr--r--.

 

Or from the command line:

cd /system/etc/init.d
chmod 744 00test

Reboot and you should see /data/Test.log created.

Link to comment
Share on other sites

It shouldn't be much more than adding a single line and making /system/etc/init.d directory and it's content executable (755 permissions).
/system/xbin/busybox run-parts /system/etc/init.d

You might want to try to run that on command line as well and confirm that it works. If not, you might need to update your busybox as well.

 
If you've installed any of the latest updates, you should have /system/etc/install-recovery.sh (which CWM has made unexecutable). You could repurpose that for running init.d. It's better than init.qcom.post_boot.sh because the ramdisk service runs earlier in the init. ClockWorkMod might whine about it every time you boot out of though because it would still think it is trying to replace the recovery...
Link to comment
Share on other sites

 

It shouldn't be much more than adding a single line and making /system/etc/init.d directory and it's content executable (755 permissions).
/system/xbin/busybox run-parts /system/etc/init.d

 

Confirmed that this also works for me.  You will need 755 permissions if you're testing from the command line.

 

 

 

ClockWorkMod might whine about it every time you boot out of though because it would still think it is trying to replace the recovery...

 

 

So what you're saying is that some really clever person needs to build us a CWM that skips the checking of install-recovery.sh...  :)

Edited by shiftyc
Link to comment
Share on other sites

I tried the XDA article you linked and it didn't work, but that was because the "00test" script in the init.d folder didn't have execute permission.  I changed permissions to owner execute and it worked fine.

 

/facepalm

I spent hours presuming the bits I were playing with were flawed - even though they should have been dead simple.  It never crossed my mind the test script installer would be flawed.  What's the point in it?? lol

Thanks

Link to comment
Share on other sites

 

It shouldn't be much more than adding a single line and making /system/etc/init.d directory and it's content executable (755 permissions).
/system/xbin/busybox run-parts /system/etc/init.d

You might want to try to run that on command line as well and confirm that it works. If not, you might need to update your busybox as well.

 

Thanks!  Yeah I tried run-parts, and updating busybox.  I was thrown purely by the init.d test script I chose being itself faulty permissions wise lol.

Link to comment
Share on other sites

So what you're saying is that some really clever person needs to build us a CWM that skips the checking of install-recovery.sh...  :)

Well, if someone was clever enough to do that then they'd probably just add the init.d support to ramdisk directly. :P Should be a lot easier than hacking the recovery, I think there's even some "kitchen" solutions to do that. Here's a good guide for splitting the boot.img at least.
 
Command to repack Blade V boot.img with all the correct parameters is:
mkbootimg --kernel zImage --ramdisk ramdisk.cpio.gz --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom vmalloc=200M' --base 0x00200000 --pagesize 4096 --ramdisk_offset 0x01300000 -o boot.img
I did actually build the Blade V kernel from source once. I uploaded it for someone to test and it got downloaded exactly zero times during couple of months. I've since removed the kernel sources (intentionally) and all recovery sources (accidentally, when removing CM10.1 sources :() from my computer. So before anyone asks, it's not going to be me.
Link to comment
Share on other sites

The Int2Ext script (which I used on the Blade 1) doesn't seem to do much even though its log file says it has.  D2Ext takes out the OS. :D

That's progress though!  Both are clearly actually running. :D

Link to comment
Share on other sites

 

Well, if someone was clever enough to do that then they'd probably just add the init.d support to ramdisk directly. :P Should be a lot easier than hacking the recovery, I think there's even some "kitchen" solutions to do that. Here's a good guide for splitting the boot.img at least.
 
Command to repack Blade V boot.img with all the correct parameters is:
mkbootimg --kernel zImage --ramdisk ramdisk.cpio.gz --cmdline 'console=ttyHSL0,115200,n8 androidboot.hardware=qcom vmalloc=200M' --base 0x00200000 --pagesize 4096 --ramdisk_offset 0x01300000 -o boot.img
I did actually build the Blade V kernel from source once. I uploaded it for someone to test and it got downloaded exactly zero times during couple of months. I've since removed the kernel sources (intentionally) and all recovery sources (accidentally, when removing CM10.1 sources :() from my computer. So before anyone asks, it's not going to be me.

 

 

Thanks, I did successfully extract the ramdisk already today from stock but I stopped because it seemed unnecessary (and more risky) to modify boot.img.  I mean risky because someone here would need to test it and my knowledge is... limited!

 

I've also tried to build the kernel from source today, it's currently failing on a #include of a header file that it can't find, I'm not sure why because it's present.  But anyway I've run out of time today so I may pick it up again tomorrow.

 

Dunno why I'm bothering if target can't get his script working anyway lol  ;)

Link to comment
Share on other sites

Trashing the OS playing with this is incredibly inconvenient because I don't have enough room on the SD for the android_secure folder, an ext partition big enough to handle the contents of the android_secure folder, and my CWM backup at the same time.

 

So to restore my phone, I have to plug the sd card into my PC, delete the ext partition and enlarge the fat, copy the CWM backup to it. Restore the CWM backup on the phone, put the sd card back into the pc, delete the CWM backup, add an ext partition. *sigh*. lol

Edited by targetbsp
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.