Commit 76192dc8 authored by sulzbach's avatar sulzbach

Temporary commit

parent 871ee349
Pipeline #17893 passed with stage
in 11 seconds
......@@ -2,3 +2,4 @@ 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"
WEEK=1
......@@ -126,6 +126,7 @@ mkdir --parents "${CACHEDIR}"
find="$(find "${CACHEDIR}" -mindepth 1 -maxdepth 1 -type d | sort --numeric)"
if [[ -z "${find}" ]]; then
[[ -z "${_INPUT}" ]] && _INPUT="$(setupISO "${ISODIR}" "${ISOURL}")"
createIsoLogger -m "_INPUT: ${_INPUT}" -t d
conditionalMount "${_INPUT}" "${PREFIX}/isobase" iso9660 ro,loop
# TODO: Mount iso in place
mkdir --parents "${TMP}/lower"
......@@ -167,24 +168,27 @@ 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}" \
"${TMP}" \
"${CHROOTDIR}" \
"${CACHEDIR}" \
"${PKGLIST}" \
"${SOURCESLIST}" \
"${_REPO}" \
"${KEYURL}" \
"${_DEBUG}"; then
cleanup "${CHROOTDIR}"
createIsoLogger --message "Failed to run " \
"$(basename "${script}")"
fi
# 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
......@@ -192,24 +196,7 @@ for script in "${SCRIPTSDIR}"/*; do
initChroot "${CHROOTDIR}"
execChroot "${CHROOTDIR}"
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
......
......@@ -5,9 +5,19 @@ if [ "$(id -u)" != "0" ]; then
exit -1
fi
source "${PWD}/conf/le6.conf"
if [ "${WEEK}" == 0 ]; then
sed --in-place "s/WEEK=0/WEEK=1/" "${PWD}/conf/le6.conf"
exit 0
else
sed --in-place "s/WEEK=1/WEEK=0/" "${PWD}/conf/le6.conf"
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"
CMD="./create-iso.sh --profile le6 --version 6.1.1 --repo testing --debug \
--sendmail"
# Create GNU screen session
screen -dmS "${SESSION}" || exit 1
......
......@@ -38,12 +38,18 @@ setupISO() {
if [[ "${oldmd5}" != "${newmd5}" ]]; then
mkdir --parents "${isodir}/input"
pushd "${isodir}/input" || createIsoLogger --message \
pushd "${isodir}/input" >/dev/null || createIsoLogger --message \
"Unable to change directory" --tag "pushd"
createIsoLogger --message "Downloading ${isoname}" --type info
wget "${isosrc}/${isoname}" || createIsoLogger --message \
"Unable to download image" --tag "wget"
popd || createIsoLogger --message "Unable to change directory" \
--tag "popd"
createIsoLogger --message "Generating md5sum" --type info
md5="$(md5sum "${isodir}/input/${isoname}" | cut --delimiter=' ' \
--fields=1)"
[[ "${md5}" != "${newmd5}" ]] && createIsoLogger --message \
"Iso image is corrupted"
popd >/dev/null || createIsoLogger --message \
"Unable to change directory" --tag "popd"
echo "${newmd5}" > "${isodir}/input/MD5SUMS"
fi
......
To: ls17@c3sl.ufpr.br
To: lesuporte@c3sl.ufpr.br
Subject: ##SUBJECT##
......@@ -26,10 +26,12 @@
# WEBSITE="$3"
TMP="$4"
CHROOTDIR="$5"
# PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
# CACHEDIR="$6"
# PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
#!/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"
# NAME="$2"
# WEBSITE="$3"
TMP="$4"
CHROOTDIR="$5"
PKGLIST="$6"
REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
PREFIX="${PWD}"
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 [[ -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 -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):
# shellcheck disable=SC2046
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 in local repository" --tag "reprepro"
chroot "${CHROOTDIR}" apt-get clean
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"
rm "${CHROOTDIR:?}/tmp/public.key"
umount "${CHROOTDIR}/etc/resolv.conf"
exit 0
......@@ -22,12 +22,16 @@
# USA.
# PROFILE="$1"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
# REPO="$5"
# KEYURL="$6"
# TMP="$7"
# NAME="$2"
# WEBSITE="$3"
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -22,12 +22,16 @@
# USA.
# PROFILE="$1"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
REPO="$5"
# KEYURL="$6"
# TMP="$7"
# NAME="$2"
# WEBSITE="$3"
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -22,12 +22,16 @@
# USA.
# PROFILE="$1"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
REPO="$5"
# KEYURL="$6"
TMP="$7"
# NAME="$2"
# WEBSITE="$3"
TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -26,10 +26,12 @@
# WEBSITE="$3"
TMP="$4"
CHROOTDIR="$5"
# PKGLIST="$6"
# REPO="$7"
CACHEDIR="$8"
# DEBUG="$9"
CACHEDIR="$6"
# PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -26,10 +26,12 @@
# WEBSITE="$3"
TMP="$4"
# CHROOTDIR="$5"
PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -22,12 +22,16 @@
# USA.
# PROFILE="$1"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
# REPO="$5"
# KEYURL="$6"
# TMP="$7"
# NAME="$2"
# WEBSITE="$3"
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -26,10 +26,12 @@
# WEBSITE="$3"
TMP="$4"
CHROOTDIR="$5"
# PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
# DEBUG="$9"
# CACHEDIR="$6"
# PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
export PREFIX="${PWD}"
......
......@@ -22,12 +22,16 @@
# USA.
# PROFILE="$1"
CHROOTDIR="$2"
PKGLIST="$3"
# SOURCESLIST="$4"
# REPO="$5"
# KEYURL="$6"
# TMP="$7"
# NAME="$2"
# WEBSITE="$3"
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -26,10 +26,12 @@ NAME="$2"
WEBSITE="$3"
TMP="$4"
CHROOTDIR="$5"
# PKGLIST="$6"
# REPO="$7"
# CACHEDIR="$8"
DEBUG="$9"
# CACHEDIR="$6"
# PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
DEBUG="${11}"
PREFIX="${PWD}"
......
......@@ -22,12 +22,16 @@
# USA.
PROFILE="$1"
CHROOTDIR="$2"
# PKGLIST="$3"
SOURCESLIST="$4"
REPO="$5"
KEYURL="$6"
# TMP="$7"
# NAME="$2"
# WEBSITE="$3"
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
# PKGLIST="$7"
SOURCESLIST="$8"
REPO="$9"
KEYURL="${10}"
# DEBUG="${11}"
PREFIX="${PWD}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment