Note
The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
User:Drobbins/CLFS
Jump to navigation
Jump to search
Isolated CLFS Script
Right now, CLFS as-is requires some changes to the host system -- the creation of /tools
and /cross-tools
symlinks on the root filesystem, as well as creation of a clfs
user along with a custom .bash_profile
and .bashrc
for that user. Rather than do this, I'm working on getting each build working from a self-contained script as a regular user without these requirements.
The script below accomplishes the following things when it builds file-5.19
:
- It creates a shell that is unpolluted with existing environment settings, setting just what is needed for the build.
- Directory structure is located inside the user's home directory:
/home/drobbins/sexybeast
. - Cross-tools are located at
/home/drobbins/sexybeast/cross-tools
, and the build uses this path directly rather than/cross-tools
. This is done by tweaking$DESTDIR
formake install
rather than--prefix
for./configure
.
So I think script essentially wraps the CLFS cross-tools build process in a self-contained build environment without the typical CLFS host-related tweaks described above.
(bash source code)
#!/bin/bash
exec /usr/bin/env -i /bin/bash --noprofile --norc << "EOF"
set +h
umask 022
export HOME=/home/drobbins
export CLFS=$HOME/sexybeast
export CLFS_CROSS_TOOLS=${CLFS}/cross-tools
export D=${CLFS_CROSS_TOOLS}
export LC_ALL=POSIX
export PATH=$CLFS/cross-tools/bin:/bin:/usr/bin
unset CFLAGS CXXFLAGS
echo Hello.
export CLFS_HOST=$(echo ${MACHTYPE} | sed -e 's/-[^-]*/-cross/')
export CLFS_TARGET="powerpc64-unknown-linux-gnu"
export BUILD64="-m64"
cd file-5.19 && ./configure --prefix=/ --disable-static && \
make -j && \
make DESTDIR=${D} install
EOF