Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing gentoo on nexus 7 WiFi 2012 [Work in progress ;]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Wed Aug 20, 2014 8:52 am    Post subject: Installing gentoo on nexus 7 WiFi 2012 [Work in progress ;] Reply with quote

By the by, I'm talking about a nexus 7 WiFi 2012, no GSM, running a Nvidia quad core, not Qualcom, or whatever the 2013 is.

Has anybody else tried this?

I've found the images to install ubuntu from this forum: http://forum.xda-developers.com/showthread.php?t=2011403

The 2 image files can be downloaded here: http://cdimage.ubuntu.com/releases/13.04/release/

Your looking for:
ubuntu-13.04-preinstalled-desktop-armhf+nexus7.bootimg
ubuntu-13.04-preinstalled-desktop-armhf+nexus7.img.gz

(I'll be keeping backup copies, if the ubuntu servers remove them. Anyone with a host at that time can tell me to edit this page :P with a kind donation of file space of coarse :) )

Once they are downloaded, go to fastboot mode on your nexus 7 (power off, then hold power and vol down), plug in usb, and from your computer (with adb installed, and should come with fastboot), issue these commands:

$ fastboot flash boot ubuntu-13.04-preinstalled-desktop-armhf+nexus7.bootimg
...
erasing boot #or too that effect
...
success #or too that effect - omitted from now on :P
...
$ gunziup ubuntu-13.04-preinstalled-desktop-armhf+nexus7.img.gz
...
$ fastboot flash userdata ubuntu-13.04-preinstalled-desktop-armhf+nexus7.img
...
$ fastboot reboot

Now you can unplug your nexus 7, and follow the boring ubuntu (the M$ of linux?) GUI prompts...

However there is the simg2img tool from google, and a make_ext4fs tool, but it's not a regular ext4, it's an android ext4 fs - that will be used by the fastboot command to flash the stupid almost proprietary image to the device. It'd like to drop in either a stage 3 tarball, or a live dvd image, instead of the ubuntu install.

Anyone ever go down this path before me? I've hacked out an esmtp patch that made it into esmtp, and eventually stable gentoo, and now I don't need my own overlay anymore. So I know C/CPP/Anything less complicated then ~some~ assembly. Any tips or ideas? From what I've seen of ubuntu, there is no working tty, and in that case, live minimals, and live CD won't work, need to get into X automagically, at least that's what the ubuntu people do. Anyone else interested in uninstalling android on the "official example of android devices" and getting a real OS on there?
_________________
echo deadram; fortune


Last edited by deadram on Sat Aug 23, 2014 9:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Thu Aug 21, 2014 10:13 pm    Post subject: Reply with quote

A little update, I've managed to crash gentoo at /sbin/init... so basically yah XD lol... the very, very, very start of the computer, except BIOS and kernel. Have a feeling it's because of some missing files from my image due to low memory and other such funnyness when i was preparing the stage3 from unbuntu, on the nexus. good news though, you can prepare a armv7-hardfp stage3 gentoo chroot from ubuntu, get to the point it has wifi, and a few other things ready, and then ftp the tarball over to another computer, to be packed by make_ext4fs, and flashed by fastboot.

I'll be giving it a few more tries today, and if I can get something working, I'll bother to make a whole set of directions.

Ohh, and as an aside, it looks like getty type consoles will work. unbuntu is probably just having trouble managing x-windows, and framebuffer, and getty... or is that the nvidia driver team having trouble? XD Anyways, get ubuntu on your nexus 7, and get into fastboot, and do this: "fastboot erase system ; fastboot erase recovery ; fastboot reboot" You should now crash, gracefully, to a console with working usb keyboard (sorry, no onscreen kb).
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Sat Aug 23, 2014 5:56 am    Post subject: Reply with quote

Seems I've figured it out :) I've got a console at least :)

http://i.imgur.com/XjIDruA.jpg

    What works
  • Boot
  • Init
  • shutdown
  • Most programs
  • mmcblk access
  • usb keyboard
  • tegrafb - framebuffer

    What probably works (untested, but they seem to load the drivers)
  • sound
  • wifi
  • Touchscreen
  • bluetooth
  • power and volume buttons (after a little configuring)
  • cpugov
  • kernel updates (they are possible, but you'll have to figure out the mkbootimg from AOSP)

    What probably doesn't work (These are just guesses, and with enough work, could be fixed)
  • adb
  • android! and android apps too! :)
  • Screen orientation changes
  • screen dimming


So the how-to...

  • Download the ubuntu install for version 13.04 ubuntu-13.04-preinstalled-desktop-armhf+nexus7.bootimg, and ubuntu-13.04-preinstalled-desktop-armhf+nexus7.img.gz
  • Install, following ubuntu directions
  • Once ubuntu is up, and running, open a term
  • type "sudo passwd" to set the root password
  • "su"
  • "mkdir gentoo ; cd gentoo ; tar xvhjf ../Downloads/<stage3>.tar.bz2 ; cd usr ; tar xvhjf ../../Downloads/<portage>.tar.bz2"
  • "cd .."
  • "mount --rbind /sys sys ; mount --rbind /dev dev ; mount -t proc proc proc"
  • "cp /etc/resolv.conf ./etc"
  • "chroot /home/<username>/gentoo /bin/bash"
  • "env-update && source /etc/profile"
  • Now follow the handbook directions until they ask you to reboot... But don't reboot
  • "exit" your chroot
  • "umount -l ./dev ; umount -l ./sys ; umount proc"
  • "cd dev ; cat /proc/partitions" now do a mknod <major> <minor> <mmcblkXpY> for each entry in the partitions info (this is more for if something bad goes down, but you still make it to a limited shell
  • "cd /home/<user>/gentoo ; tar cvzf ../rootfs.tar.gz ./"
  • Upload the rootfs.tar.gz file to your computer, via ftp, scp, or whatever you like


=== Now on your computer (with your nexus 7 tablet in fastboot mode)

  • $mkdir rootfs
  • $cd rootfs
  • $cp ~/pathtorootfsfile/rootfs.tar.gz ./
  • $cd ..
  • $make_ext4fs -s -l 6G -a data userdata.img ./rootfs
  • $fastboot erase userdata
  • $fastboot flash userdata userdata.img
  • $fastboot reboot


Should get into the stage3 gentoo install you setup on ubuntu, just give it a few minutes. I've had trouble with make_ext4fs with -l higher then 6G, so I only get a 6G data partition (even on a 32G nexus device). Also keep in mind to compile make_ext4fs with the -DANDROID gcc option, or funny things seem to happen. make_ext4fs is part of the AOSP too.

I'm going to try to edit the bootimg, and see if I can plop the copy into 'recovery' with system as the rootfs as a basic backup boot... Anyways, this seems to be headed in the direction I wanted :) If anyone wants help setting up gentoo on a Nexus 7 WiFi 2012, just post in this thread I guess?

EDIT ---

Forgot to mention, when your making your stage3 from ubuntu, "cp -a /lib/mod* /home/<user>/gentoo/lib" for your modules.

Also, seems to have trouble with the 2nd bootup. I have a feeling there's some files that the ubuntu bootimg modifies to indicate "installed ubuntu", and if I can edit the initramfs of the bootimg, or make the correct directories for the bootimg to store the "installed" state, that will be fixed :)

EDIT2 ---

Also forgot to grab /lib/fireware from the ubuntu root, and put it into the rootfs.tar.gz on my device. I'm at work now, without computer, so that'll have to wait till later tonight, or tomorrow.

ubuntu comes with an arm abootimg binary, in the bin dir, I believe. You'll want that, and possibly the source, to compile on your computer as well. That can extract the kernel, initramfs, and boot config (basically the cmdline passed to the kernel), and recompress them, into a format fastboot will understand.

I'm starting to think hacking about the ubuntu initramfs isn't going to work, I may grab the AOSP kernel from git, and try to compile a kernel without an initramfs, and boot directly into mccblk0p9 (the userdata partition, at least on my device). I'll have to figure out if the nexus can boot without an initramfs though, since abootimg seems to really want one to drop into the boot record.

FYI, from my digging, it looks like mmcblk0p2 is the "default" boot record. I'm guessing mmcblk0p1 or p4 will be the recovery boot record. It also seems that you can flash a "default" boot.img into the recovery with "fastboot flash recovery boot.img" and boot it up by getting into the bootloader (hold vol down when powering up) and selecting recovery. Probably could also do stuff like "cat boot.img > /dev/mmcblk0p2" from the nexus. That gives us at least a primary boot, and a backup.

Anywho, I'll plug away at it tonight, and see if I can get something booted, and decent.
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
reanimus
n00b
n00b


Joined: 24 Aug 2014
Posts: 4

PostPosted: Sun Aug 24, 2014 3:03 pm    Post subject: Reply with quote

Coincidentally, I just decided I want to do something similar. Do you need a USB-OTG cable?
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Sun Aug 24, 2014 10:04 pm    Post subject: Reply with quote

@reanimus I use the regular USB to micro USB cable from my computer, to the nexus 7 for adb/fastboot. Once in gentoo (unless your in ubuntu with gentoo chroot) you will not have an onscreen keyboard. So a few options, either set-up wifi and sshd on the nexus, and ssh from your computer, or use a USB keyboard. I've got a micro-USB keyboard and carry case combo, but the USB-OTG cable would work too. (if your interested, here's the amazon link http://www.amazon.ca/Black-Leather-Interface-Keyboard-Tablet/dp/B008IBDQ04/ref=sr_1_1?s=electronics&ie=UTF8&qid=1408916670&sr=1-1&keywords=micro+usb+keyboard - works well, but most of the symbols are cluttered on the right side... don't know why these things can't come with a real full keyboard, just micro sized buttons XD)

There's also a dock port, on the opposite side of the power and volume buttons on the nexus 7. It's just 4 gold colored pins about 1cm apart, one side is +5V other is ground, middle are data I'm guessing. Seems to be just an extra usb port, with a proprietary form factor. I'll probably solder some wires to it later on, and see if I can get an extra usb port to use keyboard and charge at the same time.

I believe an unpowered usb hub wouldn't work well, but a powered usb hub, with the OTG cable is probably the best solution for getting say an external HD, keyboard and mouse connected - or anything else that connects by usb to a computer.

---

Also, I can confirm mmcblk0p1 is recovery, and mmcblk0p2 is boot. Both are roughly 10MB in size. mmcblk0p3 is system at a perfect 650MB, and cache is mmcblk0p4 with about 450MB... good enough for a /boot partition, plenty of space for backup kernel images. mmcblk0p9 is the userdata, but the other 4 I'm not too sure.

mmcblk0p7 seems to mount, at 5MB, but I haven't figured out what's in there yet. mmcblk0p5 and p8 are both all zeros, and only 512Kb. mmcblk0p6 seems to be all zeros as well, but 10MB. At least from ubuntu. Might be worth checking them out from rooted android to see if they show anything different.

boot1 and boot2 I'm not sure of either. "hexdump <name> | head" didn't find anything similar to the bootloader.img file from android. I don't want to play too much with it either, don't want to accidentally over-write the bootloader and hard-brick the nexus.

EDIT ---

Got a ubuntu 13.10 kernel to boot gentoo, directly without any initramfs. Seems to be rather unstable though, and it'll take me a while to grab a backup of my gentoo system and restore the old ubuntu install. I noticed once syslog-ng starts, there seems to be a kernel panic (or a lot of text hitting the screen before a reboot). didn't bother reading it, have a feeling ubuntu is using a modified AOSP kernel, and the AOSP kernel is so stupid, as to remove basic function from the real linux kernel.

Anywho, I'll try a gentoo kernel next, and try to see if the tegra chipset will even accept VGA drivers, and the likes, to get basic function from the device.

EDIT2 ---

Had trouble booting with a gentoo kernel. going to give it a few more tries later in the week. Seem to have found a stable kernel/initramfs though. The ubuntu bootimg, and userdata image are different once you install the ubuntu system. So to get a decent gentoo working, install ubuntu, reboot, copy the /dev/mmcblk0p2 partition, extract the kernel and initramfs and config (with abootimg on the ubuntu install), edit the config file to have the kernel boot args you want, and repack with abootimg. Next just install a stage3 on a directory like /home/user/gentoo. then use http://teamw.in/project/twrp2/103 and flash it to recovery... we only need this step to boot into twrp2 and then adb shell from a computer. move the root dir of mmcblk0p9 to a folder named ubuntu, and move the /ubuntu/home/user/gentoo directories to the root of mmcblk0p9. adb shell from twrp2 is root, and if you mount the /system partition you'll probably end up with more tools to play with in the shell.

Don't forget to copy the /lib/fireware and /lib/mod* directories from ubuntu to your gentoo install, or optionally extract the config.gz from /proc/config.gz, and grab the source to the ubuntu 13.10 kernel. Then do a "zcat /proc/config.gz > /usr/src/linux/.config" and a "make modules && make modules_install && make fireware && make fireware_install"

gpm doesn't know how to talk to the touchscreen, but it's there, in /dev/input/event0 ; and "less -f /dev/input/event0" shows data when you press the screen. Maybe xorg will have better support for it?
wpa_supplicant works
backlight dimming works (in /sys)
battery status shows up (in /sys)
didn't try bluetooth, but it should work, most anything that works on the ubuntu install should work, or work after proper set-up.

abootimg source, and kernel source can be gotten from the ubuntu project, just google it :)

Anywho, going to play with my gentoo install for a while, I've subscribed to this topic, so if you need help, post a question, and I'll drop by :)
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
Shiggity
n00b
n00b


Joined: 24 Jan 2009
Posts: 12

PostPosted: Tue Aug 26, 2014 9:29 pm    Post subject: Reply with quote

Okay there're some things I don't quite understand.

1. Which N7 does this work on? The 2012 model? The 2013 model? Both?

2. Why does Ubuntu need to be installed first? Is there not a way to install Gentoo directly? I'd personally want Funtoo but the installation process is pretty much the same (stage 3 tarball and then go from there).

3. Is there a way to get this is all working on a Nexus 10? Its screen size and ultra-high resolution is enticing me. But its price is not. lol

I'd really like a more third party OS friendly tablet, as I don't own a laptop at the moment since it broke on me after 6 years last summer.

I currently have a 2011 release 'fire sale' model 32 GB HP TouchPad and a 2013 LG GPad 8.3. Both great devices, but none of them can easily run anything but their respective stock OSes well. I do own a Nexus 5, but I'd rather keep that my phone and only my phone, and not a tiny tablet. Its screen is too small to even attempt to do what I want to do with something like an N7.

Thanks,
Shiggity
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Tue Aug 26, 2014 10:21 pm    Post subject: Reply with quote

Shiggity wrote:
1. Which N7 does this work on? The 2012 model? The 2013 model? Both?

Code:
$ cat /proc/cpuinfo
...
Hardware: grouper
...


I have the 2012, WiFi (no gps) nexus 7, code name grouper. However it ~should~ work for any nexus, since they all use the abootimg tool, and fastboot tool, and ubuntu seems to work on all of them (but maybe not the 13.10 ubuntu, might have to use newer or older version).

Quote:
2. Why does Ubuntu need to be installed first? Is there not a way to install Gentoo directly? I'd personally want Funtoo but the installation process is pretty much the same (stage 3 tarball and then go from there).

You install ubuntu for 2 reasons.
1) the bootimg they provide to install ubuntu get's changed ~after~ install is completed, and re-written to mmcblk0p2. So really, if you can find where they store the "final" ramdiskfs image, that's all you'll need (plus a working abootimg).
2) It's fairly easy to setup the gentoo chroot for the initial stage3 from ubuntu, and you get working wifi/usb keyboard/onscreen keyboard. Installing twrp2, and using "adb shell" from recovery might work just as well, but I haven't tried it yet. Consider installing ubuntu the step in the handbook where they say "boot the live dvd".

Quote:
3. Is there a way to get this is all working on a Nexus 10? Its screen size and ultra-high resolution is enticing me. But its price is not. lol

Probably, my install directions should work for any nexus (even non-grouper). And as long as something works in ubuntu, it should work in gentoo. I'm using the same kernel at the moment. As far as I know, all nexus use abootimg, and fastboot.

Quote:
I'd really like a more third party OS friendly tablet, as I don't own a laptop at the moment since it broke on me after 6 years last summer.

I believe you have 3 choices, the nexus models from google, since they seems to be halve decent at releasing sourcecode and fireware... halve decent...
The other choice is a windows 8 tablet, with a ~computer~ intel, or amd cpu. I have no experience with these, but that was going to be my choice before I stumbled upon a cheap nexus 7. I've seen a few with working wifi, and touchscreen, etc.. but they do tend to be on the pricy side.
You last option is to go for the cheapest tablet you can find, install term and ssh for android, and ssh into your home computer :P

As an aside, keep twrp2 in mind for when you go to boot gentoo the first time. If you have a 16G or 32G nexus, the ubuntu install image is set to the 8G model. Prep your stage3, then unmount and tarball-compress your gentoo root, boot into twrp2 and use adb to pull the tarball. "adb shell" and then "make_ext4fs /dev/mmcblk0p9" and then push your tarball, and extract to root of mmcblk0p9. That will give you the full 16/32G of your mmcblk0p9 partition.
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
Shiggity
n00b
n00b


Joined: 24 Jan 2009
Posts: 12

PostPosted: Tue Aug 26, 2014 11:16 pm    Post subject: Reply with quote

deadram wrote:
Shiggity wrote:
1. Which N7 does this work on? The 2012 model? The 2013 model? Both?

Code:
$ cat /proc/cpuinfo
...
Hardware: grouper
...


I have the 2012, WiFi (no gps) nexus 7, code name grouper. However it ~should~ work for any nexus, since they all use the abootimg tool, and fastboot tool, and ubuntu seems to work on all of them (but maybe not the 13.10 ubuntu, might have to use newer or older version).

Quote:
2. Why does Ubuntu need to be installed first? Is there not a way to install Gentoo directly? I'd personally want Funtoo but the installation process is pretty much the same (stage 3 tarball and then go from there).

You install ubuntu for 2 reasons.
1) the bootimg they provide to install ubuntu get's changed ~after~ install is completed, and re-written to mmcblk0p2. So really, if you can find where they store the "final" ramdiskfs image, that's all you'll need (plus a working abootimg).
2) It's fairly easy to setup the gentoo chroot for the initial stage3 from ubuntu, and you get working wifi/usb keyboard/onscreen keyboard. Installing twrp2, and using "adb shell" from recovery might work just as well, but I haven't tried it yet. Consider installing ubuntu the step in the handbook where they say "boot the live dvd".

Quote:
3. Is there a way to get this is all working on a Nexus 10? Its screen size and ultra-high resolution is enticing me. But its price is not. lol

Probably, my install directions should work for any nexus (even non-grouper). And as long as something works in ubuntu, it should work in gentoo. I'm using the same kernel at the moment. As far as I know, all nexus use abootimg, and fastboot.

Quote:
I'd really like a more third party OS friendly tablet, as I don't own a laptop at the moment since it broke on me after 6 years last summer.

I believe you have 3 choices, the nexus models from google, since they seems to be halve decent at releasing sourcecode and fireware... halve decent...
The other choice is a windows 8 tablet, with a ~computer~ intel, or amd cpu. I have no experience with these, but that was going to be my choice before I stumbled upon a cheap nexus 7. I've seen a few with working wifi, and touchscreen, etc.. but they do tend to be on the pricy side.
You last option is to go for the cheapest tablet you can find, install term and ssh for android, and ssh into your home computer :P

As an aside, keep twrp2 in mind for when you go to boot gentoo the first time. If you have a 16G or 32G nexus, the ubuntu install image is set to the 8G model. Prep your stage3, then unmount and tarball-compress your gentoo root, boot into twrp2 and use adb to pull the tarball. "adb shell" and then "make_ext4fs /dev/mmcblk0p9" and then push your tarball, and extract to root of mmcblk0p9. That will give you the full 16/32G of your mmcblk0p9 partition.


Thanks for the comprehensive response! If I do end up getting one of the N7s on the market I'll totally try this pseudo-tutorial out. Totally appreciate it.
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Fri Sep 05, 2014 2:44 am    Post subject: Reply with quote

Some more progress. Writing this from firefox 31.0. Apparently there is a bug in older firefox versions to do with arm processors, without neon support. I also spent a week trying to get the touchscreen to work, before going back to the old ubuntu kernel. Apparently that sorted it out, so it looks like I'll be stuck with that kernel for a while.Just built the xf86 open tegra drivers, since the tegra drivers from Nvidia only go to ABI11, and I think xorg was at 15 or so. Have yet to restart Xorg, but the fbdev drivers work fine anyways.

wmaker is running nice and smooth. apart from very tiny places to "click" with the touchscreen, I've yet to run into serious problems. Once xorg and xscreensaver where emerged, and I put 1 min timeout for the dpms setting, the battery problems went away..

I've still to finish emerging lighttpd and mysql, and a few other toys, play with kernels a bit more too. After that I'll get a "minimal cd image" prepared for people to do their own installs.

Have to say though, compared to my 10" netbook, this thing has much more desktop real-estate, if only xorg's evdev driver supported third button emulation on touchscreens. Another project for another day, I suppose. :)

EDIT --

Here's some screens

http://i.imgur.com/lJfhwlo.jpg
http://i.imgur.com/szuc1yd.jpg
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
AaronPPC
Guru
Guru


Joined: 29 May 2005
Posts: 522
Location: Tucson, AZ

PostPosted: Sat Sep 06, 2014 2:33 am    Post subject: Reply with quote

What an interesting project. I have had an Acer A100 for a couple of years, but lost interest in it after I found that it was not very hackable. This might get me interested in tablets again.
_________________
--Aaron
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Sun Sep 28, 2014 8:25 am    Post subject: Reply with quote

A little more progress. Turns out some of my kernel woes were from using the wrong "version". I managed to thin it out about as much as possible, without losing support for drivers. Most of the drivers require kernel options to compile, or to work, but they don't "force require" the options when doing a make [old/menu/gui]config. Also, the opentegra xorg driver won't work with the included GPU driver. - I'll have to hack the wifi, driver at least; it really likes debugging support in the kernel, but who needs that anyways? It's not like the kernel ever has bugs :P Anywho, - while I plug away at thining the wifi driver, I might try to add opentegra support too.

Can't seem to get an android adobe libflashplayer.so to work with mozilla (or apparently, libc) so html5 video is the only possibility for the forseeable future. mplayer2 seems to handle video just fine, except for zoom capabilities (which I expect the open tegra drivers to solve). Goes fine without fullscreen/maximize, but will slow to a crawl if it has to scale the video, and it only seems to be able to scale by doubling the pixels.

Also, the cpu driver can't boot unless the default cpu governor is "userspace", at least till /etc/init.d/local starts. I won't bother with that one though. Much easier to add a script to /etc/local.d to echo governor's into the /sys fs. Besides, I was playing risky altering the frequency so early in boot (by using ondemand,or such, as default).

Finally, you can boot without initramfs. My problem was that I would crash,once "syslog-ng|cronnie|xdm|local" was started by init. Turns out, if you add "consolefont" to the boot rc level, it will set the tty encoding (eg: utf-8) and this was the only important step in the ubuntu initramfs. That one took a few interactive boots into single-user, so I hope someone appriciates it, lol!

You's can expect a "CD" image eventually, but for another couple months you'll probably just have to hack it out yourself :P
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Sun Sep 28, 2014 1:26 pm    Post subject: Reply with quote

amazing progress on this, congrats

I wonder, do you have usb audio output working? (I can see turning
my old nexus 7 into a pretty good sound cenre)
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Sun Sep 28, 2014 10:15 pm    Post subject: Reply with quote

albright wrote:
I wonder, do you have usb audio output working? (I can see turning
my old nexus 7 into a pretty good sound cenre)


I haven't bothered with USB audio, but it should be working. Only 2 problems I've had with the sound card.
1) alsa reports that it supports all sound formats, then a program makes a mono 8000Hz wav file, sound card HW doesn't know what to do with a mono 8000Hz wav file. A little playing around with .asoundrc fixes that.
2) alsamixer has like 500 different options to mute, or unmute, or select channels. It takes some guess work to get the audio working to begin with, but eventually you can manage to unmute the right channels XD I wonder if you'll need to use alsamixer to mute the main speaker and unmute the headphones, or if they use the old mechanical redirect of the output circuit.

Anyways, my kernel has USB audio disabled, but there's no reason it wouldn't work. A USB port is a USB port is a USB port. Send me one of them USB 8-channel recorders, and I'll test it out :)
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
ucbst
n00b
n00b


Joined: 15 Oct 2014
Posts: 1

PostPosted: Wed Oct 15, 2014 8:04 pm    Post subject: Reply with quote

My nexus 7 3g 2012 aka tilapia or nakasig has got a broken touch screen, so I use it on a daily basis with a bluetooth keyboard and console tools (vim, links, ranger etc) from an arch linux chroot where I ssh from a cyanogenmod environment.

Looking for a way to get a snappy X environment where I could work with multiple workspaces at the same time, I figured out a similar procedure to the one you describe, and managed to set up arch linux as a primary os.

Fastboot-flashed the ubuntu image, configured and backed it up, unpacked a clean archlinuxarm tarball into a chroot, installed a wpa_supplicant package, modified the boot partition with abootimg to mount my root fs read-write, booted my cwm recovery, and replaced ubuntu with arch through an adb shell. After a successful reboot, I connected to my network and installed a Xorg/framebuffer/openbox environment which seemed ok in terms of smoothness.

Unfortunately, my setup is useless without a keyboard. On ubuntu, I could get my keyboard to pair but it disconnected immediately. On arch with the ubuntu kernel, neither bluez 5 nor 4 saw any controllers at all. So I reinstalled android. This thread brought me a little more hope; maybe I could repeat your kernel building steps and get bluetooth to work on a real gnu/linux like it does on android?

I still have built no custom kernel and rely on the one from ubuntu. Could you please explain which steps you have taken to build a proper boot image with a gentoo kernel and initramfs? Is there a way for me to reproduce those steps on arch?
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Sun Oct 19, 2014 9:23 pm    Post subject: Reply with quote

@ucbst

If bluetooth doesn't work in ubuntu, I doubt it will work anywhere else. The ubuntu team merged the nexus 7 specific stuff from the android kernel fork, into the vanilla kernel, but they never got everything working. I've tried to test bluetooth by installing bluez and looking for the host device, but no host devices are listed.

There are 2 possible options to get bluetooth working.

1) add the nexus 7 bluetooth code from the android forked kernel, into the ubuntu kernel. This would take time and effort, and some knowledge of the kernel source, and C.

2) Try to use a cyanogen or AOSP android forked kernel for the nexus7 to boot up *nix. I'm not sure if the android kernel will be able to manage to boot into a real OS, but if it does it should already come with the drivers needed for bluez, etc... to work.

What I did for my setup was to use the ubuntu kernel here: https://launchpad.net/ubuntu/+archive/primary/+files/linux-nexus7_3.1.10-10.28.tar.xz

I took the .config file from the proc file system when I was booted into ubuntu, and then thinned it out, removing kernel options and features I don't use. It wouldn't make a difference if you built this kernel, or used the ubuntu kernel, since I've simply removed the kernel options I consider "bloat", but here's the .config: https://drive.google.com/file/d/0B1Bl3m359MOdeGR4ZHR0QXhXSTA/view?usp=sharing

Keep in mind, you need to set the console font before starting any tty's, since my kernel doesn't use an initramfs (in abootimg I specify the ubuntu initramfs, but it's never loaded by my kernel). In gentoo you do this by adding "consolefont" to the boot rc run level. ie:

# rc-config add consolefont boot

PS: Sorry for the late reply., ask away if you need more help :)
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
reanimus
n00b
n00b


Joined: 24 Aug 2014
Posts: 4

PostPosted: Fri Feb 20, 2015 9:17 am    Post subject: Reply with quote

Are you still about? Any updates on it?
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Sat Feb 21, 2015 11:10 am    Post subject: Reply with quote

havn't been doing much with it, got an ota cable aand usb hub for keyboard and mouse, and figured out how to dual boot android with a bash script and teamwin recovery. working on a remote controle lawnmower atm. It's been stable enough, but you need to unmask a lot of packages, and every few updates you need to work extra hard to fix dependancy problems.
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Feb 21, 2015 1:07 pm    Post subject: Reply with quote

Nice work. Can we see that asoundrc you mentioned?
Back to top
View user's profile Send private message
reanimus
n00b
n00b


Joined: 24 Aug 2014
Posts: 4

PostPosted: Sun Feb 22, 2015 2:07 am    Post subject: Reply with quote

Did you ever try using the gentoo-sources to try to boot with?
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Tue Feb 24, 2015 10:20 pm    Post subject: Reply with quote

reanimus wrote:
Did you ever try using the gentoo-sources to try to boot with?


I tried a few builds, but the config file for android, or unbuntu are much different then the gentoo config, and I never got a successful boot. I'd guess you'd have trouble getting wifi and the touch screen to work too, and maybe a few other drivers. You probably have to hack in some of the ubuntu kernel into the gentoo-source to get everything working, and the ubuntu kernel is a little hackish to begin with. They left out a lot of dependancies that show up either durring build of the kernel, or worse, at boot up. for instance wifi requires a bit of the debuging code, but if you enable wifi, you can still disable the debug code, and at build/linkntime, the wifi code can't find the debug functions.

--- EDIT ---

Code:
 # cat /etc/asound.conf
pcm.!default {
        type plug
        slave {
                pcm "hw:tegrart5640,0"
                channels 2
                rate 48000
        }
}

ctl.!default {
        type hw
        card tegrart5640
}


This should be all you need to get sound working for all users. Well,you have to play a bit with alsamixer too, and find the right channels to unmute. Updated March 17, 2015.
_________________
echo deadram; fortune


Last edited by deadram on Tue Mar 17, 2015 10:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
reanimus
n00b
n00b


Joined: 24 Aug 2014
Posts: 4

PostPosted: Mon Mar 16, 2015 12:00 am    Post subject: Reply with quote

Dang. I was hoping to go as Gentoo as possible. I'll see if I can get the gentoo-sources booting (and if I do, I'll post a config. :) )

Alternatively, did you ever figure out a good way to charge while the USB keyboard is plugged in? :S
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Mon Mar 16, 2015 6:44 am    Post subject: Reply with quote

reanimus wrote:
Dang. I was hoping to go as Gentoo as possible. I'll see if I can get the gentoo-sources booting (and if I do, I'll post a config. :) )


sweet, even if you can just get booted, it would be a step in the right direction ;) I'd recommend looking at the ubuntu, or the android config file too. I have a funny feeling these android devices need something funny turned on. not sure what though.

Quote:
Alternatively, did you ever figure out a good way to charge while the USB keyboard is plugged in? :S


cut a usb cable, and solder the +5 and ground to your pogo-pins, on bottom right (if power button is top left). If you google it, there are directions for what wire to connect to what pin. Doesn't charge well with something in the micro-usb port, since the nexus is powering the device. I turn off wifi with the volup button (emerge acpid, and play with it), have the screen blank with the power button, and unplug the keyboard... at least when doing cpu intensive operations.

Using the cpu scaling ~does~ help battery time, but not much, so when I emerge firefox, I do it with a full battery, all dependances already merged, and a 2G /swap.img file mounted as swap, along with the original charger, in the microusb port. Playing a game on android atm, but I'll post a few scrpits I wrote, for battery, and button related stuff, if you want.

--- EDIT ---

Forgot to mention, anything 'RAM' intensive, or 'HD' intensive is what really eats your battery, at least from what I can tell. That's why cpu scaling might help a bit, but not a lot, and why a long emerge can drain the battery, even when plugged in, with cpu scaling turned on.
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
deadram
n00b
n00b


Joined: 20 Dec 2006
Posts: 44

PostPosted: Thu Mar 19, 2015 6:34 am    Post subject: Reply with quote

sorry it took so long, google drive got an update that disables it unless you use chrome... or something... anyways
https://docs.google.com/file/d/0B1Bl3m359MOdc1BqelZ4M0dNS3c/edit?usp=docslist_api

should have my battery, cpufreq, and acpid scripts. It's up to yous to read them, and understand what each does :P

battery_mon I use with wmswallow on wmaker, It does a 5 min shutdown at 25% and a shutdown now at 5%... if I remeber correctly.

--- EDIT ---

Waiting on icedtea to finish it's second build, been about a day so far, but I did manage to get adb, and fastboot working. Used it to try to install ubuntu on a new nexus 4 I picked up (nexus 7 with gentoo and an OTA cable, using fastboot and adb to alter the nexus 4). By the by, don't bother trying the nexus 4 with ubuntu :P Anywho, might end up with gentoo on the poor thing, and hopefully a working phone in the end XD

Once icedtea finishes, I'll check to see if arduino and android sdk works too.

--- edit 2 ---

icedtea finished, but android sdk will have to wait till I figure out how to make a swt.jar arm file, and I forget what the latest arduino version was complaining about... by the by, to be OS independent, write good c/c++ code, not bloatware. gcc complies 4 times, before icedtea compiles once. Assuming you don't run into compile time problems... then add all the .jar dependancies, that are os dependant... ?!?!?! why is java even around anymore... ?!?!?!

anywho, nexus 4 has ubuntu/cyanogen dualboot. root you nexus 4, install cyanogenmod (so you don't have to update to android 5.x) get dual boot ubuntu working, boot into cyanogenmod, and from term 'null' the root password

Code:
$ cd /data
mkdir tmpsys
mount -o loop -t ext4 ./system.img ./tmpsys
cd tmpsys/etc
vi shadow


then erase that asterix, and save, reboot to recovery (ie: ubuntu). That's where I'm at. going to try a stage 3 tomorrow. Also, passwd doesn't work as root, so once you null the password, anything with a terminal can be root (ie: be careful now)

Ohh, and follow the ubuntu dualboot direction, and install the ”ubuntu_umc/14.04” version, if you want a terminal anyways :P
_________________
echo deadram; fortune
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum