Commit d8bf5329 authored by sulzbach's avatar sulzbach
parent 8fb40ed6
Pipeline #17658 passed with stage
in 11 seconds
chroot
overlay
*.swp
cache/*
iso/*
initrd/*
initrd.lz
......
NAME="Linux Educacional"
WEBSITE="https://linuxeducacional.c3sl.ufpr.br"
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"
ISOURL="http://cdimage.ubuntu.com/ubuntu-gnome/releases/16.04/release"
KEYURL="http://repo.c3sl.ufpr.br/le6/le.c3sl.ufpr.br.key"
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"
......@@ -22,7 +22,7 @@
# USA.
export PREFIX="${PWD}"
source "${PREFIX}/conf/common.conf"
source "${PREFIX}/conf/opts.conf"
while true; do
case "${1}" in
......@@ -73,11 +73,13 @@ if [ -z "${_PROF}" ]; then
exit 1
fi
if ! source "${PREFIX}/conf/${_PROF}/create-iso.conf"; then
if ! source "${PREFIX}/conf/${_PROF}.conf"; then
echo "Unavailable profile. Try with --help or --list-profiles."
exit 1
fi
source "${PREFIX}/conf/general.conf"
if [ -z "${_VERSION}" ]; then
echo "No version specified. Ommiting."
else
......@@ -147,31 +149,23 @@ else
SQUASHFSPATH="${PREFIX}/isobase/casper/filesystem.squashfs"
fi
if [ "${_DEBUG}" == false ]; then
# Umount if it is mounted
(! mountpoint --quiet "${TMPFS}" || umount "${TMPFS}") || createIsoLogger \
--message "Unable to umount tmpfs" --tag "umount"
rm --recursive --force "${TMPFS:?}"
fi
mkdir --parents "${TMPFS}"
# Mount if it isn't already mounted
(mountpoint --quiet "${TMPFS}" || mount tmpfs "${TMPFS}" --types tmpfs \
--options "suid,dev,size=${TMPFS_SIZE}") || createIsoLogger --message \
"Unable to mount tmpfs" --tag "mount"
find="$(find "${TMP}/cache" -mindepth 1 -maxdepth 1 -type d | sort --numeric)"
mkdir --parents "${CACHEDIR}"
find="$(find "${CACHEDIR}" -mindepth 1 -maxdepth 1 -type d | sort --numeric)"
if [ -z "${find}" ]; then
# TODO: Mount iso in place
mkdir --parents "${TMP}/lower"
lowerdir="${TMP}/lower"
else
lowerdir="$(head --lines=1 <<< "${find}")"
find="$(grep --invert-match "${lowerdir}" <<< "${find}")"
lowerdir="$(sed 's/:/\\:/g' <<< "${lowerdir}")/image"
createIsoLogger -m "Breakpoint 1: find: ${find}, lowerdir: ${lowerdir}" -t d
for dir in ${find}; do
createIsoLogger -m "Breakpoint 11: dir: ${dir}" -t d
lowerdir="$(sed 's/:/\\:/g' <<< "${dir}")/image:${lowerdir}"
done
fi
......@@ -182,8 +176,6 @@ workdir="${TMP}/work"
mkdir --parents "${upperdir}"
mkdir --parents "${workdir}"
createIsoLogger -m "Breakpoint 2: lowerdir: ${lowerdir}, upperdir: ${upperdir}, workdir: ${workdir}" -t d
mkdir --parents "${TMP}/image"
# Mount if it isn't already mounted
(mountpoint --quiet "${TMP}/image" || mount overlay "${TMP}/image" --types \
......@@ -216,6 +208,7 @@ createIsoLogger --message "Unable to mount overlay fs" --tag "mount"
source "${PREFIX}/common.sh"
# TODO: Organize variables
# Each one of the available scripts is executed in numeric order
for script in "${SCRIPTSDIR}"/*; do
if [ -x "${script}" ] && grep -E --quiet '^[0-9]{2}-[A-Za-z]+' \
......@@ -233,8 +226,10 @@ for script in "${SCRIPTSDIR}"/*; do
"${PKGLIST}" \
"${SOURCESLIST}" \
"${_REPO}" \
"${KEYURL}"; then
"${KEYURL}" \
"${CACHEDIR}"; then
cleanup "${CHROOTDIR}"
createIsoLogger --message "Failed to run script"
exit 1
fi
......@@ -247,6 +242,7 @@ for script in "${SCRIPTSDIR}"/*; do
if [[ "$(basename "${script}")" =~ [0-9]+\-chroot\.* ]]; then
initChroot "${CHROOTDIR}" "${LOG_FILE}"
execChroot "${CHROOTDIR}" "${SCRIPT_NAME}"
# [[ "$(basename "${script}")" =~ [0-9]+\-chroot\.update-sourceslist\.sh ]] && createIsoLogger -m "Breakpoint" -t d
closeChroot "${CHROOTDIR}" "${LOG_FILE}"
fi
fi
......@@ -276,33 +272,30 @@ createIsoLogger --message "Unable to umount overlay fs" --tag "umount"
rm --recursive --force "${CHROOTDIR:?}" "${upperdir:?}" "${workdir:?}"
# Umount if it is mounted
(! mountpoint --quiet "${PREFIX}/squashfsbase" || umount \
"${PREFIX}/squashfsbase") || createIsoLogger --message \
"Unable to umount squashfs" --tag "umount"
rm --recursive --force "${PREFIX:?}/squashfsbase"
# Umount if it is mounted
(! mountpoint --quiet "${TMP}/image" || umount "${TMP}/image") || \
createIsoLogger --message "Unable to umount overlay fs" --tag "umount"
if [ "${_DEBUG}" == true ]; then
mkdir --parents "${TMP}/cache/${TIME_STAMP}"
#TODO: Mover image na primeira execução
mv "${TMP}/MD5SUMS" "${TMP}/cache/${TIME_STAMP}/" || createIsoLogger \
mkdir --parents "${CACHEDIR}/${TIME_STAMP}"
mv "${TMP}/MD5SUMS" "${CACHEDIR}/${TIME_STAMP}/" || createIsoLogger \
--message "Unable to move file" --tag "mv"
mv "${TMP}/upper" "${TMP}/cache/${TIME_STAMP}/image" || createIsoLogger \
mv "${TMP}/upper" "${CACHEDIR}/${TIME_STAMP}/image" || createIsoLogger \
--message "Unable to move directory" --tag "mv"
rm --recursive --force "${TMP:?}/work"
else
# Umount if it is mounted
(! mountpoint --quiet "${TMPFS}" || umount "${TMPFS}") || createIsoLogger \
--message "Unable to umount tmpfs" --tag "umount"
rm --recursive --force "${TMPFS:?}"
fi
# Umount if it is mounted
(! mountpoint --quiet "${PREFIX}/squashfsbase" || umount \
"${PREFIX}/squashfsbase") || createIsoLogger --message \
"Unable to umount squashfs" --tag "umount"
(! mountpoint --quiet "${TMPFS}" || umount "${TMPFS}") || createIsoLogger \
--message "Unable to umount tmpfs" --tag "umount"
rm --recursive --force "${PREFIX:?}/squashfsbase"
rm --recursive --force "${TMPFS:?}"
# Umount if it is mounted
(! mountpoint --quiet "${PREFIX}/isobase" || umount "${PREFIX}/isobase") || \
......
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
......@@ -44,10 +44,6 @@ 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 \
--target-release ${REPO} install le-live-all || createIsoLogger --message \
\"Unable to install le-live-all\" --script \"$(basename "${BASH_SOURCE[0]}")\" \
--line \"${LINENO}\" --tag \"apt-get\""
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 \
......
......@@ -32,6 +32,7 @@ CHROOTDIR="$6"
# SOURCESLIST="$9"
# REPO="${10}"
# KEYURL="${11}"
CACHEDIR="${12}"
PREFIX="${PWD}"
......@@ -44,7 +45,7 @@ initrd_path="$(find "${CHROOTDIR}/boot/" -maxdepth 1 -regextype egrep -name \
NEWMD5="$(md5sum "${initrd_path}")"
echo "${NEWMD5}" > "${TMP}/MD5SUMS"
PREVIOUS="$(find "${TMP}/cache" -mindepth 1 -maxdepth 1 -type d | sort \
PREVIOUS="$(find "${CACHEDIR}" -mindepth 1 -maxdepth 1 -type d | sort \
--numeric | tail --lines=1)"
if [ -f "${PREVIOUS}/MD5SUMS" ]; then
......
......@@ -21,7 +21,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
# PROFILE="$1"
PROFILE="$1"
NAME="$2"
WEBSITE="$3"
# TMPFS="$4"
......@@ -50,7 +50,7 @@ cp /usr/lib/syslinux/modules/bios/ldlinux.c32 "${TMP}/image/isolinux/" || \
createIsoLogger --message "Unable to copy ldlinux.c32 to image" --tag "cp"
cp "${PREFIX}"/src/isolinux/* "${TMP}/image/isolinux/" || createIsoLogger \
--message "Unable to copy isolinux files to image" --tag "cp"
cp "${PREFIX}/src/preseed/preseed.cfg" "${TMP}/image/preseed/" || \
cp "${PREFIX}/src/${PROFILE}/preseed.cfg" "${TMP}/image/preseed/" || \
createIsoLogger --message "Unable to copy preseed to image" --tag "cp"
cp "${PREFIX}/src/keyboard" "${CHROOTDIR}/etc/default/" || createIsoLogger \
--message "Unable to copy default keyboard layout" --type warning --tag "cp"
......@@ -62,6 +62,8 @@ fi
echo "${size}" > "${TMP}/image/casper/filesystem.size"
cp "${PREFIX}/src/README.diskdefines" "${TMP}/image/" || createIsoLogger \
--message "Unable to copy README.diskdefines to image" --tag "cp"
sed --in-place "s/##DISKNAME##/${NAME}/" "${TMP}/image/README.diskdefines" || \
createIsoLogger --message "Unable to set up DISKNAME on README.diskdefines"
pushd "${TMP}/image/" || createIsoLogger --message \
"Unable to change directory" --tag "pushd"
ln --symbolic --force --no-dereference . ubuntu || createIsoLogger --message \
......
......@@ -44,11 +44,10 @@ createIsoLogger --message "Unable to copy default sources.list" --type warning \
if [ ! -d "${CHROOTDIR}/etc/apt/sources.list.d" ]; then
mkdir "${CHROOTDIR}/etc/apt/sources.list.d"
fi
cp "${SOURCESLIST}/${PROFILE}"/*.list "${CHROOTDIR}/etc/apt/sources.list.d/" \
cp "${SOURCESLIST}/${PROFILE}.list" "${CHROOTDIR}/etc/apt/sources.list.d/" \
|| createIsoLogger --message "Unable to copy custom sources.list"
# I'm afraid this '*.list' will destroy 3rd party's sources lists
sed --in-place "s/##CODENAME##/${REPO}/g" \
"${CHROOTDIR}/etc/apt/sources.list.d"/*.list
"${CHROOTDIR}/etc/apt/sources.list.d/${PROFILE}.list"
addToChrootFile "${CHROOTDIR}" "(wget -O- \"${KEYURL}\" | apt-key add -) || \
createIsoLogger --message \"Unable to add a key to custom repository\" \
--script \"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \
......
../../scripts-available/install-dependencies.sh
\ No newline at end of file
../../scripts-available/update-sourceslist.sh
\ No newline at end of file
../../scripts-available/remove.sh
\ No newline at end of file
../../scripts-available/install.sh
\ No newline at end of file
../../scripts-available/setup.sh
\ No newline at end of file
../../scripts-available/create-local-repository.sh
\ No newline at end of file
../../scripts-available/pre-manifest.sh
\ No newline at end of file
../../scripts-available/manifest.sh
\ No newline at end of file
../../scripts-available/make-initrd.sh
\ No newline at end of file
../../scripts-available/compress.sh
\ No newline at end of file
../../scripts-available/install-dependencies.sh
\ No newline at end of file
../../scripts-available/update-sourceslist.sh
\ No newline at end of file
../../scripts-available/remove.sh
\ No newline at end of file
../../scripts-available/install.sh
\ No newline at end of file
../../scripts-available/setup.sh
\ No newline at end of file
../../scripts-available/create-local-repository.sh
\ No newline at end of file
../../scripts-available/pre-manifest.sh
\ No newline at end of file
../../scripts-available/manifest.sh
\ No newline at end of file
../../scripts-available/make-initrd.sh
\ No newline at end of file
../../scripts-available/compress.sh
\ No newline at end of file
../../../scripts-available/install-dependencies.sh
\ No newline at end of file
../../../scripts-available/update-sourceslist.sh
\ No newline at end of file
../../../scripts-available/remove.sh
\ No newline at end of file
../../../scripts-available/install.sh
\ No newline at end of file
../../../scripts-available/setup.sh
\ No newline at end of file
../../../scripts-available/create-local-repository.sh
\ No newline at end of file
../../../scripts-available/pre-manifest.sh
\ No newline at end of file
../../../scripts-available/manifest.sh
\ No newline at end of file
../../../scripts-available/make-initrd.sh
\ No newline at end of file
../../../scripts-available/compress.sh
\ No newline at end of file
deb http://repo.c3sl.ufpr.br/lc2/ ##CODENAME## main
deb-src http://repo.c3sl.ufpr.br/lc2/ ##CODENAME## main
#define DISKNAME Linux-Educacional 6.0
#define DISKNAME ##DISKNAME##
#define TYPE binary
#define TYPEbinary 1
#define ARCH amd64
......
ubiquity ubiquity/use_nonfree boolean true
d-i apt-setup/backports boolean false
ubiquity ubiquity/success_command \
string in-target apt-get update --yes; \
if [ ! -f "/target/cdrom/.disk/info" ]; then \
if ! mount --bind /cdrom /target/cdrom; then \
echo "Failed binding /cdrom in /target/cdrom!" 1>&2; \
fi; \
if [ ! -f "/target/media/cdrom" ]; then \
cd "/target/media"; \
ln --symbolic "/cdrom"; \
cd -; \
fi; \
fi; \
in-target apt-cdrom add --fast --no-mount </dev/null; \
in-target apt-get install --yes lc-conf; \
if grep -qi "Server" "/etc/default/version"; then \
in-target apt-get install --yes lc-server-all; \
else; \
in-target apt-get install --yes lc-client-all; \
fi; \
umount "/target/cdrom"; \
unlink "/target/media/cdrom"; \
sed -i "/^deb cdrom:/s/^/#/" /target/etc/apt/sources.list; \
sed -i 's/enabled=.*/enabled=0/' /target/etc/default/apport; \
in-target apt-get autoremove --yes; \
in-target apt-get clean
......@@ -15,7 +15,7 @@ ubiquity ubiquity/success_command \
in-target apt-cdrom add --fast --no-mount </dev/null; \
in-target apt-get install --yes le-conf; \
if grep -qi "multiseat" "/etc/default/multiseat"; then \
in-target apt-get install --yes le-multiterminal; \
in-target apt-get install --yes le-multiterminal; \
fi; \
umount "/target/cdrom"; \
unlink "/target/media/cdrom"; \
......
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