Skip to content
Snippets Groups Projects
Commit bab8cba8 authored by Thiago H. S. Picharski's avatar Thiago H. S. Picharski
Browse files

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

parents 37e983bf 93c00c93
No related branches found
No related tags found
No related merge requests found
Showing
with 1656 additions and 0 deletions
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 "color sel" $CDDIR/isolinux/stdmenu.cfg \
| awk '{print $6}')@#${BGCOLOR}FF@g" $CDDIR/isolinux/stdmenu.cfg
# Update isolinux splash
rm -f $CDDIR/isolinux/splash.*
cp -af $TEMPLATES/isolinux/* $CDDIR/isolinux/
# Sets distro name
DISTRONAME="LE"
DISTRORELEASE="4.0"
echo "$DISTRONAME $DISTRORELEASE "Lucid Lynx" - Release i386 (20100816.2)" \
> $CDDIR/.disk/info
echo "http://www.c3sl.ufpr.br/le/" > $CDDIR/.disk/release_notes_url
cat <<EOF >>$CHROOTDIR/etc/sudoers
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
EOF
# configures kdm
cp -af $TEMPLATES/kdm/* $CHROOTDIR/etc/kde4/kdm/
# removes Kubuntu Autorun
rm -rf $CDDIR/wubi.exe $CDDIR/autorun.inf
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
# Update initrd splash
mkdir -p $TMP/initrd
cd $TMP/initrd || return 1
unlzma -c -S .lz $CDDIR/casper/initrd.lz | cpio -id
cp -rf $CHROOTDIR/lib/plymouth/themes/le ./lib/plymouth/themes/
cp -f $TEMPLATES/plymouth/default.plymouth ./lib/plymouth/themes/
sed -i 's@[Uu]buntu@professor@g' ./etc/casper.conf
sed -i 's@HOST="professor"@HOST="le"@g' ./etc/casper.conf
cp -f $TEMPLATES/casper/* ./scripts/casper-bottom/
find ./ | cpio --quiet --dereference -o -H newc | lzma -7 \
> $CDDIR/casper/initrd.lz
cd $PREFIX
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.
#------------------------------------------------------------------------------
. ./common.sh
PREFIX="$(dirname $PREFIX)"
export HOME=/root
export LC_ALL=C
initChroot()
{
cp /etc/resolv.conf $CHROOTDIR/etc/
cp /etc/hosts $CHROOTDIR/etc/
mount --bind /dev $CHROOTDIR/dev && echo "$CHROOTDIR/dev" >> $MOUNTLIST
mount --bind /proc $CHROOTDIR/proc && echo "$CHROOTDIR/proc" >> $MOUNTLIST
mount --bind /sys $CHROOTDIR/sys && echo "$CHROOTDIR/sys" >> $MOUNTLIST
mount --bind /dev/pts $CHROOTDIR/dev/pts && echo "$CHROOTDIR/dev/pts" \
>> $MOUNTLIST
chroot "$CHROOTDIR" dbus-uuidgen > "$CHROOTDIR/var/lib/dbus/machine-id"
#chroot "$CHROOTDIR" ln -s /bin/true /sbin/initctl
}
closeChroot()
{
chroot "$CHROOTDIR" aptitude clean
rm -rf $CHROOTDIR/root/.bash_history $CHROOTDIR/var/lib/dbus/machine-id
rm -rf $CHROOTDIR/tmp/*
chroot "$CHROOTDIR" dpkg-divert --rename --remove /sbin/initctl
umount -l $CHROOTDIR/dev/pts && removeMountList $CHROOTDIR/dev/pts
umount -l $CHROOTDIR/sys && removeMountList $CHROOTDIR/sys
umount -l $CHROOTDIR/proc && removeMountList $CHROOTDIR/proc
umount -l $CHROOTDIR/dev && removeMountList $CHROOTDIR/dev
rm -f $CHROOTDIR/etc/resolv.conf $CHROOTDIR/etc/hosts
}
#!/bin/sh
PREREQ=""
DESCRIPTION="Adding live session user..."
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
. /scripts/casper-functions
load_confmodule
log_begin_msg "$DESCRIPTION"
# U6aMy0wojraho is just a blank password
db_set passwd/root-password-crypted '*'
#db_set passwd/user-password-crypted U6aMy0wojraho
#db_set passwd/user-fullname "$USERFULLNAME"
#db_set passwd/username "$USERNAME"
#db_set passwd/user-uid 998
#chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null
# Clear out debconf database again to avoid confusing ubiquity later.
db_set passwd/root-password-crypted
db_set passwd/user-password-crypted
db_set passwd/user-fullname
db_set passwd/username
db_set passwd/user-uid
if [ -f /root/etc/sudoers ]; then
if grep -q '^%admin' /root/etc/sudoers; then
sed -i -e '/^%admin/s/(ALL) ALL$/(ALL) NOPASSWD: ALL/' /root/etc/sudoers
else
echo '%admin ALL=(ALL) NOPASSWD: ALL' >> /root/etc/sudoers
fi
fi
# XXX - awful hack to stop xscreensaver locking the screen (#7150)
echo 'RUNNING_UNDER_GDM="yes"' >> /root/etc/environment
LTS="$(cut -d' ' -f3 /root/cdrom/.disk/info 2>/dev/null)" || LTS=
RELEASE="$(cut -d' ' -f1-2 /root/cdrom/.disk/info 2>/dev/null)" || RELEASE=
if [ "$LTS" = "LTS" ] && [ -n "$RELEASE" ]; then
RELEASE="$RELEASE LTS"
fi
for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde4/ubiquity-kdeui.desktop; do
if [ -f "/root/$file" ]; then
sed -i "s/RELEASE/$RELEASE/" "/root$file"
chroot /root install -d -o $USERNAME -g $USERNAME /home/$USERNAME/Desktop
chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
break
fi
done
if [ -L /root/home/$USERNAME/Examples ]; then
chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/
fi
if [ -f /root/home/$USERNAME/examples.desktop ]; then
chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
mv /root/home/$USERNAME/examples.desktop /root/home/$USERNAME/Desktop/
fi
#Kubuntu
if [ -f "/root/usr/bin/plasma" ]; then
if [ -f "/root/usr/share/kde4/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop" ]; then
chroot /root install -d -o $USERNAME -g $USERNAME /home/$USERNAME/Desktop
chroot /root install -D -o $USERNAME -g $USERNAME /usr/share/kde4/apps/khelpcenter/plugins/kubuntu/about-kubuntu.desktop /home/$USERNAME/Desktop/about-kubuntu.desktop
fi
fi
#Ubuntu MID wants to be installed with --automatic
if [ -f "/root/usr/share/ubuntu-mid-default-settings/mid-gui-start" ]; then
if [ -f "/root/usr/share/applications/ubiquity-gtkui.desktop" ]; then
sed -i 's/--desktop/--automatic --desktop/' "/root/usr/share/applications/ubiquity-gtkui.desktop"
fi
fi
#Ubuntu MID uses kourou, and the ubiquity icon should be easy to find
if [ -f "/root/usr/lib/hildon-desktop/kourou.py" ]; then
if [ -f "/root/etc/xdg/menus/home.menu" ]; then
sed -i '/<\/Include>/i\ <Filename>ubiquity-gtkui.desktop</Filename>' "/root/etc/xdg/menus/home.menu"
fi
fi
log_end_msg
# A configuration file for setupcon
# Change to "yes" and setupcon will explain what is being doing
VERBOSE_OUTPUT=no
# Setup these consoles. Most people do not need to change this.
ACTIVE_CONSOLES="/dev/tty[1-6]"
# Put here your encoding. Valid charmaps are: UTF-8 ARMSCII-8 CP1251
# CP1255 CP1256 GEORGIAN-ACADEMY GEORGIAN-PS IBM1133 ISIRI-3342
# ISO-8859-1 ISO-8859-2 ISO-8859-3 ISO-8859-4 ISO-8859-5 ISO-8859-6
# ISO-8859-7 ISO-8859-8 ISO-8859-9 ISO-8859-10 ISO-8859-11 ISO-8859-13
# ISO-8859-14 ISO-8859-15 ISO-8859-16 KOI8-R KOI8-U TIS-620 VISCII
CHARMAP="UTF-8"
# The codeset determines which symbols are supported by the font.
# Valid codesets are: Arabic Armenian CyrAsia CyrKoi CyrSlav Ethiopian
# Georgian Greek Hebrew Lao Lat15 Lat2 Lat38 Lat7 Thai Uni1 Uni2 Uni3
# Vietnamese. Read README.fonts for explanation.
CODESET="Uni1"
# Valid font faces are: VGA (sizes 8, 14 and 16), Terminus (sizes
# 12x6, 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBold (sizes
# 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBoldVGA (sizes 14
# and 16), Fixed (sizes 13, 14, 15, 16 and 18), Goha (sizes 12, 14 and
# 16), GohaClassic (sizes 12, 14 and 16).
FONTFACE="VGA"
FONTSIZE="16"
# You can also directly specify nonstandard font and ACM to load.
# Use space as separator if you want to load more than one font.
# FONT='lat9w-08.psf.gz /usr/local/share/brailefonts/brl-08.psf'
# ACM=/usr/local/share/consoletrans/my_special_encoding.acm
# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.
XKBMODEL="abnt2"
XKBLAYOUT="br"
XKBVARIANT=""
XKBOPTIONS="grp:alts_toggle"
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment