Page 1 of 8 123 ... LastLast
Results 1 to 10 of 72
Like Tree2Likes

Thread: Gentoo in a chroot (step-by-step instructions)

  1. #1
    Resident
    Join Date
    Apr 2011
    Posts
    539
    Thanks
    31
    Thanked 92 Times in 43 Posts

    Gentoo in a chroot (step-by-step instructions)

    If you want to convert your Adam into a functioning Linux computer, with all the usual linux software, while retaining your Android ROM, dive in. This is an update of my previous Ubuntu in a chroot, now abandoned.

    What you need upfront:
    • Some basic familiarity with Linux
    • An external USB keyboard or a keyboard case (like this one)
    • An external SD card with several GB free (the chroot is 4GB), formatted in ext4 or other Linux-friendly filesystem
    • Honeycomb ROM (with earlier ROMs, the CTRL key and other special keys aren't recognised)
    • Preferably, a Linux computer to do some of the following steps on.

    I recommend mounting the external SD card on the computer (with a USB cardreader). Now, download the chroot environment, which I have split into three parts: 1, 2, 3. Save them to the same directory, and on linux, as root (thanks James), from that directory, do
    Code:
    cat gentoo.tar.bz2_* >> gentoo.tar.bz2
    cd /media/sdcard
    tar jxvf /path/to/gentoo.tar.bz2
    (where you replace the path to the sdcard, and the path to the tar.bz2 file, with whatever is appropriate). The file size of the gentoo.tar.bz2 file is 864563147 bytes. If you get less, one subpart didn't download fully. The individual subpart file sizes should be 314572800, 314572800, 235417547 bytes respectively (if I remember right). You need to be root for the permissions to come out right.

    Now download this script. You will want to save it somewhere, either on the external sdcard (I put it in the "bin" subdirectory on the external card) or internally on the Adam. But first read the comments and change what you need to -- in particular, the mount point of the external SD card. After saving it, do
    Code:
    chmod +x chroot_gentoo
    to make it executable.

    Finally, you need a VNC viewer. The "Android VNC viewer" (version 0.5.0) on the market is the best of the lot and is free, but it still doesn't seem to handle control keys correctly, even on HC. So use this patched APK instead, which works for me. (The patch is from here -- thanks for the reminder, androq.)

    Final caveat: the external SD card must be mounted with executable permission. I find that, with AdamComb 0.3, sometimes it does not get mounted at all, and sometimes it gets mounted without execute permission. So, depending on whether it is mounted already or not, do one of the following from the terminal (after becoming root with "su"):
    Code:
    mount -t ext4 /dev/block/vold/179\:17 /mnt/external_sd
    or
    Code:
    mount -o remount,rw -t ext4 /dev/block/vold/179\:17 /mnt/external_sd
    Now, from the terminal, as root, simply do
    Code:
    /mnt/external_sd/bin/chroot_gentoo
    (change the path to where you saved the script). If all went well, you should get a root shell inside the chroot. Finally, type
    Code:
    vncserver -localhost -geometry 1024x560
    and from the VNC viewer, connect to localhost on port 5901 with password 12312312. You should get an XFCE desktop. Have fun.

    More points:
    • The VNC viewer has various options for mouse/touchscreen behaviour, via menu->input mode (since the touchscreen is not a mouse, and needs to emulate one). I find the "mouse pointer control mode" option the best, as far as the touchscreen is concerned (I haven't tried an external mouse).
    • The geometry above (1024x560) is to make space for the HC menubar at the bottom. If you have disabled that menubar, use 1024x600. If you use anything larger, you will need to scroll around, but it will still work.
    • Already installed are gcc 4.4.6 and 4.5.3 (including g++, gfortran, and gcj-4.5.3); python 2.7; vim; emacs; firefox 6; midori (lightweight browser); inkscape (vector graphics); abiword (word processor); gnumeric (spreadsheet); octave (Matlab-like scientific package); and much else. All of these were compiled from portage. Also installed is libreoffice 3.4.3.1, compiled manually and installed in /usr/local/lib (programs are in /usr/local/lib/libreoffice/program). There are menu entries for everything except libreoffice, which you will need to start from a terminal (but it works).
    • The portage tree is installed; do "emerge --sync" once in a while to keep it up-to-date. You will find that many portage programs are "masked" for arm. Simply unmask them and the majority will install fine. The "autounmask" program (already installed) should help with this.
    • Some programs (notably firefox 6) exhaust memory when compiling from source. If you run into that situation, you will need to enable swap space (which I think is a good idea anyway(*)). For that, you need a kernel that supports swap space. The ROM I currently use is here; it is Adamcomb 0.3 with my custom kernel. The kernel is built from the NI tree with an additional fix for touchscreen freezes, and enables swap, but otherwise uses the same config as the kernel that comes with Beast 2.2.1. It was built on my Adam, with gcc 4.5.3. Make a swapfile on one of your internal or external filesystems (using, eg, "dd"), of 512MB or 1GB size; set it up with "mkswap /path/to/swapfile" (needs to be done only once) and use "swapon /path/to/swapfile" to activate it (needs to be done after every reboot -- you can put it in the boot scripts). I have one swapfile in /data and one in /mnt/sdcard, and activating both seems to improve memory-crunch situations without any bad effects.
    • The compiler defaults to 4.4.6 right now, but I think it should be harmless to change it to 4.5.3.
    • To modify vnc settings, dig into /root/.vnc
    • I could not get regular user accounts to access the internet. I have a workaround where I have an account with my regular user name (rsidd) but uid 0, so I have root permissions.
    • Probably other things that I have forgotten...
    (*) About swap space: James expresses the concern that using flash memory for swap space may wear it out, since flash memory supports only a limited number of rewrites. I think in practice this shouldn't be much of a concern, since (a) flash for many years now supports well over 100,000 writes, and (b) it has write-levelling characteristics so that your writes will in practice be distributed all over the disk. Still, if you are nervous, or if you habitually drive your device to swap furiously, you may want to put the swap file on the external SD card, so that you can easily replace it if it wears out...
    Last edited by rsidd; 09-06-2011 at 08:34 AM. Reason: further comments
    noci likes this.

  2. The Following 8 Users Say Thank You to rsidd For This Useful Post:

    BorjaB (09-15-2011), Edam (09-06-2011), james.e.bucher (09-06-2011), maxswam (09-07-2011), mbmad (09-04-2011), paronnax (09-04-2011), sahakar (09-06-2011), Stef (09-12-2011)

  3. #2
    Regular
    Join Date
    Apr 2011
    Posts
    125
    Thanks
    37
    Thanked 4 Times in 4 Posts
    Thanks for the wonderful effort. I will give it a try.

  4. #3
    First Post
    Join Date
    May 2011
    Posts
    1
    Thanks
    4
    Thanked 0 Times in 0 Posts
    "Thanks for the wonderful effort. I will give it a try."

    You can make a mini video hello Thanks

  5. #4
    Administrator twospirits's Avatar
    Join Date
    Apr 2011
    Location
    NYC
    Posts
    646
    Thanks
    315
    Thanked 67 Times in 32 Posts
    Nice

    We are the Android, we will assimilate you.
    Want to make this place better, just ask the staff. Remember, the "No' is always there, you are just looking for the "Yes".
    Members, please read the Guidelines otherwise Banlandia awaits.

    Find me on Google + or twitter

  6. #5
    Member
    Join Date
    May 2011
    Posts
    5
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Thanks rsidd, followed your instructions to the letter, and got Gentoo up and running on my adam within an hour.

    I've still got to play around with the swapfiles, but it's all looking pretty smooth at the moment.

    Really appreciate your (and any others) work on this mate. Get your donation link setup, and I'll buy you a drink.

    Cheers,
    Com
    Last edited by ComplexEvent; 09-03-2011 at 09:55 AM.

  7. #6
    Resident
    Join Date
    Apr 2011
    Posts
    539
    Thanks
    31
    Thanked 92 Times in 43 Posts
    Quote Originally Posted by ComplexEvent View Post
    Thanks rsidd, followed your instructions to the letter, and got Gentoo up and running on my adam within an hour.
    Good to know!

    Quote Originally Posted by ComplexEvent View Post
    Really appreciate your (and any others) work on this mate. Get your donation link setup, and I'll buy you a drink.
    If we meet in real life, a beer is welcome, but I'm not looking for donations The hard work was done by MrGuy and others on TR, for getting a usable honeycomb on Adam.

  8. #7
    Member
    Join Date
    Jun 2011
    Posts
    16
    Thanks
    3
    Thanked 2 Times in 2 Posts

  9. #8
    Resident
    Join Date
    Apr 2011
    Posts
    539
    Thanks
    31
    Thanked 92 Times in 43 Posts
    Yes, that's right. Thanks for the link. I had downloaded the patch a while ago, but lost track of it and didn't feel like digging up the reference again.

  10. #9
    Member
    Join Date
    Jun 2011
    Posts
    16
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Btw, I revamped ctrl, esc, F key handling in ConnectBot for a common Android version out there. The key was to use keyboard scancodes, ditching stupid Android keycodes (no keysym for Esc until version 3.0, heh? Do they compete with Apple who can postpone adding the most basic features until the highest version of their products?). I happen to have the same keyboard case as you, and keycodes for Esc/LCtrl are standard. For RCtrl, it's not PC kbd standard, but matches that of AC100 (see comments to https://github.com/kruton/connectbot/pull/3), so I guess it's another "standard" for embedded keyboards out there.

    With that, and setting TERM to vt100, I get pretty nicely working terminal (tested with Midnight Commander). Last thing left is removing power button handling from F4/End keys, that needs to be done on system keylayout level. And well, then need to add xterm mouse emulation to ConnectBot ;-).

  11. #10
    Resident
    Join Date
    Apr 2011
    Posts
    539
    Thanks
    31
    Thanked 92 Times in 43 Posts
    Androq - I'll take a look. Perhaps the same can be done to the VNC viewer to get it to work in froyo. (It's not entirely satisfactory now even in HC: alt-tab switching only works between two windows, and there are occasional issues with using shift and an uppercase letter -- it doesn't seem to register the keyrelease, and the letter repeats. I need to understand all this better.)

    If the terminal program can also be fixed that would be great too, but the one I use isn't open source -- do you know of one that is?

Page 1 of 8 123 ... LastLast

Similar Threads

  1. How to install Folio3x step by step
    By nyarla in forum Folio ROM Development
    Replies: 13
    Last Post: 04-27-2012, 12:27 AM
  2. Step by Step video on how to hack the Nook Tablet by Albert Wertz
    By AlbertWertz in forum Nook Tablet General Discussion
    Replies: 8
    Last Post: 01-23-2012, 07:33 PM
  3. tun.ko and step by step approach to use vpn on FolioMod 1.4
    By kishtyle in forum Folio ROM Development
    Replies: 0
    Last Post: 10-13-2011, 04:25 AM
  4. Using Gentoo to Build the NI Kernel
    By jalto in forum Adam Frequently Asked Questions
    Replies: 1
    Last Post: 07-23-2011, 09:04 AM
  5. Transformer Accolade, can NI step up?
    By lefloresg in forum Adam General Discussion
    Replies: 1
    Last Post: 07-18-2011, 03:59 PM

Search tags for this page

android chroot gentoo
,
android gentoo chroot
,

gentoo android chroot

,

gentoo chroot

,

gentoo chroot android

,

gentoo on android

,
gentoo on android tablet
,
install gentoo on android tablet
,
shmget failed error 38
,
xfce gdk-warning **: shmget failed: error 38
Click on a term to search for related topics.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •