Welcome, Guest

Author Topic: Gentoo [26 April 2018] [now with binary repo and f2fs]  (Read 3054 times)

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Gentoo [26 April 2018] [now with binary repo and f2fs]
« on: November 20, 2017, 07:13:26 PM »
Hi all, I am new here!

I have built a Gentoo image for Teres 1. It runs the amazing LXDE, has chromium, latex, libreoffice, vlc, etc.

It is fun to build, even though it is a rather long process and there are quite a few complications. I set up a repo with the configs and the local overlay:
https://github.com/khumarahn/teres1-gentoo
(there is a torrent with a pre-built image if you want to try it out)

P.S.: is this the first community image for Teres? :-)
« Last Edit: April 26, 2018, 08:03:07 PM by khumarahn »

zinoviev

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Gentoo!
« Reply #1 on: November 22, 2017, 08:31:16 PM »
This is great! What was the biggest difficulty?

BTW, the users of Chromium who care about their privacy should try Brave (https://brave.com/).

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Re: Gentoo!
« Reply #2 on: November 22, 2017, 09:25:25 PM »
Nothing was particularly difficult. It's just many smaller things.

Like setting up a cross tool chain, distcc, qemu, figuring out what works and what does not.

Specific things were: battery indication, disabling the keyboard when the lid is closed, setting up vdpau. I still do not know how to set up the audio so that with the headphones plugged in, there is no sound on the speakers.

There is quite a lot information available on the internet, for example for pine64 and cubieboard. It was really helpful.

There is quite a lot of browsers. Why Brave?

d3f

  • Newbie
  • *
  • Posts: 11
  • Karma: +1/-0
Re: Gentoo!
« Reply #3 on: November 22, 2017, 10:00:42 PM »
Thanks for that image! It's really fast and a lot more suitable for such laptop than ubuntu mate in terms of lightweight OS.

I only have that problem with the touchpad(left click = right click, no right click) but I guess it doesn't depend on the linux distribution so I am waiting for new keyboard firmware.

-L
 

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Re: Gentoo!
« Reply #4 on: November 22, 2017, 10:30:35 PM »
I found that I forgot to save/restore the sound on suspend. Arghhh. It is not enough to rebuild the image, but if you downloaded it and would like to fix it, then change two files:
/etc/acpi/actions/suspend.sh and /etc/acpi/actions/powerbtn.sh
They should be as here:
https://github.com/khumarahn/teres1-gentoo/blob/master/etc/acpi/actions/
Related commit: https://github.com/khumarahn/teres1-gentoo/commit/89417d6514e38ce4384b6242f0967664c1df6122

P.S.: There is a thread here on the touchpad buttons. I had this problem and, at least in my case, it was hardware. Wasn't difficult to solve, but I used a soldering iron + hot air station, which you may or may not have. Look into the topic, try the diagnosis with a multimeter.

P.P.S.: Can it be that haveged helps wifi? I have strange problems, sometimes cannot connect to eduroam, and later it works perfectly with the same config. The signal is very strong and numerous other devices work well.

d3f

  • Newbie
  • *
  • Posts: 11
  • Karma: +1/-0
Re: Gentoo!
« Reply #5 on: November 23, 2017, 08:43:31 PM »
So, what do you suggest? Should I burn the image again on the sd card and fix it then or I can only fixed these files directly.

In fact I just now realized that I don't have audio :-) even after shutdown/restart. It was there initially.

-L

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Re: Gentoo!
« Reply #6 on: November 23, 2017, 09:01:38 PM »
uh, no need to burn the image again.
to get the sound back, open the terminal and:
1. become root (root password was "olimex"):
# su -
2. download the sound state:
# wget https://raw.githubusercontent.com/OLIMEX/DIY-LAPTOP/master/SOFTWARE/A64-TERES/blobs/asound.state
3. apply it:
# alsactl -f asound.state restore

To fix this sound loss on suspend, you can run (also as root):
# cd /etc/acpi/actions
# rm powerbtn.sh suspend.sh
# wget https://raw.githubusercontent.com/khumarahn/teres1-gentoo/master/etc/acpi/actions/powerbtn.sh
# wget https://raw.githubusercontent.com/khumarahn/teres1-gentoo/master/etc/acpi/actions/suspend.sh
# chmod 755 powerbtn.sh
# chmod 755 suspend.sh

I will update the image also :-)
« Last Edit: November 23, 2017, 10:39:42 PM by khumarahn »

d3f

  • Newbie
  • *
  • Posts: 11
  • Karma: +1/-0
Re: Gentoo!
« Reply #7 on: November 23, 2017, 10:00:32 PM »
Great! Thanks, it works  8)
« Last Edit: November 24, 2017, 08:40:40 AM by d3f »

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Re: Gentoo!
« Reply #8 on: November 24, 2017, 01:08:29 AM »
cool, thanks, fixed. Also, you may want to rebuild the LED control program, it had an annoying bug fixed. Just run as root:
emerge -av teres1-ledctrl
(and later maybe cleanup the disproportionately large download by running rm -r /usr/portage/distfiles/*)

I uploaded a new version where these things are fixed.

d3f

  • Newbie
  • *
  • Posts: 11
  • Karma: +1/-0
Re: Gentoo!
« Reply #9 on: November 24, 2017, 09:06:35 AM »
did it! thanks!

Something that I tried and you may help here, should be easy cause I did it under ubuntu mate.

I am really interested to install kicad on teres but on Gentoo I am not sure how to fix the dependencies below:

Code: [Select]
emerge -av kicad

emerge: there are no ebuilds to satisfy ">=dev-libs/boost-1.61[context,nls,threads,python?,python_targets_python2_7(-)?,-python_single_target_jython2_7(-),-python_single_target_pypy(-),-python_single_target_pypy3(-),-python_single_target_python3_4(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),python_single_target_python2_7(+)]".
(dependency required by "sci-electronics/kicad-4.0.7::gentoo" [ebuild])
(dependency required by "kicad" [argument])

I resolved that under ubuntu by adding temporary the debian repos. Mainly the problem here is how to install the correct python version.

Many thanks!
-L

LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1713
  • Karma: +43/-2
Re: Gentoo!
« Reply #10 on: November 24, 2017, 09:44:16 AM »
About what you mentioned earlier for the audio:

Quote
I still do not know how to set up the audio so that with the headphones plugged in, there is no sound on the speakers.

Check what we uploaded here, it was missing previously:

https://github.com/OLIMEX/DIY-LAPTOP/tree/master/SOFTWARE/A64-TERES/teres1-audioselect

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Re: Gentoo!
« Reply #11 on: November 24, 2017, 12:12:31 PM »
With kicad on gentoo, it seems to be OK with python, but it required boost built with context support, which is masked by default:
Code: (/usr/portage/profiles/arch/base/package.use.mask) [Select]
# Sergey Popov <pinkbyte@gentoo.org> (27 Dec 2013)
# Mask because Boost.Context library does not work on most of arches
dev-libs/boost context
(you can see this if you do emerge -pv boost, then the context use flag with be in parenthesis, i.e. most probably masked)

You can install kicad by first unmasking context:
Code: (/etc/portage/profile/package.use.mask) [Select]
dev-libs/boost -context

Then emerge -av kicad complains about keywords and use flags, so add a few likes to respective files:
Code: (/etc/portage/package.keywords) [Select]
# kicad
sci-electronics/electronics-menu amd64 ~amd64
sci-electronics/kicad amd64 ~amd64
(this allows use of the versions which are stable or testing for amd64)

Code: (/etc/portage/package.use) [Select]
# kicad
sci-electronics/kicad examples github
x11-libs/wxGTK opengl
dev-libs/boost context
dev-python/wxpython opengl
(not sure if you want kicad with examples and github support though)

Then emerge -av kicad works, though it may take quite some time and you need a lot of disk space (roughly 2.5 GB for build, 2.5 GB for the installed files, 500MB for the source files archives. I mounted /usr/portage and /var/tmp/portage out on a large and fast sd card so I can build large packages.

And after all this, kicad may or may not work :-) Let me try to install it, I will write back.

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Re: Gentoo!
« Reply #12 on: November 24, 2017, 04:03:55 PM »
Kicad works, here is the noisy inductor:


d3f

  • Newbie
  • *
  • Posts: 11
  • Karma: +1/-0
Re: Gentoo!
« Reply #13 on: November 24, 2017, 05:37:47 PM »
WOW! Magic  :D

Can you share step-by-step how to install kicad on Teres? I think it will be very useful and may be we can move this discussion into new topic - Kicad on Gentoo..

-L

khumarahn

  • Newbie
  • *
  • Posts: 46
  • Karma: +6/-0
Re: Gentoo!
« Reply #14 on: November 24, 2017, 06:00:03 PM »
You need to make changes to files in /etc/portage/, as in https://www.olimex.com/forum/index.php?topic=5966.msg24472#msg24472

Then run emerge -av kicad, and let it work for a few hours. Set up distcc on a big computer if you want to speed it up.

You may run out of space, so if you are running on an sd card, you should use 16 gb or larger, and resize the system partition (with gparted for example).