Commit 130bbe48 authored by sulzbach's avatar sulzbach

WIP: SCRUM#601

parent 6df32bda
chroot
overlay
kernel
*.swp
iso/**/*.iso
src/preseed/.preseed.bkp
initrd
cache/*
iso/*
initrd/*
initrd.lz
chroot*.tar.gz
packages-needed
base
todos.txt
vmlinuz-*-generic
initrd.img-*-generic
.Trash-1000
\ No newline at end of file
......@@ -18,5 +18,6 @@ echo -e "$files"| xargs shellcheck -s bash && \
echo "AWESOME! No problems found." ; \
exit 0
#else
echo -e "Understand errors in: ${BLUE}https://github.com/koalaman/shellcheck/wiki${NC}"
echo -e "Understand errors in: \
${BLUE}https://github.com/koalaman/shellcheck/wiki${NC}"
exit 1
{
// sulzbach:
"editor.rulers": [80],
"editor.fontSize": 16
}
\ No newline at end of file
#!/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.
initChroot() {
local chrootdir="${1}"
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.
......@@ -16,7 +36,7 @@ initChroot() {
mount --bind "${LOG_FILE}" "${chrootdir}/${LOG_FILE}"
mount --bind "/etc/resolv.conf" "${chrootdir}/etc/resolv.conf"
mount --bind --options ro "/etc/resolv.conf" "${chrootdir}/etc/resolv.conf"
# Prevent services from being started in the chrooted environment
rm -rf "${chrootdir:?}/fakebin"
......@@ -31,7 +51,7 @@ initChroot() {
}
closeChroot() {
local chrootdir="${1}"
local chrootdir="$1"
umount --lazy "${chrootdir}/etc/resolv.conf"
umount --lazy "${chrootdir}/${LOG_FILE}"
......@@ -39,7 +59,7 @@ closeChroot() {
}
function create_stub() {
local script="${1}"
local script="$1"
cat << EOF > "${script}"
#!/usr/bin/env bash
......@@ -53,31 +73,28 @@ EOF
}
addToChrootFile() {
local chrootdir="${1}"
local script_name="${2}"
local cmd="${3}"
local chrootdir="$1"
local cmd="${2}"
if [ ! -f "${chrootdir}/tmp/${script_name}" ]; then
create_stub "${chrootdir}/tmp/${script_name}"
if [ ! -f "${chrootdir}/tmp/exec.sh" ]; then
create_stub "${chrootdir}/tmp/exec.sh"
fi
echo "${cmd}" >> "${chrootdir}/tmp/${script_name}"
echo "${cmd}" >> "${chrootdir}/tmp/exec.sh"
}
execChroot() {
local chrootdir="${1}"
local script_name="${2}"
local chrootdir="$1"
[ ! -x "${chrootdir}/tmp/${script_name}" ] && chmod +x "${chrootdir}/tmp/${script_name}"
chroot "${chrootdir}" "/tmp/${script_name}"
rm --recursive --force "${chrootdir}/tmp/${script_name:?}" &>/dev/null
[ ! -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() {
local chrootdir="${1}"
local tmp="${2}"
local chrootdir="$1"
if mountpoint --quiet "${chrootdir}/etc/resolv.conf"; then
umount --lazy "${chrootdir}/etc/resolv.conf"
......@@ -97,5 +114,4 @@ function cleanup() {
if mountpoint --quiet "${chrootdir}/proc"; then
umount --lazy "${chrootdir}/proc"
fi
rm --recursive --force "${tmp:?}"
}
TMPFS="${PREFIX}/tmp"
TMPFS_SIZE="6291456k"
TMP="${TMPFS}/${_PROF}"
CHROOTDIR="${PREFIX}/overlay"
SCRIPTSDIR="${PREFIX}/scripts-enabled/${_PROF}"
ISODIR="${PREFIX}/iso"
CACHEDIR="${PREFIX}/cache/${_PROF}/${_REPO}"
PKGLIST="${PREFIX}/pkg-list/${_PROF}"
SOURCESLIST="${PREFIX}/sources-list"
LOG_PATH="/var/log"
NAME="Linux Comunicacoes"
WEBSITE="https://cidadesdigitais.c3sl.ufpr.br/linux-comunicacoes/"
ISOURL="http://cdimage.ubuntu.com/ubuntu-gnome/releases/16.04/release"
KEYURL="http://repo.c3sl.ufpr.br/lc2/lc.c3sl.ufpr.br.key"
NAME="Linux Educacional"
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"
SHORTNAME=le6
TMP=${PREFIX}/${_DIST}
CHROOTDIR=${PREFIX}/overlay
TMPFS=${PREFIX}/tmp
DISTRO=Linux_Educacional_6.1.0
DPLIST=${PREFIX}/pkg-list/${_DIST}/dependencies.list
INSTLIST=${PREFIX}/pkg-list/${_DIST}/install.list
ISOLINUX=${PREFIX}/src/isolinux
MOUNTLIST=${TMP}/mountlist
OURSOURCESLIST=${PREFIX}/sources-list/${_DIST}/${SHORTNAME}.list
RMDSKT=${PREFIX}/pkg-list/${_DIST}/remove-desktop.list
RMLIST=${PREFIX}/pkg-list/${_DIST}/remove.list
REPOPKGS=${PREFIX}/pkg-list/${_DIST}/repo-local.list
SCRIPTSDIR=${PREFIX}/scripts-enabled/${_DIST}
SOURCESLISTDEFAULT=${PREFIX}/sources-list/${_DIST}/default.list
SCRIPT_NAME="exec.sh"
LOG_PATH="/var/log"
_HELP=false
_DIST=""
_ARCH="amd64"
_PROF=""
_INPUT=""
_OUTPUT=""
_REPO="stable"
_VERSION=""
_DEBUG=false
This diff is collapsed.
#!/bin/bash
# shellcheck disable=SC1090
mount --bind /dev chroot/dev
mount --bind /dev/pts chroot/dev/pts
mount --bind /sys chroot/sys
mount --bind /proc chroot/proc
#chroot chroot dbus-uuidgen > chroot/var/lib/dbus/machine-id
chroot chroot
......@@ -7,30 +7,32 @@ readonly ALL=15
VERBOSE_FLAGS=${ALL}
mapType() {
case "${1}" in
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 ;;
* ) 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 ;;
-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
......@@ -50,13 +52,12 @@ createIsoLogger() {
esac
echo -e "${LOG_LINE}" 1>&2
echo -e "${LOG_LINE}" >> "${LOG_FILE}"
if [ "${TYPE}" -eq "${ERROR}" ] || [ "${TYPE}" -eq "${DEBUG}" ]; then
/bin/bash
fi
else
createIsoLogger -m "Tried to use disabled type '${TYPE}'" -T "LOGGER"
return
fi
if [ "${TYPE}" -eq "${ERROR}" ]; then
/bin/bash
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.
mountTmpfs() {
local tmpfs="${1}"
if mountpoint --quiet "${tmpfs}"; then
return 1
fi
mkdir --parents "${tmpfs}"
if [ ! -d "${tmpfs}" ]; then
echo "overlay path: '${tmpfs}' has not been found."
exit 1
fi
mount --types tmpfs tmpfs --options suid,dev,size=6291456k "${tmpfs}"
}
umountTmpfs() {
local tmpfs="${1}"
if mountpoint --quiet "${tmpfs}"; then
umount "${tmpfs}"
fi
rm --recursive --force "${tmpfs:?}"
}
#!/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.
mountOverlay() {
local chrootdir="${1}"
local tmpfs="${2}"
local prefix="${PWD}"
mkdir --parents "${tmpfs}/upper"
mkdir --parents "${tmpfs}/work"
mkdir --parents "${chrootdir}"
if [ ! -d "${tmpfs}" ]; then
echo "overlay path: '${tmpfs}' has not been found."
exit 1
fi
if [ ! -d "${tmpfs}/upper" ]; then
echo "upperdir path: '${tmpfs}/upper' has not been found."
exit 1
fi
if [ ! -d "${tmpfs}/work" ]; then
echo "workdir path: '${tmpfs}/work' has not been found."
exit 1
fi
if [ ! -d "${chrootdir}" ]; then
echo "merge point path: '${chrootdir}' has not been found."
exit 1
fi
if [ ! -d "${prefix}/chroot" ]; then
echo "chroot path: '${prefix}/chroot' has not been found."
exit 1
fi
if ! mountpoint --quiet "${chrootdir}"; then
if ! mount --types overlay overlay --options rw,lowerdir="${prefix}"/chroot,upperdir="${tmpfs}"/upper,workdir="${tmpfs}"/work "${chrootdir}"; then
echo "Overlay could not be mounted:" >&2
echo " lowerdir: '${prefix}/chroot'" >&2
echo " upperdir: '${tmpfs}/upper'" >&2
echo " workdir: '${tmpfs}/work'" >&2
echo "mount point: '${chrootdir}'" >&2
exit 1
fi
fi
}
umountOverlay() {
local chrootdir="${1}"
local tmpfs="${2}"
if mountpoint --quiet "${chrootdir}"; then
umount "${chrootdir}"
fi
rm --recursive --force "${tmpfs}/{upper,work:?}"
rm --recursive --force "${chrootdir:?}"
}
lc-all-live
lc-all
#linux-generic
plymouth-x11
#plymouth-theme-lc-logo
numlockx
#webbrowser-app
#xserver-xorg
linux-generic-hwe-16.04
xserver-xorg-hwe-16.04
lc-all-live
ubiquity
ubiquity-frontend-gtk
ubiquity-frontend-kde
casper
lupin-casper
user-setup
discover
libdebian-installer4
lc-ubiquity-slideshow
lc-server-all
lc-client-all
ubuntu-standard
laptop-detect
dbus
wget
le-live-all
le-all
linux-generic-hwe-16.04
xserver-xorg-hwe-16.04
#!/usr/bin/env bash
# shellcheck disable=SC1090
# shellcheck disable=SC2091
#
# 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.
# WARNING: This script hasn't been used in a while. Probably won't just werk.
#set -x
_DIST="${1}"
_PROF="${1}"
PREFIX="${PWD}"
source "${PREFIX}/conf/${_DIST}/create-iso.conf"
source "${PREFIX}/conf/${_PROF}/create-iso.conf"
source "${PREFIX}/common.sh"
mkdir -p "${TMP}/bl/"
......
......@@ -21,25 +21,18 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# _DIST="${1}"
# _ARCH="${2}"
# _REPO="${3}"
CHROOTDIR="${4}"
# SCRIPT_NAME="${5}"
# DISTRO="${6}"
# DPLIST="${7}"
# INSTLIST="${8}"
# ISOLINUX="${9}"
# MOUNTLIST="${10}"
# OURSOURCESLIST="${11}"
# RMDSKT="${12}"
# RMLIST="${13}"
# SCRIPTSDIR="${14}"
# SHORTNAME="${15}"
# SOURCESLISTDEFAULT="${16}"
TMP="${17}"
# TMPFS="${18}"
# REPOPKGS="${19}"
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
# PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
PREFIX="${PWD}"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/common.sh"
......@@ -61,11 +54,14 @@ if mountpoint --quiet "${CHROOTDIR}/proc"; then
umount "${CHROOTDIR}/proc"
fi
mksquashfs "${CHROOTDIR}" "${TMP}/image/casper/filesystem.squashfs" -b 1M -no-recovery -processors "$(nproc)" || \
createIsoLogger --message "Failed to compress ${CHROOTDIR}" --tag "mksquashfs"
pushd "${TMP}/image" || createIsoLogger --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"
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"
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"
exit 0
......@@ -21,60 +21,60 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# _DIST="${1}"
_ARCH="${2}"
_REPO="${3}"
CHROOTDIR="${4}"
# SCRIPT_NAME="${5}"
# DISTRO="${6}"
# DPLIST="${7}"
# INSTLIST="${8}"
# ISOLINUX="${9}"
# MOUNTLIST="${10}"
# OURSOURCESLIST="${11}"
# RMDSKT="${12}"
# RMLIST="${13}"
# SCRIPTSDIR="${14}"
# SHORTNAME="${15}"
# SOURCESLISTDEFAULT="${16}"
TMP="${17}"
# TMPFS="${18}"
REPOPKGS="${19}"
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
PKGLIST="$8"
# SOURCESLIST="$9"
REPO="${10}"
# KEYURL="${11}"
PREFIX="${PWD}"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/common.sh"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/helper/logging.incsh"
mount --bind "/etc/resolv.conf" "${CHROOTDIR}/etc/resolv.conf"
fingerprint="$(gpg --list-keys --with-colons 'C3SL Live' | grep --max-count=1 'fpr' | cut --delimiter=':' --fields=10)"
mount --bind --options ro "/etc/resolv.conf" "${CHROOTDIR}/etc/resolv.conf"
fingerprint="$(gpg --list-keys --with-colons 'C3SL Live' | grep --max-count=1 \
'fpr' | cut --delimiter=':' --fields=10)"
if test -z "${fingerprint}"; then
gpg --batch --no-tty --gen-key "${PREFIX}/src/gpg-key/gen-key-script"
fingerprint="$(gpg --list-keys --with-colons 'C3SL Live' | grep --max-count=1 'fpr' | cut --delimiter=':' --fields=10)"
fingerprint="$(gpg --list-keys --with-colons 'C3SL Live' | grep \
--max-count=1 'fpr' | cut --delimiter=':' --fields=10)"
fi
cp --recursive --archive "${PREFIX}/src/local-repository/" "${PREFIX}/repo/"
sed -i "s/##ARCH##/ ${_ARCH}/" "${PREFIX}/repo/conf/distributions" || createIsoLogger --message \
"Unable to setup architecture of local repository" --type warning --tag "sed"
sed -i "s/##GPGKEY##/ ${fingerprint}/" "${PREFIX}/repo/conf/distributions" || createIsoLogger --message \
"Unable to setup the key of local repository" --type warning --tag "sed"
sed -i "s/##CODENAME##/ ${_REPO}/" "${PREFIX}/repo/conf/distributions" || createIsoLogger --message \
"Unable to setup the codename of local repository" --type warning --tag "sed"
sed -i "s/##GPGKEY##/ ${fingerprint}/" "${PREFIX}/repo/conf/distributions" || \
createIsoLogger --message "Unable to setup the key of local repository" --type \
warning --tag "sed"
sed -i "s/##CODENAME##/ ${REPO}/" "${PREFIX}/repo/conf/distributions" || \
createIsoLogger --message "Unable to setup the codename of local repository" \
--type warning --tag "sed"
chroot "${CHROOTDIR}" apt-get clean
# This disables the warning about word splitting (it is supposed to word split since each package has to be an argument):
# This disables the warning about word splitting (it is supposed to word split
# since each package has to be an argument):
# shellcheck disable=SC2046
chroot "${CHROOTDIR}" apt-get --download-only --yes install $(grep --invert-match '^#' < "${REPOPKGS}" | tr '\n' ' ') || \
createIsoLogger --message "Unable to download packages to local repository" --tag "apt-get"
reprepro --basedir "${PREFIX}/repo/" includedeb "${_REPO}" "${CHROOTDIR}"/var/cache/apt/archives/*.deb || \
createIsoLogger --message "Unable to include package to local repository" --tag "reprepro"
chroot "${CHROOTDIR}" apt-get --download-only --yes install $(grep \
--invert-match '^#' < "${PKGLIST}/repo.list" | tr '\n' ' ') || \
createIsoLogger --message "Unable to download packages to local repository" \
--tag "apt-get"
reprepro --basedir "${PREFIX}/repo/" includedeb "${REPO}" \
"${CHROOTDIR}"/var/cache/apt/archives/*.deb || createIsoLogger --message \
"Unable to include package to local repository" --tag "reprepro"
chroot "${CHROOTDIR}" apt-get clean
mv repo/{dists,pool} "${TMP}/image/" || createIsoLogger --message "Unable to move local repository to image" --tag "mv"
cp --recursive repo/{dists,pool} "${TMP}/image/" || createIsoLogger --message \
"Unable to move local repository to image" --tag "mv"
rm --recursive --force "${PREFIX:?}/repo/"
gpg --armor --export 'C3SL Live' > "${CHROOTDIR}/tmp/public.key" || createIsoLogger --message "Unable to export key" \
--tag "gpg"
chroot "${CHROOTDIR}" apt-key add /tmp/public.key || createIsoLogger --message "Unable to add key of local repository" \
--tag "apt-key"
gpg --armor --export 'C3SL Live' > "${CHROOTDIR}/tmp/public.key" || \
createIsoLogger --message "Unable to export key" --tag "gpg"
chroot "${CHROOTDIR}" apt-key add /tmp/public.key || createIsoLogger --message \
"Unable to add key of local repository" --tag "apt-key"
rm "${CHROOTDIR:?}/tmp/public.key"
umount "${CHROOTDIR}/etc/resolv.conf"
......
......@@ -21,36 +21,33 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# _DIST="${1}"
# _ARCH="${2}"
# _REPO="${3}"
CHROOTDIR="${4}"
SCRIPT_NAME="${5}"
# DISTRO="${6}"
DPLIST="${7}"
# INSTLIST="${8}"
# ISOLINUX="${9}"
# MOUNTLIST="${10}"
# OURSOURCESLIST="${11}"
# RMDSKT="${12}"
# RMLIST="${13}"
# SCRIPTSDIR="${14}"
# SHORTNAME="${15}"
# SOURCESLISTDEFAULT="${16}"
# TMP="${17}"
# TMPFS="${18}"
# REPOPKGS="${19}"
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
PREFIX="${PWD}"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/common.sh"
grep --invert-match '^#' < "${DPLIST}" | tr '\n' ' '
addToChrootFile "${CHROOTDIR}" "${SCRIPT_NAME}" "export PATH='/fakebin:${PATH}' || \
createIsoLogger --message \"Unable to export PATH\" --script \"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"export\""
addToChrootFile "${CHROOTDIR}" "${SCRIPT_NAME}" "export DEBIAN_FRONTEND=noninteractive || \
createIsoLogger --message \"Unable to export DEBIAN_FRONTEND\" --script \"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"export\""
addToChrootFile "${CHROOTDIR}" "${SCRIPT_NAME}" "apt-get update && apt-get --quiet --yes install \
$(grep --invert-match '^#' < "${DPLIST}" | tr '\n' ' ') || createIsoLogger --message \"Unable to install dependencies\" \
--script \"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"apt-get\""
grep --invert-match '^#' < "${PKGLIST}/dependencies.list" | tr '\n' ' '
addToChrootFile "${CHROOTDIR}" "export PATH='/fakebin:${PATH}' createIsoLogger \
--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 \
\"$(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\""
exit 0
......@@ -21,40 +21,32 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# _DIST="${1}"
# _ARCH="${2}"
_REPO="${3}"
CHROOTDIR="${4}"
SCRIPT_NAME="${5}"
# DISTRO="${6}"
# DPLIST="${7}"
INSTLIST="${8}"
# ISOLINUX="${9}"
# MOUNTLIST="${10}"
# OURSOURCESLIST="${11}"
# RMDSKT="${12}"
# RMLIST="${13}"
# SCRIPTSDIR="${14}"
# SHORTNAME="${15}"
# SOURCESLISTDEFAULT="${16}"
# TMP="${17}"
# TMPFS="${18}"
# REPOPKGS="${19}"
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR="$6"