source – Hackaday https://hackaday.com Fresh hacks every day Tue, 05 Nov 2024 06:24:12 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 156670177 I Installed Gentoo So You Don’t Havtoo https://hackaday.com/2024/11/04/i-installed-gentoo-so-you-dont-havtoo/ https://hackaday.com/2024/11/04/i-installed-gentoo-so-you-dont-havtoo/#comments Mon, 04 Nov 2024 15:00:22 +0000 https://hackaday.com/?p=729862 A popular expression in the Linux forums nowadays is noting that someone “uses Arch btw”, signifying that they have the technical chops to install and use Arch Linux, a distribution …read more]]>

A popular expression in the Linux forums nowadays is noting that someone “uses Arch btw”, signifying that they have the technical chops to install and use Arch Linux, a distribution designed to be cutting edge but that also has a reputation of being for advanced users only. Whether this meme was originally posted seriously or was started as a joke at the expense of some of the more socially unaware Linux users is up for debate. Either way, while it is true that Arch can be harder to install and configure than something like Debian or Fedora, thanks to excellent documentation and modern (but optional) install tools it’s no longer that much harder to run than either of these popular distributions.

For my money, the true mark of a Linux power user is the ability to install and configure Gentoo Linux and use it as a daily driver or as a way to breathe life into aging hardware. Gentoo requires much more configuration than any mainline distribution outside of things like Linux From Scratch, and has been my own technical white whale for nearly two decades now. I was finally able to harpoon this beast recently and hope that my story inspires some to try Gentoo while, at the same time, saving others the hassle.

A Long Process, in More Ways Than One

My first experience with Gentoo was in college at Clemson University in the late ’00s. The computing department there offered an official dual-boot image for any university-supported laptop at the time thanks to major effort from the Clemson Linux User Group, although the image contained the much-more-user-friendly Ubuntu alongside Windows. CLUG was largely responsible for helping me realize that I had options outside of Windows, and eventually I moved completely away from it and began using my own Linux-only installation. Being involved in a Linux community for the first time had me excited to learn about Linux beyond the confines of Ubuntu, though, and I quickly became the type of person featured in this relevant XKCD. So I fired up an old Pentium 4 Dell desktop that I had and attempted my first Gentoo installation.

For the uninitiated, the main thing that separates Gentoo from most other distributions is that it is source-based, meaning that users generally must compile the source code for all the software they want to use on their own machines rather than installing pre-compiled binaries from a repository. So, for a Gentoo installation, everything from the bootloader to the kernel to the desktop to the browser needs to be compiled when it is installed. This can take an extraordinary amount of time especially for underpowered machines, although its ability to customize compile options means that the ability to optimize software for specific computers will allow users to claim that time back when the software is actually used. At least, that’s the theory.

It didn’t work out too well for me and my Dell, though, largely because Dell of the era would put bottom-basement, obscure hardware in their budget computers which can make for a frustrating Linux experience even among the more user-friendly distributions due to a general lack of open-source drivers. I still hold a grudge against Dell for this practice in much the same way that I still refuse to use Nvidia graphics cards, but before I learned this lesson I spent weeks one summer in college with this Frankensteined computer, waiting for kernels and desktop environments to compile for days only to find out that there was something critical missing that broke my installations. I did get to a working desktop environment at one point, but made a mistake with it along the way and decided, based on my Debian experiences, that re-installing the operating system was the way to go rather than actually fixing the mistake I had made. I never got back to a working desktop after that and eventually gave up.

This experience didn’t drive me away from Gentoo completely, though. It was always at the back of my mind during any new Linux install I performed, especially if I was doing so on underpowered hardware that could have benefited from Gentoo’s customization. I would try it occasionally again and again only to give up for similar reasons, but finally decided I had gained enough knowledge from my decades as a Debian user to give it a proper go. A lot has changed in the intervening years; in the days of yore an aspiring Gentoo user had to truly start at the ground up, even going as far as needing to compile a compiler. These days only Gentoo developers take these fundamental steps, providing end users with a “Stage 3” tarball which contains the core needed to install the rest of Gentoo.

Bringing Out The Best of Old Hardware

And I do have a piece of aging hardware that could potentially benefit from a Gentoo installation. My mid-2012 Macbook Pro (actually featured in this article) is still a fairly capable machine, especially since I only really need a computer these days for light Internet browsing and writing riveting Hackaday articles. Apple long ago dropped support for this machine in macOS meaning that it’s no longer a good idea to run its native operating system. In my opinion, though, these older, pre-butterfly Macs are still excellent Linux machines aside from minor issues like finding the correct WiFi drivers. (It also can’t run libreboot, but it’s worth noting that some Macs even older than mine can.) With all of that in mind I got to work compiling my first Linux kernel in years, hoping to save my old Macbook from an e-waste pile.

There’s a lot expected of a new Gentoo user even with modern amenities like the stage 3 tarball (and even then, you have to pick a stage file from a list of around 50 options), and although the handbooks provided are fairly comprehensive they can be confusing or misleading in places. (It’s certainly recommended to read the whole installation guide first and even perform a trial installation in a virtual machine before trying it on real hardware.) In addition to compiling most software from source (although some popular packages like Firefox, LibreOffice, and even the kernel itself are available as precompiled binaries now), Gentoo requires the user to configure what are called USE flags for each package which specify that package’s compile options. A global USE flag file is also maintained to do things like build GNOME, Bluetooth, even 32-bit support into every package, while specific package USE flags are maintained in other separate files. For example, when compiling GIMP, users can choose which image formats they want their installation of GIMP to support. There’s a second layer of complexity here too as certain dependencies for packages can be “masked” or forbidden from being installed by default, so the user will also need to understand why certain things are masked and manually unmask them if the risk is deemed acceptable.

One thing that Gentoo has pioneered in recent years is the use of what it calls distribution kernels. These are kernel configurations with sane defaults, meaning that that they’ll probably work for most users on most systems on the first try. From there, users can begin tweaking the kernel for their use case once they have a working installation, but they don’t have to do that leg work during the installation process anymore. Of course, in true Gentoo fashion, you can still go through the process of configuring the kernel manually during the install if you choose to.

Aside from compiling a kernel, Gentoo also requires the user to make other fundamental choices about their installation during the install process that most other major distributions don’t. Perhaps the biggest one is that the user has to choose an init system, the backbone of the operating system’s startup and service management systems. Generally most distributions decide for you, with most larger distributions like Debian, Fedora, and Arch going with systemd by default. Like anything in the Linux world, systemd is controversial for some, so there are alternatives with OpenRC being the one with the most acceptance in the Gentoo world. I started out with OpenRC in my installations but found a few pieces of software that I use regularly don’t play well with it, so I started my build over and now use systemd. The user also can select between a number of different bootloaders, and I chose the tried-and-true Grub seeing no compelling reason to change at the moment.

In addition, there’s no default desktop environment, so you’ll also need to choose between GNOME, KDE, XFCE, any other desktop environment, or among countless window managers. The choice to use X or Wayland is up to you as well. For what it’s worth, I can at least report that GNOME takes about three times as long to compile as the kernel itself does, so keep that in mind if you’re traveling this path after me.

It’s also possible you’ll need to install a number of drivers for hardware, some of which might be non-free and difficult to install in Gentoo while they might be included by default in distributions like Ubuntu. And, like everything else, they’ll need to be compiled and configured on your machine as well. For me specifically, Gentoo was missing the software to control the fans on my MacBook Pro, but this was pretty easy to install once I found it. There’s an additional headache here as well with the Broadcom Wi-Fi cards found in older Macs, which are notoriously difficult pieces of hardware to work with in the Linux world. I was eventually able to get Wi-Fi working on my MacBook Pro, but I also have an 11″ MacBook Air from the same era that has a marginally different wireless chipset that I still haven’t been able to get to work in Gentoo, giving me flashbacks to my experience with my old Dell circa 2007.

This level of granularity when building software and an overall installation is what gives Gentoo the possibility for highly optimized installations, as every package can be configured for the user’s exact use case for every package down to the kernel itself. It’s also a rolling release model similar to Arch, so in general the newest versions of software will be available for it as soon as possible while a Debian user might have to wait a year or two for the next stable release.

A Few Drawbacks

It’s not all upside, though. For those without a lot of Gentoo experience (including myself) it’s possible to do something like spend a day and a half compiling a kernel or desktop environment only to find out a critical feature wasn’t built, and then have to spend another day and a half compiling it again with the correct USE flags. Or to use the wrong stage file on the first try, or realize OpenRC won’t work as an init system for a specific use case, or having Grub inscrutably be unable to find the installation. Also, don’t expect Gentoo to be faster out-of-the-box than Debian or Fedora without a customization effort, either; for me Gentoo was actually slower than Debian in my benchmarks without a few kernel and package re-compiles. With enough persistence and research, though, it’s possible to squeeze every bit of processing power out of a computer this way.

Personally, I’m not sure I’m willing to go through the amount of effort to migrate my workstations (and especially my servers) to Gentoo because of how much extra configuration is required for often marginal performance gains thanks to the power and performance capabilities of modern hardware. Debian Stable will likely remain my workhorse for the time being for those machines, and I wouldn’t recommend anyone install Gentoo who doesn’t want to get into the weeds with their OS. But as a Linux hobbyist there’s a lot to be said for using other distributions that are a little more difficult to use than Debian or even Arch, although I’d certainly recommend using a tool like Clonezilla to make backups of your installation from time to time so if you do make the same mistakes I made in college you can more easily restore your system. For me, though, I still plan to keep Gentoo on my MacBook Pro since it’s the machine that I tinker with the most in the same way that a classic car enthusiast wants to keep their vehicle on the road and running as well as it did when it was new. It also lets me end forum posts with a sardonic “I use Gentoo, btw” to flex on the Arch users, which might be the most important thing of all.

]]>
https://hackaday.com/2024/11/04/i-installed-gentoo-so-you-dont-havtoo/feed/ 52 729862 gentoo
Current Sink Keeps The Smoke In https://hackaday.com/2017/06/01/current-sink-keeps-the-smoke-in/ https://hackaday.com/2017/06/01/current-sink-keeps-the-smoke-in/#comments Thu, 01 Jun 2017 08:00:06 +0000 http://hackaday.com/?p=259040 One of the most versatile tools on anyone’s work bench, at least as far as electrical projects are concerned, is a power supply. Often we build our own, but after …read more]]>

One of the most versatile tools on anyone’s work bench, at least as far as electrical projects are concerned, is a power supply. Often we build our own, but after we’ve cobbled together some banana jacks with a computer’s PSU or dead-bug soldered a LM317 voltage regulator to a wall wart, how will that power supply perform? Since it’s not desirable to use a power supply that’ll let the smoke out of everything it powers (or itself, for that matter) a constant current sink, or load, can help determine the operating limits of the power supply.

[electrobob] built this particular current sink from parts he had lying around. The theory of a constant current sink is relatively straightforward so it’s easily possible to build one from parts out of the junk drawer, provided you can find a few transistors, fuses, an op amp, and some heat sinks. The full set of schematics that [electrobob] designed can be found on his main project page. He’s also gone a step further with this build as well, since he shorted out his first prototype and destroyed some of the transistors. But, using a few extra transistors in his design also improves the safety and performance of the load, so it’s a win-win.

This constant current load also has the added feature of being able to interface with a waveform generator (an Analog Discovery, specifically) and as a result can connect and disconnect the load quickly. If you aren’t in need of an industrial-grade constant current sink and you have some spare parts lying around, this would be a great one to have around the work bench.

]]>
https://hackaday.com/2017/06/01/current-sink-keeps-the-smoke-in/feed/ 11 259040 main
VGA Output On A Freescale https://hackaday.com/2016/02/26/vga-output-on-a-freescale/ https://hackaday.com/2016/02/26/vga-output-on-a-freescale/#comments Sat, 27 Feb 2016 00:00:36 +0000 http://hackaday.com/?p=190853 Even though VGA is an outdated and becoming somewhat deprecated, getting this video output running on non-standard hardware is a rite of passage for some hackers. [Andrew] is the latest …read more]]>

Even though VGA is an outdated and becoming somewhat deprecated, getting this video output running on non-standard hardware is a rite of passage for some hackers. [Andrew] is the latest to take up the challenge. He got VGA output on a Freescale i.MX233 and also got some experience diving into the Linux kernel while he was at it.

The Freescale i.MX233 is a single-board computer that is well-documented and easy to wire up to other things without specialized hardware. It has video output in the form of PAL/NTSC but this wasn’t quite enough for [Andrew]. After obtaining the kernel sources, all that’s needed is to patch the kernel, build the kernel, and build a custom DAC to interface the GPIO pins to the VGA connector.

The first thing that [Andrew] did was load up the Hackaday home page, which he notes took quite a while since the i.MX233 only runs at 454 MHz with just 64 MB of RAM. While our retro page may have loaded a little faster, this is still an impressive build and a great first step to exploring more of the Linux kernel. The Freescale i.MX233 is a popular chip for diving into Linux on single-board computers, and there’s a lot going on in that community. There are some extreme VGA hacks out there as well if that’s more your style.

]]>
https://hackaday.com/2016/02/26/vga-output-on-a-freescale/feed/ 5 190853 IMG_4080
Sci-Fi Contest Roundup: The Valve Universe https://hackaday.com/2014/04/21/sci-fi-contest-roundup-the-valve-universe/ https://hackaday.com/2014/04/21/sci-fi-contest-roundup-the-valve-universe/#comments Tue, 22 Apr 2014 02:00:19 +0000 http://hackaday.com/?p=120440 …read more]]> 653px-Source_engine_logo_and_wordmark.svg

While most of the entries to our Sci-Fi contest come from movies and TV shows, a select few are based on the Valve universe, including a few builds based on Portal and Team Fortress 2.

Deadly neurotoxinGLADOS

Who wouldn’t want a gigantic articulated sociopathic robot hanging around? Two groups are building a clone of GLaDOs from the Portal series. and already the builds look really great.

[AmarOk], developed an open-source personal assistant called RORI that intends to be a more helpful version of GLaDOs, without all the testing and killing. He, along with [Peterb0y] and [n0m1s] are turning this personal assistant software into a GLaDOs replica.

Taking a slightly different tack, [Eric] and [jjyacovelli] built a GLaDOs-like robot with a camera in the ‘face’. This camera connects to a Google Glass and tracks the user’s head movements. There’s also a Nerf gun attached to the end of the robot body, triggered by double winking. Yep, it’s a heads-up display GLaDOs, perfect for punishing your test subjects.

Heavy load comin’ through!

Sentry

Not to be out done by a malevolent, hyper-intelligent artificial intelligence, [Tyler] and [Ryan] are building the cutest gat’ dern weapon in all of west Texas. It’s the level one sentry from Team Fortress 2, and the guys are turning one into a paintball sentry.

The TF2 sentry is a cute little bugger capable of motion tracking and perimeter defense, filling enemies with lead should they ever come too close.

While the end result probably won’t be as large or as heavy as the “official” real-life turret, a smaller table-top sized model is probably a little more practical. Even if it doesn’t live up to expectations, upgrading the sentry is simply a matter of whacking it with a wrench a few times.

 

There’s still time for you to cobble together an awesome Sci-Fi project and have a chance to win some awesome prizes.

]]>
https://hackaday.com/2014/04/21/sci-fi-contest-roundup-the-valve-universe/feed/ 6 120440 653px-Source_engine_logo_and_wordmark.svg GLADOS Sentry
Wall-wart retrofitted with a high-power LED supply circuit https://hackaday.com/2013/02/13/wall-wort-retrofitted-with-a-high-power-led-supply-circuit/ https://hackaday.com/2013/02/13/wall-wort-retrofitted-with-a-high-power-led-supply-circuit/#comments Wed, 13 Feb 2013 18:01:05 +0000 http://hackaday.com/?p=94543 …read more]]> high-power-LED-wall-wart-supply

This custom circuit board picks up some of the pieces from a wall wart to drive a high-power LED.  The basic concept is to keep the high-voltage components and swap out the low voltage ones for parts that will be able to drive the 10W load.

The PCB is custom designed, but you can see that it was shaped to match the wall wort’s original board. To the right is the original 500mA transformer. The low-voltage side uses an LM393 because of its dual-comparators. This provides feedback for both current and voltage and is a perfect compliment for the TOP242. We haven’t seen that part before, but [Mincior] says that it’s nice for this application as it has safety features that lock down the chip if power or temperature are above spec. Once the replacement is nestled inside of the plastic case it looks stock and makes sure that your custom LED fixtures will stand the test of time safely.

]]>
https://hackaday.com/2013/02/13/wall-wort-retrofitted-with-a-high-power-led-supply-circuit/feed/ 10 94543 high-power-LED-wall-wart-supply
Adding a lot of twinkle to this rebar sculpture https://hackaday.com/2012/03/07/adding-a-lot-of-twinkle-to-this-rebar-sculpture/ https://hackaday.com/2012/03/07/adding-a-lot-of-twinkle-to-this-rebar-sculpture/#comments Wed, 07 Mar 2012 18:01:18 +0000 http://hackaday.com/?p=68778 Blinky lights have a way of attracting attention and that’s exactly what the members of the Maui Makers hackerspace were shooting for. The sculpture above is the logo for the …read more]]>

Blinky lights have a way of attracting attention and that’s exactly what the members of the Maui Makers hackerspace were shooting for. The sculpture above is the logo for the Source festival, a Burning Man inspired music gathering in the Aloha state. For this year’s festival they went crazy, installing twelve meters of RGB LED strip controlled by seven Arduino boards.

The goal was to make the twelve-foot tall sculpture into a lighted interactive showpiece. In addition to the LEDs it includes a microphone, capacitance sensors, Bluetooth connectivity, and a piezo speaker. There’s one Arduino to rule them all, with another Teensy controller to drive an LCD display in the control box, and five Teensy boards to address the LED strips. They grabbed [Bill Porter’s] Easy Transfer library to facilitate communication between the microcontrollers (his libraries are becoming popular, we just saw his mp3 shield library used in another project on Tuesday).

The code which drives the LED animations is based on some Adafruit examples. We really enjoy the waving flag effect seen in the clip after the break.

[youtube=http://www.youtube.com/watch?v=g8b8IzOB4I0&w=470]

]]>
https://hackaday.com/2012/03/07/adding-a-lot-of-twinkle-to-this-rebar-sculpture/feed/ 11 68778 OLYMPUS DIGITAL CAMERA
Lolo’s (perfect moment) alarm clock https://hackaday.com/2010/07/17/lolos-perfect-moment-alarm-clock/ https://hackaday.com/2010/07/17/lolos-perfect-moment-alarm-clock/#comments Sun, 18 Jul 2010 00:00:58 +0000 http://hackaday.com/?p=26169 …read more]]> [youtube http://www.youtube.com/watch?v=CphsgESZGcE&feature=player_embedded%5D

It seems everybody has a different interpretation of the perfect alarm clock. [Loic Royer’s] alarm clock is not the loudest, or the smartest, but does have some interesting features. By monitoring several environmental factors like temperature, air quality, humidity, dew point, and your own sleep patterns, this alarm clock can determine the best moment in the morning to wake you up.

The main sensor is a wireless accelerometer with the theory being: the more you move in your sleep, the closer you are to a conscious state. The other sensors assist in picking the perfect moment, and awaken you with the sound of birds chirping.

For now all we have is the source code and the list of hardware, but for anyone wanting to try, a circuit diagram wouldn’t be too hard to figure out on your own. Check after the rift for some more videos.

Setting the clock:

[youtube http://www.youtube.com/watch?v=H51m5tOAKqQ&feature=player_embedded%5D

Different sensors:

[youtube http://www.youtube.com/watch?v=9OHXxB8jQfU&feature=player_embedded%5D

Wireless accelerometer:

[youtube http://www.youtube.com/watch?v=pKqmedNijh8&feature=player_embedded%5D

]]>
https://hackaday.com/2010/07/17/lolos-perfect-moment-alarm-clock/feed/ 20 26169