Allow to optionally run package installation in two passes. Eventually, this allows to have media containing a 'bigger' live system that what they end up installing (Closes: ).

This commit is contained in:
Daniel Baumann 2011-06-11 16:36:44 +02:00
parent 65b7eb99f8
commit 238ae93f41
7 changed files with 62 additions and 36 deletions

View File

@ -61,10 +61,9 @@ case "${LB_INITRAMFS}" in
esac
# Add filesystem.packages
Chroot chroot "dpkg-query -W" > binary/"${INITFS}"/filesystem.${SUFFIX}
# Copy manifest as build output.
cp binary/"${INITFS}"/filesystem.${SUFFIX} binary.${SUFFIX}
cp binary.packages.live "binary/${INITFS}/filesystem.${SUFFIX}"
echo "$(diff binary.packages.live binary.packages.install | awk '/^< / { print $2 }')" \
> "binary/${INITFS}/filesystem.${SUFFIX}-remove"
# Creating stage file
Create_stagefile .stage/binary_manifest

View File

@ -55,11 +55,18 @@ lb chroot_sources install ${*}
lb chroot_linux-image ${*}
lb chroot_preseed ${*}
lb chroot_local-preseed ${*}
lb chroot_packagelists ${*}
lb chroot_local-packagelists ${*}
lb chroot_local-packages ${*}
lb chroot_install-packages ${*}
lb chroot_local-tasklists ${*}
for _PASS in install live
do
lb chroot_packagelists ${_PASS} ${*}
lb chroot_local-packagelists ${_PASS} ${*}
lb chroot_local-packages ${_PASS} ${*}
lb chroot_install-packages ${_PASS} ${*}
lb chroot_local-tasklists ${_PASS} ${*}
Chroot chroot "dpkg-query -W" > binary.packages.${_PASS}
done
lb chroot_local-includes ${*}
lb chroot_local-patches ${*}
lb chroot_local-hooks ${*}

View File

@ -17,6 +17,10 @@ set -e
DESCRIPTION="$(Echo 'install queued packages into chroot')"
HELP=""
USAGE="${PROGRAM} [--force]"
USAGE="${PROGRAM} {install|live} [--force]"
_PASS="${1}"
shift
Arguments "${@}"
@ -24,13 +28,13 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
Echo_message "Begin installing packages..."
Echo_message "Begin installing packages (${_PASS} pass)..."
# Requiring stage file
Require_stagefile .stage/config .stage/bootstrap
# Checking stage file
Check_stagefile .stage/chroot_install-packages
Check_stagefile .stage/chroot_install-packages.${PASS}
# Checking lock file
Check_lockfile .lock
@ -63,4 +67,4 @@ then
fi
# Creating stage file
Create_stagefile .stage/chroot_install-packages
Create_stagefile .stage/chroot_install-packages.${_PASS}

View File

@ -16,7 +16,10 @@ set -e
# Setting static variables
DESCRIPTION="$(Echo 'queue install of local package lists into chroot')"
HELP=""
USAGE="${PROGRAM} [--force]"
USAGE="${PROGRAM} {install|live} [--force]"
_PASS="${1}"
shift
Arguments "${@}"
@ -24,13 +27,13 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
Echo_message "Begin queueing installation of local package lists..."
Echo_message "Begin queueing installation of local package lists (${_PASS} pass)..."
# Requiring stage file
Require_stagefile .stage/config .stage/bootstrap
# Checking stage file
Check_stagefile .stage/chroot_local-packagelists
Check_stagefile .stage/chroot_local-packagelists.${PASS}
# Checking lock file
Check_lockfile .lock
@ -38,15 +41,19 @@ Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
if ls config/chroot_local-packagelists/*.list > /dev/null 2>&1
if ls config/chroot_local-packagelists/*.list > /dev/null 2>&1 || \
ls config/chroot_local-packagelists/*.list.${_PASS} > /dev/null 2>&1
then
for LIST in config/chroot_local-packagelists/*.list
for LIST in config/chroot_local-packagelists/*.list config/chroot_local-packagelists/*.list.${_PASS}
do
# Generating local package list
Expand_packagelist "$(basename ${LIST})" "config/chroot_local-packagelists" \
>> chroot/root/chroot_packages
if [ -e "${LIST}" ]
then
# Generating local package list
Expand_packagelist "$(basename ${LIST})" "config/chroot_local-packagelists" \
>> chroot/root/chroot_packages
fi
done
# Creating stage file
Create_stagefile .stage/chroot_local-packagelists
Create_stagefile .stage/chroot_local-packagelists.${_PASS}
fi

View File

@ -16,7 +16,10 @@ set -e
# Setting static variables
DESCRIPTION="$(Echo 'install local task lists into chroot')"
HELP=""
USAGE="${PROGRAM} [--force]"
USAGE="${PROGRAM} {install|live} [--force]"
_PASS="${1}"
shift
Arguments "${@}"
@ -24,13 +27,13 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
Echo_message "Begin installation of local task lists..."
Echo_message "Begin installation of local task lists (${_PASS} pass)..."
# Requiring stage file
Require_stagefile .stage/config .stage/bootstrap
# Checking stage file
Check_stagefile .stage/chroot_local-tasklists
Check_stagefile .stage/chroot_local-tasklists.${_PASS}
# Checking lock file
Check_lockfile .lock
@ -38,13 +41,17 @@ Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
if ls config/chroot_local-tasklists/*.list > /dev/null 2>&1
if ls config/chroot_local-tasklists/*.list > /dev/null 2>&1 || \
ls config/chroot_local-tasklists/*.list.${_PASS} > /dev/null 2>&1
then
for LIST in config/chroot_local-tasklists/*.list
for LIST in config/chroot_local-tasklists/*.list config/chroot_local-tasklists/*.list.${_PASS}
do
# Generating local task list
Expand_packagelist "$(basename ${LIST})" "config/chroot_local-tasklists" \
>> chroot/root/chroot_tasks
if [ -e "${LIST}" ]
then
# Generating local task list
Expand_packagelist "$(basename ${LIST})" "config/chroot_local-tasklists" \
>> chroot/root/chroot_tasks
fi
done
# Restoring cache
@ -137,5 +144,5 @@ then
Save_cache cache/packages_chroot
# Creating stage file
Create_stagefile .stage/chroot_local-tasklists
Create_stagefile .stage/chroot_local-tasklists.${_PASS}
fi

View File

@ -16,7 +16,10 @@ set -e
# Setting static variables
DESCRIPTION="$(Echo 'queue install of package lists into chroot')"
HELP=""
USAGE="${PROGRAM} [--force]"
USAGE="${PROGRAM} {install|live} [--force]"
_PASS="${1}"
shift
Arguments "${@}"
@ -24,13 +27,13 @@ Arguments "${@}"
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
Set_defaults
Echo_message "Begin queueing installation of package lists..."
Echo_message "Begin queueing installation of package lists (${_PASS} pass)..."
# Requiring stage file
Require_stagefile .stage/config .stage/bootstrap
# Checking stage file
Check_stagefile .stage/chroot_packagelists
Check_stagefile .stage/chroot_packagelists.${_PASS}
# Checking lock file
Check_lockfile .lock
@ -40,7 +43,6 @@ Create_lockfile .lock
if [ -n "${LB_PACKAGE_LISTS}" ] && [ "${LB_PACKAGE_LISTS}" != "none" ]
then
for LIST in ${LB_PACKAGE_LISTS}
do
# Generating package list
@ -48,5 +50,5 @@ then
done
# Creating stage file
Create_stagefile .stage/chroot_packagelists
Create_stagefile .stage/chroot_packagelists.${_PASS}
fi

View File

@ -95,7 +95,7 @@ do
rm -f binary*.img
rm -f binary*.tar.gz
rm -f binary.sh
rm -f binary.list binary.packages md5sum.txt
rm -f binary.list binary.packages binary.packages.install binary.packages.live md5sum.txt
rm -rf binary
rm -rf tftpboot