Archive for the ‘linux’ Category.
March 5, 2010, 11:28 am
You have probably seen the Host Virtual advertisements on the sidebar of gentoo.org website.
I ran into a weird clocksource issue on my VPS that I haven't seen elsewhere. This issue was that my time would progressively get worse and worse and eventually NTP could not keep up because the clock was so far out of date. This happened on a pretty quick interval, about 1-2 days until I had to manually reset it. I opened up a support case with Host Virtual and the suggestion was to change the kernel's clocksource to jiffies, from tsc, or vice versa. (or use a newer kernel, but I was already at the latest 2.6.32.x kernel at the time) My kernel's clocksource was at the default and I had to research the issue some more because I haven't heard of this before.
In the kernel's Documentation directory, I found some info. (Documentation/kernel-parameters.txt). There is quite some details in there, but the summary is that the default clocksource was 'tsc' on x86. I changed my kernel's clocksource by the clocksource=jiffies kernel parameter. Rebooted the virtual machine and NTP has been able to keep time since.
I don't really know the difference here and don't care to research much more. It is fixed and maybe this info will help someone else someday.
February 15, 2010, 10:44 am
Installing Gentoo Linux on the Genesi EfikaMX (unboxing) is fairly simple. I have completed documentation for this process here. I have enjoyed working on this platform and will highly suggest it for applications that need low power and non-extreme hardware specs. Anyway, I'm not the first to have Gentoo Linux running on EfikaMX, but the first to document the process. Thanks go to Raúl (armin76) for working on the Gentoo stages, Genesi for the support, et al.
I would have a screenshot to show here, but it is hard to take a decent picture on my 40" "monitor"
January 18, 2010, 9:23 am
It is no surprise that Gentoo Prefix works fine on arm-linux given the great work being done in Gentoo Linux by the ARM team (armin76, maekke, et al).
For the Genesi Efika MX (unboxing), I now have a binpkg repo setup (for Gentoo Prefix only). This was mainly a fun proof-of-concept that I did. I went from installing 70 packages in about 18 hours, to about 30 minutes using binpkgs.
What does this mean:
Given the relatively small set of arm users and the highly specific use cases for arm hardware, well, there isn't a very big percentage of users that will keep Ubuntu on their Efika MX when they get it. But, if they do, that means that they can get a complete toolchain and Gentoo Linux userland (including portage package manager) on the host in less than an hour. Of course, they could also get the same packages from the Ubuntu package manager but that isn't as cool
How to install/get working:
Follow this easy guide that I wrote, here. All 70 packages will occupy about 580MB of space. Then you will have the toolchain and portage (emerge) at your disposal to use on your Ubuntu ARM (cortex-a8, armv7) system.
Have fun.
January 12, 2010, 10:32 am
My linode is now my personal DNS resolver. I have officially ditched the ISP nameservers from this point forward now that I found unbound. Unbound is a lightweight, recursive resolver that is perfect for your LAN, co-located host, or even a single host.
For your single host, emerge unbound, start the service, add 127.0.0.1 to the first nameserver in /etc/resolv.conf. Unbound is setup (by default) to accept connections from localhost and refuse anything else. If you are using dhcp at home (likely) then also emerge openresolv and uncomment name_servers=127.0.0.1 in /etc/resolvconf.conf, openresolv then "intercepts" dhcpcd when it tries to write to /etc/resolv.conf and adds 127.0.0.1 as your first nameserver
For your LAN, just configure your router to look to the host that you setup unbound on, with additional configuration.
Finally, you can also have unbound run on your co-located host. Just edit /etc/unbound/unbound.conf to a) listen on an outside interface and b) allow your other host to query it. This will be left as an exercise for the reader, it is easy to figure out.
Lastly, a shout-out to Linux Gazette for an excellent write-up on GoogleDNS (and why you should use something like unbound) and DNS/LAN metaphors. Suggested reading if you feel out of your league with DNS internals, like me.
A quote from the above linked article: "Why outsource to anyone, when you can do a better job locally, at basically no cost in effort?" and really, that is the truth. Have fun.
December 27, 2009, 3:36 pm
DLNA (Digital Living Network Alliance) is a standard to allow entertainment devices within the home to share their content with each other across a home network. In other words, stream content from my computer to the TV across the LAN. The cool part about this, is that my TV, the LN40B630, can play HD content native, meaning that the computer's only function is to stream (not process the content, meaning my low power computer can 'power' the HD content). The catch is that you have to use firmware not newer than 001012, the 001013 firmware that my TV came with removes the DLNA feature. (I assume they meant for it to only be available on more expensive models).
In my opinion, the easiest way to get DLNA to work for this TV is to use mediatomb. The reason is that this TV needs the mimetype of avi/mkv's to be video/mpeg and (so far) I have not found any other DLNA software that is able to modify mimetypes like this. You also need to set a custom http header, as I found here.
Here is my config.xml that I am using to stream to the TV. It is not perfect but the majority of the work is done. Tested with mediatomb-0.11.0 only.
December 20, 2009, 2:00 pm
If you are running PHP on a limited-resource box, like a VPS then you may have seen your PHP pages randomly hang. I was able to trace this issue down because the PHP pages were hung up and the normal html pages were still being served. The problem was 'solved' when I restarted the web server. Some research later, and talking to Thilo (bangert), I found out about PHP_FCGI_MAX_REQUESTS. This is an environment variable that PHP respects, it basically tells how many requests to serve before respawning fcgi. In my case, 500 seemed like a good number after testing. Your mileage may vary, but it is worth a try if you have those symptoms.
%% cat /etc/lighttpd/mod_fastcgi.conf
server.modules += ("mod_fastcgi")
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket",
"bin-path" => "/usr/bin/php-cgi",
"max-procs" => 2, # default 4
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "2", # default 1
"PHP_FCGI_MAX_REQUESTS" => "500" #default 1000
)
)
)
)
December 10, 2009, 9:12 am
There was alot of of talk/flames on the LKML about devtmpfs. Looks like a big push for this was for embedded devices, android, etc. Since I read that it may give a boot time speed up, I was slightly intrigued. http://lkml.org/lkml/2009/4/30/182, yes...it is an old topic but it finally was released in stable .32 kernel.
So, bootcharts:
bootchart-2.6.31.6.png 39 seconds
bootchart-2.6.32-no-devtmpfs.png 37 seconds
bootchart-2.6.32-devtmpfs.png 37 seconds
bootchart-2.6.32-openrc.png 26 seconds (devtmpfs)
So, where is the real win here? Well, as I wrote before, use openrc.
December 7, 2009, 3:05 pm
About a month ago, I installed Gentoo on the new-to-me Acer Aspire1. Installation went like anything else, it is just a normal x86 host after all. I don't have everything on it working, because I don't care. If you are looking for additional resources on getting the extras working, you may want to look here or here.
The exciting part, that I got working and am ready to announce publicly, is my new atom-x86 binpkg repo. What makes this repo different than the binpkgs located on tinderbox.dev.gentoo.org/default-linux is that this repo has CFLAGS specific to the Intel Atom processor. I identified the compiler flags by using the following gcc command: gcc -Q --help=target -march=native and set the following -march=prescott -mtune=generic -msahf. On my linode (review) host, I have a chroot that builds all new packages in my world file once a day which comes from the aspire1. In this manor, I am able to always have binary packages available to me whenever I update my aspire1. Now, I have all the benefits of a source distro and the speed of a binary distro.
If you would like to use this repo, set PORTAGE_BINHOST in /etc/make.conf and add 'getbinpkg' to FEATURES (or use the emerge options directly). Be advised, that thought this works for me, I make no guarantees for you.
PORTAGE_BINHOST="http://tinderbox.jolexa.net/atom-x86/"
FEATURES="${FEATURES} getbinpkg"
I also have an html view of the packages available.