GAR: Automating Entire OS Builds
Suppose you want to perform a configure step, but there is no actual program or script associated with that step. For example, you could conceivably want to run a series of shell commands to create a configuration file. Simply pick a file associated with the configure step (or ``none'' if there isn't one) and set your CONFIGURE_SCRIPTS to that. Then write a configure- rule to handle that file (or ``configure-none'' if you used ``none'').
For example, look at the way the traceroute package (Gavron's Traceroute) performs its build step. There was no Makefile, so the maintainer had to provide a method for the compilation commands to be run semi-manually. So the BUILD_SCRIPTS is set to the .c file, and a build- rule for that file is created:
BUILD_SCRIPTS = $(WORKSRC)/traceroute.c build-$(WORKSRC)/traceroute.c: mkdir -p $(COOKIEDIR)/build-$(WORKSRC) $(CC) $(CFLAGS) -o $(WORKSRC)/traceroute \ $(WORKSRC)/traceroute.c -lresolv -lm $(MAKECOOKIE) include ../../gar.mk
This is in fact similar to the way that the default rules are defined in the GAR libraries. For example, here is how the library handles Makefiles as BUILD_SCRIPTS:
build-%/Makefile: mkdir -p $(COOKIEDIR)/build-$* $(BUILD_ENV) $(MAKE) -C $* $(BUILD_ARGS)In make, the % is a wildcard (matching) character when used in the name of a rule, and the $* variable holds whatever it matched. This means that if we told the system to build using work/robotfindskitten-1.0/Makefile, then $* would be set to work/robotfindskitten-1.0 when this rule is run.
The GAR library takes advantage of many of the advanced features of GNU make and is written with the strengths of make in mind. This has been advantageous for a number of reasons. Namely, the size of the GAR library files is a few hundred lines. The BSD Ports libraries are written more like shell scripts and weigh in at several thousand lines.
In addition, the pattern-and-rule handling of package-specific build features fits the realm of make nicely. Also, make has facilities that help avoid redundant behavior. If a package has been installed, running make install will cause it to quickly run through the seven steps, verifying that it had already performed them. To force a package to rebuild from scratch, the make clean target is provided.
GAR provides many features that are not present in most binary package systems, such as dpkg or RPM. This makes user customization of compiles much easier and allows you to rebuild your whole system with whatever optimization flags you choose. The software GAR builds can all be put in /usr/local, for example. The software can also be installed to a scratch directory or secondary volume for later packaging into a complete OS image.
GAR has largely been a product of the LNX-BBC Project, but has also been adopted by many GNOME developers as a means for building the latest CVS build of GNOME from scratch. For more information on the LNX-BBC Project and the GAR system, visit http://lnx-bbc.org/. If you have any specific questions about GAR, feel free to ask on the lnx-bbc-devel list at http://zork.net/mailman/listinfo/lnx-bbc-devel/.
Nick Moffitt is a free software enthusiast in San Francisco, California where he maintains a multiuser community shell server. He is a member of the LNX-BBC Project and maintains GAR, nwall and the popular game of robotfindskitten. When he's not building software projects in make or m4, he prefers the more conventional Scheme and Python languages.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
- SourceClear Open
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide