Monday, September 15, 2008

Trying blfs-tool with custom-tools

One can learn from the blfs book while creating custom-tools scripts to be included in a jhalfs build. I wanted to get the blfs-tool to create scripts in the same format for packages that require complex dependency calculations. I also wanted to find some way to get jhalfs to build custom-tools after the system is built and up and running.

I have approached the steep learning curve of the makefiles and scripts and xml files that make up the jhalfs system. The jhalfs system can be run in at least 2 modes: system building mode and blfs-tool mode. My interest was in mixing up the modes to get the benefits of both. Also, I hoped to gain some package management assistance from utilizing jhalfs.

What is evolving is a modified version of scripts.xsl which produces scripts in custom-tools format, a customized Makefile.custom for jhalfs to make from custom-tools after the system is up and running, and a few scripts to pull it all together.

This is an example run:
cd ~/blfs_root
make (... I selected w3m ...)
sh BLFS_TO_CUSTOM w3m
cd /jhalfs
sh remake_custom.sh
sh make_custom.sh

This is an alternative example run without using blfs-tool:
create scripts in /jhalfs/custom/config by hand
cd /jhalfs
sh remake_custom.sh
sh make_custom.sh

Explanations:

The file scripts.xsl exists in /jhalfs/BLFS/libs and in ~/blfs_root/libs. This file is used in transforming the xml version of the blfs book into scripts to run.
~/blfs_root/libs/scripts.xsl

The script BLFS_TO_CUSTOM copies the modified format scripts generated by blfs-tool to /jhalfs/custom/config assigning a number computed as highest preexisting number + seqence number.
~/blfs_root/BLFS_TO_CUSTOM

The script remake_custom.sh recomposes Makefile.custom based on all the files in /jhalfs/custom/config and makes them scripts in /jhalfs/lfs-commands/custom-tools. Additional, it downloads sources and patches that do not preexist in /sources.
/jhalfs/remake_custom.sh

The script make_custom.sh just does this:
make -f Makefile.custom $*
/jhalfs/make_custom.sh

The Makefile.custom is a watered-down version of jhalfs (LFS build) Makefile that doesn't really do chroot and it just does CUSTOM_TOOLS.
/jhalfs/Makefile.custom


Caveat 1:
Packages with oddball naming conventions like gc6.8.tar.gz, links-2.1pre33.tar.bz2 may not perform expected dependency checking function due to the difficulty of calculating a name for /var/lib/jhalfs/BLFS that coincides with ~/blfs_root/packages. Manual adjustments required.

Caveat 2:
Some patch names ending in other than .patch would get ignored.

Caveat 3:
The xorg7 workarounds were too extensive for me to convert to "custom-tools style" and the scripts for xorg7 generated using the modified scripts.xsl file won't work. Instead, in Build modular xorg X11R7, I used a different method.
I have not tested building xorg7 using the blfs-tool, but it would be necessary to replace the modified scripts.xsl with the original one in the jhalfs-2.3.1.tar.bz2 tarball.
Then to use the standard blfs-tool method:
cd ~/blfs_root
make (... select xorg7 ...)
cd xorg7
../gen-makefile.sh
make

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Click blog title for the latest post