CLFS and Jhalfs

Pierre Labastie pierre.labastie at neuf.fr
Tue Nov 12 07:55:28 PST 2013


Le 12/11/2013 15:44, William Harrington a écrit :
> On Nov 12, 2013, at 7:47 AM, Pierre Labastie wrote:
>
>> Sounds good for the TODO list. If you do not mind, I would tackle the
>> config file first, then the choice in CLFS.
>>
>> But do not expect anything before the end of the week, or so...
>>
>> Regards,
>> Pierre
> No hurry. These are things on the back burner which would be nice to
> have but not quite necessary, but a very formidable addition.
> There are things I end up doing repeatedly after a clfs build with
> jHALFS, and it peaks my interest in config additions.
In the mean-time, you could use the custom tools for that. Just use the
template given and addfiles to the custom/config directory. For example,
I have (for LFS in a virtual machine under qemu):
-------------------------------------------------
~/downloads/jhalfs$ ls custom/config
950-networkconf  952-initramfs  955-cpio
951-hostconf     953-lvm2       956-mkinitramfs
-------------------------------------------------
and 950-networkconf contains:
-------------------------------------------------
~/downloads/jhalfs$ cat custom/config/950-networkconf
#
# $Id: template 3561 2012-02-19 10:54:17Z pierre $
#
# Any comments you wish to add
#

PKG=""
PKG_VERSION=""
PKG_FILE=""
URL=""
MD5=""
for i in PATCH{1..10}; do
    unset $i
done
PATCH1=""

( cat << "xEOFx"
cat > /etc/hosts << "EOF"
# Begin /etc/hosts (network card version)

127.0.0.1 localhost
10.0.2.9 virtuallfs

# End /etc/hosts (network card version)
EOF
# The location of the next file is different on
# CLFS
cat > /etc/sysconfig/ifconfig.enp0s3 << "EOF"
ONBOOT=yes
IFACE=enp0s3
SERVICE=ipv4-static
IP=10.0.2.9
GATEWAY=10.0.2.2
PREFIX=24
BROADCAST=10.0.2.255
EOF
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf


nameserver 10.0.2.3

# End /etc/resolv.conf
EOF
echo "HOSTNAME=virtuallfs" > /etc/sysconfig/network
xEOFx
) > tmp

-------------------------------------------------
In 951-hostconf, I have:
-------------------------------------------------

~/downloads/jhalfs$ cat custom/config/951-hostconf
#
# $Id: template 3561 2012-02-19 10:54:17Z pierre $
#
# Any comments you wish to add
#

PKG=""
PKG_VERSION=""
PKG_FILE=""
URL=""
MD5=""
for i in PATCH{1..10}; do
    unset $i
done
PATCH1=""

( cat << "xEOFx"
cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock

UTC=0

# Set this to any options you might need to give to hwclock,
# such as machine hardware clock type for Alphas.
CLOCKPARAMS=

# End /etc/sysconfig/clock
EOF
cat > /etc/sysconfig/console << "EOF"
# Begin /etc/sysconfig/console

UNICODE="1"
KEYMAP="fr-latin9"
LEGACY_CHARSET="iso-8859-15"
FONT="lat0-16 -m 8859-15"

# End /etc/sysconfig/console
EOF
cat > /etc/profile << "EOF"
<... taken from BLFS book...>
EOF
install --directory --mode=0755 --owner=root --group=root /etc/profile.d
install --directory --mode=0755 --owner=root --group=root /etc/skel
cat > /etc/profile.d/dircolors.sh << "EOF"
<... From BLFS book ...>
EOF
cat > /etc/profile.d/extrapaths.sh << "EOF"
<... from BLFS book ...>
EOF
cat > /etc/profile.d/readline.sh << "EOF"
<...same ...>
EOF
cat > /etc/profile.d/umask.sh << "EOF"
<... same ...>
EOF
cat > /etc/profile.d/i18n.sh << "EOF"
# Set up i18n variables
export LANG=fr_FR.UTF-8
EOF
cat > /etc/bashrc << "EOF"
<... from BLFS book ...>
EOF
cat > /etc/skel/.bash_profile << "EOF"
<... from BLFS book ...>
EOF
cat > /etc/skel/.bashrc << "EOF"
<... from BLFS book ...>
EOF
cat > /etc/skel/.bash_logout << "EOF"
< ... same ...>
EOF
dircolors -p > /etc/dircolors
cp /etc/skel/.b* /root
cat > /etc/sysconfig/mouse << EOF
# Begin /etc/sysconfig/mouse

MDEVICE="/dev/input/mice"
PROTOCOL="imps2"
GPMOPTS=""

# End /etc/sysconfig/mouse
EOF
useradd -m -c 'Pierre Labastie' pierre
mkdir -p /etc/sudoers.d
cat > /etc/sudoers.d/10-pierre << EOF
# Begin sudo config for pierre
[...]
# End sudo config for pierre
EOF
chmod  550 /etc/sudoers.d
chmod  440 /etc/sudoers.d/*
xEOFx
) > tmp

-------------------------------------------
Example for a package:
------------------------------------------
~/downloads/jhalfs$ cat custom/config/953-lvm2
#
# $Id: template 3561 2012-02-19 10:54:17Z pierre $
#
# Any comments you wish to add
#

PKG="lvm2"
PKG_VERSION="2.02.100"
PKG_FILE="LVM2.2.02.100.tgz"
URL="ftp://sources.redhat.com/pub/lvm2/LVM2.2.02.100.tgz"
MD5="9629cf5728544d7e637cafde1f73d777"
for i in PATCH{1..10}; do
    unset $i
done
PATCH1=""

( cat << "xEOFx"
./configure --prefix=/usr       \
             --exec-prefix=      \
             --with-confdir=/etc \
             --enable-applib     \
             --enable-cmdlib     \
             --enable-pkgconfig  \
             --enable-udev_sync &&
make
make install
xEOFx
) > tmp
--------------------------------------

The only things I must do "by hand" are setting
passwords for root and pierre.

Regards
Pierre




More information about the alfs-discuss mailing list