HOWTO: Linux on Nook HD+ using native framebuffer (No VNC) - Nook HD, HD+ General

methods for booting a full linux distro on phones and tablets have existed nearly as long as Android itsself, and they almost always involve running a VNC server on a chrooted linux install and a VNC client on the host system. And the results were always virtually unusable because of how slowly it would run.
depending on what hardware your android device has, linux drivers have been included in the kernel recently enabling access to the graphics framebuffer on many common android systems.
Using the info found here as a starting point, I've adapted this to work on the Nook HD+ (and I'd imagine it would work relatively the same on the HD).
1) install Cyanogenmod
The stock firmware just isn't going to hack it. You're going to need a full Android system with a modern kernel in order to chroot into a "guest" Linux system.
2) Partition your sdcard
now, this is arguably not necessary but at a bare minimum, Linux requires a native filesystem, eg; Ext4. Yes, it could be argued that you could create a space for your Linux install on the EMMC, but for my purposes I used an ext4 partition on an external SD card.
There are quite a few ways that you can partition your SD card. The easiest would be to just do it using either CWM or TWRP. But, seeing as how you're going to need to mount the SD card on a computer in order to get a Linux system onto the new ext partition, you might as well just do it using Gparted, Disks (aka Palimpsest) or other Linux partitioning software.
I'm doing it from my macbook using OSXFuse and FUSE-ext2, so... there is more than one way to skin a cat.
3) "install" Linux
Instead of taking the time to grab one of the ARM netboot images of some distro and taking the time to build a system using Qemu (since at this point I don't have a working Linux install on my tablet), I figured it would be much easier to just download a premade system image that's already configured to run on Android... the ones I mentioned earlier when discussing accessing a host system via VNC.
Debian is my distro of choice and the "Linux-on-Android" project hosts preconfigured Debian-ARM builds. WIN! Grab the latest image (v4 at the time of writing) here:
http://sourceforge.net/projects/linuxonandroid/files/Debian/Image/Small/
Unzip the file. inside will be disk image named 'debian.img'. Mount the disk image. On Mac OS X, you can just double click the image and it will be mounted. On Linux you have a little more work to do.
Code:
sudo -s
mkdir -p /mnt/debian
mount -o loop -t ext2 /path/to/debian.img /mnt/debian
once the image is mounted, you need to copy all files from the disk image to your ext4 partition. This will have to be executed AS ROOT (sudo will NOT cut it) and you need to make sure to preserve file attributes, ownership and permissions while copying. The command will be
Code:
su
cp -vpR /mnt/debian/ /path/to/ext4partition
This is going to take a VERY long time. Even though it's less than 2gb of data, it is hundres of thousands of individual files which take a long time to process.
One the cp completes, you will be almost ready to put the card into your Nook HD+ and fire up some Linux
4) Modify xorg.conf
first and foremost you need to modify your /etc/X11/xorg.conf as follows
Code:
Section "ServerLayout"
Identifier "Layout0"
Screen "Screen0"
InputDevice "Touchscreen0" "CorePointer"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "InputDevice"
Identifier "Touchscreen0"
Driver "evdev"
Option "Device" "/dev/input/event2"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "evdev"
Option "Device" "/dev/input/event4"
Option "Protocol" "usb"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "evdev"
Option "Device" "/dev/input/event5"
Option "Protocol" "usb"
EndSection
Section "Device"
Identifier "Card0"
Driver "fbdev"
Option "fbdev" "/dev/graphics/fb0"
VendorName "Unknown"
BoardName "Unknown"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x600_60.00"
EndSubSection
EndSection
Section "ServerFlags"
Option "AutoAddDevices" "false"
EndSection
5) Script to launch Linux
I've never had any luck running these commands from the Nook itsself, it must be done via ADB shell.
Code:
setprop ctl.stop media
setprop ctl.stop zygote
setprop ctl.stop surfaceflinger
setprop ctl.stop drm
stop bootanim
mount -o remount, rw /
mkdir /mnt/linux
mount -t ext4 /dev/block/mmcblk1p2 /mnt/linux
export mnt=/mnt/linux
mount -o bind /dev $mnt/dev
mount -t devpts devpts $mnt/dev/pts
mount -t proc none $mnt/proc
mount -t sysfs sysfs $mnt/sys
export PATH=/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:$PATH
export TERM=xterm
export HOME=/root
export USER=root
chroot $mnt /bin/bash
startx &
the first five commands kill conflicting Android processes, not the least of which being the Android framebuffer. Then the root directory is mounted as read/write, a temporary directory '/mnt/linux' is created (it will need to be recreated every time the tablet reboots), and then assuming your sdcard's ext4 partition is the second partition (mmcblk1p2) is mounted to the new directory, various system components are bound to the host system, a chroot environment is created and chrooted into, and finally, the Xserver is kicked off. In a few seconds, you will see the XFCE desktop begin loading on your Nook HD+.
A few notes/caveats:
although configured what I deem to be correctly, the touchscreen is not working. Strangely enough, if you issue the command
od of /dev/input/event2, you will see debug information kicked to stdout when touching the screen, so the evdev driver sees the touchscreen, but something is not quite right. For now, you can use a female to female USB adapter with the Nook's proprietary plug to connect a usb keyboard and mouse. AFAIK, USB host mode is included and works OOB on the Cyanogenmod kernel.
Since I don't own such an adapter, I've only been able to connect to the system using x11vncserver. by default, I think tightvncserver is installed and configured to use DISPLAY:1 (configured this way for the older VNC only method). After the first time, you should be able to set up some other solution like x2x or synergy in lieu of a USB keyboard and mouse.
I've had no luck getting a connected bluetooth keyboard to work with this setup. perhaps once booted and connected to the debian system installing the Linux bluetooth stack will enable full bluetooth connectivity?

This is very cool thanks for the tutorial. I am going to try this soon.

jpisini said:
This is very cool thanks for the tutorial. I am going to try this soon.
Click to expand...
Click to collapse
I've yet to be able to do anything other than start a vnc server, connect to it from a remote system and move the mouse around. the desktop seems unresponsive and doesn't finish loading most of the time. I'm digging into it to figure out what's going on.
EDIT 8/13/14
I had some success with this! First things first. the only way I can reliably control the tablet is by using a USB keyboard and mouse. I picked up a pair of USB female to female adapters for $7 on amazon. Then you need to install USB Host Switcher to force your tablet into host mode http://nook.rootshell.ru/hd/USBHostSwitcher.apk
Turn USB host mode on, connect a mouse and keyboard and test. (I have a Logitech K400r which has both keyboard and a built in trackpad)
Then, since you are not going to be able to ADB over USB any longer, enable ADB over WiFi. Then on your computer, open a terminal/cmd.exe window and connect to your tablet
adb connect 192.168.0.10:5555 (substituting your tablet's wifi IP)
Then you need to edit your xorg.conf file. The edit is simply to remove the mouse and keyboard entries because they should be probed automatically by the kernel and don't need to be explicitly defined. At least on a modern Debian system. I can't speak for other distros like Arch.
Then, once you have edited your xorg.conf file, you can begin an X session. I've been trying to set up a standard user and GDM, but haven't had much luck yet. I will update the first post when I get more bugs worked out.

very interesting projet.
I suppose that is the same setup for Nook HD?

tebra said:
very interesting projet.
I suppose that is the same setup for Nook HD?
Click to expand...
Click to collapse
yes, since hardware wise, the HD and the HD+ are pretty much identical. The biggest issue I had was getting it connected to a mouse and keyboard. Since configuration of plug n play devices is handled automatically in the kernel for most USB devices, deleting the entries for mouse and keyboard did the trick. When i get some more free time, I'm going to look into getting bluetooth and the touch screen working. I've been able to get feedback from od /dev/input/event4 for the touchscreen but no activity with the mouse. I think the issue in both cases with bluetooth and touch screen is the fact that the debian system I'm running is Lenny, which is two major releases old. Debian 8 "Jessie" is in testing currently and Debian 7 "Wheezy" is the current stable. Using the prebuilt image from the Linux on Android project worked alright as a proof of concept, but I think that we just need something running a more modern kernel and kernel modules for later hardware support. The only real path forward is going to be to build a current Debian ARMHF image. Since I'm having constant problems with the chrooted linux system locking up, the only way to build the image is going to be to use Qemu and start from a netboot image, cherry picking packages to create a minimally functional system. It's probably going to take a while.

Related

sdcard encryption

I'd like to keep my data private (in case anyone finds the phone). has anyone got truecrypt to compile for the G1 ?
There's a lot more to making a program work in a given environment than just compiling it for the target processor...
If what you wanted to do was akin to running TC's system volume encryption, significant hacking and writing of new code would have to occur, not to mention hacking of the Android boot process.
It would probably be easier to just write a new program from scratch.
are there any other options for having an encrypted volume ?
ido said:
are there any other options for having an encrypted volume ?
Click to expand...
Click to collapse
Are you talking about having the whole partition encrypted, or just having an encrypted volume on the SD card with some data in it?
After setting up a debian partition on my card (a la this), the native "cryptsetup" mechanism in conjunction with a loop-mounted image works fine. Here's what I did from the debian bash shell:
Install cryptsetup from the debian repo:
Code:
apt-get install cryptsetup
Create an empty image (this is for 1 GB):
Code:
dd if=/dev/zero of=/sdcard/file.img bs=1 seek=1G count=1
Mount the image on a loop device:
Code:
losetup -f
(returns the next available loop device - probably /dev/loop2)
losetup /dev/loop2 /sdcard/file.img
Create an encrypted abstraction over the block device, using AES and a passphrase ('encvol' is just a name that can be anything):
Code:
cryptsetup -y create encvol /dev/loop2
(enter passphrase to use for this volume when prompted. the '-y' option prompts twice for verification)
Create an ext2 filesystem on the encrypted device:
Code:
mkfs.ext2 /dev/mapper/encvol
Mount the encrypted volume:
Code:
mount /dev/mapper/encvol /sdcard/mnt (or wherever)
I might have had to install losetup separately from the repo as well, I don't remember.
To mount it again later and use, after rebooting or manually unmounting, you need to do the losetup, cryptsetup (don't need the '-y' option anymore), and then mount the /dev/mapper/encvol device.
- Chris
I don't want to encrypt the whole drive, a bit afraid to do so, since I think there are things the G1 does on the sd card that wouldn't handle it well (like mounting/unmounting when sharing the usb drive, etc)
have you tested this ?
As I said, the steps I listed above are what I did, and yes, they work for me. Obviously, you'd want to take precautions before doing anything funky involving data that is valuable to you, as always, but I can say that the general scenario of reading and writing to a loop device, backed by an image file on my FAT32 SD card partition, through a cryptsetup indirection using AES (defaults), worked for me in a Debian shell on the G1 no differently than as if running on Ubuntu, for example.

Minimal rooting - back to basics

There are many tools and "Super-Ultra-Mega-Rooters" and things to root your Nook.
They will install 23 different things on your Nook.
If you like them, use them.
What is "rooting"?
At the most basic level, "rooting" is managing to get a root (all-powerful) shell (command line interpreter).
When your Nook is sitting there with a prompt saying # then you are rooted.
Alright, a prompt #, but on where?
On your desktop computer, which has to be linked somehow to your Nook.
The way we link Android devices to desktop computers is with ADB (Android Debug Bridge).
Every Android device has this capability built in, but sometimes it's disabled.
Sometimes they make it easy to enable, sometimes they make it hard.
On the Nook, it's fairly easy because the Nook will boot up off an external SD card.
How to root any Nook
The configuration for the Nook is stored in a filesystem called uRamdisk inside the boot partition.
If we can get a copy of uRamdisk, modify it, then replace the copy in the boot partition we can root.
Copy uRamdisk to the desktop
There are two easy ways to get a copy of uRamdisk:
Put noogie on an SD card, boot up, connect the USB and a disk will appear on your desktop.
This will be the boot partition, copy uRamdisk.
Get the update zip from B&N and unzip it.
They call the file ramdisk.img, but it's uRamdisk.
Modify uRamdisk
You need to extract two files out of uRamdisk then replace them.
There is a utility for Win32 called bootutil.exe in the signature below.
Code:
bootutil /x /v uRamdisk init.rc default.prop
This should say that it extracted two files.
Using an editor you need to edit the two files.
Don't use Windows Notepad (it's miserable and doesn't understand Unix end-of-lines).
Try Notepad++ if you don't have a good text editor.
Comment out a few lines in init.rc (additions in red):
Code:
service adbd /sbin/adbd
[color=red]#[/color] disabled
...
# adbd on at boot in emulator
on property:ro.kernel.qemu=1
[color=red]#[/color] start adbd
on property:persist.service.adb.enable=1
[color=red]#[/color] start adbd
on property:persist.service.adb.enable=0
[color=red]#[/color] stop adbd
You can use ADB over WiFi or USB.
Over WiFi can be easier because you don't need to configure desktop drivers.
As so far modified the ADB would use USB.
If you want it to work over WiFi instead, delete the comment # mark:
Code:
[color=red]#[/color] setprop service.adb.tcp.port 5555
Now a minor modification to default.prop.
Change it so that it reads only (no other lines):
Code:
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
To put these two files back into the desktop's copy of uRamdisk:
Code:
bootutil /v /r uRamdisk init.rc default.prop
This should say that it replaced two files.
Copy uRamdisk to the Nook
Use noogie as in step one and just copy the uRamdisk over the old copy.
Reboot. Make sure that your WiFi is turned on and connected.
Use ADB
Get adb.exe from the Android SDK.
You connect to your Nook using either an IP address or a host name if you defined one in your C:\Windows\System32\drivers\etc\hosts.
Code:
adb connect nook [color=red][i]or whatever you named it[/i][/color]
adb shell
or
Code:
adb connect 192.168.1.2 [color=red][i]or whatever the IP is[/i][/color]
adb shell
Then you will get your # prompt.
You can do whatever you want.
Usually the point of all this is to allow you to modify something in the system.
To do this, you have to "remount" the system partition.
Code:
# mount -o rw,remount /dev/block/mmcblk0p5 /system
The rest is up to you!
Can you release a version of this utility for linux?
nobricks said:
Can you release a version of this utility for linux?
Click to expand...
Click to collapse
In Unix (as always) you can accomplish your purpose by chaining together a half dozen commands with obscure case-sensitive parameters.
I don't know the exact parameters, but the general drift of things is here.
Thanks for pointing me in the right direction.
Did some further searching on the forums and found this post with the proceedure for modifying uRamdisk under linux.
Renate NST said:
Over WiFi can be easier because you don't need to configure desktop drivers.
Click to expand...
Click to collapse
Renate,
Question about NST USB drivers for ADB.
In short: I got 2 NSTs, they do have "slightly" different hardware, I guess. Or might be, internal SD card size is different only?
First was rooted long time ago, and my WinXP see it as ADB device (backup size 1,958,739,968 bytes)
NST modded ADB driver was installed long time ago.
Another one is a bit newer (backup size 1,962,934,272 bytes)
I’ve decided to root second one, followed instruction to the letter.
It was not detected as ADB device, only ADB via WiFi worked.
Apparently, /sbin/adbd was started, but I was not able to adb connect via USB at all, but only via WiFi with following line was uncommented (obviosly):
setprop service.adb.tcp.port 5555
Tried few times, the results are consistent.
Made me think, are there different drivers for "slightly" different NST hardware?
Am I mistaken?
The partitioning on an NST actively uses 1,941,962,752 bytes.
Any capacity over that is unused by the stock partitioning.
The exact capacity of the "2 GB" is varied.
I wrote a note somewhere of 3 different sizes that I have seen.
adbd, the ADB daemon uses either USB or TCP (on the Nook, that's WiFi).
Whether service.adb.tcp.port is defined determines this.
Renate,
Renate NST said:
The partitioning on an NST actively uses 1,941,962,752 bytes.
…
I wrote a note somewhere of 3 different sizes that I have seen.
Click to expand...
Click to collapse
The Q is: Does all 3 use exact same windows driver?
Could you compare your NST Android Composite ADB Interface driver with mine, please:
Google, Inc. | 8/11/2009 | 2.0.10.2
Hardware Ids
USB\Vid_2080&Pid_0003&Rev_0216&MI_01
USB\Vid_2080&Pid_0003&MI_01
The excess size of the internal NAND does not make a difference in anything.
The "ADB driver" is basically a way to tell Windows:
Hey, dude, you don't really know this device but pretend that you do.
It just has a bulk in endpoint and a bulk out endpoint.
Don't worry your little head over what the data is.
Just use the generic driver file C:\Windows\System32\drivers\winusb.sys
And if I feel like using it I'll interface through C:\Windows\System32\winusb.dll
Click to expand...
Click to collapse
And Windows sighs and just does it.
(Well, actually, it's a bit more complicated than that because it creates the Android Device install class.)
Anyway, what was your question?
Then what about adb wireless apps? Do we still need one of those to adb-connect wirelessly? I tried this on a fresh Nook with 1.1.2, and don't seem to be able to connect to the Nook.
If you use ADB over WiFi and if you leave your WiFi on then you have a big security leak unless you are only on a private network.
People use app like ADB Konnect to disable ADB over WiFi.
I prefer just using ADB over USB.
Renate NST said:
If you use ADB over WiFi and if you leave your WiFi on then you have a big security leak unless you are only on a private network.
People use app like ADB Konnect to disable ADB over WiFi.
I prefer just using ADB over USB.
Click to expand...
Click to collapse
Thank you for the advice. Then, if I want to use adb over wifi, but want it to be off (or standby or whatever state that doesn't allow adb connection over wifi) at boot so that it can be toggled on/off later using one of adb wireless apps, what should I do? Is keeping "setprop service.adb.tcp.port 5555" commented sufficient for this?
ADB is only designed to support one transport at a time, USB or WiFi.
Apps that control this have to kill the adbd to have it restart.
If you comment the service.adb.tcp.port out then USB will be used.
Renate NST said:
ADB is only designed to support one transport at a time, USB or WiFi.
Apps that control this have to kill the adbd to have it restart.
If you comment the service.adb.tcp.port out then USB will be used.
Click to expand...
Click to collapse
I've been having a really hard time today attempting to get ADB over USB working on my NSTG 1.2.1. I followed the instructions, but when I do
Code:
adb usb
-OR-
Code:
adb devices
I always get
Code:
error: device not found
Which, of course, means that ADB isn't picking up my Nook as an ADB device.
Can you help?
Use Device Manager (devmgmt.msc) to see if the USB part is working.
See: http://forum.xda-developers.com/showthread.php?p=55428192#post55428192

[HOWTO] Customizing webtop

For sometime now I have been meaning to write-up some of my notes and share some of the things I found can be done with webtop. I have a lapdock that I use it with my Atrix, I also have a HD dock connected to a monitor/keyboard/mouse/speakers.
Much of the following is just documenting the linux programs that are installed on the webtop and how they can be configured. You will need to have a terminal program to do most things covered in this post (not the android terminal program, but either lxterminal or xterm) and a text editor.
I use SystemR89's webtopMod to run a full debian distribution in a chooted jail (http://forum.xda-developers.com/showthread.php?t=1093790), this is not necessary for most of what this post will cover but it does install lxterminal and a lightweight text editor (leafpad) into your webtop.
AWN (the menu at the bottom of the webtop screen)
awn-manager is included in webtop and it allows you add/delete programs from the menu at the bottom of the screen. Before you use awn-manager the first time you will need to type the following command at the terminal prompt:
sudo chmod 777 /usr/share/applications/*​
Then you can just type in awn-manager and click on launchers and start changing/adding/deleting things. Alternatively you can modify the appropriate files manually.
The configuration file that has the list of menu items is:
~/.gconf/apps/avant-window-navigator/window_manager/%gconf.xml​
If you make manual changes to this file you will need to reboot for the changes to take effect (if you use awn-manager all changes take effect immediately).
As you will notice the menu configuration file references “.desktop” files. I am not going to cover the structure of the desktop files, there are a lot of good references out there covering this, just take a look at what is in them, the structure it is pretty straightforward. A number of the desktop files are found here:
/usr/share/applications​
but the ones created by awn-manager will be put here:
~/.config/awn/launchers​
If the program or command will only be run from the awn menu this directory is probably the best place to put the desktop file. If you are going to associate the program with a file type (more on this latter) you may want to put the desktop files in the following directory:
~/.local/share/applications​
any weblinks that you create by using the plus in the right hand side of the bottom awn menu bar will be put here:
~/.config/webtop-icon​
and a good place to stick any custom icons that you are going to be using is here:
~/.config/awn/custom-icons​
the default set of icons that awn-manager accesses are found here
/usr/share/pixmaps/​/usr/share/icons​
to launch an android program in the mobileview window (aka aiw) you will need to use androidlauncher, here are a couple examples of how to do this:
androidlauncher --action "android.intent.action.VIEW" --uri "content://com.android.contacts/contacts"​/usr/local/bin/androidlauncher --action "android.intent.action.MAIN" --cmp "uk.co.nickfines.RealCalc/.Calculator"​
you can look in the desktop files found in the /usr/share/applications directory to see some examples of how to launch various android programs you can also use the android app alogcat from the market to see what command is executed when you launch an android app on your phone.
Nautilus (the file manager)
Nautilus is filemanager used by webtop, it has been significnatly modified by Motorola so don't expect all of the normal features to work. If you look at the entry for the file manager using awn-manager you will see that the following command is used to launch the program:
nautilus --no-desktop --browser /mnt/sdcard​
In webtop the default preferences for nautilus are set up so that you can leave out the -no-desktop and -browser switches if you want. The /mnt/sdcard entry specifies which directory nautilus should start in. You can specify nautilus to start in the root (/) directory, but it won't have root privileges, so it is not a replacement for root explorer (or similar). If gksu was included in webtop you should have been able to run nautilus with root privileges by typing in:
gksu nautilus --no-desktop --browser /​
but when I installed gksu and tried this it did not work.
If you want to have additional directories listed on the left panel in nautilius you can edit the file:
~/.gtk-bookmarks​
You can add some functionallity to nautilus by creating scripts. After you create a script an option to run the script will appear under the files menu and come up when you right click. The scripts files are kept in the following directory:
~/.gnome2/nautilus-scripts​
I have attached a couple of scripts that I use, you can also check out:
http://linux.about.com/library/gnome/blgnome6n13a.htm
http://g-scripts.sourceforge.net/faq.php​
You can view the preferences that are set for nautilus by using:
gconftool-2 -R /apps/nautilus/preferences​
I played around with changing some of the preferences, I tried to turn on an address bar but the bread crumbs disappeared instead, I found that you can enable move-to-trash but it only works for linux filesystems (i.e. it works for your home directory but not for FAT filesystems like sdcard or sdcard-ext, although you might be able to fix this by putting appropriate entries in fstab with uid=1000 in the entry, I wrote a move to trash script instead)
It does not appear that the motorola webtop nautilus directly supports accessing network files, but if you are using a kernel with cifs support (or cifs manager from the market) you can mount network directories and then access them through nautilus.
Nautilus has saved searches built in (ctrl-f), search by name works but search by filetype does not work (you can search by file name, such as mp3, but it you tell it to find all audio files it does nothing). I guess they figured they have their smartfolders for that (Phone Music, Phone Images, Phone Video). By the way if you freeze or remove webtop connector then items will no longer be added to the smartfolders.
pcmanfm (an alternative filemanager in webtop)
There is a lightweight alternative to the nautilus file manager included in webtop called pcmanfm. To launch it with the sdcard directory showing type the following:
pcmanfm --no-desktop /mnt/sdcard​
if you want to launch it with root privileges in the root directory type the following
sudo pcmanfm --no-desktop /​
(I know you should be using gksu instead of sudo, but this works and gksu is not included with webtop).
Some of the nice features of pcmanfm:
It can run with root privileges (see above)
It has an address bar, so you can just type in the directory you want to instead of navigating the directory tree
It has an open terminal window here function built in (tool – open terminal)
There is a bookmarks menu where you can change the directories shown in the left pannel without having to edit ~/.gtk-bookmarks
File associations
If you want a specific application to launch when you double click on an item in the file manager you can change the entries in the following files:
~/.local/share/applications/defaults.list
~/.local/share/applications/mimeapps.list​
To have several “open with” options when you right click on a file you can put several entries on a line. The following is an example of an entry:
image/jpeg=gpicview.desktop;MobileView.desktop;firefox.desktop​
This enrty is telling the file manager to use gpicview.desktop to open the file if you double click on a jpep and to offer the options “open with gpicview”, “open with Mobile View” and “open with firefox” if you were to right click on a jpeg file.
The file manager will use gpicview.desktop that is found in /usr/share/applications/ unless there is a gpicview.desktop file in ~/.local/share/applications/
I have attached the files that I use for
~/.local/share/applications/defaults.list
~/.local/share/applications/mimeapps.list​
You will probably have to edit these file because some of the file associations I have set up launch programs in the chrooted linux environment.
Linux applications included with webtop
Functional and useful linux programs included in webtop
nautilus: file manager
pcmanfm: file manager
firefox: web browser
awn-manager: menu editor
xarchiver: file archive manager (zip/tar)
gpicview: a simple image viewer
epdfview: pdf viewer​
Gnome programs - most of the gnome programs are crippled/semi-functional, but the following two seem to work well:
gnome-dictionary: online dictionary
gnome-screenshot: screenshot/capture utility​
If you look at the "exec" entry in the desktop files located in /usr/share/applications you can see what other programs are included in the webtop distribution.
Swap
I am not certain if the stock atrix kernel has swap support, I am using faux123's kernel, perhaps someone could comment on if the stock kernel's swap support.
I find that I need to set up swap space if I want to use the webtop for anything more than occasional web browsing. Before I enabled swap webtop was regularly warning me that I had low memory (and you can't close the warning message, which is really annoying).
The first thing I tried was using zram for swap (fuax123's kernel supports this). I DO NOT recommend using zram for swap.
BEWARE, ZRAM CAUSES YOUR PHONE TO CRASH REGULARLY​
Next I looked into setting up a swap partition; however, after a little research I found out that the complexity of setting up a swap partition is a waste of time, you can get the same performance using a swapfile. Accordng to Wikipedia (http://en.wikipedia.org/wiki/Paging#Linux):
From a software point of view with the 2.6 Linux kernel, swap files are just as fast[14][15] as swap partitions. The kernel keeps a map of where the swap file exists, and accesses the disk directly, bypassing caching and filesystem overhead.[15] Red Hat recommends using a swap partition.[16] With a swap partition one can choose where on the disk it resides and place it where the disk throughput is highest. The administrative flexibility of swap files can outweigh the other advantages of swap partitions. For example, a swap file can be placed on any drive, can be set to any desired size, and can be added or changed as needed. A swap partition, however, requires that it be set for the entire hard drive, and once the size of a swap partition is set, it can't be changed without using tools to resize the entire drive.​
To create a 512MB swapfile, type the following commands in the terminal:
dd if=/dev/zero of=/sdcard-ext/.swapfile bs=1M count=512
sudo mkswap /sdcard-ext/.swapfile​
This is probably bigger than I need, I don't think I have ever used more than 100MB of swap. I use a "." as the first part of the filename, this makes the file a "hidden" file in linux and therefore the file is less likely to get accidentally deleted or moved.
Next, turn on the swap:
sudo swapon /sdcard-ext/.swapfile​
and make sure it is working:
free​
You will want to add the following line to the file /etc/fstab:
/sdcard-ext/.swapfile swap swap defaults 0 0​
and the following line to /etc/sysctl.conf
vm.swappiness=10​
(you may actually want to try a value less than 10, the lower the value the less the phone will swap)
Running full debian in a chooted jail (webtopMod)
As I mentioned in the first post I use SystemR89's webtopMod to run a full debian distribution in a chooted jail (http://forum.xda-developers.com/showthread.php?t=1093790)
You can install a number of very useful and fully functional linux programs in the chrooted environment and then access them from the awn menu (or if you have the file associations set up properly in defualts.list and mimeapps.list you can launch the files by double clicking on a file in the file manager).
*IMPORTANT* Some of the commands must be executed in the chrooted environment and some must be executed in the non-chrooted environment (i.e. the normal webtop environment). The following instructions tell you which environment you need to use for each command.
Once you have webtopMod installed I would recommend that the first thing you do is open an xterm window in the chrooted environment (click on the penguin and select the proper menu item for xterm) and install synaptic in the chrooted environment:
apt-get install synaptic​
You can then use synaptic to install other linux programs/packages, such as lxterminal, OpenOffice, mtpaint (gimp runs but it is really slow).
I have modified the script that SytemR89 uses to launch the chrooted environment (attached), you can replace the original script by following these steps in the non-chrooted environment:
Save the attached file,
Rename it from linux.txt to linux
Copy it to /usr/sbin
Set the permissions properly (sudo chmod +x /usr/sbin/linux)​
If you want to launch a program in the chrooted environment you can do it by typing the following in the non-chrooted environment:
linux oocalc​
where oocalc is the name of a program that you have installed in the chrooted environment.
A couple of final things, you may want to setup a symlink in the chrooted environment for /sdcard (and sdcard-ext). If I recall correctly, SytemR89 was just mounting /sdcard (and /sdcard-ext) in the chrooted environment and I changed the script to mount /mnt/sdcard instead (why? so that the chrooted directories would be set up the same as the non-chrooted environment). To make a symlink between /mnt/sdcard and /sdcard in the chrooted environment. First launch an xterm window for the chrooted environment, then type in the following commands:
sudo umount /sdcard
sudo umount /mnt/sdcard
sudo mkdir /sdcard
sudo mkdir /mnt/sdcard
sudo ln -s /mnt/sdcard /sdcard
sudo umount /sdcard-ext
sudo umount /mnt/sdcard-ext
sudo mkdir /sdcard-ext
sudo mkdir /mnt/sdcard-ext
sudo ln -s /mnt/sdcard-ext /sdcard-ext​
You may get some errors telling you that something was not mounted or that a directory exists, just ignore the error(s).
Then reboot.
I also created a directory /usbdrive in the chroot'd linux environment and use the following command to mount a usb drive so that the chrooted environment can access it (run this command from the non-chooted environment)
sudo mount -t vfat /dev/block/sda1 /osh/opt/WebTopMOD/root/usbdrive​
Many thanks for posting this, it's an excellent guide.
tamuin said:
I am not certain if the stock atrix kernel has swap support, I am using faux123's kernel, perhaps someone could comment on if the stock kernel's swap support.
I find that I need to set up swap space if I want to use the webtop for anything more than occasional web browsing. Before I enabled swap webtop was regularly warning me that I had low memory (and you can't close the warning message, which is really annoying).
The first thing I tried was using zram for swap (fuax123's kernel supports this). I DO NOT recommend using zram for swap.
BEWARE, ZRAM CAUSES YOUR PHONE TO CRASH REGULARLY​
Next I looked into setting up a swap partition; however, after a little research I found out that the complexity of setting up a swap partition is a waste of time, you can get the same performance using a swapfile. Accordng to Wikipedia (http://en.wikipedia.org/wiki/Paging#Linux):
From a software point of view with the 2.6 Linux kernel, swap files are just as fast[14][15] as swap partitions. The kernel keeps a map of where the swap file exists, and accesses the disk directly, bypassing caching and filesystem overhead.[15] Red Hat recommends using a swap partition.[16] With a swap partition one can choose where on the disk it resides and place it where the disk throughput is highest. The administrative flexibility of swap files can outweigh the other advantages of swap partitions. For example, a swap file can be placed on any drive, can be set to any desired size, and can be added or changed as needed. A swap partition, however, requires that it be set for the entire hard drive, and once the size of a swap partition is set, it can't be changed without using tools to resize the entire drive.​
To create a 512MB swapfile, type the following commands in the terminal:
dd if=/dev/zero of=/sdcard-ext/.swapfile bs=1M count=512
sudo mkswap /sdcard-ext/.swapfile​
This is probably bigger than I need, I don't think I have ever used more than 100MB of swap. I use a "." as the first part of the filename, this makes the file a "hidden" file in linux and therefore the file is less likely to get accidentally deleted or moved.
Next, turn on the swap:
sudo swapon /sdcard-ext/.swapfile​
and make sure it is working:
free​
You will want to add the following line to the file /etc/fstab:
/sdcard-ext/.swapfile swap swap defaults 0 0​
and the following line to /etc/sysctl.conf
vm.swappiness=10​
(you may actually want to try a value less than 10, the lower the value the less the phone will swap)
Click to expand...
Click to collapse
Thanks a lot, I was just starting to configure zram right before reading your post. :good:
Please explain just two things to me:
- Did you automated this to always enable swap? If so, how (init.d scripting)? EDIT: forget about... I didn't realize what changes in /etc/fstab will do...
- You've created the swap file in the external SDCard. Isn't better to create it on EMMC? EDIT: I've created the file on EMMC cause it's much faster and seems to be Ok!!!
Regards...

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?

Binding a tcp port to a block device ?

@Zaphodspeaks
Z,
okay i found a lead here http://stackoverflow.com/questions/...-android-device-failing-to-bind-tcp-port-5037
Android enforces its Internet Permission via a modification to the Linux Kernel which checks that a process is a member of an associated unix group before allowing it to open sockets in the AF_INET domain.
Such membership is inherited, so native code executed, either as a JNI library or by invoking a distinct executable, will only be able to perform network operations if it is either run as a privileged user automatically having this membership (such as adb's "shell" account, or as root on an engineering build) or run under the identify of an application package having the Internet permission in its manifest.
Click to expand...
Click to collapse
i'm going to snoop around the source and se if i can figure out how to tweak android tools source to build a modded adb and daemon and try it out.
interesting side note, even without root as long as adb is insecure you can push and run certain scripts and binaries seemingly outside of security if you work out of /data/local/tmp
for anyone wondering i had a though that maybe i could use the tab's in-house adb to connect to "itself" and achieve a root prompt.
m
EDIT- I found Q&A !!! i think ? umm this is q&a right? xD
This looks promising and fascinating.. If you pull this off, I think you will be the first to ever of done anything like this..
Zaphodspeaks said:
This looks promising and fascinating.. If you pull this off, I think you will be the first to ever of done anything like this..
Click to expand...
Click to collapse
I'd like to try it, i've been working with some simple c programming execises for the last few days
trying to figure out how to get certain system calls to work for miscellanious hooliganery! xD
i found out if you run /init in terminal you will reboot your device to recovery.
i have to re-flash a clean instance of the lp 5.1.1 firmware and then the unsecured boot.img so selinux is still intact,
then push a copy of the init binary to /data/local/tmp via adb and execute it.
if it works , then i have some neat ideas!
m
edit- i also have a new boot image which automatically mounts my debian chroot and exports the $PATH to my gcc
to anyone who needs to mount a custom block device
you need an entry like this in init.environ.rc
# Debian CHROOT
export DEBIAN_ROOT /debian
export TMPDIR /tmp
mount -t proc none /debian/proc
mount -t sysfs none /debian/sys
mount -o bind /dev /debian/dev
mount -o bind /proc/net /debian/proc/net
mount -t devpts none /debian/dev/pts
[this is for mounting my chroot, so all i have to do is run the chroot command itself and all my needed mounts are already in place]
and amend your path and ld library entries
export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/gcc/bin:/system/xbin:/bin:/usr/bin:/usr/sbin
export LD_LIBRARY_PATH /system/lib:/system/gcc/lib:/system/vendor/lib
NOTE TO SELF- pipe the output of strace <command> to text
strace id &> narc.txt
moonbutt74 said:
I'd like to try it, i've been working with some simple c programming execises for the last few days
trying to figure out how to get certain system calls to work for miscellanious hooliganery! xD
i found out if you run /init in terminal you will reboot your device to recovery.
i have to re-flash a clean instance of the lp 5.1.1 firmware and then the unsecured boot.img so selinux is still intact,
then push a copy of the init binary to /data/local/tmp via adb and execute it.
if it works , then i have some neat ideas!
m
Click to expand...
Click to collapse
Damn I wish I had your skills.. Programming is NOT my forte.... Hardware repair and PC diagnostics is what I'm best at..
@Zaphodspeaks
OKAY,
stumbled across something interesting, this will be slightly interrupted as i need to switch to tab for the second part of the post,
[via adb shell]
strace adb shell
one line in particular caught my notice in the output of strace
Code:
connect(3, {sa_family=AF_FILE, path="[COLOR="Red"]/tmp/5037[/COLOR]"}, 12) = 0
back in a minute... okay, i'm on tab from clean reboot,
when running adb shell [remember the above] i get this
Code:
[email protected]:/ # adb shell
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
1|[email protected]:/ #
okay now [with unsecured boot.img] as normal user in tab you cannot do this part, BUT you can via adb shell on pc-side
Code:
mkdir /data/local/tmp/5038
EDITED - see edit below [dammit, i really have to start taking notes]
EDIT
that's maybe a "HIT" of some kind. How to make it work from there i'm not sure yet.
okay i goofed by mkdir 5038 should actually be a link to socket [DERP]
i'll get back to this after some breakfast so as to avoid brain death from overcaffination. xD
i had to edit this, i lost a step somewhere, should have posted all of this from the first time around
I'm trying to understand sockets and pipes, yay!
m
okay
i learnded me how to create a symlink to a socket
ln socket:[5038] /blah-blah/5038 [sort of ]
i'm guessing i need to be looking at how /proc works
for an example in /proc/5743/fd
10 -> socket:[41910]
from http://www.linuxquestions.org/quest...an-i-create-a-socket-file-248399/#post4398605
Lots of misunderstanding here; let's see if I can clarify.
A socket file is not a regular file, it's more like an IP address (it is also not a fifo, although those are similar). A socket file is created by the system when a program calls bind on a unix domain socket, which is a special kind of network socket that can only be internal to one computer. The system then associates this special file with the socket file descriptor that the program bound (or more specifically, the "inode" to which that file descriptor refers).
From that point on, the program that created the socket has no interaction with the socket by the filename. If you move it elsewhere, create new links to it, or remove it, you may confuse other programs that are trying to talk to the program in question, but the program itself won't see it at all. You are only changing the set of names that point at that inode (and you can connect to the listening program at that new name!). Thinking of the filename as a domain name, the inode as the ip address, and the filesystem as DNS isn't so very far off.
Click to expand...
Click to collapse
i'm guessing sock_create is a c thing http://linux.die.net/man/2/socket
i have authbind "working" after getting the source configured for ndk-build , but i don't yet know what a good example of it's usage would be to prove that it functions as it should.
@osm0sis,
okay, as per your instucts , i did this
[email protected]:/ # cat /sdcard/dooby
#!/system/bin/sh
cd /sdcard
setprop service.adb.tcp.port 5555
stop adbd && start adbd
adb connect 192.168.254.42
pwd
adb shell pwd
[email protected]:/ # /sdcard/./dooby
connected to 192.168.254.42:5555
/sdcard
/
[email protected]:/ #
now of i understand this correctly i am connecting to myself via my router, right?
you know, if i remount / and touch this script there and run it with a little modification i can probably create a loop, xD
Sounds fun. Glad to be of service.

Categories

Resources