Self-Hosting Movies with MoviX
First of all, make sure your kernel is compiled with support for the RAM disk and loopback device, because you are going to use these features. It is cleaner to keep your PC kernel tree separated from the one used for the distribution. So get the latest stable kernel (2.4.20 at the time of this writing), and unpack it in a directory different from your main kernel directory.
The kernel configuration defaults are close to the ones we need. Once you are in the distribution kernel directory, run make menuconfig and add support for the following items:
Code maturity level options ---> Prompt for development and/or incomplete code/drivers
Processor type and features ---> Processor family: [choose Pentium-MMX]
Block device ---> Loopback device support
Block device ---> RAM disk support
Block device ---> Initial RAM disk (initrd) support
File systems ---> /dev file system support [select the “Automatically mount at boot” option]
Then run make bzImage to produce the kernel binary.
The initrd file (init Ram Disc) contains the root filesystem of the distribution. Our first initrd should contain only the system files; therefore, 5MB will be enough. To create it, we make use of the RAM discs:
dd if=/dev/zero of=/dev/ram0 bs=1k count=5000 mke2fs -m0 /dev/ram0 5000 mount /dev/ram0 /distro
The de facto standard for small distributions is the Busybox binary (the “Swiss Army Knife of Embedded Linux”) in place of the scores of small binaries we need.
Compilation instructions are pretty easy and well documented, but you also may want to take a look at Bruce Perens' Busybox articles in Embedded Linux Journal (see Resources). I suggest you compile it with support for all possible commands because, eventually, you are going to need most of them. Remember to install Busybox with ./install.sh /distro, so all links for all commands supported by your copy of Busybox automatically are created in /distro.
Binaries usually are linked dynamically to system libraries. It is possible to compile Busybox statically to save space. But, we are going to add more complex binaries to the distribution, so eventually we'll have to add dynamical libraries anyway. To add the libraries for a binary, say Busybox, the rule is always the same:
get the list of libraries linked to it:
root# ldd busybox libc.so.6 => /lib/libc.so.6 (0x40028000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
copy all of them ton /distro/lib/.
A trick to minimize libraries size is getting rid of all the debug stuff they contain:
objcopy --strip-debug /lib/libc.so.6 /distro/lib/libc.so.6
To complete the work we need to add a few configuration scripts: /distro/etc/inittab, /distro/etc/rc.d/rc.S, /distro/etc/fstab, /distro/etc/shells and /distro/etc/profile. We also need to create a few directories: /distro/dev, /distro/mnt, distro/proc, /distro/root and /distro/tmp. We don't need to create any device node in /distro/dev, because the devfs dæmon automatically creates all devices at boot time.
Finally we can create the initrd file:
umount /dev/ram0 dd if=/dev/ram0 of=initrd bs=1k count=5000
To check that everything is okay, you can mount the initrd file and take a look inside:
mount initrd /distro -o loop ls -lR /distro
Then remember to umount it and gzip it.
Before burning a CD, it is a good idea to test the initrd image by booting it from LILO. Create an /initrd directory in your system, put bzImage and initrd.gz there, rename bzImage as vmlinuz and add the lines in Listing 1 to lilo.conf.
At this point run LILO, reboot and choose the “Distro” label at the LILO prompt to boot with your new distribution.
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!
- Stunnel Security for Oracle
- SourceClear Open
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Google's SwiftShader Released
- Non-Linux FOSS: Caffeine!
- Parsing an RSS News Feed with a Bash Script
- Doing for User Space What We Did for Kernel Space
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