Commit 871ee349 authored by sulzbach's avatar sulzbach

Temporary commit

parents 41fb56cb afaac8fb
Pipeline #17838 passed with stage
in 13 seconds
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"
......@@ -5,3 +5,4 @@ _OUTPUT=""
_REPO="stable"
_VERSION=""
_DEBUG=false
_MAIL=false
......@@ -33,6 +33,7 @@ while true; do
-o | --output ) _OUTPUT="$2"; shift; shift ;;
-r | --repo ) _REPO="$2"; shift; shift ;;
-d | --debug ) _DEBUG=true; shift ;;
-s | --sendmail ) _MAIL=true; shift ;;
-* ) echo "Unrecognized option. Try with --help."; \
exit 1 ;;
* ) break ;;
......@@ -57,8 +58,7 @@ if [[ "${_HELP}" = true ]]; then
echo "output the created ISO image"
echo -n " -r, --repo [stable | testing | unstable] Select remote "
echo "repository codename to download packages from"
echo " -d, --debug Cache from last"
echo "execution"
echo " -d, --debug Execute in debug mode"
exit 0
fi
......@@ -69,32 +69,33 @@ if [[ "$(id -u)" != "0" ]]; then
fi
if [[ -z "${_PROF}" ]]; then
echo "No profile specified. Try with --help or --list-profiles."
echo "No profile specified. Try with --help."
exit 1
fi
if ! source "${PREFIX}/conf/${_PROF}.conf"; then
echo "Unavailable profile. Try with --help or --list-profiles."
echo "Unavailable profile. Try with --help."
exit 1
fi
source "${PREFIX}/conf/general.conf"
if [[ -z "${_VERSION}" ]]; then
echo "No version specified. Ommiting."
echo "No version specified. Proceeding without defining it."
else
NAME="${NAME} ${_VERSION}"
fi
if [[ "${_REPO}" != "stable" ]] && [[ "${_REPO}" != "testing" ]] && \
[[ "${_REPO}" != "unstable" ]]; then
[[ "${_REPO}" != "unstable" ]]; then
echo "Unrecognized remote repository codename. Try with --help."
exit 1
fi
TIME_STAMP="$(date +'%Y-%m-%dT%H:%M:%S')"
export LOG_FILE="${LOG_PATH}/create-iso-${TIME_STAMP}.log"
export _MAIL
export TIME_STAMP="$(date +'%Y-%m-%dT%H:%M:%S')"
mkdir --parents "${LOG_PATH}"
export LOG_FILE="${LOG_PATH}/${TIME_STAMP}.log"
exec 1<&-
exec 2<&-
......@@ -107,11 +108,12 @@ source "${PREFIX}/include/logging.sh"
source "${PREFIX}/include/mount.sh"
# Disable debug logging if not in debug mode
[[ "${_DEBUG}" == false ]] && let VERBOSE_FLAGS="${ALL} ^ ${DEBUG}"
[[ "${_DEBUG}" == false ]] && let VERBOSE_FLAGS="${ALL} ^ ${LDEBUG}"
# Installation of create-iso's dependencies
apt-get install isolinux syslinux squashfs-tools genisoimage xorriso --yes || \
createIsoLogger --message "Failed to install basic tools" --tag "apt-get"
apt-get install isolinux syslinux squashfs-tools genisoimage xorriso reprepro \
binwalk --yes || createIsoLogger --message "Failed to install basic tools" \
--tag "apt-get"
# The default filename of the generated ISO is a concatenation of lowered-cased
# hyphen-delimited distribution version, repo codename and timestamp
......@@ -165,38 +167,49 @@ conditionalMount overlay "${CHROOTDIR}" overlay \
for script in "${SCRIPTSDIR}"/*; do
if [[ -x "${script}" ]] && grep -E --quiet '^[0-9]{2}-[A-Za-z]+' \
<<< "$(basename "${script}")"; then
createIsoLogger --message "Running $(basename "${script}")..." --type \
info
if ! "${script}"\
"${_PROF}" \
"${NAME}" \
"${WEBSITE}" \
"${TMPFS}" \
"${TMP}" \
"${CHROOTDIR}" \
"${SCRIPTSDIR}" \
"${PKGLIST}" \
"${SOURCESLIST}" \
"${_REPO}" \
"${KEYURL}" \
"${CACHEDIR}"; then
cleanup "${CHROOTDIR}"
createIsoLogger --message "Failed to run script"
exit 1
fi
# createIsoLogger -m "Breakpoint" -t d
# If the script is marked as 'chroot', it means it performs changes in
# the overlaid chroot filesystem,
# therefore, the 'chroot script', filled with the required commands by
# the marked script, is executed
# This warning is disabled because the literal '-' is actually needed:
# This warning is disabled because the literal '-' is needed:
# shellcheck disable=SC1001
if [[ "$(basename "${script}")" =~ [0-9]+\-chroot\.* ]]; then
if ! "${script}" \
"${_PROF}" \
"${CHROOTDIR}" \
"${PKGLIST}" \
"${SOURCESLIST}" \
"${_REPO}" \
"${KEYURL}" \
"${TMP}"; then
cleanup "${CHROOTDIR}"
createIsoLogger --message "Failed to run " \
"$(basename "${script}")"
fi
# If the script is marked as 'chroot', it means it performs
# changes in the overlaid chroot filesystem, therefore, the
# 'chroot script', filled with the required commands by the marked
# script, is executed
initChroot "${CHROOTDIR}"
execChroot "${CHROOTDIR}"
# [[ "$(basename "${script}")" =~ [0-9]+\-chroot\.update-sourceslist\.sh ]] && createIsoLogger -m "Breakpoint" -t d
closeChroot "${CHROOTDIR}"
else
if ! "${script}" \
"${_PROF}" \
"${NAME}" \
"${WEBSITE}" \
"${TMP}" \
"${CHROOTDIR}" \
"${PKGLIST}" \
"${_REPO}" \
"${CACHEDIR}" \
"${_DEBUG}"; then
cleanup "${CHROOTDIR}"
createIsoLogger --message "Failed to run " \
"$(basename "${script}")"
fi
fi
# createIsoLogger -m "Breakpoint" -t d
fi
done
......@@ -214,18 +227,20 @@ popd || createIsoLogger --message "Unable to change directory" --tag "popd"
cleanup "${CHROOTDIR}"
conditionalUmount "${CHROOTDIR}"
rm --recursive --force "${CHROOTDIR}"
conditionalUmount "${PREFIX:?}/squashfsbase"
rm --recursive --force "${PREFIX:?}/squashfsbase"
conditionalUmount "${TMP:?}/image"
if [[ "${_DEBUG}" == true ]]; then
mkdir --parents "${CACHEDIR}/${TIME_STAMP}"
mv "${TMP}/MD5SUMS" "${CACHEDIR}/${TIME_STAMP}/" || createIsoLogger \
--message "Unable to move file" --tag "mv"
mv "${TMP}/upper" "${CACHEDIR}/${TIME_STAMP}/image" || createIsoLogger \
--message "Unable to move directory" --tag "mv"
fi
mkdir --parents "${CACHEDIR}/${TIME_STAMP}"
mv "${TMP}/MD5SUMS" "${CACHEDIR}/${TIME_STAMP}/" || createIsoLogger --message \
"Unable to move file" --tag "mv"
mv "${TMP}/upper" "${CACHEDIR}/${TIME_STAMP}/image" || createIsoLogger \
--message "Unable to move directory" --tag "mv"
conditionalUmount "${TMPFS}"
rm --recursive --force "${TMPFS}"
conditionalUmount "${PREFIX:?}/isobase"
rm --recursive --force "${PREFIX:?}/isobase"
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
......@@ -36,7 +36,7 @@ initChroot() {
mount --bind "${LOG_FILE}" "${chrootdir}/${LOG_FILE}"
mount --bind --options ro "/etc/resolv.conf" "${chrootdir}/etc/resolv.conf"
mount --bind "/etc/resolv.conf" "${chrootdir}/etc/resolv.conf"
# Prevent services from being started in the chrooted environment
rm -rf "${chrootdir:?}/fakebin"
......@@ -69,7 +69,7 @@ function create_stub() {
EOF
cat "${PREFIX}/helper/logging.incsh" >> "${script}"
cat "${PREFIX}/include/logging.sh" >> "${script}"
}
addToChrootFile() {
......@@ -96,22 +96,13 @@ execChroot() {
function 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 conditionalUmount >/dev/null 2>&1 || \
source "${PREFIX}/include/mount.sh"
conditionalUmount "${chrootdir}/etc/resolv.conf"
conditionalUmount "${chrootdir}/${LOG_FILE}"
conditionalUmount "${chrootdir}/dev/pts"
conditionalUmount "${chrootdir}/dev"
conditionalUmount "${chrootdir}/sys"
conditionalUmount "${chrootdir}/proc"
}
......@@ -24,7 +24,7 @@
readonly ERROR=1
readonly WARNING=2
readonly INFO=4
readonly DEBUG=8
readonly LDEBUG=8
readonly ALL=15
VERBOSE_FLAGS=${ALL}
......@@ -34,9 +34,9 @@ mapType() {
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 ;;
d | debug ) echo "${LDEBUG}" ;;
* ) createIsoLogger -m "Invalid type '$1'" \
-T "LOGGER"; return 1 ;;
esac
}
......@@ -55,15 +55,15 @@ createIsoLogger() {
while true; do
case "${1}" in
-t | --type ) TYPE="$(mapType "$2")" || return; shift; \
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 ;;
-l | --line ) LINE="$2"; shift; shift ;;
-* ) createIsoLogger -m \
"Unrecognized option '$1'" -T "LOGGER"; \
return ;;
* ) break ;;
"Unrecognized option '$1'" -T "LOGGER"; \
return ;;
* ) break ;;
esac
done
......@@ -80,8 +80,8 @@ createIsoLogger() {
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" ;;
"${LDEBUG}" ) \
LOG_LINE="\033[38;5;6m[LDEBUG]: ${LOG_LINE}\033[0m" ;;
* ) \
createIsoLogger -m "Invalid type '${TYPE}'" \
-T "LOGGER"; return ;;
......@@ -89,12 +89,13 @@ createIsoLogger() {
echo -e "${LOG_LINE}" 1>&2
echo -e "${LOG_LINE}" >> "${LOG_FILE}"
if [[ "${TYPE}" == "${ERROR}" ]] || \
[[ "${TYPE}" == "${DEBUG}" ]]; then
if [[ "${TYPE}" == "${ERROR}" ]] || [[ "${TYPE}" == "${LDEBUG}" ]]; then
[[ "${_MAIL}" == true ]] && sendmail -t <<< "$(sed \
"s/##SUBJECT##/${TIME_STAMP}/" < "${PREFIX}/mail.txt" && screen \
-ls; echo ""; tail --lines=20 "${LOG_FILE}")"
/bin/bash
fi
else
createIsoLogger -m "Tried to use disabled type '${TYPE}'" \
-T "LOGGER"
createIsoLogger -m "Tried to use disabled type '${TYPE}'" -T "LOGGER"
fi
}
......@@ -38,8 +38,9 @@ conditionalMount() {
conditionalUmount() {
local mountpoint="$1"
(! mountpoint --quiet "${mountpoint}" || umount "${mountpoint}") || \
(! mountpoint --quiet "${mountpoint}" || umount --lazy "${mountpoint}") || \
createIsoLogger --message "Unable to umount ${mountpoint}" --tag "umount"
rm --recursive --force "${mountpoint}"
# Todo: we may need to move this line to some points after this function call
# rm --recursive --force "${mountpoint}"
}
To: ls17@c3sl.ufpr.br
Subject: ##SUBJECT##
lc-conf
lc-server-all
lc-client-all
......@@ -24,35 +24,26 @@
# 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"
# PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
PREFIX="${PWD}"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/common.sh"
type conditionalUmount >/dev/null 2>&1 || source "${PREFIX}/include/mount.sh"
type createIsoLogger >/dev/null 2>&1 || 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
conditionalUmount "${CHROOTDIR}/dev/pts"
conditionalUmount "${CHROOTDIR}/dev"
conditionalUmount "${CHROOTDIR}/sys"
conditionalUmount "${CHROOTDIR}/proc"
mksquashfs "${CHROOTDIR}" "${TMP}/image/casper/filesystem.squashfs" -b 1M \
-no-recovery -processors "$(nproc)" -noappend || createIsoLogger --message \
......
......@@ -24,24 +24,21 @@
# 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"
PKGLIST="$6"
REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
PREFIX="${PWD}"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/common.sh"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/helper/logging.incsh"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/include/logging.sh"
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
if [[ -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)"
......@@ -62,9 +59,10 @@ 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"
# createIsoLogger -m "Breakpoint" -t d
reprepro --basedir "${PREFIX}/repo/" includedeb "${REPO}" \
"${CHROOTDIR}"/var/cache/apt/archives/*.deb || createIsoLogger --message \
"Unable to include package to local repository" --tag "reprepro"
"Unable to include package in local repository" --tag "reprepro"
chroot "${CHROOTDIR}" apt-get clean
cp --recursive repo/{dists,pool} "${TMP}/image/" || createIsoLogger --message \
......
......@@ -22,22 +22,17 @@
# USA.
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
# REPO="$5"
# KEYURL="$6"
# TMP="$7"
PREFIX="${PWD}"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/common.sh"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/include/chroot.sh"
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\""
......
......@@ -22,20 +22,16 @@
# USA.
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
# TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
PKGLIST="$8"
# SOURCESLIST="$9"
REPO="${10}"
# KEYURL="${11}"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
REPO="$5"
# KEYURL="$6"
# TMP="$7"
PREFIX="${PWD}"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/common.sh"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/include/chroot.sh"
addToChrootFile "${CHROOTDIR}" "export PATH='/fakebin:${PATH}' || \
createIsoLogger --message \"Unable to export PATH\" --script \
......
#!/usr/bin/env 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.
# PROFILE="$1"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
REPO="$5"
# KEYURL="$6"
TMP="$7"
PREFIX="${PWD}"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/include/chroot.sh"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/include/logging.sh"
fingerprint="$(gpg --list-keys --with-colons 'C3SL Live' | grep --max-count=1 \
'fpr' | cut --delimiter=':' --fields=10)"
if [[ -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)"
fi
cp --recursive --archive "${PREFIX}/src/local-repository/" "${PREFIX}/repo/"
sed --in-place "s/##GPGKEY##/ ${fingerprint}/" \
"${PREFIX}/repo/conf/distributions" || createIsoLogger --message \
"Unable to setup the key of local repository" --type warning --tag "sed"
sed --in-place "s/##CODENAME##/ ${REPO}/" "${PREFIX}/repo/conf/distributions" \
|| createIsoLogger --message \
"Unable to setup the codename of local repository" --type warning --tag "sed"
reprepro --basedir "${PREFIX}/repo/" includedeb "${REPO}" \
"${CHROOTDIR}"/var/cache/apt/archives/*.deb || createIsoLogger --message \
"Unable to include package in local repository" --tag "reprepro"
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"
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 clean && apt-key add /tmp/public.key \
|| createIsoLogger --message \"Unable to add key of local repository\" \
--script \"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \
\"apt-get\""
addToChrootFile "${CHROOTDIR}" "rm /tmp/public.key || createIsoLogger \
--message \"Unable to remove the key file\" --script \"$(basename \
"${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"apt-get\" --type warning"
exit 0
......@@ -24,19 +24,16 @@
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
# TMPFS="$4"
TMP="$5"
CHROOTDIR="$6"
# SCRIPTSDIR="$7"
# PKGLIST="$8"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
CACHEDIR="${12}"
TMP="$4"
CHROOTDIR="$5"
# PKGLIST="$6"
# REPO="$7"
CACHEDIR="$8"
# DEBUG="$9"
PREFIX="${PWD}"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/helper/logging.incsh"
type createIsoLogger >/dev/null 2>&1 || source "${PREFIX}/include/logging.sh"
# The most recent kernel available in the base system is used in the image
initrd_path="$(find "${CHROOTDIR}/boot/" -maxdepth 1 -regextype egrep -name \
......@@ -49,7 +46,6 @@ PREVIOUS="$(find "${CACHEDIR}" -mindepth 1 -maxdepth 1 -type d | sort \
--numeric | tail --lines=1)"
if [[ -f "${PREVIOUS}/MD5SUMS" ]]; then
createIsoLogger -m "Breakpoint: Got true" -t d
OLDMD5="$(cat "${PREVIOUS}/MD5SUMS")"
if [[ "${OLDMD5}" == "${NEWMD5}" ]]; then
......@@ -59,8 +55,6 @@ if [[ -f "${PREVIOUS}/MD5SUMS" ]]; then
fi
fi
createIsoLogger -m "Breakpoint: Got false" -t d
version="$(basename "${initrd_path}" | cut --delimiter='-' --fields=2,3)"
cp "${CHROOTDIR}/boot/vmlinuz-${version}-generic" \
"${TMP}/image/casper/vmlinuz" || createIsoLogger --message \
......
......@@ -24,18 +24,16 @@
# 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"
PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
PREFIX="${PWD}"
type createIsoLogger >/dev/nul 2>&1 || source "${PREFIX}/helper/logging.incsh"
type createIsoLogger >/dev/nul 2>&1 || source "${PREFIX}/include/logging.sh"
# This packages must not appear in the manifest
cp "${TMP}/image/casper/filesystem.manifest" \
......
#!/usr/bin/env 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.
# PROFILE="$1"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
# REPO="$5"
# KEYURL="$6"
# TMP="$7"
PREFIX="${PWD}"
type addToChrootFile >/dev/null 2>&1 || source "${PREFIX}/include/chroot.sh"
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 clean && apt-get update && apt-get \
--quiet --yes --download-only install $(grep --invert-match '^#' < \
"${PKGLIST}/repo.list" | tr '\n' ' ') || createIsoLogger --message \
\"Unable to install local repo packages\" --script \"$(basename \
"${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"apt-get\""
exit 0
\ No newline at end of file
......@@ -24,18 +24,16 @@
# 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"
# PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
export PREFIX="${PWD}"