[How To] Rooting any HD2 android build. - HD2 Android Q&A, Help & Troubleshooting and Genera

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

Related

CLI Play

One thing that I really love about Android, is the Gnu/Linux system running in the background. I use Linux on all my regular machines where I do most work via my beloved terminal.
Playing in CLI on Android Phones is just as much fun only Android is missing a lot of the toys I'm used to. So I'm making a collection of some of these tools, some found on the Web and some Home made.
Here if the first collection of the things I've collected so far.
Most of it can be found in different places on the Web, but I find it a lot easier to just get it in one place.
http://dl.dropbox.com/u/14234754/XDA_GLOBAL/android_cli_extras.tar.gz
This small Archive contains the fallowing:
Bash 4.1 - This shell is made to become the default shell on your phone regardless if you connect via SSH or local terminal. Also added an bashrc file.
SSH Shell Client
Remount script - Makes it easier to optain RW on /system (HTC Users will need S-Off)
Nano Editor with terminfo not defined, fix
Init Script to set a user defined hostname and update the hosts file
Now, I don't remember where everything comes from. I believe that the Nano Editor is from the MoDaCo Forum (The terminfo fix is placed in the /system/bin/sh script). The Remount Script is from somewhere on this forum. Bash, I don't remember. SSH Client is from the Better Terminal APK (Perhaps an SFTP client would be nice to). The rest is just some small home made shell scripts.
The Hostname can be changed in /system/etc/init.d/05userinit (Make sure that your current ROM does not already has init scripts to alter hostname. Some custom ROMs do)
The bashrc file is placed in /system/etc/bashrc
This location can be changed in /system/bin/sh
The remount script makes it faster and easier to option RW on /system.
Just type "remount rw" in the shell to switch to Read/Write and then "remount ro" to switch back to Read-only. HTC Users needs S-Off in order to write to /system.
In order to copy the files to the /system partition, you need to option Read/Write without the remount script. In the Shell type "mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system". (HTC Users without S-Off will need to do this using ADB in recovery)
If you use the Better Terminal APK for Android, you need to go to settings and make sure that it uses Android Terminal. Otherwise it will use it's own bash which only works when in Better Terminal and also it's full of errors. Also in the option "Command Line" it should be "/system/bin/sh". Make sure that there is NO - at the end, example "/system/bin/sh - ". You might need to remove it twice before it is gone.
(Just in case anyone should wonder. Yes your phone needs to be rooted)
Also if anyone has more fun CLI stuff for android then please bring it

Linux chroot mount scripts

The actual creation of an arm linux chroot image is probably out here on teh internetz somewhere, but I can assist with my mounting shell script (which works).
My image is of a debian arm chroot, and the image filesystem is ext2 (a good idea for fewer writes. ie innately non-journaling), has been used extensively on fw DE .17 and I'm currently trying it out on WW .29 (thank you, miloj).
I would upload my debian img somewhere, but I've actually broken it somewhat (it works for my needs, but it's nonetheless a bit too hacked up to be reliable).
I've modified it somewhat for generalization, some of it is probably wrong and/or redundant, and it IS hackish and ugly, but it works for me (tm).
* the chroot image only need a root account (and probably bash installed, but it usually is)
* You need busybox installed.
* You need to upload your chroot image named linux.img to the internal sdcard in a folder named linux
A shell script to set things up is attached.
What you need to do:
push the install script and run it:
Code:
adb push installlinuxstuff.sh /data/local/
adb shell sh /data/local/installlinuxstuff.sh
Now you can (from adb shell or terminal emulator on device):
Code:
su -
/data/local/mnt/linux.sh
/data/local/mnt/notlinux.sh
Feel free to remove the install script at
/data/local/installlinuxstuff.sh
when you've got it up and running.
Alternative way to run the scripts from adb shell:
Code:
adb shell su -c /data/local/mnt/linux.sh
adb shell su -c /data/local/mnt/notlinux.sh
I usually symlink start and stop (in my case deb and undeb) shell scripts placed in /data/local/mnt in /system/bin (ie shell scripts with 'su -c /data/local/mnt/whatever.sh' in them) for easy start an stop from terminal emulator, and if you've gotten this far you may welcome the small advice. (in other words - don't do this unless you _really_ know what you're doing)
Debian ARMHF or ARMEL?
If you would uploaded it (good place is google drive , sharing as public, as there are no ads or bull**** and the download is extremely fast) I would love to try your image - after modifying your script so it can work on a UHS-1 class MicroSD I want to try running this off of (should give it a little more speed).
zamaditix said:
Debian ARMHF or ARMEL?
If you would uploaded it (good place is google drive , sharing as public, as there are no ads or bull**** and the download is extremely fast) I would love to try your image - after modifying your script so it can work on a UHS-1 class MicroSD I want to try running this off of (should give it a little more speed).
Click to expand...
Click to collapse
Armel (I use the same chroot installation on my phone in a smaller image file (with less stuff installed)). I've got loads of personal stuff all over it and besides - it's somewhat broken. I really don't want to try to fix it.
So I'm working on retracing my steps, creating a clean armhf ext2 image (debian wheezy base installation for now) and redo the mount script, but I can't make any promises on a release date.
Anyhu - there are loads of images (armel, at least) on teh internetz (BT5 and too many ubuntu, for instance).
Just check so our kernel can mount the filesystem.
Edit: if not you can just create a new image file with a filsystem that's mountable and copy the chroot files to it.
So the ideal image for this tablet is armhf? If I wanted to create a Gentoo image, I would go with armv7? I'm just not sure exactly which ARM architecture this tablet is.
EndlessDissent said:
So the ideal image for this tablet is armhf? If I wanted to create a Gentoo image, I would go with armv7? I'm just not sure exactly which ARM architecture this tablet is.
Click to expand...
Click to collapse
The CPU is the Tegra 3 if you want to google it and it is an ARMv7 w/ NEON extensions chip. ARMv7 specification requires hardware fp so naturally it is ARMhf.
Nice to hear, keep us updated on your progress. I'm currently running an armel copy of Ubuntu 12.04 but it has problems with some packages and others are armhf only.
When I run linux.sh, I get an error that /sdcard can't be mounted because it doesn't exist.
Code:
mount: mounting /sdcard on /data/local/mnt/linux/sdcard failed: No such file or directory
I also tried changing the script to mount /mnt/sdcard, but that didn't work either.
EndlessDissent said:
When I run linux.sh, I get an error that /sdcard can't be mounted because it doesn't exist.
Code:
mount: mounting /sdcard on /data/local/mnt/linux/sdcard failed: No such file or directory
I also tried changing the script to mount /mnt/sdcard, but that didn't work either.
Click to expand...
Click to collapse
Yes, it is somewhat hackish, like I wrote. My image has got an sdcard folder (/sdcard) inside of it where I mount /sdcard from android. (Ie chroot and mkdir /sdcard)
followed this:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-rooted-transformer-prime/
make sure you have busybox installed der. Or at least the cp command in /system/bin
works well on my TF300T, Yea its not native but im currently configuring it for kernel building ;-D
FlyingPoo said:
followed this:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-rooted-transformer-prime/
make sure you have busybox installed der. Or at least the cp command in /system/bin
works well on my TF300T, Yea its not native but im currently configuring it for kernel building ;-D
Click to expand...
Click to collapse
Why does the mount script remount a non-existing block device with an ancient (according to android) filesystem?
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Edit: I read all the scripts, and they all mount that crap. It's not made for transformers, and on the android device it's made for it leaves /system mounted rw after you've run it, and WHEN run (installed) it modifies too much in /system/bin
Code:
# At first it copies loads of crap to /system/bin, and then:
cd /system/bin/
chmod 4777 *
It's not even "hackish" - it's just... wrong...
Will loop1 work every mount?
Code:
mknod /dev/loop1 b 7 0
losetup /dev/block/loop1
I'm almost only asking, since this thread was supposed to be about scripts?
gasingvar said:
Yes, it is somewhat hackish, like I wrote. My image has got an sdcard folder (/sdcard) inside of it where I mount /sdcard from android. (Ie chroot and mkdir /sdcard)
Click to expand...
Click to collapse
Thanks. I created /sdcard, and it works almost perfectly now. However, mounting devpts at /dev/pts doesn't seem to work. I replaced that line with
Code:
mount --bind /dev $mnt/dev
and it seems to work fine. Is there anything wrong with my method?
/dev/void said:
Why does the mount script remount a non-existing block device with an ancient (according to android) filesystem?
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Edit: I read all the scripts, and they all mount that crap. It's not made for transformers, and on the android device it's made for it leaves /system mounted rw after you've run it, and WHEN run (installed) it modifies too much in /system/bin
Code:
# At first it copies loads of crap to /system/bin, and then:
cd /system/bin/
chmod 4777 *
It's not even "hackish" - it's just... wrong...
Will loop1 work every mount?
Code:
mknod /dev/loop1 b 7 0
losetup /dev/block/loop1
I'm almost only asking, since this thread was supposed to be about scripts?
Click to expand...
Click to collapse
I'm assuming you're talking about the link in the post you quoted, even though you seem to be referencing the OP's use of the word "hackish". The script in the OP doesn't do any of that stuff. It just creates a few directories in /data/local/mnt/ and writes the mount/unmount scripts, which themselves only un/mount appropriate directories for the tablet. As for your question, I'm not nearly experienced enough to answer it. Sorry.
EndlessDissent said:
Thanks. I created /sdcard, and it works almost perfectly now. However, mounting devpts at /dev/pts doesn't seem to work. I replaced that line with
Code:
mount --bind /dev $mnt/dev
and it seems to work fine. Is there anything wrong with my method?
Click to expand...
Click to collapse
AFAIK your mount seems to be more complete, ie more android hardware goodies accessable from the chroot environment. However - that means more things possibly going wrong (like writing to a device who's critical to the android environment).
Personally I'd try to find what "hardware goodies" and whatnot I'd need to get the chroot environment working optimally, and not mount ALL of /dev.
EndlessDissent said:
I'm assuming you're talking about the link in the post you quoted, even though you seem to be referencing the OP's use of the word "hackish". The script in the OP doesn't do any of that stuff. It just creates a few directories in /data/local/mnt/ and writes the mount/unmount scripts, which themselves only un/mount appropriate directories for the tablet. As for your question, I'm not nearly experienced enough to answer it. Sorry.
Click to expand...
Click to collapse
Yes, and the OP is very honest about his script(s) being "hackish", which I interpret to mean 'not optimal, possibly redundant but working', all of which it is (and I applaud the early release, since for instance I could get things rolling), but the ubuntu image installation and mounting scripts from the other poster ( whom I was addressing ) are plain faulty.
I am looking for a armhf build of ubuntu or debian that I can chroot (newer the better), if anyone knows of such a build that would be fantastic but if not does anyone know of an easy to follow guide to compile such a thing?
I found two pretty good guides. I mostly followed THIS ONE, but I found that it doesn't mount enough before "first boot", so what I did was follow the guide until the point where you move the image to the tablet. Then I ran the OP's installlinux.sh script, and then the mount script. However, the mount/unmount scripts need to be edited before using them. Comment out the sdcard line and probably the devpts line (mounting devpts didn't work; Bash complained that devpts didn't exist; I had to replace it with the line I mentioned a few posts above, but as /dev/void says, it could be problematic, so be careful). Mount the image, make the /sdcard directory, exit, unmount, and edit the scripts again to mount/unmount /sdcard.
Next time you enter the chroot, feel free to run the
Code:
sh /debootstrap/debootstrap --second-stage
command to build the image, and follow the linked guide until the next time it tells you to exit the session (NOTE: The second echo "whatever" > sources.list command is wrong; it should be echo "whatever" >> sources.list; Also, remember to replace "squeeze" with the appropriate Debian version, in my case, "testing"). Instead of exiting right after the apt-get update, I'd recommend playing around with the chroot and configuring whatever apps you install. You can just use the OP's scripts now and ignore the script in the linked guide.
When the guide I linked above gets to this line:
Code:
sudo debootstrap --verbose --arch armel --foreign squeeze /mnt/squeeze/ http://ftp.debian.org/debian
just replace armel with armhf, and if you want a testing image, replace squeeze with testing.
Sorry I'm not attaching my image. I made it gigantic (5GB), so I don't really have anywhere to store it, and you probably wouldn't want to download a file that big. Plus, it already has Openbox and a bunch of other things you probably don't want installed. I'm assuming you'd want GNOME or KDE instead.

[Q] How do I install parted command?

I'm trying to wipe and format a microSD card that I have plugged in via OTG and already have it wiped with this;
Code:
dd if=/dev/zero of=/dev/block/sda
Now I'm looking into how to recreate a MBR and partition table and it says to use the parted command, which I'm glad about as I'm familiar with the command from using Ubuntu but it's not installed and I can not find any instructions on how to get it. Can anyone explain how to install it? I know I could just plug the SD card into a computer and do it but I'm having fun doing all this on a tablet. Lol
Bump
Anyone?
I have got the same question, any other solutions?
This is the most complete information I have found yet, but it doesn't work. Either from me messing something up or it not being correct for the Nexus 7 being that it was made two years ago. http://www.droidforums.net/forum/htc-droid-eris/78650-internal-storage-partitions-screwed-up.html
I pushed all six files to /sbin/ with no errors and changed their permissions with no issues but I restart the tablet and none of the six files are in /sbin/
Just for the heck of it I extracted the six files to the SD card in the tablet, CD'd to it and used chmod 0755 on all six files then tried to run it and this is what I get.
Code:
[email protected]:/storage/emulated/legacy/folder # parted
sh: parted: not found
127|[email protected]:/storage/emulated/legacy/folder # ls
e2fsck
mke2fs
parted
resize2fs
sdparted
tune2fs
... how can you NOT find that?
herqulees said:
... how can you NOT find that?
Click to expand...
Click to collapse
Depending on how your PATH env var is set, the current directory might or might not be being searched for program load(s). So indicating the current directory explicitly with a leading "./" such as
$ ./parted
will certainly work (if a read & execute bit set on file, and the filesystem is not mounted -noexec ) .
But...
...if those files are dynamically linked rather than statically linked, and the appropriate link-libraries they reference come up missing during run-time linking it is possible to still see a "not found" message. Sort of a red-herring error message, but there you go.
I just looked in TWRP's /sbin (ramdisk) just now. Don't see parted in there.
[Edit] I do see the string "fdisk" inside the busybox executable though! - maybe boot into recovery and see what
busybox fdisk /dev/block/sda
gets you? (I suppose result depends on whether or not TWRP kernel plumbs the device into place.)
Perhaps the quickest solution is to simply use a PC and media reader to do the partitioning from a PC instead of the N7. You might even want to boot a "Live CD" version of Linux to get at the tools you need. (BTW, I think that Ubuntu's Live CD mounts a fuse FS over the top of the RO DVD/CD, so you can even download and install packages as needed).
I managed to get everything to work by doing this:
1. Using this app https://play.google.com/store/apps/details?id=com.beansoft.mount_system&hl=en I remounted /system as RW
2. Using the CyanogenMod File Manager I copied the parted file to /system/bin (from the root of the SD card)
3. Then using the File Manager still, go to the Properties of the parted file and go to Permissions and under R, W, and X put a check mark in the three boxes bellow each. (I don't know which ones it needs permissions for so I just give it permissions to everything, kinda frowned upon to do but I trust this program so...)
By doing this you can completely stay out of command line, but at the same time you're installing a command line program so you shouldn't be afraid of the command line in the first place. Lol.
Note: After this you can go to a terminal window and type su to get root access then type
Code:
parted /dev/block/sda
you will of opened your external memory card, now use parted as you would normally.

Getting rid of FAT, UMS, vold

FAT (the old DOS-based file system) is a bad idea.
It's ugly, doesn't mix well with Linux and saves timestamps in local time.
Moreover, the Nook has problems with FAT, randomly changing timestamps a number of hours.
Certainly at daylight savings time transitions everything changes.
If you use timestamps as an indication for syncing files from a host, this is a problem.
UMS (USB Mass Storage) is a bad idea.
It takes a happily mounted volume from an OS, and hands it in a raw block view to a remote system.
Outside of using noogie for full physical backups or initial partitioning and formatting there is no need for UMS.
The last need of UMS was the Adobe Digital Editions which was discussed and obviated in this thread
Finally, there are some devices and occasions where you'd want to hot swap SD cards.
A camera taking megapixels shots might have a need for swapping SD cards.
Our Nooks use SD cards more as permanent expansion units.
Get a 32 GB card, stick it in and never take it out.
Then we wouldn't need vold (the volume daemon).
In another thread I posted a modified vold so that the SD card could be ext3 formatted.
To my mind, the cleanest solution to all this is to:
Format the SD card with ext3
Mount the SD card in init.rc inside the uRamdisk
Disable UMS
Disable vold
Right now I'm running into problems mounting the SD card inside init.rc
Code:
mount ext3 /dev/block/mmcblk1p1 /sdcard wait nosuid nodev noatime nodiratime
chown system sdcard_rw /sdcard
chmod 0777 /sdcard
init has not very useful error reporting, it returns an error of -1 for any condition.
I was trying to build init that could tell me something more.
This is a work in progress.
(If we get rid of vold, we'll have to strip the Android MountWatcher so that it doesn't flail.)
I found out what the problem with doing a normal mount in init.rc was.
The system had not found /dev/block/mmcblk1p1 yet.
I'm still working on this.
For now I have a oneshot service that mounts /sdcard.
It uses a little executable that waits until /dev/block/mmcblk1p1 appears.
I disabled vold.
I would have liked to be able to mount the SD card inside init.rc,
but apparently /dev/block/mmcblk1p1 has not appeared by then.
You need to have a service do the job, a few seconds later.
Yes, you could probably write a little script, but I'd rather write a little Linux program.
I'm still wondering if there is an easier solution to mount inside init.rc
People use their Nooks in such different way.
I would really like to know what exactly people are interested in this thread.
There is a poll at the top to fill in, please.
Pieces of the pie ready to go now:
mke2fs
tune2fs -j
Mods to init.rc - disable vold, enable mntsdcard
mntsdcard - a Linux program
Patches to MountService to disable it.
Is anybody interested in trying this?
Well, if you want to give it a go, here's how.
Black = commands to the Nook shell over ADB
Blue = commands to the Windows shell
Convert your SD card to ext 3
Backup the data on your SD card (or just let it all get deleted).
You can use adbsync.exe if you like:
Code:
[color=blue]mkdir sdcard[/color]
[color=blue]adbsync /hscu /s C:\sdcard sdcard[/color]
Then you can re-partition the SD card.
Code:
umount /sdcard
busybox fdisk -H 255 -S 63 /dev/block/mmcblk1
Do the commands to delete (D) old partitions, create a new (N) primary partition.
Then write (W).
Then format the SD card in ext2, upgrade to ext3 and check the mount.
Code:
mke2fs /dev/block/mmcblk1p1
tune2fs -j /dev/block/mmcblk1p1
mount -t ext3 /dev/block/mmcblk1p1 /sdcard
Install mntsdcard
Copy over mntsdcard:
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
[color=blue]adb push mntsdcard /system/bin[/color]
chmod 755 /system/bin/mntsdcard
Get uRamdisk and extract init.rc:
Code:
mount -o rw,remount rootfs /
mkdir /boot
mount -t vfat /dev/block/mmcblk0p1 /boot
[color=blue]adb pull /boot/uRamdisk[/color]
[color=blue]bootutil /x /v uRamdisk init.rc[/color]
Add in a mount for media (we'll leave it FAT for now):
Code:
mount ext2 /dev/block/mmcblk0p5 /system
mount ext2 /dev/block/mmcblk0p5 /system ro remount
[b] mount vfat /dev/block/mmcblk0p6 /media sync noatime nodiratime uid=1000,gid=1000[/b]
Comment the old vold stuff out:
Code:
#service vold /system/bin/vold
# socket vold stream 0660 root mount
Add in the mntsdcard stuff at the end of init.rc:
Code:
service mntsdcard /system/bin/mntsdcard
oneshot
Replace init.rc and push the uRamdisk back:
Code:
[color=blue]bootutil /r /v uRamdisk init.rc
adb push uRamdisk /boot[/color]
reboot
If there are any problems, look in /data/mntsdcard.log
Restore your SD card
Code:
[color=blue]adbsync /ascu /s C:\sdcard sdcard[/color]
Wow, this seems like a lot of stuff to do! :cyclops:
Thanks so much for all this great dev work, Renate!
:good:
BUT!
Will this definitely make noogie not function correctly? (I make new backups with it, like, once every week and a half, so that would definitely stop me from trying this)?
What will this do to the regular USB mounting onto a PC?
What will this do to mounting USB devices on the Nook using host mode?
And, finally: Will this mean I can't ever remove my SD card to use for something else temporarily (or to write a Nook-bootable image to it for miscellaneous reasons)?
Thanks,
3N
It's ugly, doesn't mix well with Linux and saves timestamps in local time.
Click to expand...
Click to collapse
That isn't correct. Linux has had support for FAT file systems very early on
and Linux support is quite stable. Saving timestamps in local time should not be a problem.
These mods look like it would make it non-trivial to side load content (unless you are using Linux for a main PC) for no reason.
smeezekitty said:
...These mods look like it would make it non-trivial to side load content (unless you are using Linux for a main PC) for no reason.
Click to expand...
Click to collapse
Hmmm. Good point. Thanks for pointing this out, as I use a Windows 7.
Here's your first post thank!
smeezekitty said:
TSaving timestamps in local time should not be a problem.
Click to expand...
Click to collapse
It's a problem twice a year when daylight savings time makes all your file times shift one hour.
Also, try moving timezones on your device.
smeezekitty said:
These mods look like it would make it non-trivial to side load content (unless you are using Linux for a main PC) for no reason.
Click to expand...
Click to collapse
Mmm, not really. I have a Windows desktop and I use ADB push/pull and my adbsync utility.
Moreover, I can easily sync all my Android devices before going out the door.
Renate NST said:
...Mmm, not really. I have a Windows desktop and I use ADB push/pull and my adbsync utility.
Moreover, I can easily sync all my Android devices before going out the door.
Click to expand...
Click to collapse
But if we wanted to transfer files without WiFi, ADB wouldn't be available, and so how would we sideload our files w/out ADB?
I agree ADB file transfer is more fun - heck, you can use an FTP Server app and manage your whole filesystem in the comfort of Windows Explorer! But without WiFi...
thenookieforlife3 said:
But if we wanted to transfer files without WiFi, ADB wouldn't be available, and so how would we sideload our files w/out ADB?
I agree ADB file transfer is more fun - heck, you can use an FTP Server app and manage your whole filesystem in the comfort of Windows Explorer! But without WiFi...
Click to expand...
Click to collapse
It is a little harder to set up, but adb usb has been available in the Nook since it was first rooted. This is just one of the multiple threads here that gives instructions....
Getting USB-enabled ADB working
thenookieforlife3 said:
But if we wanted to transfer files without WiFi, ADB wouldn't be available, and so how would we sideload our files w/out ADB?
I agree ADB file transfer is more fun - heck, you can use an FTP Server app and manage your whole filesystem in the comfort of Windows Explorer! But without WiFi...
Click to expand...
Click to collapse
ADB is something a little advanced for me at this point. But regardless of if you want to use it or not,
It is still very handy to be able to just copy files on and off the device just by moving the SD card or mounting by USB
I suggest that the OP adds a note for less experienced users so they know that you lose those capabilities if you do these mods.
smeezekitty said:
ADB is something a little advanced for me at this point. But regardless of if you want to use it or not,
It is still very handy to be able to just copy files on and off the device just by moving the SD card or mounting by USB
I suggest that the OP adds a note for less experienced users so they know that you lose those capabilities if you do these mods.
Click to expand...
Click to collapse
I entirely agree. Although ADB is fantastic and I absolutely love it, it's good to still have the USB mounting option instead.
The post you replied to was actually pointed toward Renate, so yeah.
---------- Post added at 02:50 PM ---------- Previous post was at 02:48 PM ----------
David0226 said:
It is a little harder to set up, but adb usb has been available in the Nook since it was first rooted. This is just one of the multiple threads here that gives instructions....
Getting USB-enabled ADB working
Click to expand...
Click to collapse
Thanks for the link - this topic has given me grief for the whole month, as I just can't seem to get the danged thing working! :laugh:
thenookieforlife3 said:
Thanks for the link - this topic has given me grief for the whole month, as I just can't seem to get the danged thing working! :laugh:
Click to expand...
Click to collapse
Good luck. My experience is that much depends on the model you have and the rooting method used. I have an original NST on which ADB over USB works without an issue. I also have a NST with Glowlight (rooted with NookManager) that I can't seem to get it working on. (I can't remember how I rooted the NST, it was a couple of years ago.)
David0226 said:
Good luck. My experience is that much depends on the model you have and the rooting method used. I have an original NST on which ADB over USB works without an issue. I also have a NST with Glowlight (rooted with NookManager) that I can't seem to get it working on. (I can't remember how I rooted the NST, it was a couple of years ago.)
Click to expand...
Click to collapse
AH! Good to know! I thought that I was just being a dumbo not being able to get ADB USB working (I have an NSTG rooted w/NookManager), but now that I hear that you're having problems, too, maybe I won't worry so much!
Getting ADB to work should be easy, especially if you have a few devices and can see if the problem is with the device or the host.
On Windows getting ADB over USBcan be a pain. There are a few roadblocks:
Make sure that your device is using USB and not WiFi for ADB. The option is set in init.rc in uRamdisk. Use bootutil.exe to check/edit.
Getting the WinUSB driver loaded. Use the driver package from here: http://forum.xda-developers.com/showthread.php?p=49665945#post49665945
Getting ADB to recognize B&N devices. The newer adb.exe has the VID for B&N built in. The older adb.exe required fiddling with adb_usb.ini
Renate NST said:
Getting ADB to work should be easy, especially if you have a few devices and can see if the problem is with the device or the host.
On Windows getting ADB over USBcan be a pain. There are a few roadblocks:
Make sure that your device is using USB and not WiFi for ADB. The option is set in init.rc in uRamdisk. Use bootutil.exe to check/edit.
Getting the WinUSB driver loaded. Use the driver package from here: http://forum.xda-developers.com/showthread.php?p=49665945#post49665945
Getting ADB to recognize B&N devices. The newer adb.exe has the VID for B&N built in. The older adb.exe required fiddling with adb_usb.ini
Click to expand...
Click to collapse
Yep, already seen these in previous posts. Modifying uRamdisk doesn't seem to work, as I can still use wireless ADB with or without the mentioned changes. Already edited adb_usb.ini to include B&N. And, I think, already got the WinUSB driver. I'll check that, though.
As stated many times, if you can connect to ADB over WiFi then you can not connect to ADB over USB.
Renate NST said:
As stated many times, if you can connect to ADB over WiFi then you can not connect to ADB over USB.
Click to expand...
Click to collapse
Yes, I know that, too. The problem, as stated, is that I always can connect over WiFi, and never USB!
No matter what mods I apply to any system file, it's the same result!
thenookieforlife3 said:
No matter what mods I apply to any system file, it's the same result!
Click to expand...
Click to collapse
Are you modifying init.rc inside uRamdisk? (Not the one that appears in the root after you have booted.)
What about default.prop in uRamdisk?
Do you see a 5555 anywhere?
Are you using some amazing-super-duper-ADB-instant-turn-on-offer-application?
Well, don't.
Renate NST said:
Are you modifying init.rc inside uRamdisk? (Not the one that appears in the root after you have booted.)
What about default.prop in uRamdisk?
Do you see a 5555 anywhere?
Are you using some amazing-super-duper-ADB-instant-turn-on-offer-application?
Well, don't.
Click to expand...
Click to collapse
Answer 1: Yes, I most definitely am. In fact, I am using your bootutil.exe program to do it.
Answer 2: Yes, I also edited that to match what you wrote in the Minimal rooting - back to basics thread.
Answer 3: Yes, in the line of code
Code:
setprop service.adb.tcp.port 5555
It doesn't matter if I comment it out, it still connects wirelessly.
Answer 4: Yes, I am. But if I don't use one, then how will I turn ADB on or off?

(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

Categories

Resources