2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2012-02-04 19:41:41 -01:00
|
|
|
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
|
|
|
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
2010-09-07 13:11:20 +00:00
|
|
|
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2011-06-15 20:01:17 +00:00
|
|
|
DESCRIPTION="$(Echo 'install task lists into chroot')"
|
2007-09-23 08:04:48 +00:00
|
|
|
HELP=""
|
2011-06-11 14:36:44 +00:00
|
|
|
USAGE="${PROGRAM} {install|live} [--force]"
|
|
|
|
|
|
|
|
_PASS="${1}"
|
|
|
|
shift
|
2007-09-23 08:04:48 +00:00
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:04:46 +00:00
|
|
|
Set_defaults
|
|
|
|
|
2011-06-15 20:01:17 +00:00
|
|
|
Echo_message "Begin installation of task lists (${_PASS} pass)..."
|
2007-09-23 08:04:49 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Requiring stage file
|
2008-10-14 19:32:50 +00:00
|
|
|
Require_stagefile .stage/config .stage/bootstrap
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2011-06-15 20:01:17 +00:00
|
|
|
Check_stagefile .stage/chroot_task-lists.${_PASS}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Check_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Creating lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Create_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2011-08-05 06:53:27 +00:00
|
|
|
if ls config/task-lists/*.list > /dev/null 2>&1 || \
|
|
|
|
ls config/task-lists/*.list.chroot > /dev/null 2>&1 || \
|
2011-08-05 06:40:03 +00:00
|
|
|
ls config/task-lists/*.list.chroot_${_PASS} > /dev/null 2>&1
|
2007-09-23 08:04:46 +00:00
|
|
|
then
|
2011-08-05 06:53:27 +00:00
|
|
|
for LIST in config/task-lists/*.list \
|
|
|
|
config/task-lists/*.list.chroot \
|
|
|
|
config/task-lists/*.list.chroot_${_PASS}
|
2011-06-11 13:25:33 +00:00
|
|
|
do
|
2011-06-11 14:36:44 +00:00
|
|
|
if [ -e "${LIST}" ]
|
|
|
|
then
|
2011-06-15 20:01:17 +00:00
|
|
|
# Generating task list
|
2011-06-15 19:52:45 +00:00
|
|
|
Expand_packagelist "$(basename ${LIST})" "config/task-lists" \
|
2011-06-11 14:36:44 +00:00
|
|
|
>> chroot/root/chroot_tasks
|
|
|
|
fi
|
2011-06-11 13:25:33 +00:00
|
|
|
done
|
|
|
|
|
2007-09-23 08:04:48 +00:00
|
|
|
# Restoring cache
|
2008-04-17 08:39:47 +00:00
|
|
|
Restore_cache cache/packages_chroot
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
# Checking depends
|
2010-09-07 13:11:20 +00:00
|
|
|
case "${LB_TASKSEL}" in
|
2011-05-16 14:03:56 +00:00
|
|
|
apt)
|
|
|
|
Check_package chroot/usr/bin/apt-get apt
|
|
|
|
;;
|
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
aptitude)
|
|
|
|
Check_package chroot/usr/bin/aptitude aptitude
|
|
|
|
;;
|
|
|
|
|
|
|
|
tasksel)
|
|
|
|
Check_package chroot/usr/bin/tasksel tasksel
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Installing depends
|
|
|
|
Install_package
|
|
|
|
|
|
|
|
# Installing tasks
|
2010-09-07 13:11:20 +00:00
|
|
|
case "${LB_TASKSEL}" in
|
2011-05-16 14:03:56 +00:00
|
|
|
apt)
|
2011-06-11 08:59:53 +00:00
|
|
|
# This needs to be cleaned up at some point
|
2011-05-16 14:03:56 +00:00
|
|
|
APT_TASKS=
|
2011-06-11 08:59:53 +00:00
|
|
|
|
|
|
|
case "${LB_MODE}" in
|
2011-07-19 08:51:20 +00:00
|
|
|
ubuntu|kubuntu)
|
2011-06-11 13:25:33 +00:00
|
|
|
TASKS="$(cat chroot/root/chroot_tasks)"
|
2011-06-11 08:59:53 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
# Avoid standard tasks which appears to not exist
|
2011-06-11 13:25:33 +00:00
|
|
|
TASKS="$(cat chroot/root/chroot_tasks | sed -e 's|standard||')"
|
2011-06-11 08:59:53 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
for TASK in ${TASKS}
|
2011-05-16 14:03:56 +00:00
|
|
|
do
|
|
|
|
APT_TASKS="${APT_TASKS:+$APT_TASKS }$TASK^"
|
|
|
|
done
|
2011-06-11 08:59:53 +00:00
|
|
|
|
2011-05-16 14:03:56 +00:00
|
|
|
Chroot chroot "apt-get ${APT_OPTIONS} install ${APT_TASKS}"
|
|
|
|
;;
|
|
|
|
|
2007-09-23 08:04:51 +00:00
|
|
|
aptitude)
|
2011-06-11 13:25:33 +00:00
|
|
|
Chroot chroot "aptitude ${APTITUDE_OPTIONS} install $(cat chroot/root/chroot_tasks)"
|
2007-09-23 08:04:51 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
tasksel)
|
2011-06-11 13:25:33 +00:00
|
|
|
for TASK in $(cat chroot/root/chroot_tasks)
|
2007-09-23 08:04:51 +00:00
|
|
|
do
|
2010-08-08 01:53:52 +00:00
|
|
|
case "${TASK}" in
|
|
|
|
gnome*)
|
|
|
|
DESKTOP="${DESKTOP} gnome"
|
|
|
|
;;
|
|
|
|
|
|
|
|
kde*)
|
|
|
|
DESKTOP="${DESKTOP} kde"
|
|
|
|
;;
|
|
|
|
|
|
|
|
lxde*)
|
|
|
|
DESKTOP="${DESKTOP} lxde"
|
|
|
|
;;
|
|
|
|
|
|
|
|
xfce*)
|
|
|
|
DESKTOP="${DESKTOP} xfce"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "tasksel tasksel/desktop multiselect ${DESKTOP}" > chroot/root/preseed
|
|
|
|
Chroot chroot "debconf-set-selections /root/preseed"
|
|
|
|
rm -f chroot/root/preseed
|
|
|
|
|
2008-10-28 14:44:06 -01:00
|
|
|
Chroot chroot "tasksel --debconf-apt-progress --logstderr install ${TASK}"
|
2007-09-23 08:04:51 +00:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2011-06-11 13:25:33 +00:00
|
|
|
# Removing task list
|
|
|
|
rm -f chroot/root/chroot_tasks
|
|
|
|
|
2007-09-23 08:04:48 +00:00
|
|
|
# Saving cache
|
2008-04-17 08:39:47 +00:00
|
|
|
Save_cache cache/packages_chroot
|
2007-09-23 08:04:48 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Creating stage file
|
2011-06-15 20:01:17 +00:00
|
|
|
Create_stagefile .stage/chroot_task-lists.${_PASS}
|
2007-09-23 08:04:46 +00:00
|
|
|
fi
|