"No such file or directory" if tried run binary file in TWRP - General Questions and Answers

I need to run a binary file, dalvikvm which located in /system/bin from TWRP terminal, but no matter what, it says, "No such file or directory found", and then I found that this is link file located another directory, I cd'd there and tried, but still the same result
I can be able to run the same file in Termux without any issues
Can anybody please help me on this?
Thanks

Hi, I think you need to mount the system partition before being able to access it. It's not mounted by default on TWRP, but when the phone is on it is (otherwise Android wouldn't work)
If you need help on how to mount partitions on TWRP, ring me (or google it, it's actually pretty simple)

Raiz said:
Hi, I think you need to mount the system partition before being able to access it. It's not mounted by default on TWRP, but when the phone is on it is (otherwise Android wouldn't work)
If you need help on how to mount partitions on TWRP, ring me (or google it, it's actually pretty simple)
Click to expand...
Click to collapse
Thanks for replying, it wasn't mounted at first, so I had mounted, still it didn't work, while some of the files in bin do work, some don't.
Then I copied the file to /sdcard and /tmp, and tried execute from these folders, still
Well, if when you're free, can you confirm if it's running on yours?
File: /system/bin/dalvikvm
Thanks once again

mizzunet said:
Thanks for replying, it wasn't mounted at first, so I had mounted, still it didn't work,
...
Thanks once again
Click to expand...
Click to collapse
I didn't found it inside, but it may be because I'm not rooted.
While searching around I've found this :
No such file or directory while running dalvikvm
I built AOSP Android and push the dalvik virtual machine in my device just to see if my built dalvik vm runs properly. I pushed it my device /opt directory but when I run dalvikvm, I get the error...
stackoverflow.com
It might get you out of trouble

Raiz said:
I didn't found it inside, but it may be because I'm not rooted.
While searching around I've found this :
No such file or directory while running dalvikvm
I built AOSP Android and push the dalvik virtual machine in my device just to see if my built dalvik vm runs properly. I pushed it my device /opt directory but when I run dalvikvm, I get the error...
stackoverflow.com
It might get you out of trouble
Click to expand...
Click to collapse
I looked into it.
I had no opt folder in root directory. So I made one, and moved dalvikvm to there and tried execute this time, it said permission denied, so I gave it chmod 755. But after that, it says "there no such file or directory".
Well, do you telegram account, so I could contact you there.
Thanks

Raiz said:
I didn't found it inside, but it may be because I'm not rooted.
While searching around I've found this :
No such file or directory while running dalvikvm
I built AOSP Android and push the dalvik virtual machine in my device just to see if my built dalvik vm runs properly. I pushed it my device /opt directory but when I run dalvikvm, I get the error...
stackoverflow.com
It might get you out of trouble
Click to expand...
Click to collapse
And even "file" binary, it says, there no file.

mizzunet said:
I looked into it.
I had no opt folder in root directory. So I made one, and moved dalvikvm to there and tried execute this time, it said permission denied, so I gave it chmod 755. But after that, it says "there no such file or directory".
Well, do you telegram account, so I could contact you there.
Thanks
Click to expand...
Click to collapse
This is really curious, tbh I'm not an expert around that subject, idk what's wrong with this binary...
Hopefully someone who knows more may help you with that. Have a nice day

This is because the binary you are trying to execute was compiled to run in the Android context, but you're trying to execute it in the TWRP one. Each binary has a path to a linker used during execution. The problem is that it refers to a linker that doesn't exist in TWRP.
Suppose we want to execte a binary file and obviously we can't:
Bash:
x00h:/ # /system/bin/awk
/sbin/sh: /system/bin/awk: No such file or directory
Let's take a look to its linker:
Bash:
x00h:/ # strings /system/bin/awk | head -n 1
/system/bin/linker64
Then, you will actually discover that it's sym linked to a linker that is available only when Android is running:
Bash:
x00h:/ # ls -ald /system/bin/linker64
lrwxr-xr-x 1 root shell 38 2009-01-01 00:00 /system/bin/linker64 -> /apex/com.android.runtime/bin/linker64
Since TWRP comes with its linker in /sbin/linker64, we can sym link it to /system/bin/linker64.
So, the hack:
Bash:
x00h:/ # mkdir -p /apex/com.android.runtime/bin/
x00h:/ # ln -s /sbin/linker /apex/com.android.runtime/bin/linker
x00h:/ # ln -s /sbin/linker64 /apex/com.android.runtime/bin/linker64
Retry, and it works:
Bash:
x00h:/ # /system/bin/awk
usage: /system/bin/awk [-F fs] [-v var=value] [-f progfile | 'prog'] [file ...]
Pray to God the TWRP's linker will be compatible and do the job (most binaries works fine), but sometimes you may get CANNOT LINK EXECUTABLE.

Related

Few EXt2 questions

Is it possible to veiw the files in the EXt2 partition from our G1 terminal? If so, can we also delete files? If so, someone explain how, thanks.
asuming is mounted on /system/sd
just
cd /system/sd
ls -la /system/sd
to list the files
is their a way to erase those files
There are commands for deleting files on Android. Look up the Linux Command prompt commands for performing those functions.
If you've rooted your phone and don't know the commands already, you haven't been paying attention to the instructions.
ls = directory listing
cp = copy
mv = move/rename
rm = remove
Those are the very basics. Remember that Unix-like operating systems are case-sensitive and file.txt is different from File.txt or file.TXT.
If you're using wildcards to delete everything, take a precaution and use the dot-slash. It could save you a lot of trouble by ensuring you're only deleting files in the current working directory. To remove all text files in a directory, for example, you'd type rm ./*.txt
god, i hate how rude people are. I grew up with DOS, so dir, and del come more naturally to me than linux commands. So just ease up on the ppl that don't know linux. I didn't know linux til i started to IRC and wanted to run an eggdrop bot. Not like everyone has irc'd or compiled, or whatever. Heck, it has been so long now, I could not write an irc script or egg addon, and I think i was the first to develop some scripts in IRC 20 years ago. So all I can say is chill.
Shaggy
??huh??
whats the beef all about?
you can google the command and linux and probably have a ton of sites that list and explain the usage and stuff like that for *nix commands unix is a very old OS linus torvalds just woke up 1 day at age 15 or sumthin and said im gonna make a unix kernal that runs on my intel based pc and then instead of selling it and making a fortune I'll give it away and still make a fortune.
LINUS is the greatest man of our time, when the other OS was charging BIG $ to run Apache web servers in the .com boom (even more so now) linux was FREE and gave better throughput on the same hardware
Now if you want a pretty box booklet and packaging as you have become accustomed they have them to, some just feel better if they pay for it, free must not be as good as the one that costs right?
why did I bother just rambling, please ignore the babbling lunatic in the corner he is harmless
bhang
beartard said:
If you've rooted your phone and don't know the commands already, you haven't been paying attention to the instructions.
ls = directory listing
cp = copy
mv = move/rename
rm = remove
Those are the very basics. Remember that Unix-like operating systems are case-sensitive and file.txt is different from File.txt or file.TXT.
If you're using wildcards to delete everything, take a precaution and use the dot-slash. It could save you a lot of trouble by ensuring you're only deleting files in the current working directory. To remove all text files in a directory, for example, you'd type rm ./*.txt
Click to expand...
Click to collapse
if you dontknow how to be polite to the noobz then dont say anything at all. let someone else answer their questions.
Hi Beartard,
Thanks for the info.
This site has such a wealth of information, that it can be overwhelming to many members.
Can you tell me how to copy my apps-private from my ext2 partition to my sd card partition so I can back them up?
Thanks
beartard said:
If you've rooted your phone and don't know the commands already, you haven't been paying attention to the instructions.
ls = directory listing
cp = copy
mv = move/rename
rm = remove
Those are the very basics. Remember that Unix-like operating systems are case-sensitive and file.txt is different from File.txt or file.TXT.
If you're using wildcards to delete everything, take a precaution and use the dot-slash. It could save you a lot of trouble by ensuring you're only deleting files in the current working directory. To remove all text files in a directory, for example, you'd type rm ./*.txt
Click to expand...
Click to collapse
uh you wan't to copy your "app-private" folder as a backup in to yoru sdcard correct? well try this
busybox cp -a /system/sd/app-private /sdcard/app-private
if it don't allows you to copy do this command to re mount the system as read-write
mount -oremount,rw /dev/block/mtdblock3 /system
Hi Nitro .
I tried it both ways and it says operation not permitted.
-------------------
Update:
But wait, I connected my phone to the computer and the app-private is copied to the sdcard.
Your procedure worked!
I erased the folder that was copied to test it again.
Then I used just this set of commands and it worked again:
busybox cp -a /system/sd/app-private /sdcard/app-private
So you still get the same error, but it works.
Thanks alot Nitro!!!
Nitro212 said:
uh you wan't to copy your "app-private" folder as a backup in to yoru sdcard correct? well try this
busybox cp -a /system/sd/app-private /sdcard/app-private
if it don't allows you to copy do this command to re mount the system as read-write
mount -oremount,rw /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
u tried it as root? what error u got?
well glad it worked.
Hi,
The error says:
"cannot preserve ownership of ... cannot preserve permissions of ... operation not permitted"
for every file it tries to transfer.
But then when you look in your sdcard the app-private is there.
So it is a false error.
Thanks again.
Nitro212 said:
uh you wan't to copy your "app-private" folder as a backup in to yoru sdcard correct? well try this
busybox cp -a /system/sd/app-private /sdcard/app-private
if it don't allows you to copy do this command to re mount the system as read-write
mount -oremount,rw /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
It's not working for me...
My error is this:
cp: cannot stat '/system/sd/app-private': No such file or directory
Hi,
Use terminal emulator jf 1.41 or better
type su enter
then the busybox commands
Connect your phone to your computer and look on your memory card.
app-private is there
Proxin said:
It's not working for me...
My error is this:
cp: cannot stat '/system/sd/app-private': No such file or directory
Click to expand...
Click to collapse
bestwebs said:
Hi,
Use terminal emulator jf 1.41 or better
type su enter
then the busybox commands
Connect your phone to your computer and look on your memory card.
app-private is there
Click to expand...
Click to collapse
hey guys need some help here i have the same problem, (as far as the error saying 'no such file or dir') and i tried your suggestion about typing su first then the busybox commands.
i have the most current terminal emulator, unfortunately i still continue to get the same error every time i try to run the busybox commands. it just simply say 'no such file or directory"
you guys have any suggestions for me to try ?
any help would be great.
the error i get is "cannot preserve permissions of" i think that error is not something harmful im n o *nix expert but is just saying it wont save the permision of that folder i think...
Code:
# mkdir /sdcard/bk
mkdir /sdcard/bk
# busybox cp -rf /data/app-private/ /sdcard/bk
busybox cp -rf /data/app-private/ /sdcard/bk
cp: cannot preserve permissions of '/sdcard/bk/app-private': Operation not permi
tted
# ls /sdcard/bk
ls /sdcard/bk
app-private
thats what i did.. worked for me.. moved the app-private in to a folder named bk inside the sdcard
Hi,
We are assuming that you have already moved your apps and caches to the memory in a ext2 partition, correct?
Otherwise this will not work.
I 1st followed all the instructions in this post:
http://forum.xda-developers.com/showthread.php?t=468959
All this has to be done 1st including the 2 step 13's
onikus said:
hey guys need some help here i have the same problem, (as far as the error saying 'no such file or dir') and i tried your suggestion about typing su first then the busybox commands.
i have the most current terminal emulator, unfortunately i still continue to get the same error every time i try to run the busybox commands. it just simply say 'no such file or directory"
you guys have any suggestions for me to try ?
any help would be great.
Click to expand...
Click to collapse
nitro all i can say is thank you very much, i was looking through a 15 yr old unix book looking up commands, and it's just been so damn long ago i couldn't put it together.
thanks a ton. i'm sure you saved me at least a few hours.
@bestwebs ya i have done everything else including moving things to the ext2 partition i was just stuck on a few comands here and there.
but again thanks to both of you, and i'm all setup up now.
Hi,
Nitro is a real blast!
Glad it's working.

[DEV] Apps2SD and Darchstar-2.1 ROM

The focus of this thread is to sort out the Apps2SD issue in cyanogenmod-darch 2.1 ROM (like the title says). Please do not post here unless it relates to this issue.
That being said, here is where I was at in the original darchstar 2.1 thread:
watzone69 said:
Taken from the instructions darchstar gave in the first post of his thread...
Code:
adb remount
adb push e2fsck /system/bin
adb shell
cd /system/bin
chmod a+x e2fsck
a2sd
reboot
First, the "chmod a+x e2fsck" command doesn't work for me (EDIT: I discovered that it WILL work in recovery mode). I had to use "chmod 777 e2fsck". After entering "a2sd" it gets enabled. After rebooting, apps2SD is NOT enabled anymore. I realized this by doing this test:
Code:
adb shell
cd /data/app
pwd
If your apps2sd is enabled, you will get "/system/sd/app" returned to you.
If you get "/data/app" returned instead then apps2sd is NOT enabled!
Click to expand...
Click to collapse
Gbhil then replied...
gbhil said:
After you restart, can you re-enable a2sd by running a2sd from a terminal as root?
If so, do all your apps still appear and are they usable?
If the above is true, try adding this to the end of gumbo.sh
Code:
su -C a2sd
for a quick fix.
Start a thread (to keep things less cluttered) about it and I'll help you guys dig into the boot image and see why it's not sticking.
Click to expand...
Click to collapse
So, I rebooted and tried to run "a2sd" from the android terminal but it spits out a long string of errors:
Code:
--- Checking ext filesystems
e2fsck 1.41.6 (30-May-2009)
ext2fs_check_if_mount: Can't check if filesystem is mounted due to missing mtab file while determining whether /dev/block/mmcblk0p2 is mounted.
/dev/block/mmcblk0p2: clean, 13/249856 files, 31387/499713 blocks
mount: permission denied. (are you root?)
chown: /system/sd: Read-only file system
chmod: /system/sd: Read-only file system
mkdir failed for /system/sd/app, Read-only file system
chown: /system/sd/app: No such file or directory
chmod: /system/sd/app: No such file or directory
cp: cannot create '/system/sd/app/android.tether.apk': No such file or directory
cp: cannot create '/system/sd/app/android.tether.usb.apk': No such file or directory
cp: cannot create '/system/sd/app/at.abraxas.mountusb.apk': No such file or directory...
(etc.)
...rm: cannot remove '/data/app/org.gmote.client.android.apk': Permission denied
rm: cannot remove '/data/app/org.hermit.substrate.apk': Permission denied
rm: cannot remove '/data/app/org.iplatform.android.apk': Permission denied
rm: cannot remove '/data/app/org.mikeyin.livewallpaper.apk': Permission denied
mkdir failed for /system/sd/app-private, Read-only file system
chown: /system/sd/app-private: No such file or directory
chmod: /system/sd/app-private: No such file or directory
cp: can't open '/data/app-private/com.android.aldiko.apk': Permission denied
cp: can't open '/data/app-private/com.protocol.x.su.fbs.apk': Permission denied
cp: can't open '/data/app-private/com.rerware.android.MyBackupPro.apk': Permission denied
rm: cannot remove '/data/app-private/com.android.aldiko.apk': Permission denied
rm: cannot remove '/data/app-private/com.protocol.x.su.fbs.apk': Permission denied
rm: cannot remove '/data/app-private/com.rerware.android.MyBackupPro.apk': Permission denied
ln: /data/app/app: Permission denied
ln: /data/app-private/app-private: Permission denied
+++ Apps-to-SD successfully enabled
So, there is no "app" or "app-private" in the "system/sd". Is a2sd supposed to generate those directories or are they supposed to be there before hand?
Anyway, the result is that I lose all of my shortcuts to the apps and market shows them as not installed even though they are.
BTW, I am not a dev or even that great at code or linux but I can usually pick stuff up fairly quickly. Just want to help fix this!
EDIT: The only thing I have found to work is to flash this kernel:
http://forum.xda-developers.com/showpost.php?p=5712377&postcount=1406
However, some people get stuck in a boot loop after flashing this.
Running into the same issues as Watzone so I can confirm that he is doing it correctly. =P
Here are all of the related commands that have been suggested whenever the question of apps2sd has come up in the darchstar 2.1 thread.
Code:
adb remount
adb shell
mkdir /system/sd
Code:
adb remount
adb shell
busybox --install /system/xbin
a2sd
Code:
cd C:\android-sdk-windows\tools
adb remount
adb shell
chown system.system /data/app
chmod 0771 /data/app
For the next command, boot into recovery and do the following:
Code:
adb shell
mount /system
exit
adb push e2fsck /system/bin
adb shell
cd /system/bin
chmod 777 e2fsck
Now, boot normally and go back to your CMD prompt...
Code:
adb remount
adb shell
a2sd
EDIT: In other threads I have seen the command...
Code:
apps2sd on
...used to enable apps2sd.
Doing all of these WILL allow the final "a2sd" command to enable (testing with the "pwd" command) but it all goes KAPUT after a reboot.
why it's not being enabled at boot time is because the init.rc isn't calling /system/etc/init.d/04apps2sd . I'll be sure that we fix that in my next release
And there you go.
It works here, but now I know why. I'm still using an old version of the boot image that looks for /system/bin/a2sd to load it, and an older version of the ROM. No sense in me to keep flashing fixes until I'm done tweaking the kernel. When darch says the kernel is good, then I'll catch up lol.
We might as well use this thread to learn to play with the boot image though, that is if you guys want to.
Awesome can't wait for the next release then! Lotsa apps out there calling out to me! Thanks guys =)
gbhil said:
We might as well use this thread to learn to play with the boot image though, that is if you guys want to.
Click to expand...
Click to collapse
You bet. It's about time I got my hands dirty.
I'm game let me know if you need me to test anything!
Cool deal. You need Linux to extract and compress the boot.img, and you need to be current with Perl and running jre5 or higher.
Ubuntu 9.04+ is set up out of the box, but any version can be made to work.
Then grab these files from Lox -
http://forum.xda-developers.com/attachment.php?attachmentid=231902&d=1254004933
http://forum.xda-developers.com/attachment.php?attachmentid=234040&d=1254622769
and extract them into your sdk/tools dir. (or any dir in your path)
get all that, then pick a boot.img from a rom and put it in a work folder.
Holler when you get that far, or if you have any q's.
I wanna learn myself. This should apply to mac os as well?
I have Mint on another machine. Gimme a bit to get caught up...
david279 said:
I wanna learn myself. This should apply to mac os as well?
Click to expand...
Click to collapse
Darwin might work. Never tried
watzone69 said:
I have Mint on another machine. Gimme a bit to get caught up...
Click to expand...
Click to collapse
np. I'm @work so going slow is better anyway lol.
ok i just ran the files in terminal. so i guess it might work.
I'm back
Inisde the work folder you dropped the boot.img into, run this from a term:
extract-kernel.pl boot.img
extract-ramdisk.pl boot.img
it will give you several files and a new directory. That dir is the unpacked ramdisk. The init.rc file is the one we're looking for. Open it with a Unicode editor and read it. It has it's own syntax, but it's almost like bash and not too hard to figure out. Hopefully you loaded a bootimg that has a2sd in it. Look near the bottom of the file for the a2sd start up line. It will have a2sd, apps2sd, a2sd004 or something like that. Once you find it so you can see the name used, search the rest of the file for that name.
Those lines will show you how a service gets declared and called at boot time.
I'm up and running now. I downloaded python 2.6.4. Do I need to install it or just extract it somewhere? Please forgive my linux noobness.
The other 2 zip files are extracted and in my tools folder. I'm getting the boot.img now.
idk if this will work as i too am a newb to android and the way they deal with the boot process is somewhat a bit different from what i'm used to, but heres a new boot.img if you guys want to flash it to see if apps2sd works. note, this is not a zip, remove that suffix.
to flash it to your phone just move the boot image to your sdcard then reboot into recovery. from there go into adb and mount your sdcard, then flash the new boot image.
Code:
adb shell
mount /sdcard
flash_image boot /sdcard/newBoot2.img
reboot
tell me if it fixes your apps2sd problem or not.
watzone69 said:
I'm up and running now. I downloaded python 2.6.4. Do I need to install it or just extract it somewhere? Please forgive my linux noobness.
The other 2 zip files are extracted and in my tools folder. I'm getting the boot.img now.
Click to expand...
Click to collapse
try it without doing anything to Python first....especially since I meant perl
Just try my last post and see if it works for ya. I'll edit my first post
gbhil said:
try it without doing anything to Python first....especially since I meant perl
Just try my last post and see if it works for ya. I'll edit my first post
Click to expand...
Click to collapse
Nope, I got "command not found" both times.
darchstar said:
idk if this will work as i too am a newb to android and the way they deal with the boot process is somewhat a bit different from what i'm used to, but heres a new boot.img if you guys want to flash it to see if apps2sd works. note, this is not a zip, remove that suffix.
to flash it to your phone just move the boot image to your sdcard then reboot into recovery. from there go into adb and mount your sdcard, then flash the new boot image.
Code:
adb shell
mount /sdcard
flash_image boot /sdcard/newBoot2.img
reboot
tell me if it fixes your apps2sd problem or not.
Click to expand...
Click to collapse
Thanks darchstar, I'll try that in a bit.
watzone69 said:
Nope, I got "command not found" both times.
Click to expand...
Click to collapse
you gotta make it executable
inside the directory with the perl scripts do this
Code:
chmod a+x ./

[Q] Anyone have Linux/Ubuntu/Fedora Working Currently On GB?

Problem:
I've worked with every available distribution of Linux, trying to get the damn thing working on my phone. Troubleshooting the ***t out of it, and no deal. Constant errors/files not found etc. So, rather than post my logs and ask for help troubleshooting them (as I've obviously been unable to do), I thought I'd just ask:
Does anybody have a Linux build (besides android!) working on their phone that's running Gingerbread or ICS? If yes, can you post your software specs?
Here are mine currently:
Busybox- v1.19.3-Stericson in /system/xbin
Firmware Version- 2.3.5
Baseband Version- T959VUVKG6
Kernel- 2.6.35.7-T959VUVKI3-CL611444
Build Number- Gingerbread.VUVKI3
Mod Version- Octaine Team Acid
Thanks, this has been a pain in my **s for too long now!
S
I had both Fedora and Ubuntu working on Froyo at one point through lots of modifying and editing of the scripts.
What do you need them for anyway? I think it's more of a hassle to set them up than it's worth.
Well, I am working quite a bit now with linux for servers and such, and it's good to have a system (even minimal) that I can use/reference, plus it helps me get better at it.
Get this: I was so frustrated that I went back to BlackIce (keeping my gb bootloaders) and the damn thing loads right up, ubuntu 11.04, no problem. So, I then loaded up Valhalla's GB build and, sure enough, that works too. So, going with my luck I load octane 2.x GB which i've been digging of late and no deal, ubuntu just won't load.
Now, trying the same trick I cannot get it to work. It just won't load now when I SH it. Here's the instructions that worked before (and I've tried them all!):
http://www.nerd65536.com/2011/07/installing-ubuntu-in-android-version-2.html
Also, I hard bricked again (corrupted bootloaders from a Parallels Windows stallout) but did Adam's UnBrickable Mod and that's all better. Everybody needs to check it out, it's awesome:
http://forum.xda-developers.com/showthread.php?t=1333424
So FBI, any idea why linux is so temperamental? Once it SH's properly, it always works.
(Thanks to all the developers for their great roms!)
Yeah I noticed that slight changes from different ROMs based on the same kernel base had that effect too. I'm thinking it had to do something with the busybox installations since I had to edit the script sometimes. For some reason on some installs running mount won't work unless you use it as busybox mount. It was very iffy like that. I haven't even tried it again because of how frustrating it is to get even a boot. The other thing is that if you try to do a shutdown from ubutu/fedora it doesn't even kill the processes all the way so the only way you can clear some ram up with with a reboot.
Yeah man, I was figuring Busybox myself. I've tried old installs, new installs, xbin only, bin only, xbin & bin, etc. It's so frustrating because I can't figure it out. When it was working it was great, pretty stable.
So the first problem always lists as:
Remounting /system rw...
Mount: no such file or directory
Usage: mount [-r] [-w] etc, etc
So does this tell us that the system is not mounted rw? I used the Mount/system r/w application, but I cannot verify it's doing it's job. Everything is rooted properly, CWM also.
In Terminal on the phone I ran:
"mount | grep system"
which gave me
"/dev/block/st19 on /system type ext4 (rw,relatime,barrier=0,data=writeback)"
which leads me to believe the system is r/w.
I'm converting the system back from ext4 using CWM Voodoo to disable Lagfix and system Lagfix to see if this has any effect. Will report.
No deal. Didn't do a damn thing. I'm going to crack this if it's the last thing I do....
I'm using Better Terminal Pro, Bash shell, and under command line in options it lists the Shell as: /system/bin/sh-
The sh install.sh also tells me:
"Mounting: Loopback mount
mknod: /dev/block/loop254: File exists"
Does this mean that all (255) of my loops are used? Do I need to remove programs?
The available loop device thing never got resolved. Nameless originally fixed it by making it use 254 so that there was a low chance of the loop device being available, but the phone's OS is very iffy about letting a new loop device get assigned to a system image file. Can't really help you out since I never got it to consistently mount with different roms.
Linux on SGS4G Working! Done and Done!
Figured it out.
I can get Ubuntu 11.04, 11.10 & Debian 6 to mount repeatedly in all sorts of ui updatable configurations using this information:
http://www.nerd65536.com/2011/07/installing-ubuntu-in-android-version-2.html
It's a friggin Christmas Miracle! Can't tell you how much time I've wasted working this out, and it all boils down to the sh and run scripts.
So, without further ado, here goes.
!!Make sure you're rooted!!
!!The quotes just tell you what to type. Don't type them!!
1.
Download one of the three builds on the website listed above (or build your own, it should work fine). Extract it from tar.bz2, they should all extract to a linux file, this includes the necessary scripts. Put it on the sd-card on your phone.
2.
Download the new scripts that (Nerd) listed found here: http://ohm.nerd65536.com/android-linux/scripts-latest.tar.bz2
And extract them. You'll have another file that says linux. Open it, take the three files inside (install.sh, root-scripts & scripts) and paste them in the linux folder you moved to your sd-card. They will overwrite the ones currently there. These scripts work for sgs4g, the originals did not.
3.
Install the latest BusyBox in xbin if it's not already installed (must be rooted). Latest is 1.19.3
4.
Download a terminal client, like Better Terminal Emulator or Android Terminal Emulator. I use the first. The terminal needs to run the commands as root, especially the linux vnc command as it didn't want to work for me no matter if I started by typing su. Better Terminal Emulator has a check box to always start in root.
5.
Open up your terminal emulator and type su if you are not rooted there. Then change directory to the linux file on the sd-card. run the sh file there.
Like this:
"su"
"cd /sdcard/linux"
"sh install.sh"
If it works, the resulting dialog in terminal won't throw up any problems.
6.
Get back to / on sd by typing in terminal:
"cd /"
You should then have a: / # prompt, which means you are still rooted.
Enter:
"linux"
Which should result in a: [email protected]:/#
This means Linux is running. Congratulations. It should continue to run unless you shut down your phone.
7.
Download a VNC client, like Android VNC Viewer (free) or Remote VNC Pro, which I use. Add a new entry in it, with the following settings:
Host: localhost
Port: 5901
Password: cheesecake
Color: 24-bit
Name: Linux
When that's done save if you can or back out if you can't, and go back to your terminal emulator.
8.
It should still say: [email protected]:/#
If it doesn't, fine, if it does, just go back to root prompt by typing:
"exit"
Which should get you: / #. Then type:
"linux vnc"
Which should run itself and mount the chroot environment. It should tell you your new 'X' desktop is localhost:1, and have a: / # prompt again.
It might also ask you for a password, if so then put whatever password you'll remember in that's longer than 6 characters and verify it. This only happens once.
9.
Go back to your VNC client and if you entered a password in step 8. then edit your listing to your password instead of cheesecake, if not then don't.
Click on the Linux link and BAM! (shameless Emerilism), you're at your Linux desktop which should be running a iceWM desktop interface, which is fast. The LXDE desktop is nicer and if you want that then go into you're terminal and get into the linux shell by typing:
"linux"
And then switch to LXDE by typing:
"apt-get autoremove icewm- lxde+"
Which will run through the removal/ installation, and verify you want to download the <400mb files. Type:
"y"
And give it time to finish. When finished, just go back to your VNC client and hit Linux again, and you will have a nice looking functional desktop, with a cpu load graph on the bottom. I tried using Gnome desktop and Unity 2d, but both of these would install and not fully run with all options. They are heavier and slower, but cool non-the-less. Let me know if anyone has luck with these on Android.
Notes-
You only have to type "linux vnc" once in terminal to start linux every time you boot your phone. Otherwise, just open your VNC client and click on Linux to use it. Easy!
You will want to update and upgrade your linux after install, do so by typing in terminal:
"apt-get update"
"apt-get upgrade"
Also, you might run across a problem if you try to add-apt-repository, that's because that python command is not present. To use it, enable by typing:
"apt-get install python-software-properties"
Also of note, the downloadable linux builds are sized to about 2.15gig on your sd, which is big enough for most. There is a way to resize them which I tried but it gave me trouble in loading. I will try again and see if I can get it to work.
Here's the link from Dangermouse:
http://www.androidfanatic.com/community-forums.html?func=view&catid=9&id=1610
Thanks to Nerd65536 for the info, write-up and files. He fixed my problem.
sconsylman said:
Also of note, the downloadable linux builds are sized to about 2.15gig on your sd, which is big enough for most. There is a way to resize them which I tried but it gave me trouble in loading. I will try again and see if I can get it to work.
Here's the link from Dangermouse:
Click to expand...
Click to collapse
You're welcome.
It's actually a lot easier than that to make the image larger. Just pop the SD card into a Linux machine and:
(Assuming the original file is: /media/phone/linux/linux.img)
Code:
resize2fs /media/phone/linux/linux.img 4095M
And you're done. resize2fs is made of magic!
Note: Most SD cards are FAT32, which has a filesize limit of 4GiB. The above instructions will make the file a megabyte less than that.
nerd65536:
Thanks! Worked like a charm. Had to e2fsck -f /media/SDCARD/linux/linux.img (phone plugged in to Mint) before i did it to check over the file system, but then it ran immediately. Much appreciated.
Have you had any luck on native boot? I've been working a little on this, as I can't run BackTrack arm well virtually, it gets buggy. Granted the telephony systems won't work during, but the functionality should be pretty good if we could run it standard.
Also, while I'm thinking of it, is it possible to run the img from an ext4 partition on the card? I have an existing one being used for link2sd files and would much prefer using it as it's a far superior file system to fat32, without the 4G limits. Vnc should have no problem graphically, but would the linux.img chroot properly?
It would probably work but you would have to alter the script to mount the other partition if it doesn't do it automatically and change the path. Shouldn't be too hard.
I'm getting an error when I try running sh install.sh:
Code:
# sh install.sh
readlink: applet not found
Remounting /system rw ...
sh: Can't open /linux/scripts/fsrw
Installing scripts in /system/bin ...
cd: can't cd to /linux/scripts
cp: write error: No space left on device
cp: omitting directory 'root-scripts'
Unable to chmod /system/bin/root-scripts: No such file or directory
cp: omitting directory 'scripts'
Unable to chmod /system/bin/scripts: No such file or directory
cp: omitting directory 'tmp'
Unable to chmod /system/bin/tmp: No such file or directory
Mounting the Linux image ...
install.sh: /system/bin/linux: not found
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't stat '/linux/root-scripts/*': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
# linux
linux: not found
NuVanDibe said:
I'm getting an error when I try running sh install.sh:
Code:
# sh install.sh
readlink: applet not found
Remounting /system rw ...
sh: Can't open /linux/scripts/fsrw
Installing scripts in /system/bin ...
cd: can't cd to /linux/scripts
cp: write error: No space left on device
cp: omitting directory 'root-scripts'
Unable to chmod /system/bin/root-scripts: No such file or directory
cp: omitting directory 'scripts'
Unable to chmod /system/bin/scripts: No such file or directory
cp: omitting directory 'tmp'
Unable to chmod /system/bin/tmp: No such file or directory
Mounting the Linux image ...
install.sh: /system/bin/linux: not found
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't stat '/linux/root-scripts/*': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
# linux
linux: not found
Click to expand...
Click to collapse
cp: write-error.. no space left on device? You need more space dude

Fix fix_permissions

Apparentely fix_permissions doesn't work in stock roms (or at least in XKPU + XDA_bam kernel v11).
In order to fix permissions, /sbin/fix_permissions reads /data/system/packages.xml. However that file is not there, but in /dbdata/system/.
I temporarily solved the problem creating a symbolinc link to the file, but in this way "fix_permissions" will not work from CWM (it doesn't mount /dbdata).
The only way to successfully run "fix_permissions" is to run it from from adb or terminal emulator, when /dbdata is already mounted.
(I suggest you not to simply copy the file from /data to /dbata. The one in /dbdata is continuously updated)
The only way to completely solve the problem is to edit /sbin/fix_permissions, but apparently the file is regenerated after every reboot and I don't know how to permanently change it (I think we need to change boot.img, that's why I specified rom and kernel), but I really don't care that much since the command works from adb/terminal emulator.
Anyway, here the commands to create the symbolic link. You need to run them only once from adb/terminal emulator:
Code:
su
mount -o remount rw /system
ln -s /dbdata/system/packages.xml /data/system/packages.xml
mount -o remount ro /system
After that, whenever you need to fix permissions, you simply need to run this from adb/terminal emulator:
Code:
su
fix_permissions
Before you create the symbolic link, you can check if the problem exists in your rom/kernel by running "fix_permissions". The error is:
Code:
cat: can't open '/data/system/packages.xml': No such file or directory
Thanks! Gonna fix that in the next release
loSconosciuto said:
Apparentely fix_permissions doesn't work in stock roms (or at least in XKPU + XDA_bam kernel v11).
In order to fix permissions, /sbin/fix_permissions reads /data/system/packages.xml. However that file is not there, but in /dbdata/system/.
I temporarily solved the problem creating a symbolinc link to the file, but in this way "fix_permissions" will not work from CWM (it doesn't mount /dbdata).
The only way to successfully run "fix_permissions" is to run it from from adb or terminal emulator, when /dbdata is already mounted.
(I suggest you not to simply copy the file from /data to /dbata. The one in /dbdata is continuously updated)
The only way to completely solve the problem is to edit /sbin/fix_permissions, but apparently the file is regenerated after every reboot and I don't know how to permanently change it (I think we need to change boot.img, that's why I specified rom and kernel), but I really don't care that much since the command works from adb/terminal emulator.
Anyway, here the commands to create the symbolic link. You need to run them only once from adb/terminal emulator:
Code:
su
mount -o remount rw /system
ln -s /dbdata/system/packages.xml /data/system/packages.xml
mount -o remount ro /system
After that, whenever you need to fix permissions, you simply need to run this from adb/terminal emulator:
Code:
su
fix_permissions
Before you create the symbolic link, you can check if the problem exists in your rom/kernel by running "fix_permissions". The error is:
Code:
cat: can't open '/data/system/packages.xml': No such file or directory
Click to expand...
Click to collapse
This should have been included in the specific ROM's thread not creating another thread. Closing this since XDA_Bam has stated the fix will be implemented.

[MOD] Enable Stock Hotspot on Verizon

I have gotten the built-in wireless tether to work. I know there's been some discussion about getting Wireless tether without FoxFi and similar.
Since we cannot use the recovery method directly, you can still use the tools and everything from it.
So to begin:
Obviously, you must have root for this to work.
1) Download the patch.zip from the original thread. [here: http://forum.xda-developers.com/showthread.php?t=2768837 ]
2) extract the zip to somewhere on sdcard. I extracted mine to the Download folder. You may need to edit the script below to reflect your locations.
3) okay, this part gets a little weird, but bear with me...
Save this code as run.sh in Download folder or wherever you extracted. You can over-write the old run.sh if you save it in toggle folder where original was located-- BE SURE TO EDIT AS REQUIRED
Code:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/data/local/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
4) now open up adb on pc (preferred!!! So you can still see progress and if necesary you can undo/alter/fix things) or terminal emulator (untested but should work, may be weird since you have to reboot phone while it's interface is locked up)
Run:
adb shell
su
sh /mnt/sdcard/Download/toggle/run.sh [or where ever you saved it]
5) Your phone will probably lock up now because you've just replaced the framework-res.apk while the system was running.
adb reboot or reboot by other methods.
6) Profit ;]
I DO NOT WARRANTY OR GUARANTEE THIS METHOD. USE AT YOUR OWN RISK
I believe the sqlite edits serve the purpose of showing the icon in the quick settings pull down. Otherwise, just replacing the framework-res.apk with the correct changes is enough: See this thread for the changes needed:
http://forum.xda-developers.com/showthread.php?t=2759119
Incidentally, I was attempting to make the changes on my own and recompile the framework-res.apk, and I must've done something not quite right because the phone hung at the verizon logo. Thankfully adb was up so I was able to remount system as rw to replace the edited framework-res.apk from the original thread OP linked. Interestingly enough, as soon as I finished copying the edited file, the phone continued booting just fine, and I'm posting from the native tethered connection now.
Edit: I was able to do the changes on the framework-res.apk extracted/decompiled from my phone after all. I'm guessing that the phone didn't like deflate method as opposed to store method (no compression) on the resources.arsc file in the apk file. Had to use the 7zip command line tool to save the modified resources.arsc file without compression to the original apk:
7z u -mx0 framework-res.apk.zip resources.arsc
where -mx0 means no compression (copy)
Got it enabled by just replacing the framework-res.apk, and noticed speeds were really slow. I get 1.88mbps on LTE at home (so-so coverage), but only .15mbps on my iPad connected to my phone via Wi-Fi.
I did this: http://forum.xda-developers.com/showpost.php?p=53431713&postcount=9
SO MUCH EASIER than what you guys were doing. :good:
Droid_Evo_8 said:
I did this: http://forum.xda-developers.com/showpost.php?p=53431713&postcount=9
SO MUCH EASIER than what you guys were doing. :good:
Click to expand...
Click to collapse
It's a manner of preference. In terms of overhead, this native method should technically be quicker to enable, as it does not have to wait for the exposed module to intercept the call and return an empty array of apps to execute for the provision check. That being said, we're probably talking miliseconds at most. While I use xposed for other modules sometimes, others might prefer not to, and this native method does not require it.
vacaloca said:
It's a manner of preference. In terms of overhead, this native method should technically be quicker to enable, as it does not have to wait for the exposed module to intercept the call and return an empty array of apps to execute for the provision check. That being said, we're probably talking miliseconds at most. While I use xposed for other modules sometimes, others might prefer not to, and this native method does not require it.
Click to expand...
Click to collapse
I don't know much about adb or terminal emulator so I'm fine with it. :good:
Here's to hoping for an easy tethering mod!
fillyo said:
Here's to hoping for an easy tethering mod!
Click to expand...
Click to collapse
I'm not sure how easier it can get than installing xposed framework + X Tether mod and rebooting, or replacing the framework-res.apk file on your phone with the one listed in the OP... either will work. This of course assumes you have the Verizon model. Replacing the premade framework-res.apk on any other S5 model would probably cause issues and wouldn't solve anything .
I just made it 'harder' on myself by deciding to copy the original framework-res.apk from my phone, and using the latest apktool and aapt to extract the apk, make the modifications, rebuild it, and replace it on my phone (after renaming the original to .bak). I mostly did this to refresh my memory on how to do it as I had done the process with another phone a while back to do the same mod. As I mentioned earlier, the sqlite stuff is only necessary if you want a toggle in the quick settings bar... otherwise you can just go into settings menu and enable it that way.
vacaloca said:
I'm not sure how easier it can get than installing xposed framework + X Tether mod and rebooting, or replacing the framework-res.apk file on your phone with the one listed in the OP... either will work.
Click to expand...
Click to collapse
I don't see the framework-res.apk file in OP, am I missing something? I have no idea how to decompile mine to make changes.
fillyo said:
I don't see the framework-res.apk file in OP, am I missing something? I have no idea how to decompile mine to make changes.
Click to expand...
Click to collapse
It's linked to in step (1). It's inside the zip file that's meant to be flashed in a recovery... however, because our bootloader is still locked, we cannot flash a recovery, so the way to do it is by replacing the framework-res.apk file as the filesystem is live, which as the OP mentions, will trigger a soft reboot as this file is used extensively by Android apps.
vacaloca said:
It's linked to in step (1). It's inside the zip file that's meant to be flashed in a recovery... however, because our bootloader is still locked, we cannot flash a recovery, so the way to do it is by replacing the framework-res.apk file as the filesystem is live, which as the OP mentions, will trigger a soft reboot as this file is used extensively by Android apps.
Click to expand...
Click to collapse
I got the framework-res apk from the zip package, I guess I am a little nervous since this is from a dev edition, correct? Anyone else successfully just replace framework-res from the zip package on their retail Verizon GS5?
fillyo said:
I got the framework-res apk from the zip package, I guess I am a little nervous since this is from a dev edition, correct? Anyone else successfully just replace framework-res from the zip package on their retail Verizon GS5?
Click to expand...
Click to collapse
The OP (presumably), user in post #3, and myself before I did the changes manually.
SO I followed these instructions and this is what i get both from adb and Term Em.
mount: No such file or directory
: Read-Only file systemramework-res.apk.bak
: Read-Only file systemramework-res.apk
/mnt/sdcard/download/toggle/run.sh[8]: /mnt/sdcard/download/toggle/sqlite3: can't execute: permission denied
I use the same folder structure you did, created a download folder and extracted the zip...
Thoughts?
tangoboyz said:
SO I followed these instructions and this is what i get both from adb and Term Em.
mount: No such file or directory
: Read-Only file systemramework-res.apk.bak
: Read-Only file systemramework-res.apk
/mnt/sdcard/download/toggle/run.sh[8]: /mnt/sdcard/download/toggle/sqlite3: can't execute: permission denied
I use the same folder structure you did, created a download folder and extracted the zip...
Thoughts?
Click to expand...
Click to collapse
Seems at least like 2 errors... the mount command can't find the input or output directories, thus you attempt to copy the files and get read-only file system, and it looks like sqlite3 needs to be changed to executable... chmod +x sqlite3
Also make sure you're running as root, obviously.
I saw a similar post int the android development subforum, and they seem to believe you will bootloop if you try to overwrite your framework-res. I chickened out and just did the xposed and x tether mod.
vacaloca said:
Seems at least like 2 errors... the mount command can't find the input or output directories, thus you attempt to copy the files and get read-only file system, and it looks like sqlite3 needs to be changed to executable... chmod +x sqlite3
Also make sure you're running as root, obviously.
Click to expand...
Click to collapse
I am rooted. Here's what i had in my run.sh:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
NOW does this look right??
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod +x 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
I'm sorry as I'm very new to this.
tangoboyz said:
I am rooted. Here's what i had in my run.sh:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
NOW does this look right??
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod +x 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
I'm sorry as I'm very new to this.
Click to expand...
Click to collapse
The original script should work assuming the files are in the right path... when I mentioned make sure you are running as root meant, make sure you run the 'su' command and get the # prompt before you run the script, otherwise the script won't run with root permissions and will fail.
For the third line, you (and the OP) can replace the mount command with:
Code:
mount -o,remount rw /system
----
As an aside, the chmod 0777 part in the original script already does mark the file as executable... chmod works with generic +rwx (read,write,execute) distinctions or the regular numbering permissions (777 means rwx for everyone)
Edit: the last line of the script should start with: /data/local/tmp/sqlite3
because that's the one that you set the permissions to rwx, not the one in your sdcard
vacaloca said:
The original script should work assuming the files are in the right path... when I mentioned make sure you are running as root meant, make sure you run the 'su' command and get the # prompt before you run the script, otherwise the script won't run with root permissions and will fail.
For the third line, you (and the OP) can replace the mount command with:
Code:
mount -o,remount rw /system
----
As an aside, the chmod 0777 part in the original script already does mark the file as executable... chmod works with generic +rwx (read,write,execute) distinctions or the regular numbering permissions (777 means rwx for everyone)
Edit: the last line of the script should start with: /data/local/tmp/sqlite3
because that's the one that you set the permissions to rwx, not the one in your sdcard
Click to expand...
Click to collapse
Hmm still no dice... Something isn't working right. Really I wanted the Hotspot in the pull down menu. I am currently paying for hotspot anyway....
Just found that wanam xposed has an option to skip provisioning check. Anyone tried this yet? Seems to enable native tethering but doesn't give a quick settings button.
dlscott1111 said:
Just found that wanam xposed has an option to skip provisioning check. Anyone tried this yet? Seems to enable native tethering but doesn't give a quick settings button.
Click to expand...
Click to collapse
Yes, we have tried it and it works. The quick settings button, as I have mentioned earlier in this thread, is what the sqlite3 executable and the file commands it takes in (just a simple text file of DB commands) take care of. You could also just get sqlite editor ($3 from the play store, IIRC) and do them manually if you don't like command line tools. it's basically adding "WiFiHotspot" to system -> notification_panel_active_app_list_for_reset and notification_panel_default_active_app_list in the settings.db file in /data/data/com.android.providers.settings/databases/
Or you could just do it the free with the command line sqlite3 using the tools already at your disposal

Categories

Resources