Commit 87b5001f authored by sulzbach's avatar sulzbach

WIP: SCRUM#601

parent b3a46582
Pipeline #18116 passed with stage
in 11 seconds
......@@ -5,4 +5,5 @@ cache/*
iso/*
initrd/*
initrd.lz
.Trash-1000
\ No newline at end of file
.Trash-1000/*
.vscode/*
\ No newline at end of file
PASSWD="123mudar"
\ No newline at end of file
......@@ -7,4 +7,4 @@ ISODIR="${PREFIX}/iso"
CACHEDIR="${PREFIX}/cache/${_PROF}/${_REPO}"
PKGLIST="${PREFIX}/pkg-list/${_PROF}"
SOURCESLIST="${PREFIX}/sources-list"
LOG_PATH="/var/log"
LOG_PATH="/var/log/create-iso"
NAME="Linux Educacional Netbook"
WEBSITE="https://linuxeducacional.c3sl.ufpr.br"
ISOURL="http://cdimage.ubuntu.com/ubuntu-gnome/releases/16.04/release"
KEYURL="http://repo.c3sl.ufpr.br/le6/le.c3sl.ufpr.br.key"
This diff is collapsed.
#!/bin/bash
# shellcheck disable=SC1090
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
# create-iso is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
if [ "$(id -u)" != "0" ]; then
echo "You must have more power to run this script. Are you root?"
exit -1
fi
CMD="$1 --profile le6 --version 6.1.1 --repo testing --debug --sendmail"
CFGFILE="$(realpath "$(dirname "$0")")/vars.cfg"
SESSION="$(date +'%Y-%m-%d')"
source "${CFGFILE}"
if [ "${SWITCH}" == 0 ]; then
# Turn up switch
sed --in-place "s/SWITCH=0/SWITCH=1/" "${CFGFILE}"
# Do nothing
exit 0
else
# Turn down switch
sed --in-place "s/SWITCH=1/SWITCH=0/" "${CFGFILE}"
# Proceed with job
fi
# Create GNU screen session
screen -dmS "${SESSION}" || exit 1
# Execute c3geniso in the main window
screen -S "${SESSION}" -X stuff "${CMD} && exit\n" || exit 2
exit 0
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "You must have more power to run this script. Are you root?"
exit -1
fi
SESSION="$(date +'%Y-%m-%d')"
DIR="/home/lucas/create-iso"
CMD="./create-iso.sh --profile le6 --version 6.1.1 --repo testing --debug --sendmail"
# Create GNU screen session
screen -dmS "${SESSION}" || exit 1
# Execute c3geniso in the main window
screen -S "${SESSION}" -X stuff "pushd ${DIR} && ${CMD} && exit\n" || exit 2
exit 0
readonly ERROR=1
readonly WARNING=2
readonly INFO=4
readonly DEBUG=8
readonly ALL=15
VERBOSE_FLAGS=${ALL}
mapType() {
case "$1" in
e | error ) echo "${ERROR}" ;;
w | warning ) echo "${WARNING}" ;;
i | info ) echo "${INFO}" ;;
d | debug ) echo "${DEBUG}" ;;
* ) createIsoLogger -m "Invalid type '$1'" -T "LOGGER"; return 1 ;;
esac
}
createIsoLogger() {
TYPE="${ERROR}"
TAG=""
MSG=""
SCRIPT="$(basename "${BASH_SOURCE[1]}")"
LINE="${BASH_LINENO[0]}"
while true; do
case "${1}" in
-t | --type ) TYPE="$(mapType "$2")" || return; shift; shift ;;
-T | --tag ) TAG="$2"; shift; shift ;;
-m | --message ) MSG="$2"; shift; shift ;;
-s | --script ) SCRIPT="$2"; shift; shift ;;
-l | --line ) LINE="$2"; shift; shift ;;
-* ) createIsoLogger -m \
"Unrecognized option '$1'" -T "LOGGER"; return ;;
* ) break ;;
esac
done
if [ "$((${VERBOSE_FLAGS} & ${TYPE}))" -eq "${TYPE}" ]; then
if [ -z "${TAG}" ]; then
LOG_LINE="[${SCRIPT}]: line ${LINE}: ${MSG}"
else
LOG_LINE="[${SCRIPT}]: line ${LINE}: [${TAG}]: ${MSG}"
fi
case "${TYPE}" in
"${ERROR}" ) LOG_LINE="\033[38;5;9m[ERROR]: ${LOG_LINE}\033[0m" ;;
"${WARNING}" ) LOG_LINE="\033[38;5;11m[WARNING]: ${LOG_LINE}\033[0m" ;;
"${INFO}" ) LOG_LINE="\033[38;5;10m[INFO]: ${LOG_LINE}\033[0m" ;;
"${DEBUG}" ) LOG_LINE="\033[38;5;6m[DEBUG]: ${LOG_LINE}\033[0m" ;;
* ) createIsoLogger -m "Invalid type '${TYPE}'" -T "LOGGER"; return ;;
esac
echo -e "${LOG_LINE}" 1>&2
echo -e "${LOG_LINE}" >> "${LOG_FILE}"
if [ "${TYPE}" -eq "${ERROR}" ] || [ "${TYPE}" -eq "${DEBUG}" ]; then
[[ "${_MAIL}" == true ]] && sendmail -t <<< \
"$(sed "s/##SUBJECT##/${TIME_STAMP}/" < \
"${PREFIX}/mail.txt" && screen -ls; echo ""; \
tail --lines=20 "${LOG_FILE}")" || createIsoLogger -m \
"Unable to send mail"
/bin/bash
fi
else
createIsoLogger -m "Tried to use disabled type '${TYPE}'" -T "LOGGER"
fi
}
true
#!/bin/bash
# shellcheck disable=SC1090
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
# create-iso is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
get_iso() {
local isodir="$1"
local isosrc="$2"
local isoname
local md5
local oldmd5
local newmd5
md5="$(wget "${isosrc}/MD5SUMS" -O- | \
grep "amd64" | \
sort --version-sort | \
tail --lines=1)"
isoname="$(cut --delimiter='*' --fields=2 <<< "${md5}")"
newmd5="$(cut --delimiter=' ' --fields=1 <<< "${md5}")"
oldmd5="$(cat "${isodir}/input/MD5SUMS")"
if [[ "${oldmd5}" != "${newmd5}" ]]; then
mkdir --parents "${isodir}/input"
pushd "${isodir}/input" >/dev/null || \
create_iso_logger --message "Unable to change directory" --tag "pushd"
create_iso_logger --message "Downloading ${isoname}" --type info
wget "${isosrc}/${isoname}" || \
create_iso_logger --message "Unable to download image" --tag "wget"
create_iso_logger --message "Generating md5sum" --type info
md5="$(md5sum "${isodir}/input/${isoname}" | \
cut --delimiter=' ' --fields=1)"
[[ "${md5}" != "${newmd5}" ]] && \
create_iso_logger --message "Iso image is corrupted"
popd >/dev/null || \
create_iso_logger --message "Unable to change directory" --tag "popd"
echo "${newmd5}" > "${isodir}/input/MD5SUMS"
fi
echo "${isodir}/input/${isoname}"
}
\ No newline at end of file
......@@ -21,11 +21,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
initChroot() {
init_chroot() {
local chrootdir="$1"
# Create the log file; this file will be bind to appear in "${VARLOG}"
# directory in the target machine that generates the iso.
mkdir --parents "${chrootdir}/$(dirname "${LOG_FILE}")"
touch "${chrootdir}/${LOG_FILE}"
touch "${LOG_FILE}"
......@@ -50,7 +51,7 @@ initChroot() {
chroot "${chrootdir}" ln --symbolic /bin/true /fakebin/start-stop-daemon
}
closeChroot() {
close_chroot() {
local chrootdir="$1"
umount --lazy "${chrootdir}/etc/resolv.conf"
......@@ -58,23 +59,23 @@ closeChroot() {
umount --lazy "${chrootdir}"/{dev/pts,proc,sys,dev}
}
function create_stub() {
create_stub() {
local script="$1"
cat << EOF > "${script}"
#!/usr/bin/env bash
# THIS SCRIPT WAS GENERATE DINAMICALLY BY CREATE-ISO
# THIS SCRIPT WAS GENERATED DINAMICALLY BY CREATE-ISO
# DO NOT EDIT IT.
EOF
cat "${PREFIX}/helper/logging.incsh" >> "${script}"
cat "${PREFIX}/include/logging.sh" >> "${script}"
}
addToChrootFile() {
add_to_chroot_file() {
local chrootdir="$1"
local cmd="${2}"
local cmd="$2"
if [ ! -f "${chrootdir}/tmp/exec.sh" ]; then
create_stub "${chrootdir}/tmp/exec.sh"
......@@ -83,35 +84,25 @@ addToChrootFile() {
echo "${cmd}" >> "${chrootdir}/tmp/exec.sh"
}
execChroot() {
exec_chroot() {
local chrootdir="$1"
[ ! -x "${chrootdir}/tmp/exec.sh" ] && chmod +x "${chrootdir}/tmp/exec.sh"
[[ ! -x "${chrootdir}/tmp/exec.sh" ]] && chmod +x "${chrootdir}/tmp/exec.sh"
chroot "${chrootdir}" "/tmp/exec.sh"
rm --recursive --force "${chrootdir:?}/tmp/exec.sh" &>/dev/null
return $?
}
function cleanup() {
cleanup() {
local chrootdir="$1"
if mountpoint --quiet "${chrootdir}/etc/resolv.conf"; then
umount --lazy "${chrootdir}/etc/resolv.conf"
fi
if mountpoint --quiet "${chrootdir}/${LOG_FILE}"; then
umount --lazy "${chrootdir}/${LOG_FILE}"
fi
if mountpoint --quiet "${chrootdir}/dev/pts"; then
umount --lazy "${chrootdir}/dev/pts"
fi
if mountpoint --quiet "${chrootdir}/dev"; then
umount --lazy "${chrootdir}/dev"
fi
if mountpoint --quiet "${chrootdir}/sys"; then
umount --lazy "${chrootdir}/sys"
fi
if mountpoint --quiet "${chrootdir}/proc"; then
umount --lazy "${chrootdir}/proc"
fi
type cond_umount >/dev/null 2>&1 || source "${PREFIX}/include/mount.sh"
cond_umount "${chrootdir}/etc/resolv.conf"
cond_umount "${chrootdir}/${LOG_FILE}"
cond_umount "${chrootdir}/dev/pts"
cond_umount "${chrootdir}/dev"
cond_umount "${chrootdir}/sys"
cond_umount "${chrootdir}/proc"
}
#!/bin/bash
# shellcheck disable=SC1090
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
# create-iso is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
readonly ERROR=1
readonly WARNING=2
readonly INFO=4
readonly DEBUG=8
readonly ALL=15
VERBOSE_FLAGS=${ALL}
map_type() {
case "$1" in
e | error ) echo "${ERROR}" ;;
w | warning ) echo "${WARNING}" ;;
i | info ) echo "${INFO}" ;;
d | debug ) echo "${DEBUG}" ;;
* ) \
create_iso_logger -m "Invalid type '$1'" -T "LOGGER"; return 1 \
;;
esac
}
create_iso_logger() {
local type
local tag
local msg
local script
local line
local log_line
local mail
type="${ERROR}"
script="$(basename "${BASH_SOURCE[1]}")"
line="${BASH_LINENO[0]}"
while true; do
case "${1}" in
-t | --type ) type="$(map_type "$2")" || return; shift; shift ;;
-T | --tag ) tag="$2"; shift; shift ;;
-m | --message ) msg="$2"; shift; shift ;;
-s | --script ) script="$2"; shift; shift ;;
-l | --line ) line="$2"; shift; shift ;;
-* ) \
create_iso_logger -m "Unrecognized option '$1'" -T "LOGGER"; return \
;;
* ) break ;;
esac
done
# If the type is enabled
if [[ "$((${VERBOSE_FLAGS} & ${type}))" -eq "${type}" ]]; then
if [[ -z "${tag}" ]]; then
log_line="[${script}]: line ${line}: ${msg}"
else
log_line="[${script}]: line ${line}: [${tag}]: ${msg}"
fi
case "${type}" in
"${ERROR}" ) log_line="\033[38;5;9m[ERROR]: ${log_line}\033[0m" ;;
"${WARNING}" ) \
log_line="\033[38;5;11m[WARNING]: ${log_line}\033[0m" \
;;
"${INFO}" ) log_line="\033[38;5;10m[INFO]: ${log_line}\033[0m" ;;
"${DEBUG}" ) log_line="\033[38;5;6m[DEBUG]: ${log_line}\033[0m" ;;
* ) \
create_iso_logger -m "Invalid type '${type}'" -T "LOGGER"; return \
;;
esac
echo -e "${log_line}" 1>&2
echo -e "${log_line}" >> "${LOG_FILE}"
if [[ "${type}" == "${ERROR}" ]] || [[ "${type}" == "${DEBUG}" ]]; then
if [[ "${_MAIL}" == true ]]; then
mail="$(sed "s/##SUBJECT##/${TIME_STAMP}/" < \
"${PREFIX}/src/mail.txt")"
mail="${mail}"$'\n'"$(screen -ls)"
mail="${mail}"$'\n'"$(tail --lines=20 "${LOG_FILE}")"
sendmail -t <<< "${mail}"
fi
/bin/bash
fi
else
create_iso_logger -m "Tried to use disabled type '${type}'" -T "LOGGER"
fi
}
#!/bin/bash
# shellcheck disable=SC1090
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
# create-iso is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# Mount if it isn't already mounted
cond_mount() {
local source="$1"
local mountpoint="$2"
local types="$3"
local options="$4"
mkdir --parents "${mountpoint}"
if ! mountpoint --quiet "${mountpoint}"; then
mount "${source}" "${mountpoint}" --types "${types}" --options \
"${options}" || \
create_iso_logger --message \
"Unable to mount ${source} on ${mountpoint}" --tag "mount"
fi
}
# Umount if it is mounted
cond_umount() {
local mountpoint="$1"
if mountpoint --quiet "${mountpoint}"; then
umount --lazy "${mountpoint}" || \
create_iso_logger --message "Unable to umount ${mountpoint}" \
--tag "umount"
fi
}
# Ignore everything in this directory
*
# Except this file
!.gitignore
openssh-server
lc-all-live
lc-all
#linux-generic
......
ubuntu-standard
laptop-detect
dbus
wget
le-live-all
le-all
le-laptop-controlpanel
audacity
geogebra
scratch
tuxpaint
openshot
gimp
openssh-server
sysfsutils
cron-apt
linux-generic-hwe-16.04
xserver-xorg-hwe-16.04
le-live-all
ubiquity
ubiquity-frontend-gtk
ubiquity-frontend-kde
casper
lupin-casper
user-setup
discover
libdebian-installer4
le-ubiquity-slideshow
le-control-panel
\ No newline at end of file
le-conf
le-multiterminal
openssh-server
le-live-all
le-all
linux-generic-hwe-16.04
......
......@@ -32,7 +32,7 @@ source "${PREFIX}/conf/${_PROF}/create-iso.conf"
source "${PREFIX}/common.sh"
mkdir -p "${TMP}/bl/"
cd "${TMP}/bl/" || createIsoLogger --message "Unable to change directory" --tag "cd"
cd "${TMP}/bl/" || create_iso_logger --message "Unable to change directory" --tag "cd"
cpio -i < "${ISOLINUX}/bootlogo"
sed -i 's/ubuntu/Linux Educacional/Ig' ./*.{tr,hlp}
echo "" > "${TMP}/list"
......@@ -42,7 +42,7 @@ done
#ls -l | awk '{if(NR>1)print}' | cut -c44- > "${TMP}/list"
cpio -o < "${TMP}/list" > bootlogo
mv "${TMP}/bl/bootlogo" "${ISOLINUX}"
cd "${ISOLINUX}" || createIsoLogger --message "Unable to change directory" --tag "cd"
cd "${ISOLINUX}" || create_iso_logger --message "Unable to change directory" --tag "cd"
sed -i 's/ubuntu/Linux Educacional/Ig' ./*.{tr,hlp}
rm -rf "${TMP:?}/bl/"
rm "${TMP:?}/list"
......
......@@ -24,44 +24,32 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
# PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
# PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DBG="${11}"
PREFIX="${PWD}"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/common.sh"
source "${PREFIX}/include/chroot.sh"
source "${PREFIX}/include/logging.sh"
#########################################
# WARNING:
# Sanity check if {dev,proc,sys} are mounted, cp from /proc will be recursive
# until run out RAM.
if mountpoint --quiet "${CHROOTDIR}/dev/pts"; then
umount "${CHROOTDIR}/dev/pts"
fi
if mountpoint --quiet "${CHROOTDIR}/dev"; then
umount "${CHROOTDIR}/dev"
fi
if mountpoint --quiet "${CHROOTDIR}/sys"; then
umount "${CHROOTDIR}/sys"
fi
if mountpoint --quiet "${CHROOTDIR}/proc"; then
umount "${CHROOTDIR}/proc"
fi
cleanup "${CHROOTDIR}"
mksquashfs "${CHROOTDIR}" "${TMP}/image/casper/filesystem.squashfs" -b 1M \
-no-recovery -processors "$(nproc)" -noappend || createIsoLogger --message \
"Failed to compress ${CHROOTDIR}" --tag "mksquashfs"
pushd "${TMP}/image" || createIsoLogger --message "Unable to change directory" \
--tag "pushd"
-no-recovery -processors "$(nproc)" -noappend || \
create_iso_logger --message "Failed to compress ${CHROOTDIR}" --tag "mksquashfs"
pushd "${TMP}/image" || \
create_iso_logger --message "Unable to change directory" --tag "pushd"
find . -type f -print0 | xargs -0 md5sum | grep --invert-match \
"\\./md5sum.txt" > md5sum.txt || createIsoLogger --message \
"Failed to generate md5sum" --tag "md5sum"
popd || createIsoLogger --message "Unable to change directory" --tag "popd"
"\\./md5sum.txt" > md5sum.txt || \
create_iso_logger --message "Failed to generate md5sum" --tag "md5sum"
popd || create_iso_logger --message "Unable to change directory" --tag "popd"
exit 0
......@@ -24,30 +24,31 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DBG="${11}"
PREFIX="${PWD}"
source "${PREFIX}/include/chroot.sh"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/common.sh"
grep --invert-match '^#' < "${PKGLIST}/dependencies.list" | tr '\n' ' '
addToChrootFile "${CHROOTDIR}" "export PATH='/fakebin:${PATH}' createIsoLogger \
--message \"Unable to export PATH\" --script \
add_to_chroot_file "${CHROOTDIR}" \
"export PATH='/fakebin:${PATH}' || \
create_iso_logger --message \"Unable to export PATH\" --script \
\"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"export\""
addToChrootFile "${CHROOTDIR}" "export DEBIAN_FRONTEND=noninteractive || \
createIsoLogger --message \"Unable to export DEBIAN_FRONTEND\" --script \
add_to_chroot_file "${CHROOTDIR}" \
"export DEBIAN_FRONTEND=noninteractive || \
create_iso_logger --message \"Unable to export DEBIAN_FRONTEND\" --script \
\"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"export\""
addToChrootFile "${CHROOTDIR}" "apt-get update && apt-get --quiet --yes \
install $(grep --invert-match '^#' < "${PKGLIST}/dependencies.list" | \
tr '\n' ' ') || createIsoLogger --message \"Unable to install dependencies\" \
--script \"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \
\"apt-get\""
add_to_chroot_file "${CHROOTDIR}" \
"apt-get update && apt-get --quiet --yes install \
$(grep --invert-match '^#' < \
"${PKGLIST}/dependencies.list" | \
tr '\n' ' ') || \
create_iso_logger --message \"Unable to install dependencies\" --script \
\"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"apt-get\""
exit 0
......@@ -24,29 +24,31 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
PKGLIST="$8"
# SOURCESLIST="$9"
REPO="${10}"
# KEYURL="${11}"
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
REPO="$9"
# KEYURL="${10}"
# DBG="${11}"
PREFIX="${PWD}"
source "${PREFIX}/include/chroot.sh"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/common.sh"
addToChrootFile "${CHROOTDIR}" "export PATH='/fakebin:${PATH}' || \
createIsoLogger --message \"Unable to export PATH\" --script \
add_to_chroot_file "${CHROOTDIR}" \
"export PATH='/fakebin:${PATH}' || \
create_iso_logger --message \"Unable to export PATH\" --script \
\"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"export\""
addToChrootFile "${CHROOTDIR}" "export DEBIAN_FRONTEND=noninteractive || \
createIsoLogger --message \"Unable to export DEBIAN_FRONTEND\" --script \
add_to_chroot_file "${CHROOTDIR}" \
"export DEBIAN_FRONTEND=noninteractive || \
create_iso_logger --message \"Unable to export DEBIAN_FRONTEND\" --script \
\"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"export\""
addToChrootFile "${CHROOTDIR}" "apt-get update && apt-get --quiet --yes \
--target-release ${REPO} install $(grep --invert-match '^#' < \
"${PKGLIST}/install.list" | tr '\n' ' ') || createIsoLogger --message \
\"Unable to install listed packages\" --script \