Commit c734039f authored by Lucas Manika Koeb's avatar Lucas Manika Koeb

le-gera-iso: Add minicom server and client configs and scripts

Signed-off-by: default avatarLucas Manika Koeb <lmk08@c3sl.ufpr.br>
parent aa845557
TMP="/dev/shm/tmp/tmp-DISTNAME"
LOGDIR="$PREFIX/log/DISTNAME"
LOGINFO="true"
DISTROBASE=ubuntu-12.04
RC="alpha1"
DISTRO=Linux_Educacional_5
SCRIPTSDIR="$PREFIX/enabled-scripts/DISTNAME"
INSTLIST="$PREFIX/pckg-list/DISTNAME/install.list"
RMLIST="$PREFIX/pckg-list/DISTNAME/remove.list"
CDDIR="$TMP/extract-cd"
CHROOTDIR="$TMP/live-image"
MOUNTLIST="$TMP/mountlist"
SQUASHIMAGE="$PREFIX/squashfs-root"
DISTROISO="$PREFIX/iso/DISTNAME/$DISTRO-BASENAME-i386"
TEMPLATES="$PREFIX/templates/DISTNAME"
LEHOST="windu.c3sl.ufpr.br/mc"
LEMIRROR="mc-testing"
DEBIAN_FRONTEND="noninteractive"
\ No newline at end of file
TMP="/dev/shm/tmp/tmp-DISTNAME"
LOGDIR="$PREFIX/log/DISTNAME"
LOGINFO="true"
DISTROBASE=ubuntu-12.04
RC="alpha1"
DISTRO=Linux_Educacional_5
SCRIPTSDIR="$PREFIX/enabled-scripts/DISTNAME"
INSTLIST="$PREFIX/pckg-list/DISTNAME/install.list"
RMLIST="$PREFIX/pckg-list/DISTNAME/remove.list"
CDDIR="$TMP/extract-cd"
CHROOTDIR="$TMP/live-image"
MOUNTLIST="$TMP/mountlist"
SQUASHIMAGE="$PREFIX/squashfs-root"
DISTROISO="$PREFIX/iso/DISTNAME/$DISTRO-BASENAME-i386"
TEMPLATES="$PREFIX/templates/DISTNAME"
LEHOST="windu.c3sl.ufpr.br/mc"
LEMIRROR="mc-testing"
DEBIAN_FRONTEND="noninteractive"
\ No newline at end of file
../../../scripts/00-update
\ No newline at end of file
../../../scripts/10-remove
\ No newline at end of file
../../../scripts/20-install
\ No newline at end of file
../../../scripts/40-configure_minicom
\ No newline at end of file
../../../scripts/60-update-initrd_minicom
\ No newline at end of file
../../../scripts/00-update
\ No newline at end of file
../../../scripts/10-remove
\ No newline at end of file
../../../scripts/20-install
\ No newline at end of file
../../../scripts/40-configure_minicom
\ No newline at end of file
../../../scripts/60-update-initrd_minicom
\ No newline at end of file
../../../scripts/common-functions.sh
\ No newline at end of file
le-desktop
le-plymouth-theme
ubiquity-frontend-gtk-le
ubiquity-le
ubiquity-slideshow-le
casper
minicom-client-all
aptitude
network-manager
network-manager-gnome
casper
ubiquity-le
ubiquity-frontend-gtk-le
ubiquity-slideshow-le
unity
unity-2d
unity-2d-panel
unity-2d-spread
unity-2d-shell
plymouth-theme-ubuntu-logo
plymouth-theme-ubuntu-text
apport
empathy
thunderbird
ubuntuone-client
ubuntuone-client-gnome
ubuntuone-control-panel
ubuntuone-couch
ubuntuone-installer
deja-dup
update-notifier
update-manager
software-center
openjdk-6-jre
openjdk-6-jre-headless
icedtea-6-jre-cacao
icedtea-6-jre-jamvm
glib-networking
le-minicom-server-desktop
le-plymouth-theme
ubiquity-frontend-gtk-le
ubiquity-le
ubiquity-slideshow-le
casper
minicom-server-all
aptitude
casper
ubiquity-le
ubiquity-frontend-gtk-le
ubiquity-slideshow-le
network-manager
unity
unity-2d
unity-2d-panel
unity-2d-spread
unity-2d-shell
plymouth-theme-ubuntu-logo
plymouth-theme-ubuntu-text
apport
empathy
thunderbird
ubuntuone-client
ubuntuone-client-gnome
ubuntuone-control-panel
ubuntuone-couch
ubuntuone-installer
deja-dup
update-notifier
update-manager
software-center
openjdk-6-jre
openjdk-6-jre-headless
icedtea-6-jre-cacao
icedtea-6-jre-jamvm
glib-networking
#!/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-base
#
# le-base 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.
#------------------------------------------------------------------------------
DIR=$(readlink -f "$0")
. "`dirname "$(echo "$DIR")"`/common-functions.sh"
checkUser || exit 1
checkMountedFS || exit 2
loadConf "$PREFIX/conf/$1/create-iso.conf" $1
# Set the default session
sed -i 's@user-session=ubuntu@user-session=gnome@g' \
"$CHROOTDIR"/etc/lightdm/lightdm.conf
sed -i 's@Exec=gnome-session --session=ubuntu@Exec=gnome-session --session=gnome@g' "$CHROOTDIR"/usr/share/xsessions/gnome.desktop
sed -i 's@Exec=gnome-session --session=ubuntu@Exec=gnome-session --session=gnome@g' "$CHROOTDIR"/usr/share/xsessions/gnome-shell.desktop
# Set the release info
echo "Linux Educacional 5.0 \"$1\" - Release i386 ($(date +\"%Y-%m-%d\"))" > "$CDDIR/.disk/info"
# Remove useless sessions from xsessions
if [ -f "$CHROOTDIR"/usr/share/xsessions/ubuntu.desktop ];
then
rm "$CHROOTDIR"/usr/share/xsessions/ubuntu.desktop
fi
if [ -f "$CHROOTDIR"/usr/share/xsessions/ubuntu-2d.desktop ];
then
rm "$CHROOTDIR"/usr/share/xsessions/ubuntu-2d.desktop
fi
# Change isolinux default language
#echo "pt_BR" > $CDDIR/isolinux/lang
rm -rf "$CDDIR"/isolinux
cp -a "$TEMPLATES"/isolinux "$CDDIR"/
# Set the default language
cp "$TEMPLATES"/.pam_environment "$CHROOTDIR"/etc/skel
# Change the live user name
#sed -i 's@USERNAME=\"ubuntu\"@USERNAME=\"le5\"@g' $CHROOTDIR/etc/casper.conf
#sed -i 's@USERFULLNAME=\"Live session user\"@USERFULLNAME=\"Linux Educacional 5\"@g' $CHROOTDIR/etc/casper.conf
# sed -i 's@HOST="professor"@HOST="le5"@g' $CHROOTDIR/etc/casper.conf
# Configures live user@host
case "$1" in
minicom)
sed -i 's@[Uu]buntu@mc@g' "$CHROOTDIR"/etc/casper.conf
sed -i 's@HOST="mc"@HOST="le5-telecentro"@g' "$CHROOTDIR"/etc/casper.conf
touch "$CHROOTDIR"/.im_a_live
;;
minicom_server)
sed -i 's@[Uu]buntu@mc@g' "$CHROOTDIR"/etc/casper.conf
sed -i 's@HOST="mc"@HOST="le5-servidor-telecentro"@g' $CHROOTDIR/etc/casper.conf
touch "$CHROOTDIR"/.im_a_live
;;
*)
sed -i 's@[Uu]buntu@le5-live@g' $CHROOTDIR/etc/casper.conf
rm -Rf $CHROOTDIR/etc/skel/*
;;
esac
echo "export \"FLAVOUR=le5\"" >> $CHROOTDIR/etc/casper.conf
cp -f "$TEMPLATES"/casper/10adduser-$(dirname $1) \
"$CHROOTDIR"/usr/share/initramfs-tools/scripts/casper-bottom/25adduser
# Sets deb-conf install command
sed -i 's@Ubuntu@LE@g' "$CDDIR"/preseed/ubuntu.seed
sed -i 's@ubuntu@le@g' "$CDDIR"/preseed/ubuntu.seed
# configures the DVD repository
for package in $(cat "$TEMPLATES"/le-packages/packgs_list); do
if [ "${package:0:3}" = "lib" ]; then
packageDir="pool/main/${package:0:4}/$package"
elif [ "${package:0:5}" = "linux" ]; then
packageDir="pool/main/${package:0:1}/${package:0:5}"
else
packageDir="pool/main/${package:0:1}/$package"
fi
packageList="$(rgrep "^Package: $package *$" "$CHROOTDIR/var/lib/apt/lists/" | grep "binary-i386" | head -n1 | cut -d ':' -f1)"
mirror="$(basename "$(echo "$packageList" | cut -d '_' -f1)")/$(
echo "$packageList" | cut -d '_' -f2)"
linkDir="$(grep -A21 "^Package: $package *$" "$packageList" | grep "^Filename:.*$package.*" | cut -d ' ' -f2)"
echo "mirror = $mirror"
echo "linkDir = $linkDir"
debFile="$(basename "$linkDir")"
mkdir -p "$CDDIR/$packageDir"
wget http://$mirror/$linkDir -O "$CDDIR/$packageDir/$debFile"
done
cd "$CDDIR"
for repository in main restricted; do
dpkg-scanpackages "pool/$repository" \
> "$CDDIR/dists/precise/$repository/binary-i386/Packages"
gzip -c "$CDDIR/dists/precise/$repository/binary-i386/Packages" \
> "$CDDIR/dists/precise/$repository/binary-i386/Packages.gz"
# rm -f "$CDDIR/dists/precise/$repository/binary-i386/Packages"
done
act="$(pwd)"
cd "$CDDIR"/dists/precise
cat << EOF > ./Release
Origin: Linux Educacional
Label: Linux Ecucacional
Suite: precise
Version: 5.0
Codename: precise
EOF
echo "Date: $(date -u +\"%a, %d %h %y %X UTC\")" >> ./Release
cat << EOF >> ./Release
Architectures: i386
Components: main restricted
Description: Linux Educacional 5.0
EOF
for alg in MD5Sum SHA1 SHA256; do
echo "$alg:"
for dir in "main/binary-i386" "restricted/binary-i386"; do
for file in $(ls ./$dir); do
case $alg in
MD5Sum)
result="$(md5sum $dir/$file)"
echo " $(echo $result | cut -d' ' -f1) $(ls -l $dir/$file |
cut -d ' ' -f5) $(echo $result | cut -d' ' -f2)"
;;
SHA1)
result="$(sha1sum $dir/$file)"
echo " $(echo $result | cut -d' ' -f1) $(ls -l $dir/$file |
cut -d ' ' -f5) $(echo $result | cut -d' ' -f2)"
;;
SHA256)
result="$(sha256sum $dir/$file)"
echo " $(echo $result | cut -d' ' -f1) $(ls -l $dir/$file |
cut -d ' ' -f5) $(echo $result | cut -d' ' -f2)"
esac
done
done
done >> ./Release
rm -f Release.gpg
gpg -bao ./Release.gpg ./Release
cp -a "$TEMPLATES/le-packages/public.key" "$CHROOTDIR/root/"
chroot "$CHROOTDIR" apt-key add /root/public.key
rm -f "$CHROOTDIR/root/public.key"
cd "$act"
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-base
#
# le-base 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.
#------------------------------------------------------------------------------
DIR=$(readlink -f "$0")
. "`dirname "$(echo "$DIR")"`/common-functions.sh"
checkUser || exit 1
checkMountedFS || exit 2
loadConf "$PREFIX/conf/$1/create-iso.conf" $1
# Extract initrd image
mkdir -p "$TMP"/initrd
cd "$TMP"/initrd || return 1
mkinitramfs -o /boot/initrd$(uname -r).img $(uname -r)
INITRD="$(ls $CHROOTDIR/boot/initrd* | sort | tail -n1)"
if file $INITRD | grep -q "gzip"; then
gunzip -c $INITRD | cpio -id
else
unlzma -c -S .lz $INITRD | cpio -id
fi
unlzma -c -S .lz $CDDIR/casper/initrd.lz | cpio -id
# Change the live user name
#sed -i 's@USERNAME=\"ubuntu\"@USERNAME=\"le5\"@g' $CHROOTDIR/etc/casper.conf
#sed -i 's@USERFULLNAME=\"Live session user\"@USERFULLNAME=\"Linux Educacional 5\"@g' $CHROOTDIR/etc/casper.conf
# Update initrd casper
case "$1" in
minicom)
sed -i 's@[Uu]buntu@mc@g' ./etc/casper.conf
sed -i 's@HOST="mc"@HOST="le5-telecentro"@g' ./etc/casper.conf
;;
minicom_server)
sed -i 's@[Uu]buntu@mc@g' ./etc/casper.conf
sed -i 's@HOST="mc"@HOST="le5-servidor-telecentro"@g' ./etc/casper.conf
;;
*)
sed -i 's@[Uu]buntu@le5-live@g' ./etc/casper.conf
;;
esac
echo "export \"FLAVOUR=le5\"" >> ./etc/casper.conf
cp -f $TEMPLATES/casper/10adduser-$(dirname $1) ./scripts/casper-bottom/25adduser
# Regenarete initrd image
find ./ | cpio --quiet --dereference -o -H newc | lzma -7 \
> $CDDIR/casper/initrd.lz
cp -af $(sed 's/initrd.img/vmlinuz/g' <<< $INITRD) \
$CDDIR/casper/vmlinuz
cd $PREFIX
exit 0
LANGUAGE=pt_BR
LANG=pt_BR.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_MONETARY=pt_BR.UTF-8
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
Package: *
Pin: origin "windu.c3sl.ufpr.br"
Pin-Priority: 1100
#!/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
#!/bin/sh
PREREQ=""
DESCRIPTION="Adding live session user..."
prereqs()
{
echo "$PREREQ"
}