Es que yad es la caña, ofrece un montón de posibilidades, cuanto mas juego con el mas cosas descurbo que se pueden hacer.
Tengo mas cosas en mente, pero estoy esperando a ver si arreglan un bug que me he encontrado mientras hacía otra gui, lo he reportado en googlecode: https://code.google.com/p/yad/issues/detail?id=212&sort=-id
A ver si hay suerte y lo arreglan.
geminis .... ;D ;D
ains , yad va por la versión 0.27.0
http://sourceforge.net/projects/yad-dialog/files/
Vaya... eso me pasa por no usar google, tanto que le digo a la gente que lo use ;D
Pues si que tiene mas opciones esta nueva versión, aunque el bug sigue presente.
Nuevas versiones:esto se puede poner en la 4.10 o son pruebas?
http://downloadwireless.net/modulos-fase-testing/wifislax-current/WifislaxInstallerGUI-0.5-noarch-1sw.xzm
http://downloadwireless.net/modulos-fase-testing/wifislax-current/Grub2InstallerGUI-0.3-noarch-1sw.xzm
Ahora ambos se integran con el theme de kde, y también se muestra mas información en la barra de progreso mientras se instala Wifislax(http://i.imgur.com/Pvp6UNJ.png)
Gracias Hwagm por el reconocimiento ;)
Ahora son otros los que modifican nuestros instaladores para usarlos en su sistema, por ejemplo Slackel utiliza nuestro antiguo instalador de grub2.
Fuimos la primera distro basada en slackware en utilizar grub2 como cargador de arranque, ya que antes del nuestro no existía ningún instalador para salckware y derivados.
Gracias Hwagm por el reconocimiento ;)
Ahora son otros los que modifican nuestros instaladores para usarlos en su sistema, por ejemplo Slackel utiliza nuestro antiguo instalador de grub2.
Fuimos la primera distro basada en slackware en utilizar grub2 como cargador de arranque, ya que antes del nuestro no existía ningún instalador para salckware y derivados.
>:( >:(
y les podemos cobrar canon ?
Coño vaya currazo ............. Entre el instalador y los update esto es una distribución , como pocas hay ..
Muy bueno señores.
Usuarionuevo hago el PDF nuevo , pero mañana no y pasado tesacon en las vegas jajjajajaj. Así que pasado
Coño vaya currazo ............. Entre el instalador y los update esto es una distribución , como pocas hay ..
Hombre es que a Wifislax no le hace falta promoción... ya tiene sus años y lo conoce mucha gente.
Sobre todo entre la juventud, yo creo que si hiciéramos una encuesta por las universidades e institutos, saldría que al menos 1 de cada 5 jóvenes han usado o han oído hablar de Wifislas o Wifiway.
garcad estas usando yad 0.27 ?
por descartar cosas.
#!/bin/bash
#Mod seleccionar updates por vk496a
VERSION="0.8"
TITULO="Wifislax Updater GUI $VERSION - By geminis_demon"
TERM="linux"
IMG_ALERT="/usr/share/pixmaps/UpdateALERT.png"
IMG_ERROR="/usr/share/pixmaps/UpdateERROR.png"
IMG_OK="/usr/share/pixmaps/UpdateOK.png"
TMP="/tmp/WifislaxUpdaterGUI"
PKGS="$TMP/PKGS"
UPDATERS="/opt/wifislax-updaters"
CREARXZM="FALSE"
NOINSTALAR="FALSE"
APAGAR="FALSE"
DEBUG="FALSE"
THEME="/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc"
[ ! -f "$THEME" ] && unset THEME
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
CrearLogPackage() {
PKGNAM="$(basename "$1")"
SIZE="$(du -ch "$1"|tail -1|cut -f1)"
(echo "PACKAGE NAME: $PKGNAM"
echo "COMPRESSED PACKAGE SIZE:"
echo "UNCOMPRESSED PACKAGE SIZE: $SIZE"
echo "PACKAGE LOCATION: $PKGNAM"
echo "PACKAGE DESCRIPTION:"
echo "FILE LIST:"
echo "./"
find "$1"|grep -v "^$"|sed "s#$1/##"
) >"$TMP/$PKGNAM.$$"
mkdir -p "$1/var/log/packages"
mv -f "$TMP/$PKGNAM.$$" "$1/var/log/packages/$PKGNAM"
}
Actualizar() {
echo
echo "######################################"
echo "##"
echo "## Actualizando $PRGNAM"
echo "##"
echo "######################################"
echo
if [ "${UPDATER/*_}" = "updater" ]; then
UPDNAM="${UPDATER/*\/}"
cat "$UPDATER"|\
sed 's/^f_comprobarConexion/:/'|\
sed 's/^f_presentacion/:/'|\
sed 's/^f_comprobarUpdates/:/'|\
sed 's/^f_versionInstalada/:/'|\
sed 's/^f_tareasFinales/:/'|\
sed 's/^f_strip/:/'|\
sed 's#^rm -rf /usr/lib/firefox#:#'\
>"$TMP/$UPDNAM" && chmod +x "$TMP/$UPDNAM"
sh "$TMP/$UPDNAM"
[ $? -ne 0 ] && echo " • $PRGNAM" >>"$TMP/fallidos" && return
ARCH_="$(grep "^f_arquitectura" "$TMP/$UPDNAM"|cut -d' ' -f2)"
[ ! "$ARCH_" ] && ARCH_="$ARCH"
BUILD_DIR="/tmp/build/$PRGNAM/${PRGNAM}-${VERSION}-${ARCH}-1sw"
mv "/tmp/build/$PRGNAM/package-$PRGNAM" "$BUILD_DIR"
stripdir "$BUILD_DIR" >/dev/null 2>&1
cleandir "$BUILD_DIR"
CrearLogPackage "$BUILD_DIR"
[ "$NOINSTALAR" = "FALSE" ] && (removepkg "$(ls /var/log/packages/$PRGNAM-[0-9]*-*|tail -1)"; cp -rfp "$BUILD_DIR"/* /)
[ "$CREARXZM" = "TRUE" ] && MODULO="$PKGS/$(basename "$BUILD_DIR").xzm" && dir2xzm "$BUILD_DIR" "$MODULO" -n
rm -rf "/tmp/build/$PRGNAM" "$TMP/$UPDNAM"
elif [ "$UPDATER" = "slapt-get" ]; then
URL="$(slapt-get --print-uris -i "$PRGNAM"|grep "^http"|tail -1)"
aria2c -x 3 -d "$PKGS" "$URL"
[ $? -ne 0 ] && echo " • $PRGNAM" >>"$TMP/fallidos" && return
TXZ="$(basename "$URL")"
[ "$NOINSTALAR" = "FALSE" ] && (removepkg "$(ls /var/log/packages/$PRGNAM-[0-9]*-*|tail -1)"; installpkg "$PKGS/$TXZ")
[ "$CREARXZM" = "TRUE" ] && MODULO="$PKGS/$(echo "$TXZ"|sed 's/txz$/xzm/')" && txz2xzm "$PKGS/$TXZ" "$MODULO"
rm -f "$PKGS/$TXZ"
fi
[ -f "$MODULO" ] && mkdir -p "$HOME/Desktop/Actualizaciones" && mv "$MODULO" "$HOME/Desktop/Actualizaciones"
unset MODULO
}
MenuActualizando() {
seleccionados=$(echo "$seleccionados" | sed -r 's/([A-Z]+\|[[:alpha:]]+)\|([A-Z]+\|[[:alpha:]]+)\|/\1\n\2/' | grep TRUE | cut -f2 -d\| |rev | cut -d- -f2- | rev | awk '{print $0"|"}')
echo "$seleccionados" >$TMP/losseleccionados
#Es posible que solo haya actualizaciones de los updaters
if [ -f $TMP/wifislax-updates ]; then
grep -f $TMP/losseleccionados $TMP/wifislax-updates |cut -d"|" -f1 > $TMP/coincidencias_updater
grep -f $TMP/coincidencias_updater $TMP/wifislax-updates > $TMP/TMP_wifislax-updates
mv $TMP/TMP_wifislax-updates $TMP/wifislax-updates
#O de ambos
if [ -f $TMP/slackware-updates ]; then #Evitamos que una misma actualizacion se haga de las dos formas
grep -v -f $TMP/coincidencias_updater $TMP/losseleccionados > $TMP/coincidencias_slackware-updates
grep -f $TMP/coincidencias_slackware-updates $TMP/slackware-updates > $TMP/TMP_slackware-updates
mv $TMP/TMP_slackware-updates $TMP/slackware-updates
rm $TMP/TMP_slackware-updates $TMP/coincidencias_slackware-updates
fi
rm $TMP/TMP_wifislax-updates $TMP/coincidencias_updater
#O solo de slapt-get
else
grep -f $TMP/losseleccionados $TMP/slackware-updates |cut -d"|" -f1 > $TMP/coincidencias_slackware-updates
grep -f $TMP/coincidencias_slackware-updates $TMP/slackware-updates > $TMP/TMP_slackware-updates
mv $TMP/TMP_slackware-updates $TMP/slackware-updates
rm $TMP/TMP_slackware-updates $TMP/coincidencias_slackware-updates
fi #Pero en esta funcion siempre hay elmenos uno de alguno
UPDATES="$(cat "$TMP/wifislax-updates" "$TMP/slackware-updates" 2>/dev/null)"
TOTAL=$(echo "$UPDATES"|wc -l)
echo "Ejecutando actualizaciones" >"$TMP/estado"
[ "$DEBUG" = "TRUE" ] && (xterm -T "$TMP/log" -e "tail -F $TMP/log" & echo $! >"$TMP/pid")
N=1
echo "$UPDATES"|\
while read LINE; do
PRGNAM="$(echo "$LINE"|cut -d'|' -f1)"
VERSION="$(echo "$LINE"|cut -d'|' -f2)"
UPDATER="$(echo "$LINE"|cut -d'|' -f3)"
PORCENT=$(($(($N*100))/$TOTAL))
echo "1:$(($PORCENT-1))"
echo "1:#Actualizando ${PRGNAM}... ${N}/${TOTAL}"
Actualizar >>"$TMP/log" 2>&1
[ $PORCENT -eq 100 ] && echo "1:100"
N=$(($N+1))
done|\
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ALERT" \
--image "$IMG_ALERT" \
--button "gtk-cancel:1" \
--text "\n\n\n\n\n\n Ejecutando actualizaciones pendientes \n" \
--multi-progress --bar="":NORM --auto-close
[ $? -ne 0 ] && Salir
echo "Esperando interacción del usuario" >"$TMP/estado"
if [ "$APAGAR" = "TRUE" ]; then
for X in {0..10}; do
SEG=$(($X-10))
SEG=${SEG/-}
PORCENT=$(($X*10))
echo "$PORCENT"
echo "#El sistema se apagará en $SEG segundos"
sleep 1
done|\
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ALERT" \
--image "$IMG_ALERT" \
--button "gtk-cancel:1" \
--progress --auto-close \
--text-align "center" \
--text "\n\n\n\n\n\nLas operaciones han finalizado \n"
[ $? -ne 0 ] && Salir
poweroff
Salir
fi
if [ -f "$TMP/fallidos" ]; then
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ERROR" \
--image "$IMG_ERROR" \
--button "gtk-close:0" \
--text-info --text "\n\nLas operaciones han finalizado con errores, \
los siguientes paquetes no han podido actualizarse: \n" \
--filename "$TMP/fallidos"
else
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_OK" \
--image "$IMG_OK" \
--button "gtk-close:0" \
--text "\n\n\n\n\n\n\nLas operaciones han finalizado sin errores, \
todos los paquetes se actualizaron correctamente. \n"
fi
[ "$DEBUG" = "TRUE" ] && kill $(cat "$TMP/pid")
Salir
}
MenuOpciones() {
yad --on-top --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ALERT" \
--image "$IMG_ALERT" \
--button "Guardar:0" \
--button "gtk-close:2" \
--form \
--text "\n\nConfigurar opciones: \n" \
--field "Guardar actualizaciones en módulos XZM":CHK $CREARXZM \
--field "No instalar actualizaciones, solo descargar":CHK $NOINSTALAR \
--field "Apagar sistema al terminar":CHK $APAGAR \
--field "Activar modo debug":CHK $DEBUG \
>"$TMP/return"
[ $? -ne 0 ] && Salir
IFS='|' read CREARXZM NOINSTALAR APAGAR DEBUG <"$TMP/return"
[ "$NOINSTALAR" = "TRUE" -a "$CREARXZM" = "FALSE" ] && CREARXZM="TRUE" && MenuOpciones
MenuActualizaciones
}
MenuActualizaciones() {
TOTAL=$(echo "$UPDATES"|wc -l)
seleccionados=$(yad --on-top --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ALERT" \
--image "$IMG_ALERT" \
--button "Actualizar:0" \
--button "Opciones:1" \
--button "gtk-close:2" \
--text-info --text "\n\n $TOTAL actualizaciones disponibles \n" \
--list \
--multiple \
--column=Selec:CHK --column "Actualizaciones" \
$(cat $TMP/actualizaciones-disponibles) --print-all )
case $? in
0) MenuActualizando;;
1) MenuOpciones;;
*) Salir;;
esac
}
ActualizarUpdater() {
UPDATER_ONLINE="$(timeout -s SIGTERM 3 curl -s "http://downloadwireless.net/${UPDATER#/opt/}"|grep "^SCRIPT_VERSION="|cut -d'=' -f2)"
UPDATER_LOCAL="$(grep "^SCRIPT_VERSION=" "$UPDATER"|cut -d'=' -f2)"
if [ "$UPDATER_ONLINE" ] && [ $UPDATER_LOCAL -lt $UPDATER_ONLINE ]; then
timeout -s SIGTERM 3 curl -s "http://downloadwireless.net/${UPDATER#/opt/}" >"$UPDATER"
fi
}
Salir() {
[ -e "${TMP}.mutex" ] && rm -rf "${TMP}.mutex"
[ -e "$TMP/estado" ] && rm -rf "$TMP/estado"
exit
}
[ "$1" = "--rm-mutex" ] && rm -rf "${TMP}.mutex"
if [ -e "${TMP}.mutex" ]; then
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ERROR" \
--image "$IMG_ERROR" \
--button "gtk-ok:0" \
--text "\n\n\n\n\n\n\n\nEl programa ya se está ejecutando. \nEstado: $(cat "$TMP/estado" 2>/dev/null||echo "desconocido")"
exit
else
touch "${TMP}.mutex"
fi
trap "Salir" SIGHUP SIGILL SIGTERM SIGTSTP
rm -rf "$TMP" && mkdir -p "$TMP" "$PKGS"
if [ "$1" = "--no-tray" ]; then
if [ ! "$(ping google.com -c1 2>/dev/null)" ]; then
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ERROR" \
--image "$IMG_ERROR" \
--button "gtk-ok:0" \
--text "\n\n\n\n\n\n\n\nNo hay conexión a internet, no se puede continuar. \n"
Salir
fi
echo "1" >"$TMP/progress"
(while true; do echo "$(cat "$TMP/progress")"; sleep 1; done|\
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_ALERT" \
--image "$IMG_ALERT" \
--button "gtk-cancel:1" \
--text-align "center" \
--text "\n\n\n\n\n\n\nBuscando actualizaciones... \n" \
--progress --pulsate --auto-close \
||touch "$TMP/stop" &)
else
while [ ! "$(ping google.com -c1 2>/dev/null)" ]; do echo "Esperando conexión a internet" >"$TMP/estado"; sleep 60; done
fi
echo "Buscando actualizaciones" >"$TMP/estado"
for UPDATER in $(find "$UPDATERS" -type f -iname "*_updater"); do
[ "$(basename "$UPDATER")" = "wifislax-updaters_updater" ] && continue
grep "PRGNAM=" "$UPDATER" >"$TMP/$$.tmp" && source "$TMP/$$.tmp" 2>/dev/null
INSTALADA="$(ls /var/log/packages/$PRGNAM-[0-9]*-* 2>/dev/null|cut -d '/' -f5-|sed "s/^${PRGNAM}-//"|rev|cut -d'-' -f3-|rev|tail -1)"
if [ "$INSTALADA" ]; then
egrep "WEB=|VERSION=|RAMA=|DOWNLOAD=|ARCHIVO=" "$UPDATER" >"$TMP/$$.tmp" && source "$TMP/$$.tmp" 2>/dev/null
if [ "$VERSION" ]; then
if [ "$VERSION" != "$INSTALADA" ]; then
ActualizarUpdater >/dev/null 2>&1
echo "${PRGNAM}|${VERSION}|$UPDATER"
fi
fi
fi
unset PRGNAM INSTALADA WEB VERSION RAMA DOWNLOAD ARCHIVO
rm -f "$TMP/$$.tmp"
done >"$TMP/wifislax-updates"
if [ ! -f "/var/slapt-get/last_update" ] || [ $(cat "/var/slapt-get/last_update") -lt $(date +%Y%m%d) ]; then
slapt-get --update && echo "$(date +%Y%m%d)" >"/var/slapt-get/last_update"
slapt-get --upgrade --simulate|grep "actualizará "|awk '{print $1" "$7}' |\
while read PRGNAM VERSION; do
VERSION="$(echo "$VERSION"|rev|cut -d'-' -f3-|rev)"
PRGNAM="$(echo "$PRGNAM"|rev|cut -d'-' -f4-|rev)"
echo "${PRGNAM}|${VERSION}|slapt-get"
done >"$TMP/slackware-updates"
fi
[ -f "$TMP/stop" ] && Salir
UPDATES="$(cat "$TMP/wifislax-updates" "$TMP/slackware-updates" 2>/dev/null)"
echo "Esperando interacción del usuario" >"$TMP/estado"
if [ "$1" = "--no-tray" ]; then
echo "100" >"$TMP/progress"
if [ ! "$UPDATES" ]; then
yad --center \
--width 600 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$IMG_OK" \
--image "$IMG_OK" \
--button "gtk-ok:0" \
--text "\n\n\n\n\n\n\nNo se encontraron actualizaciones disponibles, el sistema está actualizado. \n"
Salir
fi
else
[ ! "$UPDATES" ] && Salir
yad --notification \
--no-middle \
--gtkrc="$THEME" \
--image "$IMG_ALERT" \
--command "quit" \
--menu "Actualizaciones disponibles" \
--text "Actualizaciones disponibles"
sleep 0.5
fi
echo "$UPDATES"|cut -d '|' -f1,2|tr '|' '-'|sed 's/^/ • /' >"$TMP/actualizaciones-disponibles"
MenuActualizaciones
Salir
GNU bash, versión 4.3.39
Se le puede añadir la opcional de no formatear la partición donde se instalara.
Por defecto puede estar activada, pero que se pueda dejar opción para el usuario.
Salu2
mkdir -p "$MNT"/{tmp,boot,mnt,dev,sys,proc}
La verdad es que no lo quité porque no estaba seguro de si todos los directorios ya están en los xzm o los crea el initrd durante el arranque, pero si dices que ya están, se puede eliminar esa línea.
--- /root/Desktop/WifislaxInstallerGUI-1.0-noarch-1sw/opt/install/WifislaxInstallerGUI
+++ /opt/install/WifislaxInstallerGUI
@@ -1,12 +1,13 @@
#!/bin/bash
-VERSION="1.0"
-TITULO="Wifislax Installer GUI $VERSION - By geminis_demon"
+VERSION="1.1"
+TITULO="Wifislax64 Installer GUI $VERSION - By geminis_demon"
LOGO="/usr/share/pixmaps/notify-send/wifislax_logo.png"
TMP="/tmp/WifislaxInstallerGUI"
THEME="/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc"
-LIVECD="$(cat /var/log/wifislax-livedbg|grep '/wifislax$'|sed 's/wifislax$//')"
-MODULES="$(cat /var/log/wifislax-livedbg|grep ".xzm$")"
+LIVEOS="/etc/wifislax-version"
+LIVECD="/mnt/livemedia"
+MODULES="$(cat /mnt/live/tmp/wifislax64-livedbg|grep ".xzm$")"
if [ ! -d "$LIVECD" ]; then
@@ -27,7 +28,7 @@
--image "$LOGO" \
--button "gtk-ok:0" \
--text-align "center" \
- --text "\n\n\n Para utilizar este instalador debes iniciar Wifislax en modo live \n"
+ --text "\n\n\n Para utilizar este instalador debes iniciar Wifislax64 en modo live \n"
exit
fi
@@ -138,14 +139,7 @@
umount "$DEV"
- if [ $LANG = "en_US.utf8" ]; then
-
- RESPUESTA=y
- else
- RESPUESTA=s
- fi
-
- echo $RESPUESTA | mkfs.ext4 -t ext4 "$DEV"
+ yes | mkfs.ext4 -t ext4 "$DEV"
if [ $? -ne 0 ]; then
@@ -219,37 +213,18 @@
--no-buttons \
--progress \
--text-align "center" \
- --text "\n\n\n Instalando Wifislax $(cat /etc/wifislax-version|cut -d' ' -f2) en $DEV \n" \
+ --text "\n\n\n Instalando Wifislax64 $(cat $LIVEOS|cut -d' ' -f2) en $DEV \n" \
& echo $! >"$TMP/pid")
while true; do sleep 1; [ $(cat "$TMP/progress_bar") -ge 100 ] && break; done
-mkdir -p "$MNT"/{tmp,boot,mnt,dev,sys,proc}
-LIVE_DEV="/dev/$(cat /var/log/wifislax-livedbg|grep '/wifislax$'|cut -d/ -f3)"
-cat /etc/fstab|egrep -v "^$LIVE_DEV|^$DEV"|egrep -o "/mnt/[a-z0-9]+"|cut -b 2-|xargs -i mkdir -p "$MNT"/"{}"
-(
-echo "# System mounts:
-devpts /dev/pts devpts gid=5,mode=620 0 0
-proc /proc proc defaults 0 0
-tmpfs /dev/shm tmpfs defaults 0 0"
-echo
-echo "# Raiz del sistema"
-echo "$DEV / ext4 defaults 1 1"
-echo
-echo "# Otras particiones"
-cat /etc/fstab|grep "^/dev/"|egrep -v "^$LIVE_DEV|^$DEV| swap "
-) > "$MNT/etc/fstab"
-rm -f "$MNT/etc/mtab"
-[ "$(uname -r|grep "\-smp-")" ] && VMLINUZ="vmlinuz2"||VMLINUZ="vmlinuz"
-cp -f "$LIVECD/boot/$VMLINUZ" "$MNT/boot/vmlinuz-$(uname -r)"
-cp -rfp /dev/null "$MNT/dev"
-cp -rfp /dev/console "$MNT/dev"
-mount -o bind /dev "$MNT/dev"
-mount -t proc proc "$MNT/proc"
-cd "$MNT" && sync && cd ~
-umount "$MNT/dev"
-umount "$MNT/proc"
-umount "$MNT"
-tune2fs -L "$(cat /etc/wifislax-version|tr ' ' '-')" "$DEV"
+
+sed -i "1i $DEV / ext4 defaults 1 1" "$MNT/etc/fstab"
+cp -rf "$LIVECD/boot/vmlinuz" "$MNT/boot/vmlinuz-$(uname -r)"
+cp -rf /etc/timezone "$MNT/etc/"
+cp -rf /etc/rc.d/rc.keymap "$MNT/etc/rc.d/"
+cp -rf /etc/profile.d/lang.sh "$MNT/etc/profile.d/"
+cp -rf /etc/X11/xorg.conf.d/30-keyboard.conf "$MNT/etc/X11/xorg.conf.d/"
+tune2fs -L "$(cat $LIVEOS|tr ' ' '-')" "$DEV"
kill $(cat "$TMP/pid")
yad --on-top --center \
@@ -261,7 +236,7 @@
--image "$LOGO" \
--button "gtk-ok:0" \
--text-align "center" \
- --text "\n\n\n La instalación de Wifislax ha completado, \n se procederá a instalar el GRUB \n"
+ --text "\n\n\n La instalación de Wifislax64 ha completado, \n se procederá a instalar el GRUB \n"
Grub2InstallerGUI
exit
#!/bin/bash
VERSION="1.1"
TITULO="Wifislax64 Installer GUI $VERSION - By geminis_demon"
LOGO="/usr/share/pixmaps/notify-send/wifislax_logo.png"
TMP="/tmp/WifislaxInstallerGUI"
THEME="/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc"
LIVEOS="/etc/wifislax-version"
LIVECD="/mnt/livemedia"
MODULES="$(cat /mnt/live/tmp/wifislax64-livedbg|grep ".xzm$")"
if [ ! -d "$LIVECD" ]; then
LIVECD="$(echo "$LIVECD"|sed 's#^#/mnt/live#')"
MODULES="$(echo "$MODULES"|sed 's#^#/mnt/live#')"
fi
[ ! -f "$THEME" ] && unset THEME
if [ ! -d "/mnt/live/memory/changes" ]; then
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--button "gtk-ok:0" \
--text-align "center" \
--text "\n\n\n Para utilizar este instalador debes iniciar Wifislax64 en modo live \n"
exit
fi
rm -rf "$TMP" && mkdir -p "$TMP"
(yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--no-buttons \
--progress --pulsate \
--text-align "center" \
--text "\n\n\n Identificando particiones... \n" \
& echo $! >"$TMP/pid")
lsblk -p -o KNAME,SIZE,FSTYPE -a|grep "ext[0-9]$" >"$TMP/particiones"
if [ -z "$(cat "$TMP/particiones")" ]; then
kill $(cat "$TMP/pid")
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--button "Abrir Gparted:0" \
--button "gtk-close:1" \
--text-align "center" \
--text "\n\n\n Primero debes crear una partición con formato ext4 \n"
case $? in
0) gparted; $0; exit;;
*) exit;;
esac
fi
cat /proc/mounts|awk '{print $2}'|grep "^$MOUNTPOINT"|grep -v /mnt/live|sort -r|xargs umount &>/dev/null
os-prober >"$TMP/os-prober" 2>/dev/null
cat "$TMP/particiones"|while read DEV SIZE FS; do
SO="$(grep "^$DEV" "$TMP/os-prober"|cut -d':' -f2|cut -d'(' -f1)"
[ -z "$SO" ] && SO="Ningún SO encontrado"
echo "$DEV | $SIZE | $SO"
done|tr '\n' '!' >"$TMP/menu_particiones"
kill $(cat "$TMP/pid")
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--button "gtk-ok:0" \
--button "gtk-cancel:1" \
--text-align "center" \
--text "\n\n Selecciona una partición: \n" \
--form --field="":CB "$(cat "$TMP/menu_particiones")" \
>"$TMP/return"
DEV="$(cat "$TMP/return"|cut -d' ' -f1)"
[ -z "$DEV" ] && exit
MNT="$(echo "$DEV"|sed 's/dev/mnt/')"
[ ! -d "$MNT" ] && mkdir -p "$MNT"
mount -t ext4 "$DEV" "$MNT"
if [ "$(ls -a "$MNT"|egrep -xv ".|..|lost\+found")" ]; then
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--button "gtk-ok:0" \
--button "gtk-no:1" \
--button "gtk-cancel:2" \
--text-align "center" \
--text "\n\n\n La partición $DEV no está vacía, \n ¿Desea formatear la partición? (RECOMENDADO) \n"
case $? in
0) (yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--no-buttons \
--progress --pulsate \
--text-align "center" \
--text "\n\n\n Formateando la partición $DEV... \n" \
& echo $! >"$TMP/pid")
umount "$DEV"
yes | mkfs.ext4 -t ext4 "$DEV"
if [ $? -ne 0 ]; then
kill $(cat "$TMP/pid")
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--button "gtk-ok:0" \
--text-align "center" \
--text "\n\n\n Ocurrió un error al formatear la partición, no se puede continuar \n"
exit
fi
;;
1) echo;;
*) exit;;
esac
fi
kill $(cat "$TMP/pid") 2>/dev/null
if [ ! "$(mount|grep "^$DEV")" ]; then
mount -t ext4 "$DEV" "$MNT"
if [ $? -ne 0 ]; then
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--button "gtk-ok:0" \
--text-align "center" \
--text "\n\n\n Ocurrió un error al montar la partición, no se puede continuar \n"
exit
fi
fi
N1="$(echo "$MODULES"|wc -l)"
N2=0
PROGRESS=0
echo 0 >"$TMP/progress_bar"
(for X in $MODULES; do
N2=$(($N2+1))
PORCENT=$(($(($N2*100))/$N1))
echo $PORCENT >"$TMP/progress_bar"
echo $PORCENT
[ $PORCENT -lt 100 ] && echo "#Progreso: ${PORCENT}%"||echo "#Realizando tareas finales..."
(echo
echo "Instalando $X"
unsquashfs -n -f -dest "${MNT}" "$X"
) 1>&2
done|\
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--no-buttons \
--progress \
--text-align "center" \
--text "\n\n\n Instalando Wifislax64 $(cat $LIVEOS|cut -d' ' -f2) en $DEV \n" \
& echo $! >"$TMP/pid")
while true; do sleep 1; [ $(cat "$TMP/progress_bar") -ge 100 ] && break; done
sed -i "1i $DEV / ext4 defaults 1 1" "$MNT/etc/fstab"
cp -rf "$LIVECD/boot/vmlinuz" "$MNT/boot/vmlinuz-$(uname -r)"
cp -rf /etc/timezone "$MNT/etc/"
cp -rf /etc/rc.d/rc.keymap "$MNT/etc/rc.d/"
cp -rf /etc/profile.d/lang.sh "$MNT/etc/profile.d/"
cp -rf /etc/X11/xorg.conf.d/30-keyboard.conf "$MNT/etc/X11/xorg.conf.d/"
tune2fs -L "$(cat $LIVEOS|tr ' ' '-')" "$DEV"
kill $(cat "$TMP/pid")
yad --on-top --center \
--width 500 \
--height 190 \
--gtkrc="$THEME" \
--title "$TITULO" \
--window-icon "$LOGO" \
--image "$LOGO" \
--button "gtk-ok:0" \
--text-align "center" \
--text "\n\n\n La instalación de Wifislax64 ha completado, \n se procederá a instalar el GRUB \n"
Grub2InstallerGUI
exit