projects
/
hvlinux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added permission to mount dvd for normal users.
[hvlinux.git]
/
functions
/
main
diff --git
a/functions/main
b/functions/main
index
10c1693
..
d888168
100644
(file)
--- a/
functions/main
+++ b/
functions/main
@@
-2,6
+2,10
@@
set -o errtrace # Let shell functions inherit ERR trap.
set -o errexit
set -o errtrace # Let shell functions inherit ERR trap.
set -o errexit
+# Don' t locate and remember (hash) commands as they are looked up for
+# execution (don' t remember path):
+set +h
+
hvtrap_setup()
{
# Setting ERR trap does implicit `set -o errexit'.
hvtrap_setup()
{
# Setting ERR trap does implicit `set -o errexit'.
@@
-566,11
+570,19
@@
hv_useradd()
# Applying patch
# First argument is the name of the patch
# Applying patch
# First argument is the name of the patch
-# Second argument is the package name (target dir in $LFS_TMP)
+# Second argument is the package name
+# Third argument: optional target directory (default is $LFS_TMP)
apply_patch()
{
local PATCH_FILE=${1}
apply_patch()
{
local PATCH_FILE=${1}
- local TARGET_DIR=${2}
+ local PACKAGE=${2}
+ local TARGET_DIR=""
+
+ if [ $# -eq 3 ]; then
+ TARGET_DIR=${3}/${PACKAGE}
+ else
+ TARGET_DIR=${LFS_TMP}/${PACKAGE}
+ fi
if [ -z "${PATCH_FILE}" ]; then
echo
if [ -z "${PATCH_FILE}" ]; then
echo
@@
-585,7
+597,7
@@
apply_patch()
fi
echo "Applying patch: ${PATCH_FILE}"
fi
echo "Applying patch: ${PATCH_FILE}"
- patch -Np1 -d ${
LFS_TMP}/${
TARGET_DIR} -i ${LFS_PKG_DIR}/${PATCH_FILE}
+ patch -Np1 -d ${TARGET_DIR} -i ${LFS_PKG_DIR}/${PATCH_FILE}
}
# Applying any patch(es) found for the current package.
}
# Applying any patch(es) found for the current package.
@@
-598,7
+610,7
@@
apply_patch()
apply_patches()
{
PACKAGE=${1}
apply_patches()
{
PACKAGE=${1}
- local TARGET_DIR=
${PACKAGE}
+ local TARGET_DIR=
""
# Checking for correct number of arguments
if [ $# -gt 2 ]; then
# Checking for correct number of arguments
if [ $# -gt 2 ]; then
@@
-609,15
+621,13
@@
apply_patches()
if [ $# -eq 2 ]; then
TARGET_DIR=${2}
if [ $# -eq 2 ]; then
TARGET_DIR=${2}
- else
- TARGET_DIR=${PACKAGE}
fi
# Checking if we can find at least one patch.
if ls ${LFS_PKG_DIR}/${1}-*.patch 1> /dev/null 2>&1; then
cd ${LFS_PKG_DIR}
for patch in ${1}-*.patch; do
fi
# Checking if we can find at least one patch.
if ls ${LFS_PKG_DIR}/${1}-*.patch 1> /dev/null 2>&1; then
cd ${LFS_PKG_DIR}
for patch in ${1}-*.patch; do
- apply_patch ${patch} ${TARGET_DIR}
+ apply_patch ${patch} ${
PACKAGE} ${
TARGET_DIR}
done
fi
done
fi
@@
-644,9
+654,10
@@
static_decompressed_dirname()
# and extract base directory name with awk.
# tar 1.23 reports an error when using pipes, so
# remove error message with "2> /dev/null"
# and extract base directory name with awk.
# tar 1.23 reports an error when using pipes, so
# remove error message with "2> /dev/null"
+ # (we extract the last line from tar output)
DIRNAME=$(tar ${TAR_OPTS} -tf \
${LFS_PKG_DIR}/${PACKAGE}.${arch_ext} 2> /dev/null | \
DIRNAME=$(tar ${TAR_OPTS} -tf \
${LFS_PKG_DIR}/${PACKAGE}.${arch_ext} 2> /dev/null | \
-
head -n
1 | sed 's!^\./!!' | awk -F \/ '{print $1}')
+
tail -n
1 | sed 's!^\./!!' | awk -F \/ '{print $1}')
;;
zip)
DIRNAME=$(unzip -l \
;;
zip)
DIRNAME=$(unzip -l \
@@
-753,7
+764,7
@@
ipkg_display_build_infos()
echo " BUILD64: ${BUILD64}"
echo " CFLAGS: ${CFLAGS}"
echo " CPPFLAGS: ${CPPFLAGS}"
echo " BUILD64: ${BUILD64}"
echo " CFLAGS: ${CFLAGS}"
echo " CPPFLAGS: ${CPPFLAGS}"
- echo " CXXFLAGS: ${CFLAGS}"
+ echo " CXXFLAGS: ${C
XX
FLAGS}"
echo " LDFLAGS: ${LDFLAGS}"
echo " RANLIB: ${RANLIB}"
echo " CC: ${CC}"
echo " LDFLAGS: ${LDFLAGS}"
echo " RANLIB: ${RANLIB}"
echo " CC: ${CC}"
@@
-796,6
+807,7
@@
indicate_pkg_build_complete()
# Arg. #1: Package name and version (ex: gcc-4.5.1)
# Remaining arguments: Additional configure options
# Options:
# Arg. #1: Package name and version (ex: gcc-4.5.1)
# Remaining arguments: Additional configure options
# Options:
+# -c Do not decompress package
# -j Disable parallel make for this package
# -l Unique identification label in 'install.log'
# (default is package name and version)
# -j Disable parallel make for this package
# -l Unique identification label in 'install.log'
# (default is package name and version)
@@
-806,24
+818,29
@@
indicate_pkg_build_complete()
# gnome
# xorg
# pm
# gnome
# xorg
# pm
+# -t Enable dependency tracking
# -s Name of script to source (default is from name of package)
ipkg()
{
START_TIME=$(echo `date +%s`)
unset ALT_SCRIPT_NAME
# -s Name of script to source (default is from name of package)
ipkg()
{
START_TIME=$(echo `date +%s`)
unset ALT_SCRIPT_NAME
+
+ export DECOMPRESS="1"
export IPKG_MODE="ac" # Default mode if not specified
export HVLABEL="" # Global variable
export IPKG_MODE="ac" # Default mode if not specified
export HVLABEL="" # Global variable
+ export ENABLE_DEPENDENCY_TRACKING="0"
local HVMAKE_ORIG=${HVMAKE}
local HVMAKE_ORIG=${HVMAKE}
- # Make sure to get latest variables assignments (ex: pkg-config)
- source /etc/profile
-
- while getopts "jl:m:s:" flag ;do
+ while getopts "cjl:m:s:t" flag ;do
case ${flag} in
case ${flag} in
+ c)
+ # Do not decompress package
+ DECOMPRESS="0"
+ ;;
j)
j)
- # Disable parallel make onlyfor this package
+ # Disable parallel make only
for this package
HVMAKE="make"
;;
l)
HVMAKE="make"
;;
l)
@@
-846,6
+863,10
@@
ipkg()
# Alternate script name
ALT_SCRIPT_NAME=${OPTARG}
;;
# Alternate script name
ALT_SCRIPT_NAME=${OPTARG}
;;
+ t)
+ # Do not disable dependency tracking
+ ENABLE_DEPENDENCY_TRACKING="1"
+ ;;
?)
echo "${FUNCNAME}(): Invalid option: ${OPTARG}."
return 1
?)
echo "${FUNCNAME}(): Invalid option: ${OPTARG}."
return 1
@@
-911,6
+932,12
@@
ipkg()
# Make sure we are at a known location
cd ${SCRDIR}
# Make sure we are at a known location
cd ${SCRDIR}
+ if [ "x${LFS_STAGE}" != "xstage0" -a "x${LFS_STAGE}" != "xstage1" ]; then
+ # Make sure to update dynamic linker run-time bindings, except for
+ # stages 0 and 1 where we run as the LFS user.
+ ldconfig
+ fi
+
exec 1>&6 # Restore stdout.
# Displaying build time after the package name.
exec 1>&6 # Restore stdout.
# Displaying build time after the package name.
@@
-924,9
+951,6
@@
ipkg()
ipkg_trap_end
ipkg_trap_end
- # Make sure to update dynamic linker run-time bindings
- ldconfig
-
return $EXIT_SUCCESS
}
return $EXIT_SUCCESS
}