Commit bab8cba8 authored by Thiago H. S. Picharski's avatar Thiago H. S. Picharski

Merge remote branch 'le-gera-iso/master'

Signed-off-by: 's avatarThiago H. S. Picharski <thsp08@c3sl.ufpr.br>
parents 37e983bf 93c00c93
C3SL - Centro de Computacao Cientifica e Software Livre
Adriano da Luz
Aryane Ast dos Santos
Bruno Cesar Ribas
Carlos Carvalho
Cleide Luzia Bonfim Possamai
Danilo Kiyoshi Simizu Yorinori
Diego Giovane Pasqualin
Eduardo Todt
Erik Alexandre Pucci
Felipe Cys Laskoski
Guilherme Zasyeki Machado
Josiney de Souza
Juliana Bueno
Klismann Smoger Mottin
Laura Sanchez Garcia
Luis Carlos Erpen de Bona
Marcela Saragioto
Marcos Castilho
Pedro Eugenio Rocha
Renan Franca De Miranda
Ricardo Tavares De Oliveira
Rubens Massayuki Suguimoto
Thiago Henrique Dos Santos Picharski
Tiago Rodrigo Kepe
Victor Tarabola Cortiano
Vinicius Kwiecien Ruoso
This diff is collapsed.
# ===Install prerequisites===
# apt-get install squashfs-tools genisoimage dpkg-dev uck
#
# ===Create ISO===
# sudo ./create-iso.sh -all iso/kubuntu-10.04.1-desktop-i386.iso
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-gera-iso
#
# le-gera-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 2
# 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.
# This script is included in others scripts to use common functions
PREFIX="$(dirname "$(readlink -f $0)")"
checkStatus()
{
if [ -n "$(grep "$DEVICE" /etc/mtab)" ]; then
echo "Error: /dev/$DEVICE is mounted according with mtab"
return 1
fi
return 0
}
checkUser()
{
if ! [ -w /dev/$DEVICE ]; then
echo "Error: Please, execute this script as root!"
return 1
fi
return 0
}
loadConf()
{
if [ $# -gt 1 -a -f "$1" ]; then
conf=$(readlink -f $1)
elif [ -f "$PREFIX/"*.conf ]; then
conf="$PREFIX/"*.conf
else
echo "Error: Config file not found."
exit 1
fi
#read config file and declares only valid vars.
while read var; do
egrep -qi "^[a-z_]+=" <<< "$var" && eval "export $var"
done < $conf
return 0
}
removeMountList()
{
grep -v "$1" $MOUNTLIST > $MOUNTLIST.tmp
mv -f $MOUNTLIST.tmp $MOUNTLIST
}
checkMountedFS()
{
touch $MOUNTLIST
for file in $(sort -r $MOUNTLIST); do
if ! ( umount -l $file && removeMountList $file ); then
echo "Error: While umounting $file"
return 1
fi
done
return 0
}
TMP="$PREFIX/tmp"
DISTROBASE=kubuntu
RC=""
DISTRO=Linux_Educacional_4.0
SCRIPTSDIR="$PREFIX/scripts"
INSTLIST="$PREFIX/pckg-list/install.list"
RMLIST="$PREFIX/pckg-list/remove.list"
CDDIR="$TMP/extract-cd"
CHROOTDIR="$TMP/live-image"
MOUNTLIST="$TMP/mountlist"
SQUASHIMAGE="$PREFIX/squashfs-root"
DISTROISO="$PREFIX/iso/$DISTRO-desktop-i386.iso"
TEMPLATES="$PREFIX/templates"
LEHOST="le.c3sl.ufpr.br"
LEMIRROR="le-stable"
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-gera-iso
#
# le-gera-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 2
# 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.
#------------------------------------------------------------------------------
editDistro()
{
echo "Editing $DISTROBASE ..."
initFiles
# Edits live image
for file in $(ls $SCRIPTSDIR); do
if [ -x "$SCRIPTSDIR/$file" ]; then
if ! "$SCRIPTSDIR/$file"; then
echo "Error: While running the $SCRIPTSDIR/$file"
return 1
fi
fi
done
return 0
}
regenerateManifest()
{
echo "Regenerating manifest list ..."
chmod +w $CDDIR/casper/filesystem.manifest
chroot $CHROOTDIR dpkg-query -W --showformat='${Package} ${Version}\n' > \
$CDDIR/casper/filesystem.manifest
cp $CDDIR/casper/filesystem.manifest \
$CDDIR/casper/filesystem.manifest-desktop
for package in $(cat $INSTLIST | cut -d '=' -f1 | grep -v "^#"); do
sed -i "/$package/d" $CDDIR/casper/filesystem.manifest-desktop
done
for package in $(cat $INSTLIST-desktop | cut -d '=' -f1 | grep -v "^#"); do
( printf "$package "; chroot $CHROOTDIR apt-cache showpkg $package |
grep "^[0-9]" | tail -n1 | cut -d ' ' -f1 ) >> \
$CDDIR/casper/filesystem.manifest-desktop
done
return 0
}
compressFS()
{
echo "Compressing squash image ..."
if [ -n "$(cat $MOUNTLIST)" ]; then
echo "Error to umount $(cat $MOUNTLIST | tr '\n' ' ')"
return 1
fi
rm -f $CDDIR/casper/filesystem.squashfs
mksquashfs $CHROOTDIR $CDDIR/casper/filesystem.squashfs
return 0
}
extractISO()
{
echo "Extracting $1 ..."
initFiles
mount -o loop $1 $TMP/$DISTROBASE && echo "$TMP/$DISTROBASE" >> $MOUNTLIST
rsync --exclude=/casper/filesystem.squashfs -a $TMP/$DISTROBASE/ $CDDIR\
|| return 1
unsquashfs $TMP/$DISTROBASE/casper/filesystem.squashfs || return 1
mv -f $SQUASHIMAGE $CHROOTDIR || return 1
umount $TMP/$DISTROBASE && removeMountList $TMP/$DISTROBASE
return 0
}
createISO()
{
echo "Generating live ISO ..."
# Edits DEFINE
sed -i 's@Kubuntu 10.04.1 LTS "Lucid Lynx"@Linux Educacional 4.0@g' \
$CDDIR/README.diskdefines
# Calculates MD5
cd $CDDIR/
rm -f md5sum.txt
find -type f -print0 | xargs -0 md5sum |
egrep -v 'isolinux/boot.cat|md5sum.txt' | tee md5sum.txt
# Generates ISO file
mkisofs -D -r -V "$DISTRO" -cache-inodes -J -l -b \
isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size \
4 -boot-info-table -o $DISTROISO $CDDIR
}
initFiles()
{
mkdir -p $TMP || return 1
mkdir -p $TMP/$DISTROBASE $CDDIR || return 1
touch $MOUNTLIST || return 1
}
replaceIso()
{
if [ -e $CDDIR ]; then
echo -n "Want to replace the current image? [y/N]"
read ack
if [ "$ack" == "y" ]; then
$0 -clean || exit 6
else
echo "Extraction canceled!"
return 1
fi
fi
return 0
}
#------------------------------------------------------------------------------
# Sets configuration variables
. "$(dirname "$(readlink -f $0)")/common.sh"
loadConf "$PREFIX/create-iso.conf"
#------------------------------------------------------------------------------
# Check ambient integrity
checkUser || exit 1
checkMountedFS || exit 7
#------------------------------------------------------------------------------
# Init routines
case "$1" in
-iso)
#if ! regenerateManifest; then
# echo "Error to regenarate manifest file"
# exit 3
#fi
if ! compressFS; then
echo "Error to create squash image"
exit 4
fi
if ! createISO; then
echo "Error to create ISO image"
exit 5
fi
;;
-clean)
echo "Cleaning temporary directory ..."
rm -rf $TMP/* $CHROOTDIR $CDDIR $SQUASHIMAGE || exit 6
;;
-all)
replaceIso || exit 6
if ! extractISO $2; then
echo "Error to extract $2"
exit 1
fi
if ! editDistro; then
echo "Error to edit Squash image"
exit 2
fi
if ! regenerateManifest; then
echo "Error to regenarate manifest file"
exit 3
fi
if ! compressFS; then
echo "Error to create squash image"
exit 4
fi
if ! createISO; then
echo "Error to create ISO image"
exit 5
fi
;;
*)
echo "Use: $0 OPTION [SRC_IMAGE]"
echo " OPTION:"
echo " -clean Cleaning temporary files and old iso"
echo " -iso Using existing temporary files generates a new LE iso"
echo " -all Extract SRC_IMAGE and it edits to generate a new LE iso"
;;
esac
exit 0
vlc-nox=1.0.6-1ubuntu1.4userful
vlc=1.0.6-1ubuntu1.4userful
le-all
le-users
le-edubar
le-edubar-fixed-position
le-proinfodata-installer
le-multiterminal-installer
ubiquity-slideshow-le
ubiquity-desktop-icon
ubiquity-frontend-kde-le
ubiquity-le
casper
mec-dp-machado.de.assis
mec-dp-musica.erudita.brasileira
mec-vol2-dvd2-saltoparaofuturo34
vlc-nox=1.0.6-1ubuntu1.4userful
vlc=1.0.6-1ubuntu1.4userful
le-all
le-users
le-edubar
le-edubar-fixed-position
le-proinfodata-installer
le-multiterminal-installer
mec-dp-machado.de.assis
mec-dp-musica.erudita.brasileira
mec-vol2-dvd2-saltoparaofuturo34
akregator
apt-transport-https
apturl-common
apturl-kde
avahi-utils
bcmwl-modaliases
bogofilter
bogofilter-bdb
bogofilter-common
brltty
byobu
dnsmasq-base
dragonplayer
exiv2
fancontrol
fglrx-modaliases
freespacenotifier
geoip-database
gnupg-curl
hunspell-en-us
icoutils
im-switch
installation-report
intel-gpu-tools
irqbalance
kaddressbook
kcalc
kcm-touchpad
kdegraphics-strigi-plugins
kdepim-groupware
kdepim-kresources
kdepim-strigi-plugins
kdepim-wizards
kerneloops-daemon
kmail
kmousetool
knotes
konqueror-plugin-searchbar
kontact
kopete
kopete-message-indicator
korganizer
kpackagekit
kppp
krdc
krfb
krosspython
ktimetracker
ktorrent
ktorrent-data
kubuntu-debug-installer
kubuntu-notification-helper
kvkbd
kwalletmanager
libbrlapi0.5
libcap-ng0
libclass-accessor-perl
libdjvulibre-text
libdjvulibre21
libepub0
libgadu3
libindicate-qt0
libindicate4
libio-string-perl
libjs-jquery
libkdepim4
libkleo4
libkopete4
libkpgp4
libksieve4
liblockfile1
libmailtools-perl
libmeanwhile1
libmimelib4
libmsn0.3
libotr2
libpackagekit-glib2-12
libpackagekit-qt-12
libparse-debianchangelog-perl
libqca2-plugin-ossl
libsub-name-perl
libtimedate-perl
libvncserver0
libxml-sax-expat-perl
libzip1
lm-sensors
lockfile-progs
modemmanager
mtools
network-manager-kde
okular-extra-backends
openoffice.org-style-oxygen
oxygen-icon-theme-complete
packagekit
packagekit-backend-apt
plasma-widget-message-indicator
plymouth-label
plymouth-theme-kubuntu-logo
plymouth-theme-ubuntu-text
plymouth-x11
pm-utils-powersave-policy
printer-applet
psfontmgr
python-newt
python-packagekit
quassel
quassel-data
rdesktop
sane-utils
syslinux
tcl8.4
telnet
tk8.4
ttf-kacst-one
ttf-khmeros-core
ttf-punjabi-fonts
ttf-takao-pgothic
ttf-unfonts-core
ttf-wqy-microhei
usb-creator-common
usb-creator-kde
virtuoso-nepomuk
xfonts-mathml
indi
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-gera-iso
#
# le-gera-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 2
# 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.
#------------------------------------------------------------------------------
. $(dirname "$(readlink -f $0)")/common-functions.sh
checkUser || exit 1
checkMountedFS || exit 2
loadConf $PREFIX/create-iso.conf
initChroot
# Configures ubuntu repositories
#cp -f /etc/apt/sources.list /etc/apt/sources.list.BKP
sed -i 's/# deb/deb/g' $CHROOTDIR/etc/apt/sources.list
# C3SL repositories
sed -i 's@//security.ubuntu.com@//ubuntu.c3sl.ufpr.br@g' \
$CHROOTDIR/etc/apt/sources.list
sed -i 's@//archive.ubuntu.com@//ubuntu.c3sl.ufpr.br@g' \
$CHROOTDIR/etc/apt/sources.list
# Configures LE repositories
rm -f /etc/apt/sources.list.d/le-repos.list
echo "deb http://$LEHOST educ main" \
>> $CHROOTDIR/etc/apt/sources.list.d/le-repos.list
echo "deb http://$LEHOST $LEMIRROR main" \
>> $CHROOTDIR/etc/apt/sources.list.d/le-repos.list
echo "deb http://archive.canonical.com/ lucid partner" \
>> $CHROOTDIR/etc/apt/sources.list.d/java-repos.list
chroot "$CHROOTDIR" wget http://windu.c3sl.ufpr.br/le/public.key -O /dev/stdout \
> $TMP/windu.key
chroot "$CHROOTDIR" apt-key add - < $TMP/windu.key
# Changes distro
chroot $CHROOTDIR apt-get -y --force-yes update
closeChroot
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-gera-iso
#
# le-gera-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 2
# 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.
#------------------------------------------------------------------------------
. $(dirname "$(readlink -f $0)")/common-functions.sh
checkUser || exit 1
checkMountedFS || exit 2
loadConf $PREFIX/create-iso.conf
initChroot
# Changes distro
chroot "$CHROOTDIR" \
apt-get -y --force-yes purge $(cat $PREFIX/pckg-list/remove.list | grep -v "^#")
chroot "$CHROOTDIR" apt-get -y --force-yes autoremove
closeChroot
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-gera-iso
#
# le-gera-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 2
# 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.
#------------------------------------------------------------------------------
. $(dirname "$(readlink -f $0)")/common-functions.sh
checkUser || exit 1
checkMountedFS || exit 2
loadConf $PREFIX/create-iso.conf
initChroot
# Changes distro
chroot $CHROOTDIR \
apt-get -y --force-yes install --purge $(cat $PREFIX/pckg-list/install.list | grep -v "^#")
closeChroot
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-gera-iso
#
# le-gera-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 2
# 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.
#------------------------------------------------------------------------------
. $(dirname "$(readlink -f $0)")/common-functions.sh
checkUser || exit 1
checkMountedFS || exit 2
loadConf $PREFIX/create-iso.conf
initChroot
# Changes distro
chroot "$CHROOTDIR" /usr/local/sbin/le-autoupgrade
closeChroot
exit 0
#!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-gera-iso
#
# le-gera-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 2
# 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.
#------------------------------------------------------------------------------
. $(dirname "$(readlink -f $0)")/common-functions.sh
checkUser || exit 1
checkMountedFS || exit 2
loadConf $PREFIX/create-iso.conf
DISTRONAME="Linux Educacional"
DISTRORELEASE="4.0"
# Sets distro default config
cp -af $TEMPLATES/default/* $CHROOTDIR/etc/default
# Update casper config
cp -f $TEMPLATES/casper/* \
$CHROOTDIR/usr/share/initramfs-tools/scripts/casper-bottom/
# Configures live user@host
sed -i 's@[Uu]buntu@professor@g' $CHROOTDIR/etc/casper.conf
sed -i 's@HOST="professor"@HOST="le"@g' $CHROOTDIR/etc/casper.conf
# Sets isolinux colors
BGCOLOR="469C3D"
sed -i "s@$(grep "screen-colour" $CDDIR/isolinux/gfxboot.cfg \
| cut -d '=' -f2)@0x$BGCOLOR@g" $CDDIR/isolinux/gfxboot.cfg
sed -i "s@$(grep