Sunday, August 28, 2011

Rewrite: How to use USE and Gentoo dependencies support

Good morning ladies and Gentoo-men. For today's mental exercise you are instructed to prove the Pythagorean Theorom

Editors Note: This is a rewrite to address some things in the previous version and make it more informative.

At one of the last LUG meetings I attended; a discussion with one user of Slackware turned up the topic of dependencies. In Slackware AFAIK since I have not used it in several years you get what Patrick Volkerding gives you.
I have not seen a way to do this with Debian or other distributions and it is one of the ways Gentoo is unique.

In Gentoo dependencies are pulled in by USE flags in several ways. In /etc/make.conf they are enabled on a global basis. This means when they are defined here every package on the box that can support that flag will be compiled with support in your application. Let's take some real world examples.

The pam USE flag adds support for pluggable authentication modules and I suspect that it is enabled on every Gentoo profile. ipv6 since it is all the rage and brings many new features to networking as well. However there have been some issues with ipv6 and my router (the communications point for the home network) does not support it. So making use of the global properties as in the following line removes support system wide without having to do it on a package by package basis which is currently done by hand. Instead just add this to /etc/make.conf

USE="-ipv6"

Initial system flags on Gentoo installations are determined by the system profile which is set through 'eselect' To view or set your profile is as easy as running the following command in your shell. Here I have selected the AMD64 Gnome desktop profile as is indicated with the *

localhost david # eselect profile list
Available profile symlink targets:
[1] default/linux/amd64/10.0
[2] default/linux/amd64/10.0/desktop
[3] default/linux/amd64/10.0/desktop/gnome *
[4] default/linux/amd64/10.0/desktop/kde
[5] default/linux/amd64/10.0/developer
[6] default/linux/amd64/10.0/no-multilib
[7] default/linux/amd64/10.0/server
[8] hardened/linux/amd64
[9] hardened/linux/amd64/selinux
[10] hardened/linux/amd64/no-multilib
[11] hardened/linux/amd64/no-multilib/selinux
[12] selinux/2007.0/amd64
[13] selinux/2007.0/amd64/hardened
[14] selinux/v2refpolicy/amd64
[15] selinux/v2refpolicy/amd64/desktop
[16] selinux/v2refpolicy/amd64/developer
[17] selinux/v2refpolicy/amd64/hardened
[18] selinux/v2refpolicy/amd64/server


Changing your profile greatly affects the packages installed on your system and should be done likely only once.

In order to tailor a system and only install the applications you want you can specify USE flags on a per package basis
Create the file /etc/portage/package.use if it is not there already and add your per-package Use flags there. Here is a short listing from mine on a new build adding gallium, llvm, gles support for mesa. As well as the ones I set for some mail programs, X etc.

##Global flags are set by the profile too
localhost david # cat /etc/portage/package.use
sys-devel/llvm llvm-gcc udis86
media-libs/mesa gles
sys-devel/gcc lto objc objc++ objc-gc
dev-cvs/git emacs cvs subversion gtk
dev-libs/udis86 pic
sys-libs/pam audit
app-portage/eix sqlite tools optimization
# For courier-imap support
net-mail/courier-imap -ipv6 gnutls
net-libs/courier-authlib vpopmail
# To satisfy lxde-meta
x11-libs/cairo X
x11-libs/pango X
sys-fs/udev extras
# add gnome-keyring support to gnome-base/gvfs
gnome-base/gvfs gnome-keyring
# X for freetype
media-libs/freetype X
#and I add what I want to satisfy dependencies
gnome-base/gconf policykit
sys-auth/consolekit policykit


At present I can ssh in from the random host so progress ;-) Installing via ethernet but plan to wireless the new build soon.

As to the topic by manipulating the file package.use and editing the USE line in /etc/make.conf you can tailor your Gentoo install. Running emerge -vp world or system will show you how dependencies are set on your system now and you can tailor your system and achieve a more stable host since by eliminating unneeded dependencies one can eliminate bugs that might be pulled in by them.

You may wish to run eselect profile set $ where $ is the value your system supports and see what emerge -vp world will show on different profiles but remember where you started so you can set it back if you don't wish to change anything. Proper building steps would include first choosing a profile then editing USE in /etc/make.conf and package.use to achieve fine grained control over dependencies on Gentoo linux.

Thursday, April 7, 2011

Linux wireless

I've written about some of what works for my hardware. 2 boxes currently running Gentoo.Network manager has never worked for me on either of these. Gentoo bug #345143 I had no luck trying to setup Gentoo and wireless as it is currently documented.

For me what worked was using instead 'emerge -vp iw wireless-regdb crda' and configuring wpa thru wpa_cli wpa_passphrase and two files /etc/wpa_supplicant/wpa_supplicant.conf and /etc/conf,d/net

As of version Connman 0.70 it does load the card properly but when it does it loses the routing table and I would have to add it each time I start up connman. ;-( Guess I could add it to local till they get it fixed or I find out what is the issue and then emerge gconnman and actually have a gui for networks. It also over writes /etc/resolv.conf without regard for using the nameservers provided by dhcp

I've a half completed application for arch tester. Got halfway and just not sure I want to dedicate the time. Also wondering what restrictions would come with actual association. Even generated a gpg key so I could sign email. I do like contributing but in actuality my profession and family life come first. Dedicating 20+ hours a week on a consistent basis is not likely. Could certainly host on a dedicated ip cheaply enough and give others access to the hardware on a speedy connection at times As is flameeyes power usage and my own high electric bills make me think twice about even running so much hardware.

In fact updating my pc's and a slight rate reduction last month dropped $80 from my utility bill this month. Modern hardware is providing more computing power at far less energy cost. One would think there would be new pc's flying off the shelf in the low and mid-range. This Coding Horror blog shows an energy reduction of 75% for hardware purchased today versus that purchased just 5 years ago.

Wednesday, March 9, 2011

Random progress

So now the hard drive has been moved to it's new home. A dual core pentium 4 and it lives further on sata2

I had run about 9 passes of memtest 86 and have done an emerge -e system since then. Everything is pretty stable.
Did have a bug report but this was an issue that occurred long before moving to this hardware but bug-buddy was
unable to report due to the keyboard failing to work when nautilus crashed. After moving from Nvidia/AMD 64 to radeon/dual core P4 I was able to type in my email address which was preventing the crash report.

The ATI TV 650 reports as

02:00.0 Multimedia controller: ATI Technologies Inc Device 4d51
Subsystem: ATI Technologies Inc Device b041
Flags: bus master, fast devsel, latency 0, IRQ 11
Memory at ff400000 (64-bit, non-prefetchable) [size=1M]
Memory at dc000000 (64-bit, prefetchable) [size=32M]
Capabilities: [50] Power Management version 3
Capabilities: [58] Express Endpoint, MSI 00

I do not see the Xcieve module loading via lsmod. I do have I believe the proper firmware installed for the Xcieve 3028
I built much of v4l/tuner in kernel as modules Likely will try installing a tv app (after re-check MSI in kernel support)

Rescued a docking station for tuxmobl It was a timely event as it was on it's way to the great electronics graveyard in the sky

I am quite satisfied with the new Windows laptop it is snappy and capable. I have yet to try to boot a linux on that machine yet. May try a liveusb image at some point. The biggest drawback was the lack of hdmi Although the vga out is compatible with about any conference room in the US and a ton of image projectors.

At a time when labor is taking a beating sellable skills are still at a premium and so things may change for me soon.

For anyone using Gentoo please avail yourself of the 'eclean' command I have suggested some enhancements but it is already very useful.

Thursday, March 3, 2011

Getting better.

Been down with a nasty flu for about a month. It lines your lungs with a thick phlegm and saps your energy. Rough stuff. Getting enough sleep to get better was the thing to do.

Congratulations to Flameeyes on his elevation to Gentoo QA lead. An excellent 'technical' choice by Gentoo and due recognition for what he has accomplished in the community. I am very pleased in having contributed in some small way to his fine book Autotools Mythbuster which he has recently expanded and edited considering some more minor changes I proposed. What is discussed is quite concise and a valuable resource worthy of a hard copy but available online. Please consider Flattr'ing it if you find it useful. I hope for him patience enough to work with us all ;-) (users and devs alike)

I decided to just build in support for the 'random' box's new hardware and just move the drive. Mostly done but the drive swap isn't. Several questions arise from this. I may need to run an 'emerge -e world' before/after the swap which will rebuild all packages. The compiler flag was set 'native' and the old AMD 64 3200+ vs a dual core Pentium 4 It is speculated that the chipset of the ATI 650 tv tuner card may be supported by the Xcieve driver in kernel. If it is I will know soon but cannot say until I move to the new platform.

The first computer I ever bought off the shelf arrived. I'll perhaps review it soon.

Connman is a blur of work and I'm sure it is wonderful for those it works for ...but not for any setup I've built yet. I'm still using wpa_cli at startup (tuxmobl and random) with my configured wlan fine. I've a lot to do if I had the time. ;-( and 'iw list scan' works fine with both SMC 2802 (p54pci) and WNA1100(ath9k_ht) For now it's cli tools only for me. The p54pci support requires a custom kernel build something non-trivial on some linux distributions (Ubuntu I know of Debian no idea Red Hat don't remember it being an issue ) But all my linux is wireless.

Really ruminating of late about Gentoo but I don't make a living from it. My change process seems to be more along the lines of dripping water, than a flood; since for me it's just utilizing older hardware and I've only so many projects for the boxes. It's cheaper to just turn them off though they do run pretty much 24/7 they need work jobs.

Saturday, February 12, 2011

A Noid by any other name

Warning: Some of the following material qualifies as a rant.

Is still annoying. It irritates me how hardware manufacturer's and retailers conspire to elevate ram prices at times. Take a recent purchase I made from Ascendtech. I have this NIB cpu sitting on my desk and wanted a board for it. Well I had a system go bad and needed an alternate power supply to continue troubleshooting. I had no POST card at the time. So for (RC410-M2 and a P4 520) $51 US I found this setup. Note it is now a $75 part. It was shipped for $24 bringing the total to $84 and change. I could have ordered memory from them at a premium (iirc 2 gb was circa $69) price but I had some I thought to re-use. Patriot DDR2-667 It seemed a good compromise. A case and power supply and board and cpu except the memory failed to boot the machine. I pulled the power supply and checked the other board. This traced to a bad agp card. Unplugged the fan on the card and it booted. That system is down.

There was no manual shipped via Asecndtech so I called them asking for some help. He replied after I pulled it and we got a beep that I had incompatible memory. I could return it. (loose money on shipping twice) or try something else. Their memory was still higher than I see listed on the Ascendtech site today. I asked for manual and was told there was none available. He was just silent when asked what the specifications were. Or non-informative. (ddr2 667)

In the end I spent about 8 man hours searching chipsets and manufacturers to order compatible memory for the board from Kingston. I guess persistence pays in the end. Though I am not likely to buy products from them in the future and recommend you buy a complete barebones if you do. Newegg and Tiger Direct are the two vendors I use most often. BTW this board is afrom the Acer e500 bios splash says.

So now I have a dual core system I can consider dumping the AMD64 3200+ as the LGA 775 setup will be faster if more power hungry. Even that should be a wash though the 3200+ is an agp board and the newer board is onboard pci-e Not trivial to re-install a complete Gentoo on a new board Likely the quickest way would be to build in support for the new system in a chroot on another partition then just swap the drive over and reboot ;) YMMV of course but isn't tech support just like dealing with the 'Noid?

Editors Note: Thought a bit about this and will add here that as of the time of my purchase of Kingston ram for that board A Kingston sales rep replied "We don't sell memory for that board. It takes a special 'gigabit' chip" When i pressed conversationally she confirmed she just was not allowed to supply me with the req'd part number saying "We don't make that type anymore"

Wednesday, January 12, 2011

tuxmobl gits wireless

tuxmobl is progressing well. I now have working wireless on linux via a Netgear WNA1100 I initially had a few issues but have since ironed them out. Mainly with connecting to the router it seems. The connection is actually on a usb 1.0 port but has been stable enough for over a week with my router that the tether is gone. ;-)

Retrieving the latest firmware and installing it was as easy as making a directory for kernel/firmware and cloning with git. You should not need to rebuild a kernel to take advantage of an update in firmware your distribution has not pushed through (busy guys) I didn't initially do this but the method does have benefits. Requires git.

Launch a terminal and create a directory for the kernel and change from that directory -

git clone git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git

If you need to install a wireless-testing kernel to get the latest wireless kernel and build your own in order to achieve some added functionality (this is also an alternative to gentoo-sources though it may contain bug fixes and patches you are missing out on) create another directory for your new kernel source and cd there

git clone git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git

Making a kernel is a subject in itself. Gentoo has genkernel if you need help. Or you could visit Pappy's kernel seeds for a jump start.

connman is the next project but currently you would add it to package.keywords
if you are using the 'stable' tree.

#echo 'net-misc/connman ~x86' >> /etc/portage/package.keywords

One of connman's dependencies is iptables so that should help firewalling the connection and wireless should be firewalled.