How to build JayOS from source: You will need an up-to-date JayOS source CD and a ton of free disk space-- at least eight gigs, not including room for the ISOs. Quickstart: 1) Boot JayOS 2) Mount a scratch filesystem on /lfs. Something like: dd if=/dev/zero of=/mnt/lfs.fs bs=1024k count=8192 3) Run /root/build.sh *** SVN Update *** JayOS source is now available for browsing or checkout from the subversion repository http://svn.jayos.lfs-matrix.net/jayos *** The Toolchain ** The magic toolchain combo used to build JayOS consists of: BASH = bash-2.05b BINUTILS = binutils-2.15.90.0.1.1 BISON = bison-1.875a BZIP = bzip2-1.0.2 COREUTILS = coreutils-5.2.1 DIFFUTILS = diffutils-2.8.1 FINDUTILS = findutils-4.1.20 FLEX = flex-2.5.31 GAWK = gawk-3.1.3 GCC = gcc-3.3.3 GETTEXT = gettext-0.14.1 GLIBC = glibc-2.3.3-20040326 GREP = grep-2.5.1 GZIP = gzip-1.3.5 ICONV = libiconv-1.9.1 LLH = linux-libc-headers-2.6.11.2 M4 = m4-1.4 MAKE = make-3.80 NCURSES = ncurses-5.4 PATCH = patch-2.5.4 PERL = perl-5.8.6 SED = sed-4.0.9 TAR = tar-1.15.1 TEXINFO = texinfo-4.6 TEXTUTILS = textutils-2.0 UDEV = udev-058 UTIL-LINUX = util-linux-2.12a Upgrading any one of these components by itself (especially binutils, gcc, coreutils, or glibc) is likely to cause the build to fail. Because the toolchain is so tightly integrated version-wise, it is best to use a JayOS livecd to compile the JayOS sources, as other distros may not have the required sources. Note that this is the inevitable result of progress in the Linux world, not any particular shortcoming of the toolchain I used. Toolchains go "out of date" entirely due to changes and upgrades in gcc, glibc, and the Linux kernel. Many programs need to be patched in order to compile cleanly under gcc-3.3.4, while gcc-4.x requires other library upgrades in addition to specific program patches. Sooner or later I will upgrade the base of JayOS from lfs-5.0 to lfs-6.1, but only when a program I really want/need requires updates to libraries that are out of date by several revisions. Rhythmbox is a prime candidate since it requires gnome-2.10 and JayOS is only at gnome-2.6. The long explanation: Source code is located in the following directories on the CD: /src/lfs /src/jlfs Each directory has a Makefile which manages the building and installation of packages. The LFS Makefile is an almost-stock version from LFS-5.0, modified to include newer and other packages. The Makefile within the jlfs directory uses updated sources from BLFS-6.0 (roughly comparable to Fedora Core 4). That Makefile also controls the building of distribution media (CD and DVD). Four additional directories contain support scripts and any changes I've made to a package's default configuration. The make target is listed next to each one. /src/jlfs/skel (make root) /src/jlfs/skel-initrd (make boot) /src/jlfs/skel-efi (no specific target) /src/jlfs/skel-uml (make root-uml) /src/jlfs/skel-qemu (make isowin) The whole build process is tied together by /root/build.sh. When run, it will copy the sources from CD, compile everything, and create a LiveCD ISO. Once the ISO is finished, it's a good idea to keep /lfs around to speed up subsequent builds. The anatomy of /usr/src/Makefile: The Makefile is really just a huge shell script executed by a smart interpreter, make. At the top, lots of variables are defined. You probably won't need to modify any except for maybe the kernel version and root filesystem size. The latter can be reduced almost in half if you choose not to build anything other than LFS. After the variables is a series of stanzas which identify the following make targets: make gnome make strip-man make usr make vanilla make isox86 make isox86-short make isoimac make isowin Each target is on a single line by itself ending with a colon. The default entry point into the Makefile, where execution begins when you type "make" without arguments/targets, is "all". The "all" target first sets up the shell environment, then executes the target "inside-chroot". The latter target (as well as its sister target "inside-gnome") parses a huge list of targets, one named for each program to be built. Adding a new program to the build process is as easy as creating a new target (but we'll get into that later). Make is designed to check the current directory for directories named the same as the Makefile targets. What this means is, if there is a target called linux-2.6.16 and you run "make", make will execute the target only if the directory linux-2.6.16 does NOT exist. The difference between running "make" and "make linux-2.6.16" is the latter is compiled and installed relative to / not /lfs. Installing anything outside of the chrooted environment of /lfs is likely to fail unless /usr is writeable. (See the section below on Unionfs). How to upgrade an already-installed program: * copy the tarball to /usr/src * edit Makefile; change all references to the version number * remove old source directory (/usr/src/program-1.0.0) * cd to /usr/src and type "make" Programs will be installed relative to /lfs, but won't be directly usable until you rebuild/reload the root and usr filesystems with: * cd /usr/src && make root && make usr Filesystems will be installed under /lfs/build/livecd. It *is* possible to remount /usr without rebooting. Here's how: * quit the GUI by hitting ctrl-alt-backspace * unmount anything unmountable with "umount -av" * run "/etc/init.d/cups stop; /etc/init.d/sshd stop" * run "fuser -m /usr" and kill remaining process(es) * unmount the loop device /usr is mounted on (umount /dev/loop0) * detach that same device (losetup -d /dev/loop0) Now you can do: * mount -o loop /lfs/build/livecd/fs/usr.fs /usr * hit Alt-F1 to get to first virtual terminal, then * ctrl-D to exit that shell and launch the GUI. How to use Unionfs: A much simpler way to remount /usr without rebooting is to make /usr a union filesystem. See the short script /root/bin/unify. You'll want to make a directory called /usb/fs/ufs (or change that variable). It's best for it to be on a filesystem whose type supports links. In short, all you would do is run "unify /usr" to effectively make /usr writeable. All further changes and updates will be written to your save directory. When you are finished, run "umount /usr". You can unify and unmount over and over again, so have fun! How to rebuild the initial ramdisk: The source for initrd.gz begins in the Makefile (search for ^boot). The Makefile creates and mounts a loopback file, then populates it with the contents of /usr/src/skel-initrd (where you can make your modifications). The initial ramdisk only needs to be rebuilt if one of the following has changed: * isolinux configuration files in / and /boot of LiveCD * /linuxrc * kernel modules in /lib * busybox in /bin * cd to /usr/src and type "make boot"