Kali Nethunter terminal problem - Android Q&A, Help & Troubleshooting

Hi guys I've installed kali nethunter on my old smartphone and I have a problem with the terminal. When I try to boot kali with command: bootkali, I recive an error message about permission despite I use root terminal. I have a moto g 2gen and I've done a downgrade from marshmellow to lollipo to use kali nethunter's version for nexus 4. I've tryed also the version for nexus 5 mashmellow before downgrade but It gives me an error while installing chroot. Anyone can helpme to solve the problem or simply I can't use kali on my old phone?
Terminal:
[email protected]_umtsds: / # bootkali
tmp-mksh: bootkali: can't execute: Permission denied

Try setting the permissions to 755 as root. Like this:
mount -o rw,remount /system #mount /system rw
cd /system/bin/ #change dir
chmod 755 bootkali #set permission rwxr-xr-x
mount -o ro,remount /system #mount /system ro

Related

WORK AROUND - Scripting help for Android and my DX2!

All right... I guess it's time to "ask the experts". My linux background has not been very much help here... ARGH!
Okay, I have two script that I have written that are supposed to mount /system as RO and RW respectively. Very simple:
To mount rw:
Code:
#!/system/bin/sh
mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
To mount ro:
Code:
#!/system/bin/sh
mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
I manually ran the mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system command and adb pushed them to /system/xbin as mountro and mountrw and chmod both to 755.
In ADB I try to execute:
Code:
/system/xbin/mountrw
and get an error stating:
Code:
/system/xbin/mountrw: not found
I even try:
Code:
/system/bin/sh /system/xbin/mountrw
and I get this error:
Code:
mount: No such file or directory
Okay, so I figured out that it is having a problem trying to find the mount command, so I modify the script to:
Code:
#!/system/bin/sh
/system/bin/mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
I then re-run this:
Code:
/system/bin/sh /system/xbin/mountrw
and I'm still getting this friggin' error message!
Code:
mount: No such file or directory
When I run it through Script Manager I get the same error:
Code:
mount: No such file or directory
This should just friggin' work damn it! (Sorry, very frustrated.)
Also, it would be nice NOT to have to type the path to the script. I can run ZepplinRox V6_SuperCharger script from the ADB command line just by typing from the directory I have it in:
Code:
sh V6_SuperCharger_for_Android-update9_RC3.2.sh
No absolute path, no ./ path... WTF? ARGH!
Okay, I KNOW this is friggin' possible just by the fact that I can run Zep's script in ADB...
So, any takers? Thanks in advanced...
Friggin' Ciao.
[EDIT]
Okay, I figured out a work around for this... I probably should not work on this after working at work all day... But, that is another story...
I have heavily modified the script files I have created. They are still called mountrw and mountro and the contents are as follows:
mountrw:
Code:
#!/system/bin/sh
# This mounts the /system file system as Read Write in order to modify or add
# files to the /system file system.
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
mountro:
Code:
#!/system/bin/sh
# This mounts the /system file system as Read Only which is the default when
# Android is booted.
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
So, after poking around in ZepplinRox's V6_SuperCharger script, I found those values repeated several times, so that helped point me in the right direction. The next problem I had was getting the scripts to "run from anywhere". I still haven't figured that one out yet, and the VERY MESSY solution to that is to put the two scripts in /. I know, I know, I know... that is the most dangerous place to put it.
So, when I first log into the ADB shell all I have to type is
Code:
sh mountrw
and when I'm done, type
Code:
sh mountro
So, As the work around, this works. I really don't recommend anyone else doing this because of the data security risks that you open your phone up to... Yes, I'm aware of them and that is why I am asking now for some help in having the ability to run a script globally, from anywhere in the android file structure. I don't mind typing the "sh" in front of the script since I sometimes must do that in linux. I have noticed that the $PATH of Android doesn't allow scripts to be executed unless you type the absolute path to the script, or are in the same directory as the script.
Okay, so again to ask: Is there any way to execute a script without having to type the absolute path to it? Thanks!
Ciao! (MUCH calmer now then when I first wrote this post...)
[/EDIT]
I don't use adb much at all.
Usually I move stuff around with root explorer and use terminal emulator a lot.
I assume you ran everything as superuser as I sometimes forget to type su first
Maybe the sh command work on the supercharger script because it has the .sh extention.
You can try typing "bash mountrw" since that works when I install the script to /system/xbin/V6
But after reading your post I looked and saw I forgot about permissions so I did chmod 755 and now this works...
su
V6
heh..
I don't have tp type "bash V6" anymore
zeppelinrox said:
I don't use adb much at all.
Usually I move stuff around with root explorer and use terminal emulator a lot.
I assume you ran everything as superuser as I sometimes forget to type su first
Maybe the sh command work on the supercharger script because it has the .sh extention.
You can try typing "bash mountrw" since that works when I install the script to /system/xbin/V6
But after reading your post I looked and saw I forgot about permissions so I did chmod 755 and now this works...
su
V6
heh..
I don't have tp type "bash V6" anymore
Click to expand...
Click to collapse
Yes, I ran everything as su. (I'm a linux admin guy, so su and sudo is next to natural for me...)
Okay, so you put the mountrw script in /system/xbin/V6/ ??
Also, it is an sh script. I identify that in the first line of
Code:
#!/system/bin/sh
I have changed it to bash and same problem. Oh well. I think I can live with the scripts at /
Thanks though!
Ciao!

[Q] chmod 755 doesn't work in adb shell: wifi broken

Hello, I have a serious problem.
I am using adb for hacking my Android Galaxy 5 smartphone.
Wifi got broken because I can't make file /data/misc/wifi/wpa_supplicant.conf executable.
Issuing chmod 755 have no effect, even after remounting the system as rw with command
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Consequence: Wifi is broken. I have no idea about how to prevent this behaviour of chmod. Can you help me?
Solved: I was confunding two files: wpa_supplicant and wpa_supplicant.conf. Sorry

[Q] Root for Acer A210 nearly working but /system doesn't mount

I have an Acer A210 and have modified the boot.img to have ro.secure=0 and ADB root. Then I had to mount the /system partition but that is not so easy:
Code:
C:\>adb shell
[email protected]:/ # mount -o remount,rw /system
mount -o remount,rw /system
mount: Operation not permitted
C:\>adb push busybox /data/local/tmp
1065 KB/s (777216 bytes in 0.712s)
126|[email protected]:/data/local/tmp # chmod 755 busybox
chmod 755 busybox
[email protected]:/data/local/tmp # ./busybox mount -o remount,rw /system
./busybox mount -o remount,rw /system
mount: permission denied (are you root?)
Currently the only way to mount /system rw is this:
Code:
cd /system/xbin/
mount -o remount,rw /dev/block/platform/sdhci-tegra.3/by-name/APP /system/
So now I have root (pushed su and busybox from A510 and installed SuperUser from ChainsDD) but installed applications that want to mount /system rw cannot do that. I think because of the mounting problem. Also a custom CWM 6.0.1.4 cannot mount /sdcard but it works with ADB.
Thanks for help with that!
MaluNoPeleke said:
So now I have root (pushed su and busybox from A510 and installed SuperUser from ChainsDD) but installed applications that want to mount /system rw cannot do that. I think because of the mounting problem. Also a custom CWM 6.0.1.4 cannot mount /sdcard but it works with ADB.
Thanks for help with that!
Click to expand...
Click to collapse
Acer implemented in kernel "system RW protection" (I don't know how to call that)- kernel prohibits such operations. Only workaround is compiling a custom kernel with this feature disabled.
As for recovery- check /etc/fstab if sdcard mountpoint (stored in init.rc or init.[device name].rc) matches the one recovery uses (/etc/fstab)
Thanks for that! Is it hard to disable the system rw security in the kernel? I haven't done that before. Is there a tutorial from another Acer tablet?
How can I check the fstab content in the recovery? It was built by the recovery builder.
Thanks!
MaluNoPeleke said:
Thanks for that! Is it hard to disable the system rw security in the kernel? I haven't done that before. Is there a tutorial from another Acer tablet?
Click to expand...
Click to collapse
It's a kernel config option only, for a510 it's CONFIG_ACER_SECURE_MOUNT and it is accessible in menuconfig or by hand- in .config change "CONFIG_ACER_SECURE_MOUNT=yes" to "# CONFIG_ACER_SECURE_MOUNT is not set" (as for kernel compilation- there are many tutorials floating around)
MaluNoPeleke said:
How can I check the fstab content in the recovery? It was built by the recovery builder.
Click to expand...
Click to collapse
Start recovery and just
Code:
adb shell
cat /etc/fstab
or
Code:
adb pull /etc/fstab [path on your pc]
I've never used any recovery builder but kernel and ramdisk/initramfs (where recovery is placed) are separate files, you can unpack boot.img and just modify what you need (note- linux machine required, virtual one will do)
Is it already disabled in the source code?
Code:
[email protected] ~/Dokumente/kernel $ grep -R -i 'CONFIG_ACER_SECURE_MOUNT*' ./*
./arch/arm/configs/picasso_mf_defconfig:# CONFIG_ACER_SECURE_MOUNT is not set
./arch/arm/configs/picasso_m_defconfig:# CONFIG_ACER_SECURE_MOUNT is not set
./arch/arm/configs/picasso_e_defconfig:# CONFIG_ACER_SECURE_MOUNT is not set
./arch/arm/configs/picasso_e2_defconfig:# CONFIG_ACER_SECURE_MOUNT is not set
./arch/arm/configs/picasso2_defconfig:# CONFIG_ACER_SECURE_MOUNT is not set
./fs/Makefile:ifeq ($(CONFIG_ACER_SECURE_MOUNT),y)
It seems that it's disabled.
Is there a zip file for Acer 210 tablet now 4/2013
dobie62 said:
Is there a zip file for Acer 210 tablet now 4/2013
Click to expand...
Click to collapse
There is a real lot available for A210:
Pure root (German)
CWM recovery (German)
Custom Kernel
CM 10.1 like ROM
What are you looking for?
regards Uwe
This is it but in English please.
A210
Are the A210 and the A510 similar enough to use the same kernel, ROM's or Recovery?

android /System/bin permission error

Hello everyone
Can somebody help me i have accidently changed the permission of the folder /System/bin to [rw-r-r] in my lg g3 using CM13 nightly latest version.
now the phone wont boot only in recovery mode even if i reboot system it goes to the recovery.
is there a way to undo the changes i did or fix this problem ?
tetouan22 said:
Hello everyone
Can somebody help me i have accidently changed the permission of the folder /System/bin to [rw-r-r] in my lg g3 using CM13 nightly latest version.
now the phone wont boot only in recovery mode even if i reboot system it goes to the recovery.
is there a way to undo the changes i did or fix this problem ?
Click to expand...
Click to collapse
How do you accidently changed them?
Reffering to this Thread you could use adb to change permissions in recovery by:
Code:
adb shell
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
chmod 755 /system/bin
Edit: When just coying and pasting I forgot, that the part
Code:
yaffs2 /dev/block/mtdblock3
may be a little bit different on your device. I do not have a G3 at hand and did not find the fstab that fast, but you can run
Code:
mount
Code:
cat /proc/partitions
and so on out of the CM Porting tutorial to find out your parameter.
MichaelSX said:
How do you accidently changed them?
Reffering to this Thread you could use adb to change permissions in recovery by:
Code:
adb shell
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
chmod 755 /system/bin
Edit: When just coying and pasting I forgot, that the part
Code:
yaffs2 /dev/block/mtdblock3
may be a little bit different on your device. I do not have a G3 at hand and did not find the fstab that fast, but you can run
Code:
mount
Code:
cat /proc/partitions
and so on out of the CM Porting tutorial to find out your parameter.
Click to expand...
Click to collapse
I have reflashed my ROM now,
and about the accident ... well i was reading a tutorial about how to install stock G3 apps on cm13 and i did the permission things for the wrong folder, and that was the probleme :laugh:

How can I run 3 lines of code after Boot (to mount a network share)

Hi,
I've got a Probox2 AndroidTV box on Marshmallow.
I would like to mount a remote NFS share into it's filesystem, so that the share is accessible to all apps (I've disabled mountspace in SuperSU).
I can do this via terminal or SSH using the following 3 lines
Code:
su busybox mkdir -p /mnt/nfs/roms
su busybox chmod 777 /mnt/nfs
su --mount-master -c busybox mount -o rw,nolock,hard,intr,vers=3 -t nfs x.x.x.x:/mnt/Roms /mnt/nfs/roms
This works well and my Apps can find the network shares.
However I would like this be mounted automatically at every boot...
I've tried ScriptManager with this as the script
Code:
#!/system//bin/sh
su busybox mkdir -p /mnt/nfs/roms
su busybox chmod 777 /mnt/nfs
su --mount-master -c busybox mount -o rw,nolock,hard,intr,vers=3 -t nfs x.x.x.x:/mnt/Roms /mnt/nfs/roms
The script doesn't work from script manager or cli. (I know nothing about scripting).
I'm unsure how to go about getting it run/work....
Please could someone explain to me how to get those lines to run after boot or how to fix the script...
Thanks

Categories

Resources