Commit f3e72237 authored by Daniel Bissani Furlin's avatar Daniel Bissani Furlin

overlay version

Signed-off-by: Daniel Bissani Furlin's avatarDaniel Bissani Furlin <dbf15@inf.ufpr.br>
parent d654ab6d

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

chroot
chroot-beta*
image
*.swp
iso/**/*.iso
israel-version
initrd*
iso/*
Essa é a versão modular do script de geração de isos do le6.
Este script gera uma iso de acordo com os scripts habilitados na pasta ´scripts-enabled´
para cada distribuição, este modelo está configurado para funcionar com a distrubuição
le6/testing, para criar uma nova distribuição basta criar uma pasta com o nome da nova
distribuição nos diretórios, pkg-list, que contém as listas de pacotes que devem ser
instalados e removidos, em scripts-enabled, e linkar os scripts que devem ser executados
para a geração da iso. iso, onde será criada a imagem. log, onde será criado o arquivo
de log, e em conf, e nessa pasta criar um arquivo de configuração para a geração da iso.
Esta versão não mantem o diretório base "limpo", ou seja, a cada execução as modificações
para a geração da iso se mantém.
File added
#!/bin/bash
cleanTmpFiles()
{
cleanTmpFiles() {
rm -rf ${TMP}
closeChroot
}
emergency_shell()
{
emergency_shell() {
cleanTmpFiles
echo "FATAL ERROR!"
exit 1
}
log()
{
log() {
local _TYPE=$1
local _TXT=$(echo $@ | cut -d' ' -f2-)
local _FILE=${PREFIX}/log/${DIST}/${_TYPE}-create-iso.log
......@@ -30,14 +27,12 @@ log()
fi
}
removeMountList()
{
removeMountList() {
grep -v "$1" ${MOUNTLIST} > ${MOUNTLIST}.tmp
mv -f ${MOUNTLIST}.tmp ${MOUNTLIST}
}
initChroot()
{
initChroot() {
local _DIST=$1
mkdir -p ${CHROOTDIR}/var/log/create-iso/
......@@ -54,10 +49,10 @@ initChroot()
>> ${MOUNTLIST}
mount --bind ${PREFIX}/log/${_DIST}/ ${CHROOTDIR}/var/log/create-iso/ && \
echo "${CHROOTDIR}/var/log/create-iso/" >> ${MOUNTLIST} || \
log ERROR "Failed to mount log dir."
log ERROR "Failed to mount log dir."
mount --bind /proc ${CHROOTDIR}/proc && echo "${CHROOTDIR}/proc" >> ${MOUNTLIST}
chroot ${CHROOTDIR} dbus-uuidgen > ${CHROOTDIR}/var/lib/dbus/machine-id
# chroot ${CHROOTDIR} dbus-uuidgen > ${CHROOTDIR}/var/lib/dbus/machine-id
# Prevent services from being started in the chrooted environment
rm -rf ${CHROOTDIR}/fakebin
......@@ -71,8 +66,7 @@ initChroot()
chroot ${CHROOTDIR} ln -s /bin/true /fakebin/start-stop-daemon
}
closeChroot()
{
closeChroot() {
chroot ${CHROOTDIR} apt-get clean
rm -rf ${CHROOTDIR}/fakebin
......@@ -99,16 +93,15 @@ closeChroot()
rm -rf ${CHROOTDIR}/var/log/create-iso/
}
addToChrootFile()
{
addToChrootFile() {
local _FILE=$1
local _CMD=$2
echo "$_CMD \\ || /bin/bash" add no arquivo
echo "$_CMD \\" >> "$_FILE"
echo '|| /bin/bash' >> "$_FILE"
}
execChroot()
{
execChroot() {
_FILE=$1
_DIR=$2
chmod +x $_FILE
......
TMP=/dev/shm/${_DIST}/
ISOLINUX=${PREFIX}/src/isolinux/
DISTRO=Linux_Educacional_6
CHROOTDIR=${PREFIX}/chroot/
SHORTNAME=le6
CHROOTDIR=/dev/shm/create-iso/
SCRIPTSDIR=${PREFIX}/scripts-enabled/${_DIST}/
DPLIST=${PREFIX}/pkg-list/${_DIST}/dependencies.list
RMDSKT=${PREFIX}/pkg-list/${_DIST}/remove-desktop.list
RMLIST=${PREFIX}/pkg-list/${_DIST}/remove.list
INSTLIST=${PREFIX}/pkg-list/${_DIST}/install.list
CHROOTFILE=${TMP}/todo.sh
MOUNTLIST=${TMP}/mountlist
SOURCESLISTDEFAULT=${PREFIX}/sources-list/${_DIST}/default.list
OURSOURCESLIST=${PREFIX}/sources-list/${_DIST}/${SHORTNAME}.list
work_dir='/var/le6-beta-work'
#!/bin/bash
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
File deleted
#! /bin/sh
set -e
PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Only do this once.
if [ -z "$DEBCONF_REDIR" ]; then
exec <&4
export DEBIAN_HAS_FRONTEND=1
export DEBCONF_REDIR=1
fi
root="$1"
. "$root/usr/share/debconf/confmodule"
question="$2"
value="$3"
seen="$4"
[ "$seen" ] || seen=true
if ! db_set "$question" "$value"; then
db_register debian-installer/dummy "$question"
db_set "$question" "$value"
fi
db_fset "$question" seen "$seen"
exit 0
#! /bin/sh
set -e
export PATH=/usr/bin:/usr/sbin:/sbin:/bin
frontend=noninteractive
findcommandinroot() {
ROOT="$1/"
shift
while [ "$#" -ge 1 ]; do
P="$PATH"
while [ "$P" ]; do
D=${P%%:*}
P=${P#*:}
if [ "$D" = "$P" ]; then
P=
fi
if [ -z "$D" ]; then
D=.
fi
if [ -x "$ROOT$D/$1" ]; then
echo "$D/$1"
return 0
fi
done
shift
done
return 1
}
runcommandinroot() {
C=$(findcommandinroot "$1" "$2")
ROOT="$1"
shift
shift
[ -n "$C" ] && chroot "$ROOT" "$C" "$@"
}
root="$1"
package="$2"
version=$(runcommandinroot "$root" dpkg-query -W --showformat='${Version}' "$package" 2>/dev/null) || version=""
if [ -z "$version" ]; then
echo >&2 "$0: package '$package' is not installed"
exit 0
fi
unset DEBIAN_HAS_FRONTEND
unset DEBIAN_FRONTEND
unset DEBCONF_REDIR
runcommandinroot "$root" dpkg-reconfigure -fnoninteractive --no-reload "$package"
exit 0
#!/bin/sh
# Cloned-and-hacked from preseed/debconf-set-selections for casper.
set -e
OLDIFS="$IFS"
CR=$(echo -en "\r")
NL="
"
. /scripts/casper-functions
load_confmodule
# Returns the first field in the current line
first_field() {
echo "$line" | grep -q "[[:space:]]" || return 1
echo "$line" | sed -r 's/^([^[:space:]]*).*/\1/'
}
# Returns any fields after the first field in the current line
rest_line() {
if echo "$line" | grep -q "[[:space:]]"; then
echo "$line" | sed 's/^[^[:space:]]*[[:space:]]*//'