Added a switch to submmint a real /etc/fstab file.
Some space clean-up.
This commit is contained in:
parent
1f1d6a145e
commit
50408d5a72
1 changed files with 35 additions and 7 deletions
42
jhalfs
42
jhalfs
|
@ -37,8 +37,8 @@ Options:
|
||||||
--no-toolchain-test don't run the toolchain testsuites. This
|
--no-toolchain-test don't run the toolchain testsuites. This
|
||||||
disables also the build of TCL, Expect
|
disables also the build of TCL, Expect
|
||||||
and DejaGNU
|
and DejaGNU
|
||||||
|
|
||||||
--timezone TIMEZONE set TIMEZONE as the local timezone. If not
|
--timezone TIMEZONE set TIMEZONE as the local timezone. If not
|
||||||
specified, Europe/London will be used.
|
specified, Europe/London will be used.
|
||||||
|
|
||||||
--page_size PAGE set PAGE as the default page size (letter
|
--page_size PAGE set PAGE as the default page size (letter
|
||||||
|
@ -46,12 +46,17 @@ Options:
|
||||||
build Groff. If not specified, \"letter\"
|
build Groff. If not specified, \"letter\"
|
||||||
will be used.
|
will be used.
|
||||||
|
|
||||||
|
--fstab FILE use FILE as the /etc/fstab file for the
|
||||||
|
LFS system. If not specified, a default
|
||||||
|
/etc/fstab file with dummy values is
|
||||||
|
created.
|
||||||
|
|
||||||
-C, --kernel-config FILE use the kernel configuration file specified
|
-C, --kernel-config FILE use the kernel configuration file specified
|
||||||
in FILE to build the kernel. If not found,
|
in FILE to build the kernel. If not found,
|
||||||
the kernel build is skipped.
|
the kernel build is skipped.
|
||||||
|
|
||||||
-M, --run-make run make on the generated Makefile
|
-M, --run-make run make on the generated Makefile
|
||||||
|
|
||||||
"
|
"
|
||||||
|
|
||||||
help="\
|
help="\
|
||||||
|
@ -169,6 +174,18 @@ while test $# -gt 0 ; do
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--fstab )
|
||||||
|
test $# = 1 && eval "$exit_missing_arg"
|
||||||
|
shift
|
||||||
|
if [ -f $1 ] ; then
|
||||||
|
FSTAB=$1
|
||||||
|
else
|
||||||
|
echo -e "\nFile $1 not found. Verify your command line.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
--kernel-config | -C )
|
--kernel-config | -C )
|
||||||
test $# = 1 && eval "$exit_missing_arg"
|
test $# = 1 && eval "$exit_missing_arg"
|
||||||
shift
|
shift
|
||||||
|
@ -623,7 +640,7 @@ EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In the mount of kernel filesystems we need to set LFS
|
# In the mount of kernel filesystems we need to set LFS
|
||||||
# and not to use chroot.
|
# and not to use chroot.
|
||||||
if [ ${i:4:6} = "kernfs" ] ; then
|
if [ ${i:4:6} = "kernfs" ] ; then
|
||||||
(
|
(
|
||||||
|
@ -691,7 +708,7 @@ EOF
|
||||||
continue
|
continue
|
||||||
# The filesystems can't be unmounted yet due that the user must
|
# The filesystems can't be unmounted yet due that the user must
|
||||||
# to enter to the chroot environment to create the root password,
|
# to enter to the chroot environment to create the root password,
|
||||||
# edit several files and setup Grub,
|
# edit several files and setup Grub,
|
||||||
elif echo $i | grep -q "reboot" ; then
|
elif echo $i | grep -q "reboot" ; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
@ -735,7 +752,7 @@ EOF
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Put in place the kernel .config file
|
# Put in place the kernel .config file
|
||||||
if [ ${i:4:6} = "kernel" ] ; then
|
if [ ${i:4:6} = "kernel" ] ; then
|
||||||
(
|
(
|
||||||
|
@ -745,6 +762,16 @@ EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if we have a real /etc/fstab file
|
||||||
|
if [ ${i:4:5} = "fstab" ] && [ -n "$FSTAB" ] ; then
|
||||||
|
(
|
||||||
|
cat << EOF
|
||||||
|
@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >logs/$i && \\
|
||||||
|
cp -v $FSTAB \$(LFS)/etc/fstab >>logs/$i 2>&1 && \\
|
||||||
|
echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >>logs/$i
|
||||||
|
EOF
|
||||||
|
) >> $MKFILE.tmp
|
||||||
|
else
|
||||||
# Initialize the log an run the script
|
# Initialize the log an run the script
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
@ -753,13 +780,14 @@ EOF
|
||||||
echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >>logs/$i
|
echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=0??-* \$(LFS)\`\n" >>logs/$i
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove the build directory except if the package build fails.
|
# Remove the build directory except if the package build fails.
|
||||||
if [ ${i:4:11} = "bootscripts" -o ${i:4:6} = "kernel" ] ; then
|
if [ ${i:4:11} = "bootscripts" -o ${i:4:6} = "kernel" ] ; then
|
||||||
(
|
(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
|
@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
|
||||||
rm -r \$(LFS)\$(SRC)/\$\$ROOT
|
rm -r \$(LFS)\$(SRC)/\$\$ROOT
|
||||||
EOF
|
EOF
|
||||||
) >> $MKFILE.tmp
|
) >> $MKFILE.tmp
|
||||||
fi
|
fi
|
||||||
|
|
Reference in a new issue