Ubuntu?

Michael J. Lynch mlynch at gcom.com
Tue Jul 31 07:22:40 PDT 2007


Hi all,

    I've been using ALFS hosted on an Ubuntu machine and have
run into a couple of problems.  I worked around the problems myself
but I figured I'd post the problems and my work arounds for anyone
else that may run into them.

    First, I'm using an older Ubuntu distro (Hoary).  There were two
major problems I ran into.

    The first problem was with the "md5sum" command.  For whatever
reason the md5sum command on Ubuntu Hoary won't allow use of
stdin as the source of the "checkfile" argument.  The "checkfile" arg
must come from a real file.  So my fix was to modify the func_download_pkgs
file to write the MD5 variable to a temporary file and then change the
actual check to:

    if ! md5sum -c .t >/dev/null ; then

The change was required in two places.

    The second problem was with the tar command.  For whatever
reason the tar command on Ubuntu Hoary can not untar files with
.bz2, .gz, etc. extensions.  The files must be uncompressed before
being unarchived.  Solving this problem took a little more work.  I had
to make a wrapper script (TAR) for tar that checked the extension
and then used the correct uncompressor and piped the output to
tar as follows:


> #/bin/sh
>
> opts=""
> while [ $# -gt 1 ]
> do
>         opts="${opts}${1} "
>         shift
> done
>
> echo ${1} | grep -q ".tar.gz"
> if [ $? -eq 0 ]
> then
>         gunzip -c ${1} | tar ${opts}- 2>/dev/null
> else
>         bunzip2 -c ${1} | tar ${opts}- 2>/dev/null
> fi

The second part of the change was to replace all occurrences of "tar" in
makefile-functions with "TAR".  Finally, I had to add:

@sudo cp -av /bin/TAR /mnt/build_dir/tools/bin

to the "mk_CHROOT:" target in LFS/master.sh, and I had to add:

@sudo cp -av /tools/bin/TAR /mnt/build_dir/bin

to the "mk_BOOT:" targget in LFS/master.sh.


Just one last quick note.  It would be nice if advanced features of these
commands were not used so the ALFS system would work out of the
box with distros like Ubuntu.  Just my 2 cents.


Mike





More information about the alfs-discuss mailing list