Commit 941e564b authored by Diego Pasqualin's avatar Diego Pasqualin

Merge branch 'le-gera-iso'

parents dfa5d5bb dbfa469a
......@@ -54,13 +54,38 @@ loadConf()
echo "Error: Config file for $2 not found."
exit 1
fi
host=true
mirror=true
if [ ! -z "$LEHOST" ];
then
host="false"
fi
if [ ! -z "$LEMIRROR" ];
then
mirror="false"
fi
#read config file and declares only valid vars.
BASENAME=`basename $(echo "$2")`
while read var; do
egrep -qi "^[a-z_]+=" <<< "$var" &&
eval "export $(echo $var | sed -e "s@DISTNAME@$2@g" -e "s/BASENAME/$BASENAME/g")"
if egrep -qi "^[a-z_]+=" <<< "$var";
then
varname="$(echo $var | cut -d"=" -f 1)"
if [ "$varname" != "LEHOST" ] && [ "$varname" != "LEMIRROR" ];
then
eval "export $(echo $var | sed -e "s@DISTNAME@$2@g" -e "s/BASENAME/$BASENAME/g")"
elif [ "$varname" == "LEHOST" ];
then
$host && eval "export $(echo $var)"
elif [ "$varname" == "LEMIRROR" ];
then
$mirror && eval "export $(echo $var)"
fi
fi
done < "$conf"
return 0
}
......
......@@ -20,9 +20,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#------------------------------------------------------------------------------
export DEBIAN_FRONTEND=noninteractive
editDistro()
{
log "Editing $DISTROBASE ..."
......@@ -52,12 +53,13 @@ regenerateManifest()
#cp $CDDIR/casper/filesystem.manifest \
# $CDDIR/casper/filesystem.manifest-desktop
cat "$INSTLIST"-remove >> "$CDDIR"/casper/filesystem.manifest-remove
for package in $(cat "$CDDIR"/casper/filesystem.manifest-remove | cut -d '=' -f1 | grep -v "^#"); do
if ! grep -q "^$package " "$CDDIR"/casper/filesystem.manifest; then
sed -i "/$package/d" "$CDDIR"/casper/filesystem.manifest-remove
fi
done
#for package in $(cat "$CDDIR"/casper/filesystem.manifest-remove | cut -d '=' -f1 | grep -v "^#"); do
# if ! grep -q "^$package " "$CDDIR"/casper/filesystem.manifest; then
# sed -i "/$package/d" "$CDDIR"/casper/filesystem.manifest-remove
# fi
#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 ) >> \
......@@ -171,6 +173,10 @@ clean=false
all=false
dist=false
edit=false
host=false
mirror=false
nextHost=false
nextMirror=false
for opc in $*; do
case "$opc" in
......@@ -195,7 +201,17 @@ for opc in $*; do
bash
exit 0
;;
--host)
host=true
nextHost=true
;;
--mirror)
mirror=true
nextMirror=true
;;
*)
$nextHost && export LEHOST="$opc" && nextHost=false
$nextMirror && export LEMIRROR="$opc" && nextMirror=false
$nextDist && distName="$opc" && nextDist=false
$nextAll && baseIso="$opc" && nextAll=false
esac
......
......@@ -65,14 +65,14 @@ cp "$TEMPLATES"/.pam_environment "$CHROOTDIR"/etc/skel
# 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
"minicom/client")
sed -i 's@[Uu]buntu@monitor@g' "$CHROOTDIR"/etc/casper.conf
sed -i 's@HOST="monitor"@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
"minicom/server")
sed -i 's@[Uu]buntu@monitor@g' "$CHROOTDIR"/etc/casper.conf
sed -i 's@HOST="monitor"@HOST="le5-servidor-telecentro"@g' $CHROOTDIR/etc/casper.conf
touch "$CHROOTDIR"/.im_a_live
;;
*)
......@@ -81,10 +81,10 @@ case "$1" in
;;
esac
echo "export \"FLAVOUR=le5\"" >> $CHROOTDIR/etc/casper.conf
echo "export \"FLAVOUR=le5\"" >> "$CHROOTDIR"/etc/casper.conf
cp -f "$TEMPLATES"/casper/10adduser-$(dirname $1) \
"$CHROOTDIR"/usr/share/initramfs-tools/scripts/casper-bottom/25adduser
#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
......
......@@ -51,13 +51,13 @@ unlzma -c -S .lz $CDDIR/casper/initrd.lz | cpio -id
# 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/client")
sed -i 's@[Uu]buntu@monitor@g' ./etc/casper.conf
sed -i 's@HOST="monitor"@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
"minicom/server")
sed -i 's@[Uu]buntu@monitor@g' ./etc/casper.conf
sed -i 's@HOST="monitor"@HOST="le5-servidor-telecentro"@g' ./etc/casper.conf
;;
*)
sed -i 's@[Uu]buntu@le5-live@g' ./etc/casper.conf
......@@ -66,7 +66,7 @@ esac
echo "export \"FLAVOUR=le5\"" >> ./etc/casper.conf
cp -f $TEMPLATES/casper/10adduser-$(dirname $1) ./scripts/casper-bottom/25adduser
cp -f $TEMPLATES/casper/10adduser ./scripts/casper-bottom/25adduser
# Regenarete initrd image
find ./ | cpio --quiet --dereference -o -H newc | lzma -7 \
......
escola/
\ No newline at end of file
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"
debconf_backup () {
local question backup
for question; do
backup="$question-casper-backup"
db_register debian-installer/dummy "$backup"
db_get "$question"
db_set "$backup" "$RET"
db_fget "$question" seen
db_fset "$backup" seen "$RET"
done
}
debconf_restore () {
local question backup
for question; do
backup="$question-casper-backup"
db_get "$backup"
db_set "$question" "$RET"
db_fget "$backup" seen
db_fset "$question" seen "$RET"
db_unregister "$backup"
done
}
debconf_backup \
passwd/root-password-crypted \
passwd/root-password passwd/root-password-again \
passwd/user-password-crypted \
passwd/user-password passwd/user-password-again \
passwd/user-fullname passwd/username passwd/user-uid
# 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.
debconf_restore \
passwd/root-password-crypted \
passwd/root-password passwd/root-password-again \
passwd/user-password-crypted \
passwd/user-password passwd/user-password-again \
passwd/user-fullname passwd/username passwd/user-uid
if [ -f /root/etc/sudoers ]; then
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
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"
}
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"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
. /scripts/casper-functions
load_confmodule
log_begin_msg "$DESCRIPTION"
debconf_backup () {
local question backup
for question; do
backup="$question-casper-backup"
db_register debian-installer/dummy "$backup"
db_get "$question"
db_set "$backup" "$RET"
db_fget "$question" seen
db_fset "$backup" seen "$RET"
done
}
debconf_restore () {
local question backup
for question; do
backup="$question-casper-backup"
db_get "$backup"
db_set "$question" "$RET"
db_fget "$backup" seen
db_fset "$question" seen "$RET"
db_unregister "$backup"
done
}
debconf_backup \
passwd/root-password-crypted \
passwd/root-password passwd/root-password-again \
passwd/user-password-crypted \
passwd/user-password passwd/user-password-again \
passwd/user-fullname passwd/username passwd/user-uid
# 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.
debconf_restore \
passwd/root-password-crypted \
passwd/root-password passwd/root-password-again \
passwd/user-password-crypted \
passwd/user-password passwd/user-password-again \
passwd/user-fullname passwd/username passwd/user-uid
if [ -f /root/etc/sudoers ]; then
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
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=