max | 9 Oct 11:20 2010
Picon

Re: LFS-build-notes

Hi,

here are my notes. I generally keep manually created configuration files
as root.
You will notice that I build LFS-6.6 on a Virtual machine (32-bit
emulation). But I think that the procedure is also valid for a 'real'
machine. My last LFS was 6.3 on a real machine and it also build fine
with the user based package management. The host is of course the LFS
liveCD.

I skipped commenting on packages that do not need special attention. I
also do not comment on errors which are related to manpages. I also do
not see the '/usr/share/aclocal' issue in my notes. I must have missed
to document that. Keep that in mind when installing Bison.

-------------------------------------------------------------------------
Build on Virtual Machine: VirtualBox, Version: 3.1.6_OSE r59338, Sun
Microsystems

CHAPTER 5:
----------

chapter 5.17: coreutils-8.4
After installing su-tools in chapter 5 make a symlink
/tools/bin/su -> /tools/bin/su-tools

At the end of chapter 5:
  chmod 4755 /tools/libexec/pt_chown
This is important in order for expect to work properly when called by a
packageuser.

CHAPTER 6:
----------

Chapter 6.6:
------------
Before moving on to the next chapter create the (!)file(!) /usr/info/dir
and give it write permission for the install group. Now it can be
updated by the package users.
As root
  touch /usr/info/dir
  chown 0:install /usr/info/dir
  chmod 664 /usr/info/dir
Create a dummy ldconfig so that installations won't abort due to lack of
permission when running ldconfig.

  #/bin/bash
  echo '*** ldconfig: This is a dummy. Run /sbin/ldconfig as root!'
  exit 0

Save it as
  /usr/lib/pkgusr/ldconfig

It is not always necessary to run ldconfig after installing a package
but it is strongly recommended. With the dummy ldconfig in place
installation will not abort and a necessary /sbin/ldconfig might go
unnoticed.

Chapter 6.9: glibc-2.11.1
-------------------------
Before executing 'make install':
1.) The directory /usr/include/scsi is created and owned by
linux-headers and therefore not an install directory. Installation of
glibc headers
  - glibc-2.11.1/sysdeps/unix/sysv/linux/scsi/sg.h
  - glibc-2.11.1/sysdeps/unix/sysv/linux/scsi/scsi_ioctl.h
into that directory will fail.
Make /usr/include/scsi an install directory. As root issue
  chgrp install /usr/include/scsi
  chmod ug=rwx,o=rxt /usr/include/scsi

2.) The header ../glibc-2.11.1/sysdeps/unix/sysv/linux/scsi/scsi.h
already exists in /usr/include/scsi and is owned by linux-headers.
The install script tries to replace it with a glibc version.
The glibc version has to be installed. Otherwise corresponding binaries
will not be installed and compilation of util-linux package will fail
later. Hence remove as root
  rm -v /usr/include/scsi/scsi.h

Chapter 6.12: binutils-2.20
---------------------------
/tools/libexec/pt_chown needs to be suid root at this point, otherwise
'expect -c "spawn ls"' will fail! The tests will also fail as a direct
consequence. /usr/lib/glibc/pt_chown won't do at this point since
'expect' uses the /tools version.

Chapter 6.15: gcc-4.4.3
-----------------------
Before installing remove as root the following symlinks:
  rm -f /usr/lib/libgcc_s.so{,.1}

Chapter 6.18: ncurses-5.7
-------------------------
I did not build non-wide-character libs. But since there was no special
handling needed previously I do not expect problems.

Chapter 6.19: util-linux-ng-2.17
--------------------------------
If scsi.h from kernel-header package was kept then compilation will
fail. In this case go back and install scsi.h from glibc.

Chapter 6.20: e2fsprogs-1.41.9
------------------------------
The command
  make install-libs
fails due to a permission issue for directory /usr/lib/pkgconfig/. This
directory was created by util-linux and is not an install directory by
default. Making /usr/lib/pkgconfig/ an install directory prevents this
error.

Chapter 6.21: coreutils-8.4
---------------------------
Logout to run the tests that were meant to be run as root. Then run the
remaining tests as user 'nobody'.
As root change ownership back to coreutils. This is just a precaution in
case the tests that were run as root did something 'funny'.
  chown -R coreutils:coreutils /usr/src/coreutils
Some symlinks need to be removed as root before continueing the
installation.
  rm -f /bin/{cat,echo,pwd,stty}
Afterwards log back in and perform the installation.

Chapter 6.28: bash-4.1
----------------------
See notes for running tests as user nobody in coreutils.
As root change ownership of /bin/bash to bash
  chown -h bash:bash /bin/bash
Do not delete this link.
Execute the last command as root
  exec /bin/bash --login +h

Chapter 6.32: perl-5.10.1
-------------------------
After installation the symlink /usr/bin/perl still points
to /tools/bin/perl. It is not replaced by a link to /usr/bin/perl5.10.1
since it is owned by root. The problem at this point is that this error
did _not_ cause the installation to abort and therefore it went
unnoticed! It will give you trouble when running the testsuite for
automake.

Chapter 6.34: automake-1.11.1
-----------------------------
If all tests start to fail then check where /usr/bin/perl points to. If
it still points to /tools/bin/perl then change this as root
  rm /usr/bin/perl
  ln -sv perl5.10.1 /usr/bin/perl
  chown -h perl:perl /usr/bin/perl
Login as pkguser and rebuild automake-1.11.1 with a fresh untarred
source.

Chapter 6.52: psmisc-22.10
--------------------------
[obsolete as of LFS 6.7]
According to the book lfs-6.6-rc1 you may make an optional link to
killall
  ln -sv killall /bin/pidof
However, killall has bin installed in /usr/bin and not in /bin.
So you are creating a dead link. If you want /bin/pidof to point to
killall then issue
  ln -sv /usr/bin/killall /bin/pidof
Creating this optional link will cause trouble with sysvinit
installation.

Chapter 6.53: shadow-4.1.4.2
----------------------------
After finishing the installation logout and configure shadow as root.
Fix the permissions for passwd
  chown 0 /bin/passwd
  chmod 4765 /bin/passwd
By default /bin/su got permission 4755 but with user:group set to
shadow:shadow. This prohibits roots from using su. Fix permission for su
with
  chmod 0755 /bin/su
If you want normal users to be able to use su then apply following
changes
  chown 0 /bin/su
  chmod 4755 /bin/su
Keep in mind that other binaries of this package might need permission
adjustment, too, e. g. useradd, groupadd, etc.
Apply additional 'sed' to avoid future complains about non-existent
default group.
  sed -i '/GROUP/d' /etc/default/useradd

Chapter 6.54: sysklogd-1.5
--------------------------
Installation fails because the Makefile uses /usr/bin/install instead of
the wrapper-script. This is 'hardcoded'. Correct this with by changing
the offending line to use the wrapper-install:
  sed -i 's <at> \(INSTALL =\) /usr/bin/install <at> \1 /usr/lib/pkgusr/install <at> '
Makefile
Alternative:
  make INSTALL=install install

Chapter 6.55: sysvinit-2.86
---------------------------
[obsolete as of LFS 6.7]
Installation might fail because /bin/pidof is owned by psmisc. Either
remove this link as user psmisc
  rm /bin/pidof # this is recommended
or if you really prefer to keep the psmisc version
  sed -i '\ <at> (ROOT)/bin/pidof <at> d' src/Makefile # NOT recommended
It is strongly discouraged to use the /bin/pidof from the psmisc package
(which is a link to /usr/bin/killall).

Chapter 6.57: texinfo-4.13a
After installation recreate the file /usr/share/info/dir as user root.
Best option here is to store the following commands in a script since
recreation of /usr/share/info/dir might be necessary in the future.
Choose an appropriate place and name for the script.

#!/bin/bash
# /usr/sbin/recreate-info-dir
rm -vf /usr/share/info/dir
for file in /usr/share/info/*; do
	install-info "$file" /usr/share/info/dir 2>/dev/null
done
chown 0:install /usr/info/dir
chmod 664 /usr/info/dir

Chapter 6.58: udev-151
[obsolete?]
Execute the command
  mknod -m0666 /lib/udev/devices/null c 1 3
as root.

CHAPTER 7:
----------

Chapter 7.2: lfs-bootscript
---------------------------
Install these scripts as user bootscripts:bootscripts. No problems
expected.

CHAPTER 8:
----------

Chapter 8.3: linux-2.6.32.7 (The Kernel)
----------------------------------------
When trying to copy the compiled kernel image to /boot a Permission
denied error will occur. /boot is not an install directory hence
installation fails. Make /boot an install-dir and the problem is solved.

Chapter 8.4: GRUB
-----------------
All the steps in this chapter should be performed as root. Creating a
rescue floppy optional. Manually edit /boot/grub/grub.cfg. You will most
probably have to change entries like /dev/hda1 to /dev/sda1. Also edit
the /etc/fstab accordingly.
-------------------------------------------------------------------------

That's it so far. I hope I did not miss something. One final note:
When I first tried to boot there was a problem mounting /dev/sda1. fsck
never succeeded and failed with a fatal error. Changing the
corresponding line in /etc/rc.d/init.d/checkfs from
  fsck ${options} -a -A -C -T
to
  e2fsck -f /dev/sda1
took care of the problem. Afterwards the line was changed back to the
original command and settings. It seems that this error occurs when grub
is installed with the --force switch. I had to --force grub because it
was complaining about cylinder boundaries. I think the reason for that
might be creating the partitions with parted. It seems, that parted
causes some issues with cylinder boundaries. So this error is probably
_not_ related to the package management technique.
Maybe the book should advice against using parted for LFS. But I am not
sure about that yet.

-- 
Regards
Max

--

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Gmane