summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2008-10-28 16:44:06 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:03:43 +0100
commit1c1e7db6c44d639fd51ee23061087c7d14b6ef6b (patch)
treee20b0cfa3a45140a39be0cadf45410eab5cc22e7
parent6696b019fe03a371d69c50a1ef82223e4bb364a7 (diff)
downloadlive-build-1c1e7db6c44d639fd51ee23061087c7d14b6ef6b.zip
live-build-1c1e7db6c44d639fd51ee23061087c7d14b6ef6b.tar.gz
Generalizing internal Chroot(); by requiring its first argument to be the chroot directory.
-rwxr-xr-xfunctions/cache.sh2
-rwxr-xr-xfunctions/chroot.sh5
-rwxr-xr-xfunctions/packages.sh12
-rwxr-xr-xfunctions/wrapper.sh4
-rwxr-xr-xhelpers/lh_binary_chroot2
-rwxr-xr-xhelpers/lh_binary_debian-installer6
-rwxr-xr-xhelpers/lh_binary_encryption2
-rwxr-xr-xhelpers/lh_binary_iso2
-rwxr-xr-xhelpers/lh_binary_local-packageslists2
-rwxr-xr-xhelpers/lh_binary_manifest4
-rwxr-xr-xhelpers/lh_binary_rootfs6
-rwxr-xr-xhelpers/lh_binary_usb-hdd16
-rwxr-xr-xhelpers/lh_bootstrap_cdebootstrap2
-rwxr-xr-xhelpers/lh_chroot_hooks4
-rwxr-xr-xhelpers/lh_chroot_install-packages4
-rwxr-xr-xhelpers/lh_chroot_interactive6
-rwxr-xr-xhelpers/lh_chroot_local-hooks2
-rwxr-xr-xhelpers/lh_chroot_local-patches2
-rwxr-xr-xhelpers/lh_chroot_local-preseed2
-rwxr-xr-xhelpers/lh_chroot_preseed2
-rwxr-xr-xhelpers/lh_chroot_sources28
-rwxr-xr-xhelpers/lh_chroot_symlinks2
-rwxr-xr-xhelpers/lh_chroot_sysvinit4
-rwxr-xr-xhelpers/lh_chroot_tasks4
-rwxr-xr-xhelpers/lh_source_debian6
-rwxr-xr-xhelpers/lh_source_iso2
-rwxr-xr-xhelpers/lh_source_usb-hdd8
27 files changed, 71 insertions, 70 deletions
diff --git a/functions/cache.sh b/functions/cache.sh
index 9e70f2c..9e92a94 100755
--- a/functions/cache.sh
+++ b/functions/cache.sh
@@ -37,7 +37,7 @@ Save_cache ()
if [ "${LH_CACHE}" = "enabled" ] && [ "${LH_CACHE_PACKAGES}" = "enabled" ]
then
# Cleaning current cache
- Chroot "apt-get autoclean"
+ Chroot chroot "apt-get autoclean"
if ls chroot/var/cache/apt/archives/*.deb > /dev/null 2>&1
then
diff --git a/functions/chroot.sh b/functions/chroot.sh
index 227f792..d665787 100755
--- a/functions/chroot.sh
+++ b/functions/chroot.sh
@@ -11,6 +11,7 @@ set -e
Chroot ()
{
+ CHROOT="${1}"; shift
COMMANDS="${@}"
# Executing commands in chroot
@@ -18,10 +19,10 @@ Chroot ()
if [ "${LH_USE_FAKEROOT}" != "enabled" ]
then
- ${LH_ROOT_COMMAND} chroot chroot /usr/bin/env -i HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" ftp_proxy="${LH_APT_FTP_PROXY}" http_proxy="${LH_APT_HTTP_PROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" XORG_CONFIG="custom" ${COMMANDS}
+ ${LH_ROOT_COMMAND} chroot "${CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" ftp_proxy="${LH_APT_FTP_PROXY}" http_proxy="${LH_APT_HTTP_PROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LH_DEBCONF_NOWARNINGS}" XORG_CONFIG="custom" ${COMMANDS}
else
# Building with fakeroot/fakechroot
- ${LH_ROOT_COMMAND} chroot chroot ${COMMANDS}
+ ${LH_ROOT_COMMAND} chroot "${CHROOT}" ${COMMANDS}
fi
return "${?}"
diff --git a/functions/packages.sh b/functions/packages.sh
index ed1bdc4..f1796ca 100755
--- a/functions/packages.sh
+++ b/functions/packages.sh
@@ -34,11 +34,11 @@ Install_package ()
then
case "${LH_APT}" in
apt|apt-get)
- Chroot "apt-get install -o APT::Install-Recommends=false --yes ${_LH_PACKAGES}"
+ Chroot chroot "apt-get install -o APT::Install-Recommends=false --yes ${_LH_PACKAGES}"
;;
aptitude)
- Chroot "aptitude install --without-recommends --assume-yes ${_LH_PACKAGES}"
+ Chroot chroot "aptitude install --without-recommends --assume-yes ${_LH_PACKAGES}"
;;
esac
fi
@@ -50,11 +50,11 @@ Remove_package ()
then
case "${LH_APT}" in
apt|apt-get)
- Chroot "apt-get remove --purge --yes ${_LH_PACKAGES}"
+ Chroot chroot "apt-get remove --purge --yes ${_LH_PACKAGES}"
;;
aptitude)
- Chroot "aptitude purge --assume-yes ${_LH_PACKAGES}"
+ Chroot chroot "aptitude purge --assume-yes ${_LH_PACKAGES}"
;;
esac
fi
@@ -72,7 +72,7 @@ Check_installed ()
case "${LH_CHROOT_BUILD}" in
enabled)
- if Chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
+ if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
then
INSTALL_STATUS=0
else
@@ -82,7 +82,7 @@ Check_installed ()
disabled)
if which dpkg-query > /dev/null 2>&1
then
- if Chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
+ if Chroot chroot "dpkg-query -s ${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
then
INSTALL_STATUS=0
else
diff --git a/functions/wrapper.sh b/functions/wrapper.sh
index 6a71e81..ee013dd 100755
--- a/functions/wrapper.sh
+++ b/functions/wrapper.sh
@@ -13,11 +13,11 @@ Apt ()
{
case "${LH_APT}" in
apt|apt-get)
- Chroot apt-get ${APT_OPTIONS} ${@}
+ Chroot chroot apt-get ${APT_OPTIONS} ${@}
;;
aptitude)
- Chroot aptitude ${APTITUDE_OPTIONS} ${@}
+ Chroot chroot aptitude ${APTITUDE_OPTIONS} ${@}
;;
esac
}
diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot
index 77ddf4e..f89c885 100755
--- a/helpers/lh_binary_chroot
+++ b/helpers/lh_binary_chroot
@@ -100,7 +100,7 @@ then
if [ -e chroot/chroot/"${EXCLUDE}" ]
then
# Run "rm" inside the chroot so it cannot possibly remove host files.
- Chroot "rm -r chroot/${EXCLUDE}"
+ Chroot chroot "rm -r chroot/${EXCLUDE}"
else
Echo_warning "Excluded path does not exist: %s" "${EXCLUDE}"
fi
diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer
index b635702..5dca679 100755
--- a/helpers/lh_binary_debian-installer
+++ b/helpers/lh_binary_debian-installer
@@ -434,16 +434,16 @@ then
done
# Download .deb's that we just marked as "purged" which caused broken dependencies
- Chroot ${_LH_APT_COMMAND} -f dist-upgrade
+ Chroot chroot ${_LH_APT_COMMAND} -f dist-upgrade
# Revert dpkg status file
mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
# Download .debs of the required packages
- Chroot ${_LH_APT_COMMAND} install ${DI_REQ_PACKAGES}
+ Chroot chroot ${_LH_APT_COMMAND} install ${DI_REQ_PACKAGES}
else
# Download .debs of the required packages
- Chroot ${_LH_APT_COMMAND} install ${DI_PACKAGES}
+ Chroot chroot ${_LH_APT_COMMAND} install ${DI_PACKAGES}
# Revert dpkg status file
mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
diff --git a/helpers/lh_binary_encryption b/helpers/lh_binary_encryption
index b45b0b4..df518af 100755
--- a/helpers/lh_binary_encryption
+++ b/helpers/lh_binary_encryption
@@ -102,7 +102,7 @@ do
case "${LH_CHROOT_BUILD}" in
enabled)
- if Chroot aespipe -e ${LH_ENCRYPTION} -T \
+ if Chroot chroot aespipe -e ${LH_ENCRYPTION} -T \
< chroot/filesystem.${LH_CHROOT_FILESYSTEM} \
> chroot/filesystem.${LH_CHROOT_FILESYSTEM}.tmp
then
diff --git a/helpers/lh_binary_iso b/helpers/lh_binary_iso
index 8866197..b5d3d6a 100755
--- a/helpers/lh_binary_iso
+++ b/helpers/lh_binary_iso
@@ -142,7 +142,7 @@ case "${LH_CHROOT_BUILD}" in
mv binary.sh chroot
mv binary chroot
- Chroot "sh binary.sh"
+ Chroot chroot "sh binary.sh"
# Move image
mv chroot/binary chroot/binary.iso ./
diff --git a/helpers/lh_binary_local-packageslists b/helpers/lh_binary_local-packageslists
index 7e76801..d85ca02 100755
--- a/helpers/lh_binary_local-packageslists
+++ b/helpers/lh_binary_local-packageslists
@@ -63,7 +63,7 @@ then
Expand_packagelist "${PACKAGESLIST}" "config/binary_local-packageslists" "config/chroot_local-packageslists" > chroot/root/"$(basename ${PACKAGESLIST})"
# Downloading additional packages
- Chroot "xargs --arg-file=/root/$(basename ${PACKAGESLIST}) apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb --download-only install"
+ Chroot chroot "xargs --arg-file=/root/$(basename ${PACKAGESLIST}) apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb --download-only install"
# Remove package list
rm chroot/root/"$(basename ${PACKAGESLIST})"
diff --git a/helpers/lh_binary_manifest b/helpers/lh_binary_manifest
index 7b6481e..b403dc5 100755
--- a/helpers/lh_binary_manifest
+++ b/helpers/lh_binary_manifest
@@ -45,7 +45,7 @@ Create_lockfile .lock
if [ "${LH_INITRAMFS}" = "casper" ]
then
# Add filesystem.manifest
- Chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > binary/casper/filesystem.manifest
+ Chroot chroot "dpkg --get-selections" | awk '{ print $1 }' | sort -u > binary/casper/filesystem.manifest
fi
# Add packages.list
@@ -55,7 +55,7 @@ This file contains the list of all packages installed in this live system.
EOF
-Chroot "dpkg -l" >> binary/packages.txt
+Chroot chroot "dpkg -l" >> binary/packages.txt
cp binary/packages.txt binary.packages
diff --git a/helpers/lh_binary_rootfs b/helpers/lh_binary_rootfs
index 4d61af4..d6ab957 100755
--- a/helpers/lh_binary_rootfs
+++ b/helpers/lh_binary_rootfs
@@ -147,7 +147,7 @@ case "${LH_CHROOT_FILESYSTEM}" in
case "${LH_CHROOT_BUILD}" in
enabled)
- Chroot "genext2fs --size-in-blocks=${REAL_DIM} ${RESERVED_PERCENTAGE}=0 --root=chroot filesystem.${LH_CHROOT_FILESYSTEM}"
+ Chroot chroot "genext2fs --size-in-blocks=${REAL_DIM} ${RESERVED_PERCENTAGE}=0 --root=chroot filesystem.${LH_CHROOT_FILESYSTEM}"
# Move image
mv chroot/filesystem.${LH_CHROOT_FILESYSTEM} binary/${INITFS}
@@ -189,7 +189,7 @@ case "${LH_CHROOT_FILESYSTEM}" in
case "${LH_CHROOT_BUILD}" in
enabled)
- Chroot "mkfs.jffs2 ${JFFS2_OPTIONS} --root=chroot --output filesystem.jffs2"
+ Chroot chroot "mkfs.jffs2 ${JFFS2_OPTIONS} --root=chroot --output filesystem.jffs2"
# Move image
mv chroot/filesystem.jffs2 binary/${INITFS}
@@ -263,7 +263,7 @@ case "${LH_CHROOT_FILESYSTEM}" in
case "${LH_CHROOT_BUILD}" in
enabled)
# Create image
- Chroot "mksquashfs chroot filesystem.squashfs ${MKSQUASHFS_OPTIONS}"
+ Chroot chroot "mksquashfs chroot filesystem.squashfs ${MKSQUASHFS_OPTIONS}"
# Move image
${LH_ROOT_COMMAND} mv chroot/filesystem.squashfs binary/${INITFS}
diff --git a/helpers/lh_binary_usb-hdd b/helpers/lh_binary_usb-hdd
index db3806d..115321d 100755
--- a/helpers/lh_binary_usb-hdd
+++ b/helpers/lh_binary_usb-hdd
@@ -148,10 +148,10 @@ esac
case "${LH_CHROOT_BUILD}" in
enabled)
- Chroot "parted -s ${FREELO} mklabel ${PARTITION_TABLE_TYPE}" || true
- Chroot "parted -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0.0 100%" || true
- Chroot "parted -s ${FREELO} set 1 boot on" || true
- Chroot "parted -s ${FREELO} set 1 lba off" || true
+ Chroot chroot "parted -s ${FREELO} mklabel ${PARTITION_TABLE_TYPE}" || true
+ Chroot chroot "parted -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0.0 100%" || true
+ Chroot chroot "parted -s ${FREELO} set 1 boot on" || true
+ Chroot chroot "parted -s ${FREELO} set 1 lba off" || true
if [ "${LH_BOOTLOADER}" = "syslinux" ]
then
@@ -196,7 +196,7 @@ esac
case "${LH_CHROOT_BUILD}" in
enabled)
- Chroot "mkfs.${MKFS} ${MKFS_OPTIONS} ${FREELO}"
+ Chroot chroot "mkfs.${MKFS} ${MKFS_OPTIONS} ${FREELO}"
;;
disabled)
@@ -226,7 +226,7 @@ find /live/vmlinuz
EOM
EOF
- rootpartition="$(Chroot 'sh grub.sh' 2>/dev/null | grep -A 1 'find /live/vmlinuz' | grep -v 'find /live/vmlinuz')"
+ rootpartition="$(Chroot chroot 'sh grub.sh' 2>/dev/null | grep -A 1 'find /live/vmlinuz' | grep -v 'find /live/vmlinuz')"
usbdev="$(echo $rootpartition | sed -e 's|,[[:digit:]]||')"
echo "Root partition is $rootpartition, device is: $usbdev"
@@ -239,7 +239,7 @@ EOF
#EOM
#EOF
-#Chroot "sh grub.sh"
+#Chroot chroot "sh grub.sh"
rm -f chroot/grub.sh
fi
@@ -252,7 +252,7 @@ if [ "${LH_BOOTLOADER}" = "syslinux" ]
then
case "${LH_CHROOT_BUILD}" in
enabled)
- Chroot "syslinux ${FREELO}"
+ Chroot chroot "syslinux ${FREELO}"
;;
disabled)
diff --git a/helpers/lh_bootstrap_cdebootstrap b/helpers/lh_bootstrap_cdebootstrap
index 66e419f..7b260b1 100755
--- a/helpers/lh_bootstrap_cdebootstrap
+++ b/helpers/lh_bootstrap_cdebootstrap
@@ -165,7 +165,7 @@ then
# Remove cdebootstrap-helper-diverts (needed at least for minimal flavours)
case "${LH_PACKAGES_LISTS}" in
stripped|minimal)
- Chroot "dpkg -P cdebootstrap-helper-diverts"
+ Chroot chroot "dpkg -P cdebootstrap-helper-diverts"
;;
esac
diff --git a/helpers/lh_chroot_hooks b/helpers/lh_chroot_hooks
index 5922ef3..6621bc1 100755
--- a/helpers/lh_chroot_hooks
+++ b/helpers/lh_chroot_hooks
@@ -57,7 +57,7 @@ do
fi
# Executing hook
- Chroot "/root/${HOOK}"
+ Chroot chroot "/root/${HOOK}"
# Removing hook
rm -f chroot/root/"${HOOK}"
@@ -69,5 +69,5 @@ done
if [ -n "${LH_HOOKS}" ] && [ "${LH_HOOKS}" != "none" ]
then
- LH_DEBCONF_FRONTEND="readline" LH_DEBCONF_PRIORITY="low" LH_DEBCONF_NOWARNINGS="no" Chroot "${LH_HOOKS}"
+ LH_DEBCONF_FRONTEND="readline" LH_DEBCONF_PRIORITY="low" LH_DEBCONF_NOWARNINGS="no" Chroot chroot "${LH_HOOKS}"
fi
diff --git a/helpers/lh_chroot_install-packages b/helpers/lh_chroot_install-packages
index ddd5f73..4a9305a 100755
--- a/helpers/lh_chroot_install-packages
+++ b/helpers/lh_chroot_install-packages
@@ -50,11 +50,11 @@ then
# Installing packages
case "${LH_APT}" in
apt|apt-get)
- Chroot "xargs --arg-file=/root/chroot_packages apt-get ${APT_OPTIONS} install"
+ Chroot chroot "xargs --arg-file=/root/chroot_packages apt-get ${APT_OPTIONS} install"
;;
aptitude)
- Chroot "xargs --arg-file=/root/chroot_packages aptitude ${APTITUDE_OPTIONS} install"
+ Chroot chroot "xargs --arg-file=/root/chroot_packages aptitude ${APTITUDE_OPTIONS} install"
;;
esac
diff --git a/helpers/lh_chroot_interactive b/helpers/lh_chroot_interactive
index b7d34d6..62f7652 100755
--- a/helpers/lh_chroot_interactive
+++ b/helpers/lh_chroot_interactive
@@ -50,15 +50,15 @@ Create_lockfile .lock
case "${LH_INTERACTIVE}" in
enabled|shell)
Echo_message "Pausing build: starting interactive shell..."
- Chroot "/bin/bash --login"
+ Chroot chroot "/bin/bash --login"
;;
x11)
Echo_message "Pausing build: starting interactive X11..."
- Chroot "startx"
+ Chroot chroot "startx"
;;
xnest)
Echo_message "Pausing build: starting interactive Xnest..."
- #Chroot "" # FIXME
+ #Chroot chroot "" # FIXME
;;
esac
diff --git a/helpers/lh_chroot_local-hooks b/helpers/lh_chroot_local-hooks
index 33718b0..5798aab 100755
--- a/helpers/lh_chroot_local-hooks
+++ b/helpers/lh_chroot_local-hooks
@@ -57,7 +57,7 @@ then
fi
# Executing hook
- Chroot "/root/$(basename ${HOOK})"
+ Chroot chroot "/root/$(basename ${HOOK})"
# Removing hook
rm -f chroot/root/"$(basename ${HOOK})"
diff --git a/helpers/lh_chroot_local-patches b/helpers/lh_chroot_local-patches
index e65562e..2884042 100755
--- a/helpers/lh_chroot_local-patches
+++ b/helpers/lh_chroot_local-patches
@@ -56,7 +56,7 @@ then
for PATCH in config/chroot_local-patches/*
do
Echo_message "Applying patch %s..." "${PATCH}"
- Chroot "patch -p1" < ${PATCH}
+ Chroot chroot "patch -p1" < ${PATCH}
done
# Removing depends
diff --git a/helpers/lh_chroot_local-preseed b/helpers/lh_chroot_local-preseed
index afdcb47..fed6613 100755
--- a/helpers/lh_chroot_local-preseed
+++ b/helpers/lh_chroot_local-preseed
@@ -55,7 +55,7 @@ then
# Copying local preseed
cp "${PRESEED}" chroot/root/preseed
- Chroot "debconf-set-selections /root/preseed"
+ Chroot chroot "debconf-set-selections /root/preseed"
# Removing local preseed file
rm -f chroot/root/preseed
diff --git a/helpers/lh_chroot_preseed b/helpers/lh_chroot_preseed
index ce9235e..09baef7 100755
--- a/helpers/lh_chroot_preseed
+++ b/helpers/lh_chroot_preseed
@@ -56,7 +56,7 @@ do
# Copying preseed
cp "${PRESEED}" chroot/root/preseed
- Chroot "debconf-set-selections /root/preseed"
+ Chroot chroot "debconf-set-selections /root/preseed"
# Removing preseed file
rm -f chroot/root/preseed
diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources
index 30b117c..e5ddfdb 100755
--- a/helpers/lh_chroot_sources
+++ b/helpers/lh_chroot_sources
@@ -108,7 +108,7 @@ case "${1}" in
# completed all the indices.
case "${LH_BOOTSTRAP_FLAVOUR}" in
stripped|minimal)
- Chroot "apt-get update"
+ Chroot chroot "apt-get update"
;;
esac
@@ -122,13 +122,13 @@ case "${1}" in
Install_package
# Generate Packages and Packages.gz
- echo "cd /root/local-packages && apt-ftparchive packages . > Packages" | Chroot sh
+ echo "cd /root/local-packages && apt-ftparchive packages . > Packages" | Chroot chroot sh
gzip -9 -c chroot/root/local-packages/Packages > chroot/root/local-packages/Packages.gz
# Generate Release
echo "cd /root/local-packages && apt-ftparchive \
-o APT::FTPArchive::Release::Origin=chroot_local-packages \
- release . > Release" | Chroot sh
+ release . > Release" | Chroot chroot
if [ "${LH_APT_SECURE}" = "enabled" ]
then
@@ -161,7 +161,7 @@ case "${1}" in
Expire-Date: 0
%secring /root/local-package-keyring.sec
%pubring /root/local-package-keyring.pub
- %commit" | Chroot "gpg --batch --gen-key" || _LH_RET=${?}
+ %commit" | Chroot chroot "gpg --batch --gen-key" || _LH_RET=${?}
case "${_LH_RET}" in
""|2)
@@ -180,14 +180,14 @@ case "${1}" in
fi
# Sign release
- Chroot "gpg --no-default-keyring --secret-keyring /root/local-package-keyring.sec \
+ Chroot chroot "gpg --no-default-keyring --secret-keyring /root/local-package-keyring.sec \
--keyring /root/local-package-keyring.pub -abs -o \
/root/local-packages/Release.gpg /root/local-packages/Release"
# Import key
- Chroot "gpg --no-default-keyring --secret-keyring /root/local-package-keyring.sec \
+ Chroot chroot "gpg --no-default-keyring --secret-keyring /root/local-package-keyring.sec \
--keyring /root/local-package-keyring.pub --armor \
- --export ${_LH_LOCAL_KEY_EMAIL}" | Chroot "apt-key add -"
+ --export ${_LH_LOCAL_KEY_EMAIL}" | Chroot chroot "apt-key add -"
# Remove temporary keyrings
rm chroot/root/local-package-keyring.pub
@@ -258,7 +258,7 @@ case "${1}" in
if [ "${LH_APT}" = "aptitude" ] && [ ! -x /usr/bin/aptitude ]
then
- Chroot "apt-get ${APT_OPTIONS} install aptitude"
+ Chroot chroot "apt-get ${APT_OPTIONS} install aptitude"
fi
else # Get fresh indices
# Check local gpg keys
@@ -267,7 +267,7 @@ case "${1}" in
for FILE in config/chroot_sources/*.chroot.gpg
do
cp ${FILE} chroot/root
- Chroot "apt-key add /root/$(basename ${FILE})"
+ Chroot chroot "apt-key add /root/$(basename ${FILE})"
rm -f chroot/root/$(basename ${FILE})
done
fi
@@ -278,7 +278,7 @@ case "${1}" in
for PACKAGE in config/chroot_sources/*.deb
do
cp ${PACKAGE} chroot/root
- Chroot "dpkg -i /root/$(basename ${PACKAGE})"
+ Chroot chroot "dpkg -i /root/$(basename ${PACKAGE})"
rm -f chroot/root/$(basename ${PACKAGE})
done
fi
@@ -286,8 +286,8 @@ case "${1}" in
# Installing aptitude
if [ "${LH_APT}" = "aptitude" ] && [ ! -x /usr/bin/aptitude ]
then
- Chroot "apt-get ${APT_OPTIONS} update"
- Chroot "apt-get ${APT_OPTIONS} install aptitude"
+ Chroot chroot "apt-get ${APT_OPTIONS} update"
+ Chroot chroot "apt-get ${APT_OPTIONS} install aptitude"
fi
Apt update
@@ -297,7 +297,7 @@ case "${1}" in
# Installing keyring packages
if [ -n "${LH_KEYRING_PACKAGES}" ]
then
- Chroot "apt-get --yes --force-yes install ${LH_KEYRING_PACKAGES}"
+ Chroot chroot "apt-get --yes --force-yes install ${LH_KEYRING_PACKAGES}"
Apt update
fi
@@ -395,7 +395,7 @@ case "${1}" in
for FILE in config/chroot_sources/*.binary.gpg
do
cp ${FILE} chroot/root
- Chroot "apt-key add /root/$(basename ${FILE})"
+ Chroot chroot "apt-key add /root/$(basename ${FILE})"
rm -f chroot/root/$(basename ${FILE})
done
fi
diff --git a/helpers/lh_chroot_symlinks b/helpers/lh_chroot_symlinks
index aaf1f72..06ae2d3 100755
--- a/helpers/lh_chroot_symlinks
+++ b/helpers/lh_chroot_symlinks
@@ -54,7 +54,7 @@ Check_package chroot/usr/bin/symlinks symlinks
Install_package
# Converting symlinks
-Chroot "symlinks -c -r -s /"
+Chroot chroot "symlinks -c -r -s /"
# Removing depends
Remove_package
diff --git a/helpers/lh_chroot_sysvinit b/helpers/lh_chroot_sysvinit
index b0031ff..ec8613f 100755
--- a/helpers/lh_chroot_sysvinit
+++ b/helpers/lh_chroot_sysvinit
@@ -47,7 +47,7 @@ then
# Disable all
for FILE in chroot/etc/init.d/*
do
- Chroot "update-rc.d -f $(basename ${FILE}) remove"
+ Chroot chroot "update-rc.d -f $(basename ${FILE}) remove"
done
# Re-enable all required (taken from -f standard chroot)
@@ -56,7 +56,7 @@ then
if [ -f chroot/var/lib/dpkg/info/${PACKAGE}.postinst ]
then
# Re-configure if existing
- Chroot "/var/lib/dpkg/info/${PACKAGE}.postinst configure"
+ Chroot chroot "/var/lib/dpkg/info/${PACKAGE}.postinst configure"
fi
done
diff --git a/helpers/lh_chroot_tasks b/helpers/lh_chroot_tasks
index 9662477..395cd3c 100755
--- a/helpers/lh_chroot_tasks
+++ b/helpers/lh_chroot_tasks
@@ -64,13 +64,13 @@ then
# Installing tasks
case "${LH_TASKSEL}" in
aptitude)
- Chroot "aptitude ${APTITUDE_OPTIONS} install ${LH_TASKS}"
+ Chroot chroot "aptitude ${APTITUDE_OPTIONS} install ${LH_TASKS}"
;;
tasksel)
for TASK in ${LH_TASKS}
do
- Chroot "tasksel --debconf-apt-progress --logstderr install ${TASK}"
+ Chroot chroot "tasksel --debconf-apt-progress --logstderr install ${TASK}"
done
;;
esac
diff --git a/helpers/lh_source_debian b/helpers/lh_source_debian
index 43e49e9..14cf531 100755
--- a/helpers/lh_source_debian
+++ b/helpers/lh_source_debian
@@ -54,7 +54,7 @@ then
fi
# Download sources
-Chroot "dpkg --get-selections" | awk '{ print $1 }' > source-selection.txt
+Chroot chroot "dpkg --get-selections" | awk '{ print $1 }' > source-selection.txt
cat >> source-selection.txt << EOF
${LH_BOOTLOADER}
@@ -107,7 +107,7 @@ MISSING=""
grep . source-selection.txt | \
while read PACKAGE
do
- if ! Chroot "apt-get ${APT_OPTIONS} --download-only source ${PACKAGE}"
+ if ! Chroot chroot "apt-get ${APT_OPTIONS} --download-only source ${PACKAGE}"
then
MISSING="${MISSING} ${PACKAGE}"
fi
@@ -123,7 +123,7 @@ EOF
for PACKAGE in ${MISSING}
do
- Chroot "dpkg -l ${PACKAGE}" | tail -n1 >> source/missing-source.txt
+ Chroot chroot "dpkg -l ${PACKAGE}" | tail -n1 >> source/missing-source.txt
done
fi
diff --git a/helpers/lh_source_iso b/helpers/lh_source_iso
index 6c3fc1e..585e812 100755
--- a/helpers/lh_source_iso
+++ b/helpers/lh_source_iso
@@ -101,7 +101,7 @@ cat >> chroot/source.sh << EOF
genisoimage ${GENISOIMAGE_OPTIONS} -o source.iso -r -J -l -cache-inodes source
EOF
-Chroot "sh source.sh"
+Chroot chroot "sh source.sh"
# Move image
mv chroot/source chroot/source.iso ./
diff --git a/helpers/lh_source_usb-hdd b/helpers/lh_source_usb-hdd
index c15d225..7d62afa 100755
--- a/helpers/lh_source_usb-hdd
+++ b/helpers/lh_source_usb-hdd
@@ -95,9 +95,9 @@ esac
Echo_warning "!!! The following error/warning messages can be ignored !!!"
Losetup $FREELO source.img 0
-Chroot "parted -s ${FREELO} mklabel msdos" || true
-Chroot "parted -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0.0 100%" || true
-Chroot "parted -s ${FREELO} set 1 lba off" || true
+Chroot chroot "parted -s ${FREELO} mklabel msdos" || true
+Chroot chroot "parted -s ${FREELO} mkpart primary ${PARTITION_TYPE} 0.0 100%" || true
+Chroot chroot "parted -s ${FREELO} set 1 lba off" || true
${LH_LOSETUP} -d ${FREELO}
Losetup $FREELO source.img 1
@@ -119,7 +119,7 @@ case "${LH_BINARY_FILESYSTEM}" in
;;
esac
-Chroot "mkfs.${MKFS} ${MKFS_OPTIONS} ${FREELO}"
+Chroot chroot "mkfs.${MKFS} ${MKFS_OPTIONS} ${FREELO}"
mkdir -p source.tmp
${LH_ROOT_COMMAND} mount ${FREELO} source.tmp