#!/bin/bash source ../functions/main # Some programs hard-wire paths to programs which don't exist yet. In order to # satisfy these programs, we create a number of symbolic links which will be # replaced by real files when we're installing all the software. # We must not use "-sf" to force the creation of a symlink, because we don't # want to write over a valid program if the install script needs to be # re-started. source=/tools/bin target=${LFS}/bin for link in ${source}/{bash,cat,echo,grep,pwd,sleep,stty}; do if [ ! -L ${target}/$(basename ${link}) ]; then ln -sv ${link} ${target} fi done # 'env' symlink is for glib source=/tools/bin target=${LFS}/usr/bin for link in ${source}/{env,file}; do if [ ! -L ${target}/$(basename ${link}) ]; then ln -sv ${link} ${target} fi done source=/tools/lib target=${LFS}/usr/lib for link in ${source}/libgcc_s.so{,.1} ${source}/libstd*so* ; do if [ ! -L ${target}/$(basename ${link}) ]; then ln -sv ${link} ${target} fi done if [ ! -L ${LFS}/bin/sh ]; then ln -sv bash ${LFS}/bin/sh fi # /etc/mtab can be either a regular file updated by mount/umount, or a symlink # to /proc/mounts. # # With linux < 2.6.26, /proc/mounts lacks information present in /etc/mtab such # as additional mount options. Thus a symlink breaks things like discquotas # which rely on parsing the additional mount options. As a result, we are # mostly all still using it as a plain file. # # With linux >= 2.6.26, /proc/mounts contains all of the information in # /etc/mtab, plus more. The mount system call can now pass all of the mount # options to the kernel, so no information is missing in /proc/mounts. This # has obviously useful benefits such as read-only root, and the state in # /etc/mtab never gets out of sync with reality (there are a number of open # bugs against mount where this occurs). ln -svfT /proc/mounts ${LFS}/etc/mtab exit $?