Skip to content
Snippets Groups Projects
Commit 352a06f7 authored by Lucas Manika Koeb's avatar Lucas Manika Koeb
Browse files

Change the le4 scripts to support spaces on folder names

parent b2200b87
No related branches found
No related tags found
No related merge requests found
...@@ -32,34 +32,34 @@ initChroot ...@@ -32,34 +32,34 @@ initChroot
# Configures ubuntu repositories # Configures ubuntu repositories
#cp -f /etc/apt/sources.list /etc/apt/sources.list.BKP #cp -f /etc/apt/sources.list /etc/apt/sources.list.BKP
sed -i 's/# deb/deb/g' $CHROOTDIR/etc/apt/sources.list sed -i 's/# deb/deb/g' "$CHROOTDIR/etc/apt/sources.list"
# C3SL repositories # C3SL repositories
#sed -i 's@//security@//br.archive@g' /etc/apt/sources.list #sed -i 's@//security@//br.archive@g' /etc/apt/sources.list
#sed -i 's@//archive@//br.archive@g' /etc/apt/sources.list #sed -i 's@//archive@//br.archive@g' /etc/apt/sources.list
#sed -i 's@//security.ubuntu.com@//ubuntu-archive.locaweb.com.br@g' \ #sed -i 's@//security.ubuntu.com@//ubuntu-archive.locaweb.com.br@g' \
sed -i 's@//security.ubuntu.com@//ubuntu.c3sl.ufpr.br@g' \ sed -i 's@//security.ubuntu.com@//ubuntu.c3sl.ufpr.br@g' \
$CHROOTDIR/etc/apt/sources.list "$CHROOTDIR/etc/apt/sources.list"
#sed -i 's@//archive.ubuntu.com@//ubuntu-archive.locaweb.com.br@g' \ #sed -i 's@//archive.ubuntu.com@//ubuntu-archive.locaweb.com.br@g' \
sed -i 's@//archive.ubuntu.com@//ubuntu.c3sl.ufpr.br@g' \ sed -i 's@//archive.ubuntu.com@//ubuntu.c3sl.ufpr.br@g' \
$CHROOTDIR/etc/apt/sources.list "$CHROOTDIR/etc/apt/sources.list"
#grep "^deb" /etc/apt/sources.list.BKP >> /etc/apt/sources.list #grep "^deb" /etc/apt/sources.list.BKP >> /etc/apt/sources.list
# Configures LE repositories # Configures LE repositories
rm -f $CHROOTDIR/etc/apt/sources.list.d/le-repos.list rm -f "$CHROOTDIR/etc/apt/sources.list.d/le-repos.list"
rm -f $CHROOTDIR/etc/apt/sources.list.d/java-repos.list rm -f "$CHROOTDIR/etc/apt/sources.list.d/java-repos.list"
echo "deb http://$LEHOST educ main" \ echo "deb http://$LEHOST educ main" \
>> $CHROOTDIR/etc/apt/sources.list.d/le-repos.list >> "$CHROOTDIR/etc/apt/sources.list.d/le-repos.list"
echo "deb http://$LEHOST $LEMIRROR main" \ echo "deb http://$LEHOST $LEMIRROR main" \
>> $CHROOTDIR/etc/apt/sources.list.d/le-repos.list >> "$CHROOTDIR/etc/apt/sources.list.d/le-repos.list"
echo "deb http://archive.canonical.com/ lucid partner" \ echo "deb http://archive.canonical.com/ lucid partner" \
>> $CHROOTDIR/etc/apt/sources.list.d/java-repos.list >> "$CHROOTDIR/etc/apt/sources.list.d/java-repos.list"
chroot "$CHROOTDIR" wget http://windu.c3sl.ufpr.br/le/public.key -O /dev/stdout \ chroot "$CHROOTDIR" wget http://windu.c3sl.ufpr.br/le/public.key -O /dev/stdout \
> $TMP/windu.key > "$TMP/windu.key"
chroot "$CHROOTDIR" apt-key add - < $TMP/windu.key chroot "$CHROOTDIR" apt-key add - < "$TMP/windu.key"
# Changes distro # Changes distro
chroot $CHROOTDIR apt-get -y --force-yes update chroot "$CHROOTDIR" apt-get -y --force-yes update
closeChroot closeChroot
......
...@@ -32,7 +32,7 @@ initChroot ...@@ -32,7 +32,7 @@ initChroot
# Changes distro # Changes distro
chroot "$CHROOTDIR" \ chroot "$CHROOTDIR" \
apt-get -y --force-yes purge $(cat $RMLIST | grep -v "^#") apt-get -y --force-yes purge $(cat "$RMLIST" | grep -v "^#")
chroot "$CHROOTDIR" apt-get -y --force-yes autoremove chroot "$CHROOTDIR" apt-get -y --force-yes autoremove
closeChroot closeChroot
......
...@@ -30,14 +30,14 @@ checkMountedFS || exit 2 ...@@ -30,14 +30,14 @@ checkMountedFS || exit 2
loadConf "$PREFIX/conf/$1/create-iso.conf" $1 loadConf "$PREFIX/conf/$1/create-iso.conf" $1
initChroot initChroot
chroot $CHROOTDIR \ chroot "$CHROOTDIR" \
apt-get -y --force-yes install --purge $(cat $INSTLIST | grep -v "^#") apt-get -y --force-yes install --purge $(cat "$INSTLIST" | grep -v "^#")
# Changes distro # Changes distro
if [ "$1" == "multiterminal" ]; then if [ "$1" == "multiterminal" ]; then
cp -af $TEMPLATES/le-installer/le-multiterminal-installer_1.0.8_i386.deb \ cp -af "$TEMPLATES"/le-installer/le-multiterminal-installer_1.0.8_i386.deb \
$CHROOTDIR/tmp/ "$CHROOTDIR"/tmp/
chroot $CHROOTDIR dpkg -i /tmp/le-multiterminal-installer_1.0.8_i386.deb chroot "$CHROOTDIR" dpkg -i /tmp/le-multiterminal-installer_1.0.8_i386.deb
fi fi
closeChroot closeChroot
......
]#!/bin/bash #!/bin/bash
# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre # Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR # Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
......
...@@ -40,44 +40,44 @@ DISTRORELEASE="4.0" ...@@ -40,44 +40,44 @@ DISTRORELEASE="4.0"
# $CHROOTDIR/usr/share/applications/kde4/ubiquity-kdeui.desktop # $CHROOTDIR/usr/share/applications/kde4/ubiquity-kdeui.desktop
# Sets distro default config # Sets distro default config
cp -af $TEMPLATES/default/* $CHROOTDIR/etc/default cp -af "$TEMPLATES"/default/* "$CHROOTDIR"/etc/default
# Update casper config # Update casper config
cp -f $TEMPLATES/casper/10adduser-$1 \ cp -f "$TEMPLATES"/casper/10adduser-$1 \
$CHROOTDIR/usr/share/initramfs-tools/scripts/casper-bottom/10adduser "$CHROOTDIR"/usr/share/initramfs-tools/scripts/casper-bottom/10adduser
cp -f $TEMPLATES/casper/casper $CHROOTDIR/etc/init.d/ cp -f "$TEMPLATES"/casper/casper "$CHROOTDIR"/etc/init.d/
# Configures live user@host # Configures live user@host
if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then
sed -i 's@[Uu]buntu@professor@g' $CHROOTDIR/etc/casper.conf sed -i 's@[Uu]buntu@professor@g' "$CHROOTDIR"/etc/casper.conf
sed -i 's@HOST="professor"@HOST="le"@g' $CHROOTDIR/etc/casper.conf sed -i 's@HOST="professor"@HOST="le"@g' "$CHROOTDIR"/etc/casper.conf
else else
sed -i 's@[Uu]buntu@le-live@g' $CHROOTDIR/etc/casper.conf sed -i 's@[Uu]buntu@le-live@g' "$CHROOTDIR"/etc/casper.conf
rm -Rf $CHROOTDIR/etc/skel/* rm -Rf "$CHROOTDIR"/etc/skel/*
fi fi
# Sets isolinux colors # Sets isolinux colors
BGCOLOR="469C3D" BGCOLOR="469C3D"
sed -i "s@$(grep "screen-colour" $CDDIR/isolinux/gfxboot.cfg \ sed -i "s@$(grep "screen-colour" $CDDIR/isolinux/gfxboot.cfg \
| cut -d '=' -f2)@0x$BGCOLOR@g" $CDDIR/isolinux/gfxboot.cfg | cut -d '=' -f2)@0x$BGCOLOR@g" "$CDDIR"/isolinux/gfxboot.cfg
sed -i "s@$(grep "color sel" $CDDIR/isolinux/stdmenu.cfg \ sed -i "s@$(grep "color sel" $CDDIR/isolinux/stdmenu.cfg \
| awk '{print $6}')@#${BGCOLOR}FF@g" $CDDIR/isolinux/stdmenu.cfg | awk '{print $6}')@#${BGCOLOR}FF@g" "$CDDIR"/isolinux/stdmenu.cfg
# Update isolinux splash # Update isolinux splash
rm -f $CDDIR/isolinux/splash.* rm -f "$CDDIR"/isolinux/splash.*
if [ "$1" == "light" ]; then if [ "$1" == "light" ]; then
echo "ISOLINUX LIGHT" echo "ISOLINUX LIGHT"
cp -af $TEMPLATES/isolinux_light/* $CDDIR/isolinux/ cp -af "$TEMPLATES"/isolinux_light/* "$CDDIR"/isolinux/
else else
echo "ISOLINUX NORMAL" echo "ISOLINUX NORMAL"
cp -af $TEMPLATES/isolinux/* $CDDIR/isolinux/ cp -af "$TEMPLATES"/isolinux/* "$CDDIR"/isolinux/
fi fi
# Sets distro name # Sets distro name
DISTRONAME="LE" DISTRONAME="LE"
DISTRORELEASE="4.0" DISTRORELEASE="4.0"
echo "$DISTRONAME $DISTRORELEASE "Lucid Lynx" - Release i386 (20100816.2)" \ echo "$DISTRONAME $DISTRORELEASE "Lucid Lynx" - Release i386 (20100816.2)" \
> $CDDIR/.disk/info > "$CDDIR"/.disk/info
echo "http://www.c3sl.ufpr.br/le/" > $CDDIR/.disk/release_notes_url echo "http://www.c3sl.ufpr.br/le/" > "$CDDIR"/.disk/release_notes_url
#[ "$1" != "home" ] && cp -af $TEMPLATES/le-installer/le-proinfodata-installer $CHROOTDIR/etc/init.d/ #[ "$1" != "home" ] && cp -af $TEMPLATES/le-installer/le-proinfodata-installer $CHROOTDIR/etc/init.d/
#[ "$1" == "multiterminal" ] && cp -af $TEMPLATES/le-installer/le-multiterminal-installer $CHROOTDIR/etc/init.d/ #[ "$1" == "multiterminal" ] && cp -af $TEMPLATES/le-installer/le-multiterminal-installer $CHROOTDIR/etc/init.d/
...@@ -85,7 +85,7 @@ echo "http://www.c3sl.ufpr.br/le/" > $CDDIR/.disk/release_notes_url ...@@ -85,7 +85,7 @@ echo "http://www.c3sl.ufpr.br/le/" > $CDDIR/.disk/release_notes_url
if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then
chpasswd <<< "root:qwe123" chpasswd <<< "root:qwe123"
cat <<EOF >>$CHROOTDIR/etc/sudoers cat <<EOF >>"$CHROOTDIR"/etc/sudoers
# Members of the admin group may gain root privileges # Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL %admin ALL=(ALL) ALL
...@@ -93,7 +93,7 @@ EOF ...@@ -93,7 +93,7 @@ EOF
fi fi
# configures DVD repository # configures DVD repository
for package in $(cat $TEMPLATES/le-packages/packgs_list); do for package in $(cat "$TEMPLATES"/le-packages/packgs_list); do
if [ "${package:0:3}" = "lib" ]; then if [ "${package:0:3}" = "lib" ]; then
packageDir="pool/main/${package:0:4}/$package" packageDir="pool/main/${package:0:4}/$package"
elif [ "${package:0:5}" = "linux" ]; then elif [ "${package:0:5}" = "linux" ]; then
...@@ -117,18 +117,18 @@ rm -f "$CDDIR/dists/lucid/main/binary-i386/Packages" ...@@ -117,18 +117,18 @@ rm -f "$CDDIR/dists/lucid/main/binary-i386/Packages"
#cp -af $CHROOTDIR/boot/$(ls $CHROOTDIR/boot/ | grep "vmlinuz" | sort | tail -n1) $CDDIR/casper/vmlinuz #cp -af $CHROOTDIR/boot/$(ls $CHROOTDIR/boot/ | grep "vmlinuz" | sort | tail -n1) $CDDIR/casper/vmlinuz
# configures kdm # configures kdm
cp -f $TEMPLATES/kdm/* $CHROOTDIR/etc/kde4/kdm/ cp -f "$TEMPLATES"/kdm/* "$CHROOTDIR"/etc/kde4/kdm/
# removes Kubuntu Autorun # removes Kubuntu Autorun
rm -rf $CDDIR/wubi.exe $CDDIR/autorun.inf rm -rf "$CDDIR"/wubi.exe "$CDDIR"/autorun.inf
# run the script to download and install libdvdcss2 # run the script to download and install libdvdcss2
$CHROOTDIR/usr/share/doc/libdvdread4/install-css.sh "$CHROOTDIR"/usr/share/doc/libdvdread4/install-css.sh
# Turn off acpi for light version # Turn off acpi for light version
if [ "$1" != "light" ]; then if [ "$1" != "light" ]; then
echo "ACPI OFF" echo "ACPI OFF"
cp -f $TEMPLATES/grub $CHROOTDIR/etc/default/ cp -f "$TEMPLATES"/grub "$CHROOTDIR"/etc/default/
fi fi
echo "------------" echo "------------"
......
...@@ -53,8 +53,8 @@ else ...@@ -53,8 +53,8 @@ else
awk '{print $2}' | egrep '2.6.[0-9]{2}-[0-9]+-generic$' | sort | tail -n1) awk '{print $2}' | egrep '2.6.[0-9]{2}-[0-9]+-generic$' | sort | tail -n1)
fi fi
NEWHEADER=$(sed 's/image/headers/g' <<< $NEWKERNEL) NEWHEADER=$(sed 's/image/headers/g' <<< "$NEWKERNEL")
chroot "$CHROOTDIR" apt-get -y --force-yes install $NEWKERNEL $NEWHEADER chroot "$CHROOTDIR" apt-get -y --force-yes install "$NEWKERNEL" "$NEWHEADER"
if (( $(chroot "$CHROOTDIR" dpkg -l linux-image* | grep -v linux-image-generic \ if (( $(chroot "$CHROOTDIR" dpkg -l linux-image* | grep -v linux-image-generic \
| grep '^ii' | wc -l) > 1 )); then | grep '^ii' | wc -l) > 1 )); then
......
...@@ -30,20 +30,20 @@ checkMountedFS || exit 2 ...@@ -30,20 +30,20 @@ checkMountedFS || exit 2
loadConf "$PREFIX/conf/$1/create-iso.conf" $1 loadConf "$PREFIX/conf/$1/create-iso.conf" $1
# Extract initrd image # Extract initrd image
mkdir -p $TMP/initrd mkdir -p "$TMP"/initrd
cd $TMP/initrd || return 1 cd "$TMP"/initrd || return 1
INITRD="$(ls $CHROOTDIR/boot/initrd* | sort | tail -n1)" INITRD="$(ls $CHROOTDIR/boot/initrd* | sort | tail -n1)"
if file $INITRD | grep -q "gzip"; then if file "$INITRD" | grep -q "gzip"; then
gunzip -c $INITRD | cpio -id gunzip -c "$INITRD" | cpio -id
else else
unlzma -c -S .lz $INITRD | cpio -id unlzma -c -S .lz "$INITRD" | cpio -id
fi fi
# unlzma -c -S .lz $CDDIR/casper/initrd.lz | cpio -id # unlzma -c -S .lz $CDDIR/casper/initrd.lz | cpio -id
# Update initrd boot splash # Update initrd boot splash
cp -af $CHROOTDIR/lib/plymouth/themes/le ./lib/plymouth/themes/ cp -af "$CHROOTDIR"/lib/plymouth/themes/le ./lib/plymouth/themes/
cp -af $TEMPLATES/plymouth/default.plymouth ./lib/plymouth/themes/ cp -af "$TEMPLATES"/plymouth/default.plymouth ./lib/plymouth/themes/
# Update initrd casper # Update initrd casper
if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then
...@@ -52,15 +52,15 @@ if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then ...@@ -52,15 +52,15 @@ if [ "$1" != "home" ] && [ "$1" != "desktop" ]; then
else else
sed -i 's@[Uu]buntu@le-live@g' ./etc/casper.conf sed -i 's@[Uu]buntu@le-live@g' ./etc/casper.conf
fi fi
cp -f $TEMPLATES/casper/10adduser-$1 ./scripts/casper-bottom/10adduser cp -f "$TEMPLATES"/casper/10adduser-$1 ./scripts/casper-bottom/10adduser
# Regenarete initrd image # Regenarete initrd image
find ./ | cpio --quiet --dereference -o -H newc | lzma -7 \ find ./ | cpio --quiet --dereference -o -H newc | lzma -7 \
> $CDDIR/casper/initrd.lz > "$CDDIR"/casper/initrd.lz
cp -af $(sed 's/initrd.img/vmlinuz/g' <<< $INITRD) \ cp -af $(sed 's/initrd.img/vmlinuz/g' <<< $INITRD) \
$CDDIR/casper/vmlinuz "$CDDIR"/casper/vmlinuz
cd $PREFIX cd "$PREFIX"
exit 0 exit 0
...@@ -30,14 +30,14 @@ export LC_ALL=C ...@@ -30,14 +30,14 @@ export LC_ALL=C
initChroot() initChroot()
{ {
cp /etc/resolv.conf $CHROOTDIR/etc/ cp /etc/resolv.conf "$CHROOTDIR"/etc/
cp /etc/hosts $CHROOTDIR/etc/ cp /etc/hosts "$CHROOTDIR"/etc/
mount --bind /dev $CHROOTDIR/dev && echo "$CHROOTDIR/dev" >> $MOUNTLIST mount --bind /dev "$CHROOTDIR"/dev && echo "$CHROOTDIR/dev" >> "$MOUNTLIST"
mount --bind /proc $CHROOTDIR/proc && echo "$CHROOTDIR/proc" >> $MOUNTLIST mount --bind /proc "$CHROOTDIR"/proc && echo "$CHROOTDIR/proc" >> "$MOUNTLIST"
mount --bind /sys $CHROOTDIR/sys && echo "$CHROOTDIR/sys" >> $MOUNTLIST mount --bind /sys "$CHROOTDIR"/sys && echo "$CHROOTDIR/sys" >> "$MOUNTLIST"
mount --bind /dev/pts $CHROOTDIR/dev/pts && echo "$CHROOTDIR/dev/pts" \ mount --bind /dev/pts "$CHROOTDIR"/dev/pts && echo "$CHROOTDIR/dev/pts" \
>> $MOUNTLIST >> "$MOUNTLIST"
chroot "$CHROOTDIR" dbus-uuidgen > "$CHROOTDIR/var/lib/dbus/machine-id" chroot "$CHROOTDIR" dbus-uuidgen > "$CHROOTDIR/var/lib/dbus/machine-id"
#chroot "$CHROOTDIR" ln -s /bin/true /sbin/initctl #chroot "$CHROOTDIR" ln -s /bin/true /sbin/initctl
...@@ -47,14 +47,14 @@ closeChroot() ...@@ -47,14 +47,14 @@ closeChroot()
{ {
chroot "$CHROOTDIR" aptitude clean chroot "$CHROOTDIR" aptitude clean
rm -rf $CHROOTDIR/root/.bash_history $CHROOTDIR/var/lib/dbus/machine-id rm -rf "$CHROOTDIR"/root/.bash_history "$CHROOTDIR"/var/lib/dbus/machine-id
rm -rf $CHROOTDIR/tmp/* rm -rf "$CHROOTDIR"/tmp/*
chroot "$CHROOTDIR" dpkg-divert --rename --remove /sbin/initctl chroot "$CHROOTDIR" dpkg-divert --rename --remove /sbin/initctl
umount -l $CHROOTDIR/dev/pts && removeMountList $CHROOTDIR/dev/pts umount -l "$CHROOTDIR"/dev/pts && removeMountList "$CHROOTDIR"/dev/pts
umount -l $CHROOTDIR/sys && removeMountList $CHROOTDIR/sys umount -l "$CHROOTDIR"/sys && removeMountList "$CHROOTDIR"/sys
umount -l $CHROOTDIR/proc && removeMountList $CHROOTDIR/proc umount -l "$CHROOTDIR"/proc && removeMountList "$CHROOTDIR"/proc
umount -l $CHROOTDIR/dev && removeMountList $CHROOTDIR/dev umount -l "$CHROOTDIR"/dev && removeMountList "$CHROOTDIR"/dev
rm -f $CHROOTDIR/etc/resolv.conf $CHROOTDIR/etc/hosts rm -f "$CHROOTDIR"/etc/resolv.conf "$CHROOTDIR"/etc/hosts
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment