So stock kernal of mate9 does not have loop device support? - Huawei Mate 9 Guides, News, & Discussion

No magisk, no linux?
losetup success, but mount failed.
if try mount under twrp recovery, the phone just reboots.
Nothing we can do till Huawei releases kernel sources?

Is there a kernel that can be set permissive
Sent from my MHA-L29 using XDA Labs

Sylphia said:
No magisk, no linux?
losetup success, but mount failed.
if try mount under twrp recovery, the phone just reboots.
Nothing we can do till Huawei releases kernel sources?
Click to expand...
Click to collapse
If you want to run linux commands from terminal (not sure if you can create desktop environment using vnc) you can use the app GNURoot debian (other variants can be installed). I have it installed on my Mate 9 and I do not have root. Many typical commands work well like convert, vim, emacs, and even f77 and maxima (you have to install emacs, vim and gfortran and so forth using apt-get install).

Related

[How To] Rooting any HD2 android build.

Hi.
I was wondering how to do that and what's required for this - turned out that it's dead simple.
Requirements:
Linux machine
Root on the above Linux machine
Already working android on HD2
HD2 booted into Windows Mobile or the SD card taken out of it and mounted to your Linux machine
So...
There are some rootfs.img available to download from: http://ip208-100-42-21.static.xda-developers.com/showthread.php?t=719646 but they may not be working with your build or there's a newer build. The instructions I provide are universal and should work for all builds.
Since we have access to all partition images we can modify anything we like on them so getting root on your android will be easy.
From what I discovered - which maybe is obvious to some but was not to me, was that su binary is located in 2 places (two partitions):
/bin
/system/xbin
and the one in /system/xbin is overmounted by by the one from /bin - probably because the one in /bin is hacked (the standard one may not allow granting root to any application and only allow it to ADB shell).
If you do the following using any terminal emulator from Android:
ls -all /system/xbin/su
you'll see that it's permissions are set to: -rwxrwxrwx or -rwxr-xr-x depending on what build u have (the first one is not really a good permission set since it allows anybody to write to the file - BAD but irrelevant here). What's missing here is the SUID bit. Without SUID permission this binary won't be able to grant root. So what u need to do here is set su as SUID.
I saw on some hacked/rooted rootfs.img that this has been done by adding a chmod 04755 /bin/su and /system/xbin/su lines to startup scripts somewhere near the end of the booting process but my way of doing it is to set SUID on the binary itself.
So...
Assuming that you have your HD2 connected to your Linux machine via USB and it's set to STORAGE mode or you have your SD card inserted to the Linux machine and mounted as /media/disk (the path may be different in your case) you need:
On your Linux machine - Become root (su -) or (sudo bash) or login simply login as root
create yourself a directory (eg rootfs): mkdir rootfs
mount the root partition image to rootfs: mount -o loop /media/disk/rootfs.img rootfs
grant SUID to /bin/su: chmod +s rootfs/bin/su
unmount the image: umount rootfs
safely remove the card/disconnect HD2 (by using your distro ways - eg in KDE4 use "device notifier widget"
insert your SD card to HD2/disconnect HD2 from Linux box's USB port
Fire up haret and boot your Android distro
Enjoy rooted Android
a.key said:
Hi.
I was wondering how to do that and what's required for this - turned out that it's dead simple.
Requirements:
Linux machine
Root on the above Linux machine
Already working android on HD2
HD2 booted into Windows Mobile or the SD card taken out of it and mounted to your Linux machine
So...
There are some rootfs.img available to download from: http://ip208-100-42-21.static.xda-developers.com/showthread.php?t=719646 but they may not be working with your build or there's a newer build. The instructions I provide are universal and should work for all builds.
Since we have access to all partition images we can modify anything we like on them so getting root on your android will be easy.
From what I discovered - which maybe is obvious to some but was not to me, was that su binary is located in 2 places (two partitions):
/bin
/system/xbin
and the one in /system/xbin is overmounted by by the one from /bin - probably because the one in /bin is hacked (the standard one may not allow granting root to any application and only allow it to ADB shell).
If you do the following using any terminal emulator from Android:
ls -all /system/xbin/su
you'll see that it's permissions are set to: -rwxrwxrwx or -rwxr-xr-x depending on what build u have (the first one is not really a good permission set since it allows anybody to write to the file - BAD but irrelevant here). What's missing here is the SUID bit. Without SUID permission this binary won't be able to grant root. So what u need to do here is set su as SUID.
I saw on some hacked/rooted rootfs.img that this has been done by adding a chmod 04755 /bin/su and /system/xbin/su lines to startup scripts somewhere near the end of the booting process but my way of doing it is to set SUID on the binary itself.
So...
Assuming that you have your HD2 connected to your Linux machine via USB and it's set to STORAGE mode or you have your SD card inserted to the Linux machine and mounted as /media/disk (the path may be different in your case) you need:
On your Linux machine - Become root (su -) or (sudo bash) or login simply login as root
create yourself a directory (eg rootfs): mkdir rootfs
mount the root partition image to rootfs: mount -o loop /media/disk/rootfs.img rootfs
grant SUID to /bin/su: chmod +s rootfs/bin/su
unmount the image: umount rootfs
safely remove the card/disconnect HD2 (by using your distro ways - eg in KDE4 use "device notifier widget"
insert your SD card to HD2/disconnect HD2 from Linux box's USB port
Fire up haret and boot your Android distro
Enjoy rooted Android
Click to expand...
Click to collapse
Excellent post mate! Been wondering how to do this myself... I only got as far as mounting and chmod'ng the wrong files
What build did you root, btw?
Will test this in a bit
pongster said:
Excellent post mate! Been wondering how to do this myself... I only got as far as mounting and chmod'ng the wrong files
What build did you root, btw?
Will test this in a bit
Click to expand...
Click to collapse
pongster, long no heared of any new cleanex thinking of making any android builds?
I'm using Desire V5 and it's the one I rooted.
shu8i said:
pongster, long no heared of any new cleanex thinking of making any android builds?
Click to expand...
Click to collapse
Might give it a whirl once I find the time...
pongster said:
Might give it a whirl once I find the time...
Click to expand...
Click to collapse
what happened to ubunto
Rubanzip said:
what happened to ubunto
Click to expand...
Click to collapse
Why are you bumping old threads from 3 months ago?
one question fellos .... this post means booting android directly with out help of windows mobile ....
sathara said:
one question fellos .... this post means booting android directly with out help of windows mobile ....
Click to expand...
Click to collapse
nope. that's called NAND

(Working) Ubuntu on A500

Maybe you've heard of this app? https://market.android.com/details?id=com.galoula.LinuxInstall
Note: You need to be rooted for this to work.
I've just installed and run it on my a500 (After a full backup through CWM of course). In settings, I set it to install Ubuntu Maverick Meerkat. It installed fine, although you have to go through some trial and error with the settings panel:
Loop file must be "/data/local/tmp/Linux.loop"
"Bind Android" must be enabled
"Allow write on /system" must be enabled!
Linux is activated through a terminal by typing "linuxchroot". Here is an extract from the terminal. (I'll upload screenshots when I find a working program.)
Code:
#linuxchroot
I: Mounting device for ubuntu maverick...
I: Entering chroot...
I: Executing /etc/init.android/rc_enter.sh
/etc/init.android/rc_enter.sh: 2: /etc/init.d/hostname.sh: not found
[email protected]:/# cat /etc/issue
Ubuntu 10.10 \n \l
[email protected]:/# apt-get install python
Reading package lists... Done
Building dependency tree... Done
python is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[email protected]:/# python
Python 2.6.6 (r266:84292, Sep 16 2010, 14:12:30)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 3+7
10
>>> exit()
[email protected]:/#
I'm running a stock 4.010.13_COM_GEN2 rom.
I'm working my way around the console now. As you can see, apt-get and python work. I just need to figure out how (if it's possible) to install gnome onto this installation.
Update:
So it turns out "add-apt-repository" isn't installed by default in the usual place. Or the shortcut doesn't work. Either way, I found that the /usr/bin directory contains all the required files. Since this linux seems to log you in directly into root, which might not have well-made shortcuts, you cannot access the applications normally. I cd'd inbto /usr/bin and add-apt-repository works. Now to see if usr can be the default login.
Alright. Forget about trying to get a GUI working on this type of linux. Nvidia's Tegra drivers for Xorg are MIA.
Getting the following:
/system/xbin/linuxchroot.sh: UID: readonly variable
Any thoughts?
Sent from my MB860 using xda premium
just_mike said:
Getting the following:
/system/xbin/linuxchroot.sh: UID: readonly variable
Any thoughts?
Sent from my MB860 using xda premium
Click to expand...
Click to collapse
When do you get the message? Right after you type "linuxchroot"? If so, try typing su then hitting enter; and then typing "linuxchroot"
Same thing happens, will post over in the main thread? Thanks
Sent from my MB860 using xda premium
If you want a working guide with all the necessary files there is an app in the market.
For Ubuntu:
https://market.android.com/details?id=com.appbuilder.u14410p30729
Or for backtrack:
https://market.android.com/details?id=com.appbuilder.u14410p30729
Both work on the iconia. The only fiddling I had to do was change a CD command from the guides suggested command to CD /mnt/external_sdcard. I am able to boot both from my iconia .
profclean2000 said:
If you want a working guide with all the necessary files there is an app in the market.
For Ubuntu:
https://market.android.com/details?id=com.appbuilder.u14410p30729
Or for backtrack:
https://market.android.com/details?id=com.appbuilder.u14410p30729
Both work on the iconia. The only fiddling I had to do was change a CD command from the guides suggested command to CD /mnt/external_sdcard. I am able to boot both from my iconia .
Click to expand...
Click to collapse
I cant load it in the iconia
FearL0rd said:
I cant load it in the iconia
Click to expand...
Click to collapse
Where are you stuck? Maybe I can help.
GNOME
Zen_Jackal said:
I just need to figure out how (if it's possible) to install gnome onto this installation.
Click to expand...
Click to collapse
Idea: Install GNOME and then a VNC client and connect.
I'll try it later. Will post my conclusions/steps taken/results here.
-Cameron
Zen_Jackal said:
Alright. Forget about trying to get a GUI working on this type of linux. Nvidia's Tegra drivers for Xorg are MIA.
Click to expand...
Click to collapse
http://developer.nvidia.com/linux-tegra
Possibly this could help??
You cannot run Xorg with Tegra 2 drivers when your GPU is already in use by Android. Either you have to run some sort of a virtual Xorg driver and use VNC to connect to the Linux, or you have to use native Linux and scrap Android.
Connecting via VNC works just fine, I'm doing it all the time... Just don't try running a heavyweight like GNOME or KDE, use something like LXDE (looks ok, but it's a lot faster!). There are plenty of tutorials on how to set this up on the internet.

[GUIDE] Revert from ART to Dalvik if boot fails

Today I tried to enable ART on my S3 Mini running Maclaw's CM11. After the phone was shut down, the CM loading circle stayed there forever and the phone didn't boot.
To fix this you can boot the phone into recovery (I'm using CWM) and use ADB to revert the runtime back to Dalvik.
There are 3 ways to do this:
Use the following manual instructions
Download the second attachment and run the batch file, while the phone is connected using a USB cable and in recovery mode. For this you need USB drivers installed.
Download the first attachment and flash it in recovery
Manual instructions
Boot to recovery
Open the shell
Code:
adb shell
Now, while in the shell, the data filesystem must be mounted.
Code:
mount /data
Still staying in the shell, use the following command to set Dalvik as the runtime of choice.
Code:
setprop persist.sys.dalvik.vm.lib libdvm.so
Now the /data-filesystem can be unmounted using
Code:
umount /data
Type exit in the shell to exit ADB shell.
Reboot the phone and it should get past the loading circle again
If anything goes wrong, I'm not responsible
Very good idea. Thanks
I am not sure, but maybe it is possible to set property from recovery update script?
Such script, downloaded onto phone and accessible from recovery would be better, than PC with USB drivers and a cable
piskor said:
Very good idea. Thanks
I am not sure, but maybe it is possible to set property from recovery update script?
Such script, downloaded onto phone and accessible from recovery would be better, than PC with USB drivers and a cable
Click to expand...
Click to collapse
Thank you for the idea, implemented it now and added to the OP.
dextrey said:
Thank you for the idea, implemented it now and added to the OP.
Click to expand...
Click to collapse
Excellent, thanks
Updated to mount the /data filesystem directly using the fstab entry. Also changed the recovery-flashable .ZIP to use a temporary BusyBox for all commands, because I'm not completely sure about the filesystem differences between different ROMs and recoveries (the locations of binaries such as mount and umount)
Thanks!!!
Very useful!!
Thanks, this worked. I was on CM11 nightlies and read an article about ART and switched it from Dalvik, phone app crashed and wouldnt let me boot in. Although I'm using HTC One, this method worked for me.
For TWRP users, boot into recovery and go into Advanced, and then use terminal to command the type the main line to switch to Dalvik, no need to adb shell and mount data.
Fixed my HTC ONE m7 that got brinked when selecting ART.
dextrey said:
Today I tried to enable ART on my S3 Mini running Maclaw's CM11. After the phone was shut down, the CM loading circle stayed there forever and the phone didn't boot.
To fix this you can boot the phone into recovery (I'm using CWM) and use ADB to revert the runtime back to Dalvik.
There are 3 ways to do this:
Use the following manual instructions
Download the second attachment and run the batch file, while the phone is connected using a USB cable and in recovery mode. For this you need USB drivers installed.
Download the first attachment and flash it in recovery
Manual instructions
Boot to recovery
Open the shell
Code:
adb shell
Now, while in the shell, the data filesystem must be mounted.
Code:
mount /data
Still staying in the shell, use the following command to set Dalvik as the runtime of choice.
Code:
setprop persist.sys.dalvik.vm.lib libdvm.so
Now the /data-filesystem can be unmounted using
Code:
umount /data
Type exit in the shell to exit ADB shell.
Reboot the phone and it should get past the loading circle again
If anything goes wrong, I'm not responsible
Click to expand...
Click to collapse
Thank you, thank you, I'm in great debt for this.
Can recommend the method if you are running viperOne 6** on a HTC one m7 (bulletproof kernel).
NB:
My ADB was totally broken, but I wrote all commands in the TWRP terminal window, and it reverted my phone back to dalvic from ART!

(help) kali linux on galaxy s5 sm-g900f

hello guys sorry for my english, but at the time is possibile to have kali linux on android 4.4.2 of galaxy s5??? i try a lot of guide but nothing, thanks
Yes there is a way. I am running Kali Linux on my Galaxy s5 now!!
Download linux deploy and install Kali linux from there.
GL!
la2o said:
Yes there is a way. I am running Kali Linux on my Galaxy s5 now!!
Download linux deploy and install Kali linux from there.
GL!
Click to expand...
Click to collapse
i've already tried but nothing , maybe can you send me a pvt message with a little guide for the installation?? p.s. i have a sdcard of 8 gb
I tried Linux on Android but it gives invalid argument mounting the loop device. Linux Deploy has an option to not use a loop device and install to a folder I think. Not positive. Try Advanced Linux Installer. That might work. It costs but it's way better than the free version. Try Standard Linux Installer first if you like.
Could you please add some note on how you managed to install?
I am trying with several options, but always get stuck on a "dd: permission denied" creating the volume
Z
I'll try to provide that info. What you're seeing likely means where it's trying to write isn't allowed. Try changing the install location to somewhere safe like /data/kali or something. Also I just found out the S5 won't do ext2 so if you're trying to do a loop device use ext4 if possible. Sorry I don't have more info at the moment.
I am having the same issue. What SU app are you using? I am using SuperSU, I read that SuperSU might be the problem but I do not know the conditions on how to switch SU apps. Hopefully we can find a solution.
Just got running.
use a terminal emulator as root
cd /data/data/ru.meefik.linuxdeploy/linux/bin
rm sh chroot
ln -s /system/bin/mksh sh
ln -s /system/xbin/busybox chroot
make sure your file location is on your sd card
change image size to appropriate size.
also change to ext4 file system
DipSprayArc said:
Just got running.
use a terminal emulator as root
cd /data/data/ru.meefik.linuxdeploy/linux/bin
rm sh chroot
ln -s /system/bin/mksh sh
ln -s /system/xbin/busybox chroot
make sure your file location is on your sd card
change image size to appropriate size.
also change to ext4 file system
Click to expand...
Click to collapse
Can you explain this deeper? I typed that in an emulater but no luck
DipSprayArc said:
Just got running.
use a terminal emulator as root
cd /data/data/ru.meefik.linuxdeploy/linux/bin
rm sh chroot
ln -s /system/bin/mksh sh
ln -s /system/xbin/busybox chroot
make sure your file location is on your sd card
change image size to appropriate size.
also change to ext4 file system
Click to expand...
Click to collapse
Also here are screen shots of my errors, settings, and anything else I figured might be useful to you. Thanks for help in advance.
I think it's long overdue for a Galaxy S4/5 guide. I know tinkering must be done and there are several issues to negotiate. I've found scattered info here and there but nothing definitive. Complete Linux Installer or Linux Deploy. Either/or. The only way I've ever got Linux to work is by installing to a directory and doing a chroot into it and doing a debootstrap.
Please&ty.
Is the stock WiFi radio compatible with packet injection or monitor mode on the S5 that you know of? I never put much effort into the install after I had such as hard time initially, attempting to install it to my extSdCard.
Solution
Hi there, I tried to install the kali distro in a s5 (g900f) with de Linux Deploy v 1.5.5 and I couldnt, i downloaded the 1.4 and neither but with de v 1.3 I could make it!
So if you are having any troubles with the installation, just download a previous version from the project's github (here)
Hope it helps!
su error
[email protected]:~$ su
Password:
su: Authentication failure
[email protected]:~$ sudo -i
sudo: PERM_ROOT: setresuid(0, -1, -1): Permission denied
[email protected]:~$
And now ?
plz help bro

[ROOT]Gaining write access on system partition

The latest update to .368 restricts access to /system, in particular 'mount -o remount,rw /system' won't give write access.
With the SuperSU 'supolicy' tool and a current busybox there is an easy way around the protection:
Code:
/system/xbin/supolicy --live \
"allow init_shell unlabeled file {execute execute_no_trans}"\
"allow {init_shell kernel} {device unlabeled mmc_block_device} blk_file {getattr read write open ioctl}"\
"allow init_shell kernel process setsched"\
"allow init_shell {rootfs labeledfs} filesystem {mount umount remount}"
mknod /dev/loop2 b 7 2
losetup /dev/loop2 /dev/block/mmcblk0 -o 96468992
mount -t ext4 /dev/loop2 /system
The number in the losetup command is the position of the system partition in bytes in the internal memory. (This number in blocks (bytes = blocks * 512) is displayed in the expert mode of fdisk)
This works because we do not use the device corresponding to the system partition but construct an equivalent device.
Chainfires adbd Insecure app. Try the app first but if you still can't mount and push files read this thread - [HOW TO]Make your favorite kernel adbd insecure to run ADB as root on /system
Click to expand...
Click to collapse
I can now just adb remount and have access to the system.
I could not write to /system because I somehow lost the XZDualRecovery during the last update. When installed that does the magic at startup and enables a "remount,rw" of /system. In particular it has nothing to do with .368 as I initially suspected.
The flashable zip of the XZDualRecovery contains the necessary scripts and modules.
The method proposed in my initial post has the advantage, that it builds on (heavily used) features of the (Linux) kernel and is independent of the kernel version. Kernel modules on the other hand often only work with the kernel they were compiled for.
Far from an expert, so please let me know what I'm missing. Ran all commands successfully, rebooted, but still seems like no system rw access. Does this actually create that access, or does this only enable the ability to get access, and now there's another step? Thanks
Those commands grant immediate write access, but this is not persistent.
If you need a persistent solution, you should install the XZDualrecovery (which you should do anyway!).
Then a "mount -o remount,rw /system" gives you write access.
njhuiz said:
Those commands grant immediate write access, but this is not persistent.
If you need a persistent solution, you should install the XZDualrecovery (which you should do anyway!).
Then a "mount -o remount,rw /system" gives you write access.
Click to expand...
Click to collapse
Thanks, I'll give it a try, (switched ROMs at the moment, but not for long).
I have an unlocked Bootloader, root (working!) and XZDualRecovery. I' running prerooted 5.1 Android Stock ROM. I can't write to system... I tried many commands via ADB.
Is there any workaround?
FrikandelChris said:
I have an unlocked Bootloader, root (working!) and XZDualRecovery. I' running prerooted 5.1 Android Stock ROM. I can't write to system... I tried many commands via ADB.
Is there any workaround?
Click to expand...
Click to collapse
This works for me - [2014.11.10][ROOT] adbd Insecure v2.00, install it, tick Enable insecure adb, then run...
Code:
[B]adb remount[/B]
...and that should allow you.
mount -o remount,rw /system
Works for me on 5.1 with XZDualRecovery installed (locked BL, Xposed installed, Linux adb host).
I just spent a long time trying to get write access on my Z1C, too. I'm on MX ROM and wanted to debloat some of the software.
Turns out I just had to set the SE Linux from Enforced to Permissive, then using the mount -o remount,rw /system went fine.
Code:
su -c setenforce 0
mount -o remount,rw /system
exit
EDIT:
The "su -c setenforce 0" should make the change to Permissive permanent. Will check.
EDIT 2:
I had to get the app SELinuxModeChanger (http://forum.xda-developers.com/showthread.php?t=2524485) in conjunction with the adbd Insecure app to finally get it to work reliably, now...
I tried all the solution in this post but I failed every time... Someone to explain me how I have to do?
Envoyé de mon D5503 en utilisant Tapatalk
xander59 said:
I tried all the solution in this post but I failed every time... Someone to explain me how I have to do?
Envoyé de mon D5503 en utilisant Tapatalk
Click to expand...
Click to collapse
Did you try all of them, (terminal commands in op, adb insecure app, mount -o remount command, selinux permission change..)? If so, and you still can't rw, I'd say it might be a problem with your ROM. I have used RockZ1 and MX ROM recently, and initially had issues, but at least one of these things worked for me.
In fact, I read again the topic and I have the version 21 of dual recovery, so I have the r/w permission... But i can't still see an app when I'm moving its to /system/app and set right permission
Envoyé de mon D5503 en utilisant Tapatalk
With a root browser or a terminal app you should be able so see all files... which app did you use?
xander59 said:
In fact, I read again the topic and I have the version 21 of dual recovery, so I have the r/w permission... But i can't still see an app when I'm moving its to /system/app and set right permission
Envoyé de mon D5503 en utilisant Tapatalk
Click to expand...
Click to collapse
Not sure about that... I've definitely had apps that won't install or won't open before. I'm not sure what makes something compatible or not. Maybe email developer.
It was an issue to kill the app before moving it to system app
Envoyé de mon D5503 en utilisant Tapatalk
SGP621-RICDefeat
The SGP621-RICDefeat.zip will work on latest .216 stock. It's not a flashable zip but it contains a install.bat file, wich will remove the write to system protection. Then you can download an app from play store to mount system as RW and RO.
Don't remember where i found it though, but it was somewhere in the Z1 compact forum.
XperienceD said:
This works for me - [2014.11.10][ROOT] adbd Insecure v2.00, install it, tick Enable insecure adb, then run...
Code:
[B]adb remount[/B]
...and that should allow you.
Click to expand...
Click to collapse
well when i try to tick the enable insecure adb it says could not patch,,
i am currently on 14.6.A.1.236
ok well kingroot saves the day.,
Look at this. Worked for me. Very easy. http://forum.xda-developers.com/z3-...-sgp621-lollipop-23-1-0-690-noba-ftf-t3058400

Categories

Resources