#! /usr/bin/gtkdialog -e # # gtkHDinstall, The GoblinX Harddisk Installer # Author: Grobsch(Flavio de Oliveira) # VERSION: 2.5 SGN="livecd.sgn" MOUNTDIR="/mnt/live/mnt" # Call library functions . /usr/lib/libgoblix . /usr/lib/liblinuxlive # Internationalization/Help Functions . /usr/lib/i18nHDInstall || exit 1 # Functions passive_(){ DISPLAY=:0.0 dbus-launch notify-send -i gtk-info -t 2000 'Installer Notification' "$2" } checkroot(){ if [ "$(whoami)" != 'root' ]; then zenity --title="Error Message" --error --text "You must be root to run this application" 0 0 exit 1 fi } install_help(){ gtkHDInstall_hlp.sh } check_dest(){ if [ "$DEST" = "" ]; then zenity --title="Error Message" --error --text "You must select a mounted partition" 0 0 ps -ef | grep gtkHDInstal[l] | awk '{print $2}' | xargs kill /usr/bin/gtkHDInstall else echo $DEST > /tmp/dest_install fi } live_data(){ DATAFROM=$(cmdline_value from) if [ "$DATAFROM" ]; then DATAFROM=$(find_in_computer $DATAFROM) if [ "$DATAFROM" ]; then if [ $? -eq 0 -a "$(find_modules $LOOPMOUNT/$LIVECDNAME)" != "" ]; then passive "found in $DATAFROM" LIVEDATA=$LOOPMOUNT/$LIVECDNAME fi fi fi if [ "$DATA" = "" ]; then # from= is not used or it didn't contain valid data LIVEDATA=$(find_in_computer $LIVECDNAME/$SGN) LIVEDATA=$(dirname $LIVEDATA 2>/dev/null) fi } live_(){ cat /tmp/livedata_found } progress_fast(){ live_data i=10 while [ "$LIVEDATA" = "" ]; do echo "$i + 10" done echo "100" echo Found $LIVEDATA/$SGN echo $LIVEDATA/ > /tmp/livedata_found } create_files(){ if [ ! -e /tmp/extra_modules ]; then touch /tmp/extra_modules fi } getpoints(){ ls -aA1bd /mnt/*{1,2,3,4,5,6,7,8,9} 2>/dev/null | while read LINE; do MOUNT=`mount | grep -F "$LINE" | cut -d " " -f 1` if [ ! "$MOUNT" = "" ]; then echo "$LINE" fi done } second_warning(){ zenity --warning --text "The install script is going to prepare the choosen partition, all data from $DEST will be lost.\nDo you wish to continue?" if [ $? -eq 0 ] then $1 else continue fi } progress_(){ if [ "$?" != "" ]; then echo; fi $1 } format_(){ POINT="`basename $DEST`" umount -f /dev/$POINT mkfs.$FSTYPE -q /dev/$POINT mount /dev/$POINT /mnt/$POINT } delete_(){ POINT="`basename $DEST`" rm -rf /mnt/$POINT/* } repair_(){ POINT="`basename $DEST`" TYPE=`fsck -N /dev/$POINT` umount /dev/$POINT if echo $TYPE | grep -i reiserfs >/dev/null 2>/dev/null then reiserfsck --check -q -y /dev/$POINT mount /dev/$POINT elif echo $TYPE | grep -i ext3 >/dev/null 2>/dev/null then e2fsck -y /dev/$POINT mount /dev/$POINT elif echo $TYPE | grep -i xfs >/dev/null 2>/dev/null then xfs_repair /dev/$POINT mount /dev/$POINT else mount /dev/$POINT fi } formatdest(){ progress_ format_ | zenity --title="Progressbar" --progress --pulsate --auto-close --text "Formatting mounted partition $DEST" } deletedest(){ progress_ delete_ | zenity --title="Progressbar" --progress --pulsate --auto-close --text "Deleting all files on $DEST" } repairdest(){ progress_ repair_ | zenity --title="Progressbar" --progress --pulsate --auto-close --text "Checking mounted partition $DEST" } second_exec(){ if echo $FORMAT | grep Completely 1>/dev/null 2>/dev/null then second_warning formatdest elif echo $FORMAT | grep Delete 1>/dev/null 2>/dev/null then second_warning deletedest elif echo $FORMAT | grep Repair 1>/dev/null 2>/dev/null then second_warning repairdest elif echo $FORMAT | grep NOTHING 1>/dev/null 2>/dev/null then continue else continue fi } makedirs(){ mkdir -p $DEST/{bin,usr,etc,var/tmp,lib,opt,sbin,dev,proc,boot,tmp,sys,mnt,home} 2>/dev/null mkdir -p $DEST/home/Mymods 2>/dev/null mkdir -p $DEST/{var/lib,var/lib/modules} 2>/dev/null chmod 777 $DEST/{tmp,var/tmp} if [ "$?" -ne 0 ]; then zenity --title="Error Message" --error --text "Cannot create directories in $DEST" 0 0 fi } createmountpoints(){ ls -aA1b /mnt | while read LINE; do if [ "$LINE" != "live" ]; then mkdir -p $DEST/mnt/$LINE fi done } getimos(){ rm /tmp/{base_mods,modules_mods,optional_mods} LIDATA="`cat /tmp/livedata_found`" ls -R $LIDATA/{base,modules,optional} | egrep '[.]lzm$' > /tmp/list_modules } to_install(){ rm /tmp/{base_mods,modules_mods,video_mods,optional_mods} 1>/dev/null 2>/dev/null cat /tmp/list_modules | tr " " "\n" | egrep '.lzm$' | sed "s/\"//g" | sed "s/'//g" >/tmp/install_modules cat /tmp/install_modules | while read LINE ; do LIDATA="`cat /tmp/livedata_found`" if ls $LIDATA/base | grep $LINE 1>/dev/null 2>/dev/null; then echo $LINE >>/tmp/base_mods fi if ls $LIDATA/modules | grep $LINE 1>/dev/null 2>/dev/null; then echo $LINE >>/tmp/modules_mods fi if ls $LIDATA/optional | grep $LINE 1>/dev/null 2>/dev/null; then echo $LINE >>/tmp/optional_mods fi done } less_modules(){ getimos to_install rm /tmp/install_mos cat /tmp/install_modules | while read LINE; do TMPMOD="FALSE $LINE"; echo $TMPMOD >>/tmp/install_mos done PKGLIST="`cat /tmp/install_mos`" zenity --title "Modules Remove Dialog" --text "Select modules from the list below to not install..." --list --width=400 --height=550 --multiple --separator=" " --checklist --column "Remove" --column "Packages" $PKGLIST > /tmp/re_paks if [ "$?" = "" ]; then exit 1; fi cat /tmp/re_paks | tr " " "\n" > /tmp/re_paks2 passmodules } add_modules(){ zenity --title "Choose extra modules to be installed" --separator=" " --multiple --file-selection >/tmp/selected_mods cat /tmp/selected_mods | tr " " "\n" > /tmp/extra_modules cat /tmp/selected_mods >> /tmp/extra_mods } getmodules(){ cat /tmp/extra_modules } passmodules(){ rm /tmp/{modules_base,modules_module,modules_optional} 1>/dev/null 2>/dev/null LIDATA="`cat /tmp/livedata_found`" cat /tmp/base_mods | while read LINE; do if ! grep $LINE /tmp/re_paks2 1>/dev/null 2>/dev/null; then echo $LIDATA/base/$LINE >>/tmp/modules_base; fi; done cat /tmp/modules_mods | while read LINE; do if ! grep $LINE /tmp/re_paks2 1>/dev/null 2>/dev/null; then echo $LIDATA/modules/$LINE >>/tmp/modules_module; fi; done cat /tmp/optional_mods | while read LINE; do if ! grep $LINE /tmp/re_paks2 1>/dev/null 2>/dev/null; then echo $LIDATA/optional/$LINE >>/tmp/modules_optional; fi; done echo "OK" > /tmp/module_removed } gparted_(){ if which gparted >/dev/null; then gparted else zenity --title="Error Message" --error --text "No GParted package founded, you need to download it." 0 0 fi } configure_lang(){ . /usr/lib/liblangs if [ "$LANG" == "Current Language" ]; then continue else if [ "$LANG" == "English" ] then cp -p /etc/issues/issue.en $DEST/etc/issues/issue cp -p /etc/issues/motd.en $DEST/etc/issues/motd elif [ "$LANG" == "Spanish" ] then lang_ES cp -p /etc/issues/issue.es $DEST/etc/issues/issue cp -p /etc/issues/motd.es $DEST/etc/issues/motd elif [ "$LANG" == "French" ] then lang_FR cp -p /etc/issues/issue.fr $DEST/etc/issues/issue cp -p /etc/issues/motd.fr $DEST/etc/issues/motd elif [ "$LANG" == "Deutsch" ] then lang_DE cp -p /etc/issues/issue.de $DEST/etc/issues/issue cp -p /etc/issues/motd.de $DEST/etc/issues/motd elif [ "$LANG" == "Portuguese" ] then lang_BR cp -p /etc/issues/issue.br $DEST/etc/issues/issue cp -p /etc/issues/motd.br $DEST/etc/issues/motd else continue fi fi } configure_init(){ if [ "$LEVEL" == "Multiuser Mode (3)" ] then LEV=`cat /etc/inittab | grep id | cut -f2 -d ":"` sed "s/id:$LEV/id:3/" /etc/inittab > $DEST/etc/inittab elif [ "$LEVEL" == "Single Mode (1)" ] then LEV=`cat /etc/inittab | grep id | cut -f2 -d ":"` sed "s/id:$LEV/id:1/" /etc/inittab > $DEST/etc/inittab elif [ "$LEVEL" == "X11 KDM/GDM/XDM (4)" ] then LEV=`cat /etc/inittab| grep id | cut -f2 -d ":"` sed "s/id:$LEV/id:4/" /etc/inittab > $DEST/etc/inittab else continue fi } configure_wm(){ if [ "$WMD" == "Running" ]; then if [ -e /tmp/wm_default ]; then continue else if [ "$(ps ax | grep xfdesktop)" != "" ]; then echo "Xfce" > /tmp/wm_default elif [ "$(ps ax | grep kdesktop)" != "" ]; then echo "Kde" > /tmp/wm_default elif [ "$(ps ax | grep fluxbox)" != "" ]; then echo "Fluxbox" > /tmp/wm_default elif [ "$(ps ax | grep wmaker)" != "" ]; then echo "WindowMaker" > /tmp/wm_default elif [ "$(ps ax | grep e16)" != "" ]; then echo "Enlightement" > /tmp/wm_default else echo "Xfce" > /tmp/wm_default fi fi else if [ "$WMD" == "KDE" ] then echo "Kde" > /tmp/wm_default elif [ "$WMD" == "Xfce" ] then echo "Xfce" > /tmp/wm_default elif [ "$WMD" == "Fluxbox" ] then echo "Fluxbox" > /tmp/wm_default elif [ "$WMD" == "WindowMaker" ] then echo "WindowMaker" > /tmp/wm_default elif [ "$WMD" == "Enlightement" ] then echo "Enlightement" > /tmp/wm_default else echo "Xfce" > /tmp/wm_default fi fi cp /tmp/wm_default $DEST/etc/ } fixfstab(){ FSTABTMP=/tmp/fstab$$ DEV="`basename $DEST`" echo -ne "" >$FSTABTMP cp /etc/fstab $DEST/etc/fstab cat $DEST/etc/fstab | while read LINE; do if [ "0$FIRST" -ne 0 ]; then # Skip first line echo $LINE >>$FSTABTMP fi FIRST=1 done FS="`blkid -s TYPE /dev/$DEV | cut -d = -f 2 | tr -d ' \"'`" echo "`mount | grep -w $DEST | cut -f 1 -d \" \"` / $FS defaults 1 1" > $DEST/etc/fstab.new cat $FSTABTMP | egrep -v $DEST >> $DEST/etc/fstab.new mv $DEST/etc/fstab.new $DEST/etc/fstab } root_pass(){ if [ "$NEWROOTPASS" != "" ]; then if [ "$NEWROOTPASS" = "$NEWROOTPASS02" ]; then echo "root:$NEWROOTPASS" | /usr/sbin/chpasswd else zenity --title="Error Message" --error --text "Your confirm password does not match, try again." 0 0 fi fi } go_pass(){ if [ "$NEWGOPASS" != "" ]; then if [ "$NEWGOPASS" = "$NEWGOPASS02" ]; then echo "goblix:$NEWGOPASS" | /usr/sbin/chpasswd else zenity --title="Error Message" --error --text "Your confirm password does not match, try again." 0 0 fi fi } user_create(){ if [ "$USERID" != "" ]; then useradd -m -c $USERID -d /home/$USERID -s '/bin/bash' $USERID -g users -G $USERGRPS usermod -p "" $USERID mkdir $DEST/tmp/ksocket-$USERID chown -R $USERID:users $DEST/tmp/ksocket-$USERID # change password if [ ! "$USERPASS" = "" ]; then echo "$USERID:$USERPASS" | /usr/sbin/chpasswd fi fi } config_save(){ configsave $DEST/tmp/confsave.lzm lzm2dir $DEST/tmp/confsave.lzm $DEST/ } last(){ cd $DEST chmod 666 dev/ptmx rm dev/{console,null,systty,tty,tty0,tty1} mknod $DEST/dev/console c 5 1 mknod $DEST/dev/null c 1 3 mknod $DEST/dev/tty c 5 0 mknod $DEST/dev/tty0 c 4 1 mknod $DEST/dev/tty1 c 4 1 rm -rf $DEST/tmp/* chmod 777 $DEST/tmp rm $DEST/root/.fluxbox/autostart/gidesk.desktop 1>/dev/null 2>/dev/null find $DEST/home -name 'gidesk.desktop' | xargs rm 1>/dev/null 2>/dev/null rm -rf $DEST/.wh* rm -rf $DEST/mnt/live rm $DEST/home/*/.xlockrc rm $DEST/etc/skel/.xlockrc if [ -e /tmp/fstab ]; then cp /tmp/fstab $DEST/etc/fstab; fi } install_mos(){ sleep 1 echo "05" && echo "Destination partition is being prepared..." second_exec echo "10" && echo "Creating dirs and mount points..." makedirs createmountpoints for i in `cat /tmp/modules_base | tr '/' '\n' | grep '.lzm$'`; do MODULE="`cat /tmp/modules_base | grep $i`" case $i in a.Bindings-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "11" && echo "Uncompressing $i..." sleep 2 ;; a.Core-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "13" && echo "Uncompressing $i..." sleep 2 ;; a.Defapps-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "15" && echo "Uncompressing $i..." sleep 2 ;; a.Deflibs-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "17" && echo "Uncompressing $i..." sleep 2 ;; a.Dev4Use-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "19" && echo "Uncompressing $i..." sleep 2 ;; a.Devel-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "21" && echo "Uncompressing $i..." sleep 2 ;; a.Docs-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "23" && echo "Uncompressing $i..." sleep 2 ;; a.Drivers-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "25" && echo "Uncompressing $i..." sleep 2 ;; a.EXapps-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "27" && echo "Uncompressing $i..." sleep 2 ;; a.Enlight-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "28" && echo "Uncompressing $i..." sleep 2 ;; a.Extrapps-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "29" && echo "Uncompressing $i..." sleep 2 ;; a.Fluxbox-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "31" && echo "Uncompressing $i..." sleep 2 ;; a.GStreamer-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "33" && echo "Uncompressing $i..." sleep 2 ;; a.Games-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "35" && echo "Uncompressing $i..." sleep 2 ;; a.Glibc-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "37" && echo "Uncompressing $i..." sleep 2 ;; a.Goblix-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "38" && echo "Uncompressing $i..." sleep 2 ;; a.Help-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "39" && echo "Uncompressing $i..." sleep 2 ;; a.Includes-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "40" && echo "Uncompressing $i..." sleep 2 ;; a.Kde-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "42" && echo "Uncompressing $i..." sleep 2 ;; a.Kdedocs-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "44" && echo "Uncompressing $i..." sleep 2 ;; a.Kdehelp-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "44" && echo "Uncompressing $i..." sleep 2 ;; a.Kdeincludes-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "46" && echo "Uncompressing $i..." sleep 2 ;; a.Kdelibs-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "47" && echo "Uncompressing $i..." sleep 2 ;; a.Kdeplus-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "48" && echo "Uncompressing $i..." sleep 2 ;; a.Kderemoved-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "49" && echo "Uncompressing $i..." sleep 2 ;; a.Kernel-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "51" && echo "Uncompressing $i..." sleep 2 ;; a.Mapps-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "53" && echo "Uncompressing $i..." sleep 2 ;; a.Mcore-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "55" && echo "Uncompressing $i..." sleep 2 ;; a.Media-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "57" && echo "Uncompressing $i..." sleep 2 ;; a.Mlibs-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "59" && echo "Uncompressing $i..." sleep 2 ;; a.Moreapps-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "61" && echo "Uncompressing $i..." sleep 2 ;; a.Mozilla-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "62" && echo "Uncompressing $i..." sleep 2 ;; a.Mx11-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "63" && echo "Uncompressing $i..." sleep 2 ;; a.Network-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "64" && echo "Uncompressing $i..." sleep 2 ;; a.Plus-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "65" && echo "Uncompressing $i..." sleep 2 ;; a.Removed-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "66" && echo "Uncompressing $i..." sleep 2 ;; a.Sapps-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "67" && echo "Uncompressing $i..." sleep 2 ;; a.Score-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "68" && echo "Uncompressing $i..." sleep 2 ;; a.Slibs-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "69" && echo "Uncompressing $i..." sleep 2 ;; a.System-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "70" && echo "Uncompressing $i..." sleep 2 ;; a.WMaker-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "71" && echo "Uncompressing $i..." sleep 2 ;; a.X11-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "72" && echo "Uncompressing $i..." sleep 2 ;; a.X3D-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "73" && echo "Uncompressing $i..." sleep 2 ;; a.XBeryl-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "74" && echo "Uncompressing $i..." sleep 2 ;; a.XPlus-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "75" && echo "Uncompressing $i..." sleep 2 ;; a.Xfce-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "76" && echo "Uncompressing $i..." sleep 2 ;; a.Xwm-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "77" && echo "Uncompressing $i..." sleep 2 ;; ap.Firefox-*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "78" && echo "Uncompressing $i..." sleep 2 ;; ap.Sylpheed-*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "79" && echo "Uncompressing $i..." sleep 2 ;; ap.Thunderbird-*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "80" && echo "Uncompressing $i..." sleep 2 ;; i.Kdehelp-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "80" && echo "Uncompressing $i..." sleep 2 ;; i.Locales-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "81" && echo "Uncompressing $i..." sleep 2 ;; i.i18n_de-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "82" && echo "Uncompressing $i..." sleep 2 ;; i.i18n_es-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "83" && echo "Uncompressing $i..." sleep 2 ;; i.i18n_fr-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "84" && echo "Uncompressing $i..." sleep 2 ;; i.i18n_pt_BR-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "85" && echo "Uncompressing $i..." sleep 2 ;; z.Duser-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "86" && echo "Uncompressing $i..." sleep 2 ;; z.Goblix-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "87" && echo "Uncompressing $i..." sleep 2 ;; z.Kde-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "87" && echo "Uncompressing $i..." sleep 2 ;; z.Micro-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "88" && echo "Uncompressing $i..." sleep 2 ;; z.Mini-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "89" && echo "Uncompressing $i..." sleep 2 ;; z.Muser-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "90" && echo "Uncompressing $i..." sleep 2 ;; z.Premium-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "90" && echo "Uncompressing $i..." sleep 2 ;; z.User-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "91" && echo "Uncompressing $i..." sleep 2 ;; esac done for i in `cat /tmp/modules_module | tr '/' '\n' | grep '.lzm$'`; do MODULE="`cat /tmp/modules_module | grep $i`" case $i in broffice-2.4.1-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "92" && echo "Uncompressing $i..." sleep 2 ;; jre-6u6-i586-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "92" && echo "Uncompressing $i..." sleep 2 ;; kernel_src-2.6.24.3-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "92" && echo "Uncompressing $i..." sleep 2 ;; openoffice-2.4.1-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "92" && echo "Uncompressing $i..." sleep 2 ;; esac done for i in `cat /tmp/modules_optional | tr '/' '\n' | grep '.lzm$'`; do MODULE="`cat /tmp/modules_optional | grep $i`" case $i in i.i18n_de-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "93" && echo "Uncompressing $i..." sleep 2 ;; i.i18n_es-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "93" && echo "Uncompressing $i..." sleep 2 ;; i.i18n_fr-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "93" && echo "Uncompressing $i..." sleep 2 ;; i.i18n_pt_BR-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "93" && echo "Uncompressing $i..." sleep 2 ;; z.Muser-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "93" && echo "Uncompressing $i..." sleep 2 ;; z.User-?-i486-v*.lzm) insert_module $DEST $MODULE /tmp 1>/dev/null 2>/dev/null find /tmp/$i | xargs rm -rf; echo "93" && echo "Uncompressing $i..." sleep 2 ;; esac done cat /tmp/extra_mods | while read LINE; do if [ "$LINE" != "" ]; then MODULE="`find $LIVEDATA -wholename $LINE`" insert_module $DEST $LINE /tmp 1>/dev/null 2>/dev/nul echo "94" && echo "Uncompressing Extra Modules..." fi done lspci | grep VGA > /etc/vga.dat if ( cat /etc/vga.dat | grep -i nVidia 1>/dev/null 2>/dev/null ) then FILE=`ls $LIVEDATA/video/ | grep nvidia` if [ "$FILE" != "" ]; then insert_module $DEST $LIVEDATA/video/$FILE /tmp 1>/dev/null 2>/dev/nul fi elif ( cat /etc/vga.dat | grep -i Radeon 1>/dev/null 2>/dev/null ) then FILE=`ls $LIVEDATA/video/ | grep fglrx` if [ "$FILE" != "" ]; then insert_module $DEST $LIVEDATA/video/$FILE /tmp 1>/dev/null 2>/dev/null fi fi echo "95" && echo "Saving modificated files (configsave)..." if [ "$CONFIG_SAVE" == "SAVE" ]; then config_save else cp -Rp /home/* $DEST/home/ cp -p /etc/{group,group-,gshadow,gshadow-,passwd,passwd-,shadow,shadow-} $DEST/etc fi sleep 2 echo "96" && echo "Fixating the FSTAB for mount points..." fixfstab $DEST sleep 2 echo "96" && echo "Trying rebuild initramfs (initrd) for your system..." go-initramfs.sh $DEST sleep 1 echo "96" && echo "Copying some modificated files..." cp /boot/vmlinuz $DEST/boot/vmlinuz if [ ! -e $DEST/boot/initrd.img.2.6.24.3 ]; then cp /etc/bootsplash/themes/initrd $DEST/boot/initrd fi cp /etc/X11/xorg.conf $DEST/etc/X11 sleep 2 echo "96" && echo "Configuring default language..." configure_lang sleep 2 echo "97" && echo "Configuring default level mode..." configure_init sleep 2 echo "98" && echo "Configuring default windows manager..." configure_wm sleep 2 echo "99" && echo "Reparing and fixating partition..." repairdest last sleep 2 zenity --question --text "Do you wish to reinstall LILO (Linux Boot Loader)?" if [ $? -eq 0 ] then configurelilo | zenity --progress --pulsate --auto-close --text "Generating lilo.conf file for you..." cp /etc/lilo.conf.goblinx /tmp/lilo.conf.goblinx DEVI="$(echo $DEST | cut -f3 -d "/")" if [ "$(cat /tmp/lilo.conf.goblinx | grep Linux- | grep $DEVI)" ]; then DUBI="$(echo Linux-$DEVI)" sed "s|$DUBI|GoblinX|" /tmp/lilo.conf.goblinx > /tmp/lilo.conf.goblinx.new sed "9a\bitmap = $DEST/etc/goblinx.bmp" /tmp/lilo.conf.goblinx.new > /etc/lilo.conf.goblinx fi gtki_lilo else continue fi echo "100" echo "Finished all install process" } some_clean(){ for i in gomodules.txt golanguages.txt listmodules.txt listlanguages.txt livedata_found locale_added module_removed \ extra_modules list_modules install_modules base_mods modules_mods optional_mods video_mods dest_install \ install_mos selected_mods extra_mods re_paks2 re_paks modules_base modules_module help_3 help_ modules_optional fstab*; do if [ -e /tmp/$i ]; then rm -rf /tmp/$i; fi done } command_exec(){ check_dest if [ -e /tmp/module_removed ]; then continue else getimos to_install passmodules fi } # Main # Must run before gtkDialogs checkroot create_files # gtkDialogs export USERS_DIALOG=' disabled true if true enable:NEWROOTPASS if false disable:NEWROOTPASS if true enable:R1 if false disable:R1 if true enable:R2 if false disable:R2 if true enable:NEWROOTPASS02 if false disable:NEWROOTPASS02 R1 NEWROOTPASS disabled R2 NEWROOTPASS02 disabled true if true enable:NEWGOPASS if false disable:NEWGOPASS if true enable:GO1 if false disable:GO1 if true enable:GO2 if false disable:GO2 if true enable:NEWGOPASS02 if false disable:NEWGOPASS02 GO1 NEWGOPASS disabled GO2 NEWGOPASS02 disabled /usr/share/images/goinstall_accounts.png disabled true if true enable:USERID if false disable:USERID if true enable:USEPASS if false disable:USERPASS if true enable:USERGRPS if false disable:USERGRPS if true enable:U1 if false disable:U1 if true enable:U2 if false disable:U2 if true enable:U3 if false disable:U3 U1 USERID disabled U2 USERPASS disabled U3 USERGRPS floppy,cdrom,audio,video,plugdev disabled disabled disabled disabled ' export PROGINST_DIALOG=' install_mos some_clean PROGINST_DIALOG FINAL_DIALOG ' export FINAL_DIALOG=' /usr/share/images/goinstall_image03.jpg disabled disabled disabled ' export MAIN_DIALOG=' add_modules less_modules USERS_DIALOG install_help disabled disabled getpoints DEST enabled disabled disabled CHECKBOX if true enable:FSTYPE if false disable:FSTYPE if true enable:FORMAT if false disable:FORMAT if true enable:CONFIG_SAVE if false disable:CONFIG_SAVE if true enable:LEVEL if false disable:LEVEL if true enable:LANG if false disable:LANG if true enable:WMD if false disable:WMD /usr/share/pixmaps/filetype_22.png disabled FSTYPE ext3 reiserfs xfs /usr/share/pixmaps/edit-delete.png disabled FORMAT Completely Format Partition Delete Files (Do NOT Format Partition) Check & Repair Partition (Do NOT Format) DO NOTHING /usr/share/pixmaps/configsave_22.png disabled CONFIG_SAVE SAVE SAVE NOT SAVE /usr/share/pixmaps/wmd_22.png disabled WMD Running Running Xfce Kde Fluxbox WindowMaker Enlightenment /usr/share/pixmaps/runlevel_22.png disabled LEVEL Multiuser Mode (3) Multiuser Mode (3) Single Mode (1) X11 KDM/GDM/XDM (4) /usr/share/pixmaps/preferences-desktop-locale.png disabled LANG Current Language English Portuguese French Deutsch Spanish disabled /tmp/help_3 HELP_2 395125 disabled progress_fast '