LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Blogs > The Slacker's Blog
User Name
Password

Notices

This is a semi-random collection of posts on nearly all things Slackware and Linux-related -- at least as I see it.
Rate this Entry

Build Notes for LFS 6.6 with Package Users -- Part 2

Posted 10-20-2010 at 02:58 PM by Lufbery
Updated 11-07-2010 at 08:26 PM by Lufbery

Continued from part 1.

IV. Known Issues with LFS Packages

The package user scripts and wrappers install just fine according to the hints instructions during the proper spot in chapter 6.

Chapter 6.6
Create a dummy ldconfig so that installations won't abort due to lack of permission when running ldconfig:

Code:
cat > /usr/lib/pkgusr/ldconfig << "EOF"
#/bin/bash
echo '*** ldconfig: This is a dummy. Run /sbin/ldconfig as root!'
exit 0
EOF
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 run of ‘/sbin/ldconfig’ might go unnoticed.

Finally, set up the LFS root user's Bash configuration to take advantage of the neat user name Bash completion feature mentioned in the package users hint:

Code:
cat > .bash_profile << EOF
# ~/.bash_profile
source $HOME/.bashrc
EOF

Code:
cat > .bashrc << EOF
# ~/.bashrc

complete -o default -o nospace -A user su finger pinky
 
alias lsl='ls -l -h'
alias rm='rm -i'
alias cp='cp -v -i'
alias mv='mv -v -i'
EOF
You'll notice that I add a few command aliases as well. The 'lsl' alias for ls -l is useful because the long form of the directory listing shows the owner and group for files and directories.

The -i switch for cp, mv, and rm is helpful because it asks me if I really want to delete, copy, or move something. They are optional, of course, but I'd recommend at least using the 'rm -i' option. It can be overridden with '-I', which only asks once for all files. So, when you're done with the untarred source directory, just type: 'rm -R -I <package-o.1.0>' to delete the whole directory in one fell swoop.

Linux Headers
The Linux headers install without a problem.

Man Pages
The man pages installed just fine too. As far as I can tell, the there's no attempt to make the posix man?p directories as indicated in the hint.

Glibc-2.11.1
Glibc can be tricky. I failed to build it as a package user and built/installed it as root. LQ user crts, however, found the solution.

Before executing 'make install' (or running the make_install.sh script):
1) The directory /usr/include/scsi is created and owned by linux-headers and therefore not an install directory. Installation of the 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:

Code:
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 package users install script helper prevents its replacement with the glibc version, but 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:

Code:
rm -v /usr/include/scsi/scsi.h
Finally, after installing Glibc, you will probably encounter an "empty file" error regarding /usr/info/dir. The install-package command can cope with a non-existent /usr/info/dir file but it will exit with an error if the file does exist and is empty. So run the following commands to make the file, /usr/info/dir group-writable:

Code:
chown 0:install /usr/info/dir
chmod 664 /usr/info/dir

Zlib-1.2.3
This builds without a problem as a package user.

Binutils-2.20
If you mount devpts according to the script above, then Binutils should build, test, and install without a problem.

If you don’t mount devpts with the gid and mode, then making /tools/libexec/pt_chown setuid root is a valid work-around.

GMP-5.0.0
MPFR-2.4.2
File-5.04

Nothing remarkable when built as a package user for the above packages.

GCC-4.4.3
Once again, I had trouble with GCC, but crts has the solution:

Before installing remove as root the following symlinks:

Code:
rm -f /usr/lib/libgcc_s.so{,.1}
Sed-4.2.1
Pkg-config-0.23

Nothing remarkable when built as a package user for the above packages.

Ncurses-5.7
Run /sbin/ldconfig after installation.

Util-linux-ng-2.17
As the hint says, Util-linux-ng wants to set write as setgid tty and u/mount as setuid root. I chose to go back as root and do just that. The decision to make a program setuid root is a personal one, of course, and the hint recommends caution when doing so for security reasons.

E2fsprogs-1.41.10
An additional directory needs to be install directories. E2fsprogs installs static libs in /usr/lib/pkgconfig:

Code:
chgrp install usr/lib/pkgconfig && \
  chmod g+w,o+t /usr/lib/pkgconfig
It also needs to modify /usr/share/info/dir when installing documentation. If you did not follow the directions in this document for chapter 6.6 (above) then:

Code:
chgrp install /usr/share/info/dir && \
  chmod g+w,o+t /usr/share/info/dir
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':

Code:
chown -R coreutils:coreutils /usr/src/coreutils
Some symlinks need to be removed as root before continuing the installation.

Code:
rm -f /bin/{cat,echo,pwd,stty}
Afterward log back in and perform the installation.

Iana-Etc-2.30
M4-1.4.13

Nothing special as a package user.

Bison-2.4.1
Make install failed because /usr/share/aclocal was not an install directory. Installation worked fine after correcting that error.

Procps-3.2.8
If you do not follow the directions above to make a dummy ldconfig, then make install fails because package users cannot run /sbin/ldconfig (as indicated in the hint's build notes). Just run ‘/sbin/ldconfig’ after installing.

Grep-2.5.4
Readline-6.1

Nothing special as a package user.

Bash-4.1
As with Coreutils, exit to the root user to run the tests. Be sure to chown everything back to the bash:bash after running the tests.

Before installation, change (as root) the ownership of /bin/bash to bash:

Code:
chown -h bash:bash /bin/bash
Do not delete this link.

Execute the last command as root:

Code:
exec /bin/bash --login +h
Libtool-2.2.6b
GDBM-1.8.3

Nothing special for a package user.

Inetutils-1.7
Installation went smoothly. Check the log file, make.err, for a list of binaries that want to be setuid root.

Perl-5.10.1
Chown /usr/bin/perl to perl:perl (as with bash above) before running 'make install' or the installation will not be able to remove the link and install perl. If you do not do this ahead of time, it will cause problems as crts notes:

“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 test suite for automake.”

Autoconf-2.65
Automake-1.11.1
Bzip2-1.0.5
Diffutils-2.8.1
Gawk-3.1.7
Findutils-4.4.2
Flex-2.5.35
Gettext-0.17
Groff-1.20.1

Nothing special for a package user.

GRUB-1.97.2
I did not build Grub, but the recommendation is to build and install it as root.

Gzip-1.4
IPRoute2-2.6.31
Kbd-1.15.1
Less-436
Make-3.81

Nothing special for a package user.

Man-DB-2.5.6
Installation initially fails with the error: “/bin/mkdir: cannot create directory `/usr/share/man/de': Permission denied.” Make /usr/share/man is an install directory to fix that error:

Code:
chgrp install /usr/share/man && chmod g+w,o+t /usr/share/man
Rerun ‘list_package’ script for previously installed packages to get man page summaries for installed binaries.

Module-Init-Tools-3.11.1
Patch-2.6.1

Nothing special for a package user.

Psmisc-22.10
Do not make the optional link to killall described in the LFS 6.6 book (obsolete for 6.7). Creating this optional link will cause trouble with sysvinit installation.
There is nothing special to do as a package user for Psmisc.

Continued in part 3...
Posted in Uncategorized
Views 12214 Comments 3
« Prev     Main     Next »
Total Comments 3

Comments

  1. Old Comment

    about smilies ...

    Hi,

    is it possible to disable the smilies? E.g. in the section perl:
    'perl:perl' has a smilie in between.
    Posted 11-02-2010 at 12:40 PM by crts crts is offline
  2. Old Comment

    about smilies ...

    Quote:
    Originally Posted by crts View Comment
    Hi,

    is it possible to disable the smilies? E.g. in the section perl:
    'perlerl' has a smilie in between.
    Yeah. I noticed that. I'll take a look to see if I can disable them and update the post.

    Yup. I disabled the smilies.
    Posted 11-07-2010 at 07:11 PM by Lufbery Lufbery is offline
    Updated 11-07-2010 at 07:56 PM by Lufbery
  3. Old Comment
    great stuff! Thanks!
    Posted 06-07-2011 at 09:22 AM by Janek566 Janek566 is offline
 

  



All times are GMT -5. The time now is 03:39 AM.

Main Menu

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration