[Q] Using a partition in DriveDroid app - General Questions and Answers

Hi,
I'm using Linux Deploy app to have a minimalistic ubuntu system on my android (just to have linux with me all time to test some commands or to build small C programms). I tried DriveDroid app yesterday and I really like it: I can use my linux deploy system on PCs too. The question is DriveDroid lets you add images (img) only to boot them from your PC, but I'm using an SDcard partition on my android phone for Linux Deploy not an img; so can we add a partition to DriveDroid too?! some linux tricks to do that I mean... I tried making a symlink of /dev/block/mmcblk1p4 (my linux deploy partition) and /sdcard1/ubuntu.img but this fails (action not permitted) I think it's because the first is ext4 partition and the sdcard1 uses fat32. Any help please?
Thanks XDA.

Related

Ubuntu on HTC Desire (Native, No chroot)

Hi guys,
First of all, if this is in the wrong section, Sorry. (I thought this would be the -most- appropriate place)
I've managed to create a minimal ubuntu build (No GUI etc), but everytime I goto boot it from my kernel, my kernel loads correctly, but with Android from NAND - rather than Ubuntu from SD!
I have only one partition on my SD, It's an EXT2 partition (and of course my kernel supports ext2).
I'm attempting to load it like this:
fastboot -c 'root=/dev/mmcblk0p1 rw rootfs=ext2 init=/usr/bin/sh rootdelay=5 noinitrd' boot arch/arm/boot/zImage
So as above, the kernel loads fine, but loads Android on my NAND rather than Ubuntu on my SD - Help!
I should mention that everything works under a CHROOT, and I can SSH into the phone... just can't boot natively ;\
So obviously the kernel isn't calling the SD card, but why?!?!
I've no idea what you're talking about, but check this thread if it might help (maybe you can help them too?).
http://forum.xda-developers.com/showthread.php?t=764255
If you post this on Villainrom.co.uk there is a good chance that someone who refuses to use xda can help you.
Thanks for the help guys,
I'll try a few things including the prebuilt kernel in one posts
at the moment, I gotta wait as it's converting itself to ubuntu - netbook edition. ;\
OzJD said:
Hi guys,
First of all, if this is in the wrong section, Sorry. (I thought this would be the -most- appropriate place)
I've managed to create a minimal ubuntu build (No GUI etc), but everytime I goto boot it from my kernel, my kernel loads correctly, but with Android from NAND - rather than Ubuntu from SD!
I have only one partition on my SD, It's an EXT2 partition (and of course my kernel supports ext2).
I'm attempting to load it like this:
fastboot -c 'root=/dev/mmcblk0p1 rw rootfs=ext2 init=/usr/bin/sh rootdelay=5 noinitrd' boot arch/arm/boot/zImage
So as above, the kernel loads fine, but loads Android on my NAND rather than Ubuntu on my SD - Help!
Click to expand...
Click to collapse
Try:
fastboot -c 'root=/dev/block/mmcblk0p1 rw rootfs=ext2 init=/usr/bin/sh rootdelay=5 noinitrd' boot arch/arm/boot/zImage
Anything new ?
Hi
So finally did you succeed in booting a linux environment from your Desire without chrooting ?
If yes, could you please explain step-by-step how you did this ?
Maybe there are good examples or tutorials out there ?
I did a search and did not find anything noob proof
At least i would really be interested in doing this too.
Thanks in advance.
Lennyuk said:
If you post this on Villainrom.co.uk there is a good chance that someone who refuses to use xda can help you.
Click to expand...
Click to collapse
I hope there's a simple answer to this question, but why do some people "refuse" to post on XDA?
I'm not sure why yours isn't working... This is the command I use to boot Debian:
fastboot -c "root=/dev/mmcblk0p3 rootfs=xfs rootwait rw init=/sbin/startlinux boot *path to zImage*"
Startlinux is my custom script that boots it all up as it doesn't like init for some reason.
EDIT: Actually, your problem might be that it's rebooting straight after you send it the command. Have a look at "cat /proc/last_kmsg" straight after it boots, it might give you some info.
OzJD said:
Hi guys,
First of all, if this is in the wrong section, Sorry. (I thought this would be the -most- appropriate place)
I've managed to create a minimal ubuntu build (No GUI etc), but everytime I goto boot it from my kernel, my kernel loads correctly, but with Android from NAND - rather than Ubuntu from SD!
I have only one partition on my SD, It's an EXT2 partition (and of course my kernel supports ext2).
I'm attempting to load it like this:
fastboot -c 'root=/dev/mmcblk0p1 rw rootfs=ext2 init=/usr/bin/sh rootdelay=5 noinitrd' boot arch/arm/boot/zImage
So as above, the kernel loads fine, but loads Android on my NAND rather than Ubuntu on my SD - Help!
Click to expand...
Click to collapse
I am interesting your idea,a and which kernel did you used for it.
As same as build by bravo_defconfig ?
Because I run native debian on Android,But could not open /dev/tty0,so could not use Xserver,directvnc,fbterm and some software needs open /dev/tty0.
When use that debian from VNC.(running vnc server on debian and accsess by vnc client),I can see GUI debian. But it is not my aim.
There is my entry configure native devian on android and usb hosthttp://forum.xda-developers.com/showthread.php?t=702742&highlight=usb+host&page=8
Do you want to run ubuntu on android device without run android ?
My aim is run debian(any whatever) on external usb monitor from android device.
Now mplayer could run on external monitor by USB hosted kernel that in above link.
Thank/
It run native debian without chroot.
sirnono said:
Hi
So finally did you succeed in booting a linux environment from your Desire without chrooting ?
If yes, could you please explain step-by-step how you did this ?
Maybe there are good examples or tutorials out there ?
I did a search and did not find anything noob proof
At least i would really be interested in doing this too.
Thanks in advance.
Click to expand...
Click to collapse
Maybe you want to run boot a linux environment without run android.
It can run native debian software on android without chroot.
http://forum.xda-developers.com/showthread.php?t=702742&highlight=usb+host&page=8
tknv said:
I am interesting your idea,a and which kernel did you used for it.
As same as build by bravo_defconfig ?
Because I run native debian on Android,But could not open /dev/tty0,so could not use Xserver,directvnc,fbterm and some software needs open /dev/tty0.
When use that debian from VNC.(running vnc server on debian and accsess by vnc client),I can see GUI debian. But it is not my aim.
There is my entry configure native devian on android and usb hosthttp://forum.xda-developers.com/showthread.php?t=702742&highlight=usb+host&page=8
Do you want to run ubuntu on android device without run android ?
My aim is run debian(any whatever) on external usb monitor from android device.
Now mplayer could run on external monitor by USB hosted kernel that in above link.
Thank/
Click to expand...
Click to collapse
You need to compile a custom kernel with virtual terminal support (under device drivers -> character devices) to run X11.
I use vorkKernel because I find it beats the plain CM kernel in just about every way and I just modify the default vork config to suit my needs.
Sent from my HTC Desire using XDA App
That I tried before.
Deathisfatal said:
You need to compile a custom kernel with virtual terminal support (under device drivers -> character devices) to run X11.
I use vorkKernel because I find it beats the plain CM kernel in just about every way and I just modify the default vork config to suit my needs.
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Thanks advice,But I tried it before and could not compile it.
Tried Configure both.
[*]Virtual terminal
[*]Enable character translations in console
[*]Support for console on virtual terminal
[*]Support for binding and unbinding console drivers
and
[*] Virtual terminal
[ ]Enable character translations in console
[ ]Support for console on virtual terminal
[ ]Support for binding and unbinding console drivers
Compile Error log.
CC drivers/video/console/vgacon.o
drivers/video/console/vgacon.c: In function 'vgacon_startup':
drivers/video/console/vgacon.c:508: error: 'PCIMEM_BASE' undeclared (first use in this function)
drivers/video/console/vgacon.c:508: error: (Each undeclared identifier is reported only once
drivers/video/console/vgacon.c:508: error: for each function it appears in.)
drivers/video/console/vgacon.c: In function 'vgacon_do_font_op':
drivers/video/console/vgacon.c:1073: error: 'PCIMEM_BASE' undeclared (first use in this function)
make[3]: *** [drivers/video/console/vgacon.o] Error 1
make[2]: *** [drivers/video/console] Error 2
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2
This is my problems.
Here I used kernelhttps://github.com/tknv/cm-kernel/tree/android-msm-2.6.35-bravo
Disable VGA text console and Framebuffer console if it's selected in Device Drivers -> Graphics Support -> Console Display Driver Support. That should hopefully fix your problem
Works !
Deathisfatal said:
Disable VGA text console and Framebuffer console if it's selected in Device Drivers -> Graphics Support -> Console Display Driver Support. That should hopefully fix your problem
Click to expand...
Click to collapse
Disable VGA text console then works !(I did not configure FB console yet at that time)
Thank you.
Now could run directvnc on external monitor USB-display from Android device,also usb key-board works on directvnc from USB-hosted bravo.
But very wild.
I need configure monitor setting and also now no way to stop direcvnc except kill process from wireless adb.
bergfex made it boot on DHD
http://forum.xda-developers.com/showthread.php?t=1045910
tknv said:
Disable VGA text console then works !(I did not configure FB console yet at that time)
Thank you.
Now could run directvnc on external monitor USB-display from Android device,also usb key-board works on directvnc from USB-hosted bravo.
But very wild.
I need configure monitor setting and also now no way to stop direcvnc except kill process from wireless adb.
Click to expand...
Click to collapse
Any news and code to share with us?

solved nautilus issue in chrooted ubuntu (android)

I tried to reply to this post
http://forum.xda-developers.com/showpost.php?p=26061651&postcount=132
however I am new to this forum and I am still not allowed
Inside the chrooted ubuntu environment in an android device, nautilus does not work because it thinks that the whole filesystem is read-only, so it does not let you to create or modify anything (Thunar - the file manager of xfce - works correctly).
I found and solved the problem.
If inside the chrooted environment, you type mount, you see that there are two entries for "/": the first one is of the host (android) machine, and it is a read only filesystem. The second is the mount of the ubuntu image, but nautilus sees only the first one and thinks that the whole filesystem is ro.
So I created another image (say, homeroot.img), formatted, copied it in the android device, mounted first as /data/local/mnt/tmproot (AFTER having mounted ubuntu.img on /data/local/mnt), entered the chroot environment, copied all files contained in /root to /tmproot, exited chroot, unmounted homeroot.img, remounted it as /data/local/mnt/root, re-entered chroot, and voilĂ ! Nautilus works correctly (at least within the /root directory, the rest is still seen as a readonly filesystem, but this is not bad for security reasons, isnt't it?)

[HOWTO] Install LinuxOnAndroid distros on your sdcard's second partition.

Hello friends! I'm a year long follower of the LinuxOnAndroid project. I have always wanted to install ubuntu on my sdcard instead of using image files. I waited a long time for an instruction to crop up somewhere on the internet about how to do this, and in the meantime, learnt a lot of things. Then I decided to experiment with the idea a few days ago and also managed to get satisfying results. There was a significant performance boost compared to using a linux image.
While writing this tutorial, I have assumed that you are already quite familiar with the LOA project and that you have already managed to run a linux distro on your android device.
Please note that while this tutorial aims to be applicable for all distros released under the LOA project, I have only run Ubuntu 12.04 small, Ubuntu 13.10 small and Debian small images. I have never had any experience with the other distros. But I'm pretty confident that the instructions can be applied to other distros without any problem. If you encounter any problem while applying the instructions for your device and distro, I'm willing to help you as much as I can.
Warning: I've never bricked my android devices while rooting, modding or hacking them and I hope you will be as lucky. But please remember that I will not be held responsible for any damage or losses suffered by you or your devices while following the instructions given in this tutorial. You will do so at your own risk.
Let's begin.
First of all, Things You'll Need:
Root access on your android device
Busybox
An sdcard of optimum storage capacity. You decide what's optimum for your case. I have a 16GB card with a 4GB partition for ubuntu small image.
Init.d script support for auto-mounting second sdcard partition on boot. You can skip this if you want to mount the second partition only when booting up linux.
Attached zip containing bootscript.sh and 03ubuntu files.
Step 1: Partitioning the sdcard
WARNING: This will erase all data on your sdcard!
Use MiniTool Partition Wizard for windows, gParted for linux or aParted for Android to create the two partitions on your sdcard. I reccomend that you do the partitioning on your PC. Note that you cannot partition your sdcard by connecting your device to your PC my USB. You need to use a card reader. If you have a USB modem with built in card reader, you can use that too.
The first partition will be used by your android device for mass storage. Make it FAT32 or exFAT or vFAT. Note that if you make the first partition exFAT, custom recoveries like CWM will not mount it. This can cause problems, for example, when you are trying to restore a nandroid backup from your sdcard.
As for the format for the second partition (let's call it the linux partition), it depends on what linux filesystems your device supports. You can't use (ex/v)FAT(32). You can only use linux filesystem for installing a linux OS.
If you are using aParted to partition the sdcard, not every format will work. My tablet supports mkfs.ext2 and make_ext4fs but
Code:
mke2fs -t ext3/4
doesn't work. So I used aParted to format the second partition as ext2 and ran
Code:
make_ext4fs /dev/block/mmcblk0p2
in terminal emulator. So my linux partition is ext4. You need to unmount your sdcard to use aParted.
NOTE: Before creating your second partition, make sure your device is able to mount the format that you want to use. Run the
Code:
cat /proc/filesystems
or
mount
command in terminal emulator to check for supported filesystems.
STEP 2: Mounting the sdcard partitions
WARNING: If you are using the Link2SD app or any other app2sd app, you might be prompted to create mount scripts for the second partition. DO NOT CREATE THE MOUNT SCRIPTS. Our linux partition is not meant for app2sd.
In this tutorial, we will be mounting the linux partition automatically on startup. For this, you'll need init.d script support on your device. You can use Uni-Init to check/enable init.d easily. If your device does not support init.d and you've failed to enabled it, you could go for more advanced methods like unpacking your boot image and editing init.rc to mount the linux partition. You could also try the Script Manager app. You can also choose to mount the linux partition only when you boot up linux. Let me know if you'd like instructions for this.
Assuming that you already have init.d support, let us proceed.
Download the attached 03ubuntu script and using a root explorer copy it to /system/etc/init.d/here. I use ES File Explorer. Set file permissions to rwx-rwx-rwx or 777(? I'm not very familiar with numerical permissions). rwx-r-xr-x might also work. You can also use terminal to copy, set file permissions, etc. It's up to you.
EDIT: WARNING! Depending on your device, your MicroSD card might me mmcblk1. You can check using the mount command or from the aParted app. It is mmcblk1 on one of my friends' phone. If this is the case you must edit the 03ubuntu script to replace mmcblk0p2 by mmcblk1p2
The 03ubuntu script mounts the linux partition as ext4 at /mnt/ubuntu. The mount options in the script are meant for the maximum performance but may reduce reliability. I haven't had any problems yet. If your linux partition is not ext4, edit the script accordingly. Some of the mount options used in the script are meant for ext4 filesystems only. Google "best/optimum ext(whatever your linux partition is) mount options" to learn more. My linux partition is mounted with noatime option but becomes relatime sometimes after shutting down linux. Somebody please tell me why this happens.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
After placing the script in the init.d directory, reboot your phone.
After rebooting, open the /mnt folder. If you see a folder named ubuntu, congratulations, the init.d script worked. But is the linux partition mounted? You can check by opening the /mnt/ubuntu folder. If you see a lost+found or LOST.DIR folder, the partition is very likely to be mounted. Confirm it by running
Code:
mount
in the terminal. Look for the line
Code:
/dev/block/mmcblk0p2 /mnt/ubuntu ext4 rw,noatime,user_xattr,barrier=0,data=writeback 0 0
If you see that line, we're ready to move to the next step.
STEP 3: Copying the files from linux image to linux partition
Now, we install your linux distro on the sdcard. Place the image (a fresh one or the one that you've been using) in your sdcard and run the following commands. Note: You might need to make changes to the commands according to your image location and format.
Code:
su
mkdir /data/local/mnt
mknod /dev/block/loop255 b 7 255
losetup /dev/block/loop255 /mnt/sdcard/ubuntu.img
mount -t ext2 /dev/block/loop255 /data/local/mnt
cp -dpR /data/local/mnt/* /mnt/ubuntu
## wait till copy is complete ##
umount /data/local/mnt
exit
So that was it. You have your favorite linux distro installed on your sdcard now.
But before you go ahead and press that BOOT LINUX button, we still have some things left to do to make it possible to boot from sdcard.
STEP 4: Editing the bootscript.sh and init.sh files
Actually, I did the bootscript editing part for you. I made all (and only) the changes that are required to boot from the sdcard. The modified bootscript is based on the latest (v8) version. Things like sdcard and external sdcard mounts and binds are unchanged. I added comments in the script with my name to mark places where I made the changes. You can look through it if you like.
So now copy the modified bootscript.sh file inside /data/data/com.zpwebsites.linuxonandroid/files/here and set file permissions to rw-------.
After that, comes init.sh. Although the bootscript is common for all distros, it may not be the case for init.sh. You'll find it in /mnt/ubuntu/root/init.sh.
Copy it to your sdcard and keep a copy somewhere safe. Open the script in a text editor (I use Jota+ text editor) and find the following lines and remove them.
Code:
if [ $# -ne 0 ]; then
cfgfile=/root/cfg/$1.config
if [ -f $cfgfile ]; then
echo "Using config file $cfgfile"
else
echo "Config file not found, using defaults!($cfgfile)"
fi
fi
The original permissions for the init.sh file are rwx-rwx-rx
After that, place the modified init.sh file back inside /mnt/ubuntu/root/here and don't forget to set correct file permissions.
STEP 5: Final steps and booting linux
Everything is in place and now you can boot up your linux, or can you? Nope. The Complete Linux Installer app won't let you boot if it does not find an image file.
For this, create an empty file inside /mnt/ubuntu/here and name it ubuntu.img.
In the app, enter the location of linux image as /mnt/ubuntu/ubuntu.img and tap on the awesome boot button.
Voila! You've now successfully installed linux to your sdcard and managed to boot it up too! Well done, my son.
Aaaand...Just a reminder: Don't Update Script if you want to continue booting from thee linux partition.
If you have been successful in achieving the goal of this tut, please leave a feedback with your device name and any modifications that you had to make, if any, to the whole process. That will be of great help to others.
EDIT: RISK OF DOUBLE BOOTING!
In case of booting from linux image, when you (accidentally) tap on the boot widget or the boot button while linux is already running, the app would display a confirmation dialog to chroot into the mounted image. This may not happen when you are booting from the second sdcard partition.
To prevent errors when you accidentally tap on the boot widget/button, add the following code into the bootscript right after the error_exit() function at the beginning of the script.
Code:
echo "Boot up Linux? Make sure it is safe to boot before proceeding!"
read answer
if [ $answer != muchfunny ]; then
error_exit "Aborted"
fi
Replace "muchfunny" with y or yes or any word of your choice.
When you try to boot, you'll have to enter this word to proceed. If you type in the wrong word, it won't boot. This way, you will have a chance to prevent errors when you accidentally tap on the boot widget while linux is already running.
Any user of LOA, not just those who are booting from linux partition, can benefit from this. You could replace "muchfunny" with a secret code to prevent anyone from messing with your linux installation. So it's like implementing password protection.
I'm using this on my tablet.
hello david,
Looks nice and clear, haven't had the chance to try yet but will post my results when i do.
Just wanted to say big thanks for the write up.
Sent from my Nexus 7 using Tapatalk 2
joesnose said:
Looks nice and clear, haven't had the chance to try yet but will post my results when i do.
Click to expand...
Click to collapse
When you do a factory reset in CWM (probably also in other recoveries), the second sdcard partition is wiped.
So it's best to store the backups in the internal sd and remove the sdcard before performing a reset.
If you don't already know, and if you have not run "apt-get clean", you can back up any packages that you downloaded on ubuntu (if you're using it) by keeping a copy of the contents of the archives folder in /var/cache/apt/. In case your linux installation gets corrupted or the partition gets wiped, you can restore the backed-up packages later. So you won't have to download them again.
I have used this thread to install Archlinux using LinuxonAndroid on a Samsung Epic 4G's SD card. I have some issues to sort out with using VNC to access the Archlinux installation but the commandline environment on the Epic 4G works fine.
If you're trying to use this with Ubuntu, there are several issues. First, the image hosted by the LoA project for Ubuntu 13.10 doesn't work for this application: you'll get errors when you try to mount the image for installation to the SD partition. Second, you might try the 13.04 image: it will mount and install but the repositories are all gone because 13.04 is no longer supported.
If you're trying to install this in order to use a specific program (in my case, I'm wanting to use this device as a Prosody server), it's probably best to see which available distro hosted by LoA has up-to-date packages for that program and use that to guide your decision. Based on this logic, I chose Archlinux.
If you aren't using Ubuntu, the bootscript.sh file included with this post becomes problematic as it is littered with Ubuntu-specific calls. It isn't overly difficult to edit: open it in Notepad+ (or similar) and read through it, changing $mnt and $ubuntu to whatever you've named your partition mount folder as. In my case, my mount folder is /archlinux/ and the fake image file (used to spoof the LoA app as detailed in OP's post) is /archlinux/archlinux.img, so this meant simply replacing $mnt and $ubuntu with $archlinux. There are a few instances of $ubuntu that I didn't mess with--in the comments, David has mentioned that they refer to the "usermounts feature" and that he left these alone because he didn't understand it. Are these the usermounts that are defined in the LoA app? I don't know and I haven't tried defining a mount yet (such as partition 1 on the SD card). In short, bootscript.sh will need to be edited to account for a non-Ubuntu installation.
(If you're using Archlinux, LoA hosts a modified bootscript.sh that contains a Archlinux-specific change to mounting /dev/pts, whatever that is. I used this as a base script to work with, then added and deleted the areas that David has edited in his bootscript.sh.)
Accounting for the differences, Archlinux works at the terminal on the device. However, if you try to connect to the automatically configured VNC server, things start to get weird for a Linux noob (which I am). For starters, there isn't a desktop environment defined so when you first connect, you're gonna see a blank gray screen and a cursor. Right-clicking brings up a menu. Almost none of the apps on the menu work, because they aren't installed. I think what you're looking at is the openbox window environment. What you need is a terminal to install something that works better but here's the catch: the terminal isn't installed/working, either (in VNC, not at the device). What I did here might have been a mistake compounding an error: I used the terminal on the device (which is logged in as root) to install a desktop environment using Archlinux's package manager, pacman. Then, I edited the (hidden by default) /home/$yourinstallhere/.vnc/xstartup.sh to boot the installed desktop environment; add a line with the command appropriate to your chosen DE: e.g. gnome-session; startxfce4; startlxde. You can comment out most anything else as those lines are loading the openbox environment and a terminal session. Alternatively, leave those in place as a backup environment and place your DE load command after those, so if your DE doesn't load, you still have the nearly useless gray screen to look at.
Okay, so that got a DE going (after the xstartup script was executed again and possibly the Linux install rebooted). Now what? Well, as mentioned before, terminal still doesn't work. It will open but there isn't a prompt and no keyboard input is shown. Without terminal, Linux is crippled, DE or no DE. This is where I am currently. I can still manage the Archlinux installation from the device's terminal as root but access from VNC is effectively unusable. I don't know why: is it because the DE packages (including a terminal emulator) were installed by root and therefore the VNC user doesn't have the permissions to access them?
In any event, I would like to thank David for posting this thread. The LoA project has little to no documentation or discussion so this has been very helpful to me. Please let me know if you have any ideas regarding VNC access of the installation.
Edit: Additional installation-specific information:
My Epic 4G is running the Cyanogenmod 10.1 stable release. The init.d mount script for the second partition will not automatically run at boot, despite CM supporting init.d and having installed the Universal init.d app. However, the script can be manually executed from within the Universal app and that will mount the partition. I tried adding a 50-second sleep to the script to see if it was just bogging down but that had no effect so I gave that idea up. The test script that the Universal app uses to test if the device has init.d support also doesn't work, which indicates that the Epic 4G CM port may be at fault here.
Using Archlinux's systemctl to manage services from the root terminal on the device is not working as expected. For instance, if I try to restart the vncserver service (systemctl restart vncserver) the terminal returns, "Running in chroot, ignoring request."
Edit #2:
Installed xterm from the device terminal and now I can access xterm from VNC /facepalm (why does the xstartup script call something that isn't installed by default?).
When my device's screen powers off, the VNC session drops because the server apparently kills itself. I have Android set to keep wifi on during sleep. How do I keep VNC active while the device's screen is off?
I seem to have succeeded with having my Epic 4G run an XMPP server (Prosody) within Archlinux on Android. I don't want to take this thread too far off-topic but there were some aspects to my project that would be useful to know for someone installing LoA.
http://sourceforge.net/p/linuxonand...do-users-and-groups-work-under-linuxonandroid
https://android.googlesource.com/pl...r/include/private/android_filesystem_config.h
This is pretty key knowledge to know if you're going to install anything that's going to need to gain control over the Android hardware (e.g., opening sockets). Root at the terminal is probably in all of these groups but the default user (ubuntu or whatever you named your installation) might not be; if your software installs its own user, it definitely won't have these group memberships so you'll have to add them. In my case, Prosody creates its own user and group and refuses to run as root, so I had to give the Prosody user membership in the 3003 group so it could open listening ports (I also had to modify all of the files that should have belonged to Prosody with chown because root took ownership by default). I figured this was something to keep in mind, if you're a fellow Linux noob.
http://forum.xda-developers.com/showthread.php?t=1585009&page=24
Speaking of the "everything as root" problem, I came across this that purports to make the default ubuntu user more typical of what you'd encounter in a Linux distro. I haven't tried it yet but I may need to in the future, if I expand the services offered by my Epic 4G. I still haven't figured out why the VNC server drops when the screen is turned off, though; I probably need to switch servers. The default is xVNC and I have been using Win7 x64 TightVNC Viewer to access it.
Hello there! Thanks for your posts! After encountering problems while trying to get LAMP to run on Ubuntu 12.04 and 13.10, I had given up LoA, until today. I've been using Linux Deploy instead for the past few months. Everything works fine on it. Have you tried it?
Anyway, I've decided to install LoA Debian as image from now. I think dedicating a 4 GB partition to a Linux installation is costly when you have just 14.7 GB of available storage.
Hello David,
I gave up on Linux on Android because I couldn't get it to stay connected to wifi with the screen off. I went back to using an XMPP server on my OpenWRT router instead.
Thank you for the suggestion regarding Linux Deploy. If I have some time, I will try it.
Does your LAMP stack manage to stay constantly connected with the screen off?
hammmy said:
Hello David,
I gave up on Linux on Android because I couldn't get it to stay connected to wifi with the screen off. I went back to using an XMPP server on my OpenWRT router instead.
Thank you for the suggestion regarding Linux Deploy. If I have some time, I will try it.
Does your LAMP stack manage to stay constantly connected with the screen off?
Click to expand...
Click to collapse
Linux Deploy has options to keep screen on and to keep wifi on while the app is running. I'm not sure if this will help with accessing LAMP when the screen is off. BTW, I found other problems with LoA Debian. So I'm back to Linux Deploy Debian. I'll test LAMP with screen off and let you know how it goes.
Instead of running the web servers through a linux installation, I suggest you try the various web server apps available for Android, if you haven't already, that is. I use Palapa Web Server which is free and has a nice interface.
Unfortunately I was unable to get Apache to work. Anyways, like I said, the Android web server apps might best serve your needs.
davidheis said:
Instead of running the web servers through a linux installation, I suggest you try the various web server apps available for Android, if you haven't already, that is. I use Palapa Web Server which is free and has a nice interface.
Click to expand...
Click to collapse
This is a good suggestion but unfortunately the XMPP server apps that I've tried didn't work out. I don't recall exactly why as it's been awhile since I tested them. They are bare-bones and lack configuration options.
hammmy said:
This is a good suggestion but unfortunately the XMPP server apps that I've tried didn't work out. I don't recall exactly why as it's been awhile since I tested them. They are bare-bones and lack configuration options.
Click to expand...
Click to collapse
Oh, okay. I highly recommend Linux Deploy as the distros are downloaded directly from the official sources. Installing to a second partition is very easy too. And it also allows running of custom scripts during startup of your distro. So if you manage to have XMPP working, you won't have to open a terminal to start the service (which is necessary for apache - have to run "service apache2 start").
Let me know if you have any success with Linux Deploy. I may be working with XMPP in the near future, so having a 'take anywhere' server might prove very useful.
Hello David can you make a brief guide on how to install Kali on sdcards second partition. I'm stuck I don't know how to install the linux.IMG on the ext2 partition, I partitioned my SD card using minitool the problem is when I hit install on Linux deploy the IMG will be installed on the SD card but on the fat32 partition not the ext2, which is the path to ext2 ? I can't find it using file explorer maybe you can help me
EDIT: i need to mount the new ext2 partition right? which is the easiest way to do it?
hi... can you provide me a method to access the filesystem (eg. var, etc....) because in the old ubuntu version is no longer supported. i got 404 not found when try to get update(apt-get update). only one solution is modify etc/resource.list file....but ubuntu cant access the filesystem via termimal
Cifs mount on start? I've added it to fstab and mount -a works fine, but it seems that fstab is not being run on start-up? I tried adding the same line I used in fstab to the custom mount points but it does not like it "skip"' it's probably simple syntax, the mount cmd seems to change dep. on where you run it, anyone know the right way to get a cifs mount on start in ld? thanks..
this is what works in fstab/mount -a
//192.168.1.65/media/Cifs /Public/Video cifs username=user,password=pw,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
Well hello everyone.
I am going to try this now cause Linux deploy failed for me and it also messed up my external sd card (cause my xperia e3 doesn't have that Much internal).
Then i tried complete linux installer normal installation method but that also didn't worked so now i am going to try this.
I know this thread is very old but that's my only chance left for installing Ubuntu in phone
If anyone can provide any advice or any guidance i will be grateful to him
Thanks In Advance

[testers needed]Help]dualboot lg aristo 2 and cv1 Native ubuntu on sdcard plus kali-linux kernel [Help[testers needed]

howdy folks im currently in development of bringing Ubuntu touch and Native Ubuntu to the lge cv1 devices including the Aristo 2, Aristo 2 plus and K8 plus.
Oreo roms only!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
i have had a really hard time trying to bring this too and to be honest most of the work ive done has been Kernel related as Ubuntu touch and Ubuntu need systemd/upstart kernels to boot into the rootfs and beyond.
oreo roms only !!!!!!!!!!!!!!!!!!!!!!
ive also added kali-linux-nethunter support to the kernels as well for all of you ethical hackers that want to use it for protecting yourself from the blackhat hackers out there or a lil bit of both. Duhjoker doesnt judge just compiles the kernels for you.
DUALBOOT
one added benifit is that one kernel dual boots to android and a native Ubuntu rootfs of your choice. both kernels will boot ubuntu touch or ubuntu natively but the second kernel has ubuntu security requirements like apparmor enabled that break android.
Ubuntu Touch
is still in development as im needing a solid system.img. Right now i have been working on an armhf GSI thats also non trebler. the GSI is complete and has vendor built into it but im having trouble getting the lxc container inside the rootfs to start android.
that means no GUI but it will boot into the ubuntu touch rootfs. it will also boot into any ubuntu armhf root file system from ubuntu 14 to 18.
this is where i need help. the system is quite capable of booting to the rootfs and beyond but i cant figure out how to go beyond on the non-UT rootfs.
im including some downloads
a boot.img that has commandline arguments built in to allow you to boot ubuntu from your external sdcard.
dualboota2p.zip that flashes the Kali_NeHunter dualbooting kernel to your boot image
fullubuntukernel.zip which flashes the full ubuntu non-dualboot kernel to the cli modified boot images described above
arm-ramdisk-installer zip that flashes a generic ubuntu ramdisk to your boot image.
a /lib/modules and /boot folder to add to your rootfs that has all the modules needed by the rootfs and boot folder requirements needed like a config and vmlinuz
you will need:::::
cv1 device = aristo 2, aristo 2 plus or k8 plus
32gb or higher (im using a 128gb) external sdcard split into two partition vfat for partition 1 and ext4 for partition 2
an armhf ubuntu root file system of your choice between 14 and 18 or choose a kali rootfs
basic knowledge of linux comnands and setting up a rootfs for ssh and internet
patience and know how
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I AM IN NO WAY RESPONSIBLE FOR ANY
DAMAGE CAUSED TO YOUR DEVICE BY ATTEMPTING THE PRICEDURES BELOW YOUR WARRANTY IS NOW VOID
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
now it seems like a lot of flashing but its to make it easier to get started with dual booting from your external sdcard. And i know some people like to make sure thier boot image matches thier device so the comnandline arguments are
root=/dev/mmcblk1p2 rootwait rw rootfstype=ext4
now to make it easier for you to chroot into the native ubuntu envirinment on your device so you do configuring offline and set things up you will need to add these lines to init.rc under mkdir /mnt/appfuse 0711 root root.
mkdir /linux 0755 root root
mount ext4 /dev/block/mmcblk1p2 /inux rw
that will automatically mount the second partition of your ext4 formatted external sdcard to a folder called /linux in the root of your device as well as make it rewritable.
note: after much experimentation i chose to use init.rc as on oreo any other place i put the commands had no effect.
if you want to try an initd command the kernel and rom support it just add an init.d folder to /system/etc from TWRP RECOVERY and place your script in init.
the following procedure is to build up rootfs
download and copy an ubuntu or kali armhf rootfs.tar.gz to the /linux folder
type these commands into your terminal on your cv1 device
su
cd /linux
tar xvzf your-rootfs.tar.gz
cd /
chroot /linux /bin/bash
export PATH="$PATH:/usr/sbin:/sbin:/bin"
apt-get update
apt-get install build-essential lightdm openssh-server
once thats done setup ssh for your device so when it boots into the rootfs you can use ssh to problem solve and get the GUI working
now you should reference this for how i got the idea and how i got this far.
https://www.reddit.com/r/lgv20/comments/bqp7f3
you will need to compile install and make a service for msm-framebuffer-refresher
add the /lib/modules and /boot zip to your rootfs and grab all your firmware from etc vendor and root and copy them to /lib/firmware of your rootfs
go ahead and grab that kali firmware from the magiskk repo too.
you should already be testing out the dualboot kernel i hope and now you that you have set up lets move to flashing
boot to twrp and flash the provided boot.img or your own modified boot.img then flash the full ubuntu kernel if you like or leave it on the dualboot kernel. now flash the ramdisk installer and reboot
it will go to first lge bootsplash then then bootloader unkock warning then boot to first android lge bootsplash.
you have now booted into the ubuntu rootfs.
But wait theres no GUI
i have mentioned that already.
heres where i need help and testing. i have not been able to go any further as my expertise is lacking. its all there and should work but im not knowledgable enough to solve the problems of getting it up and running.
for some the refresher might do the trick if you get it figured out. for others it might just need ssh into it to startx
im still working on getting the UT rom going and ill post what i have of that too for any of you that want to try and get it going
you can find me ubports porting and @duhjokersinhell on telegram if you need
here is the link to the ubuntu touch images i have compiled. they are a halium-9 ubuntu touch rootfs.img and a hal9 android-rootfs.img. to play around with them just go to twrp and format data making sure its formatted to ext4. then move the images from your external sdcard storage to data. then flash the full ubuntu kernel zip and the ramdisk installer
ssh [email protected]
password = phablet
try to get the lxc container loaded with
sudo mount -o remount,rw /
sudo lxc-start -n android
to get init logs
sudo lxc-start -n android -F -l DEBUG -- /init
ubuntu touch - Google Drive
drive.google.com
need to redo op but look i got it working

[ROM Development] Device Tree / System Image EXT2 instead of EXT4?

Hello Everyone!
I'm trying to develop for the Microsoft Surface Duo. I feel this device has the potential to run other operating systems (like Ubuntu, different versions of Android, Windows, etc.) as the kernel source was released. I've ran into two problems: creating a device tree for the Surface Duo and unzipping the system image. First, the device tree for OS builds was not released. Second, the system image is formatted as an EXT2 file, NOT an EXT4 file, and not as an Android system file that sim2img desires.
I found the system image through two methods:
Finding the payload.bin OTA file and extracting the images there.
Rooting the phone, copying the super.img, and extracting the images.
In both situations running file system.img gives me
Code:
Linux rev 1.0 ext2 filesystem data, UUID=3dc9e73d-c9c2-5764-89e7-0426672bbdb9 (extents) (64bit) (large files) (huge files)
This is for both A and B Partitions. I can't mount ext2 images onto my linux OS (I'm on Kali OS) via mount loop.
Code:
wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
If anyone can give me some insight on what the problem could be, that would be great!

Categories

Resources