# HG changeset patch # User Pascal Bellard # Date 1372530041 -7200 # Node ID bcdab80798a7160be93ffd2fd9f3b5a6f46f90e4 # Parent 0051c77af248d2493352919c0ad5ec659a32b257 Add tazpanel files diff -r 0051c77af248 -r bcdab80798a7 Makefile --- a/Makefile Mon Jun 17 12:46:34 2013 +0200 +++ b/Makefile Sat Jun 29 20:20:41 2013 +0200 @@ -37,8 +37,11 @@ install -m 0755 -d $(DESTDIR)/etc/tazlito install -m 0644 tazlito.conf $(DESTDIR)/etc/tazlito install -m 0755 -d $(DESTDIR)/usr/share/doc + install -m 0755 -d $(DESTDIR)/var/www/tazpanel/menu.d cp -a applications $(DESTDIR)/usr/share cp -a doc $(DESTDIR)/usr/share/doc/tazlito + cp -a live.cgi $(DESTDIR)/var/www/tazpanel + cp -a live $(DESTDIR)/var/www/tazpanel/menu.d # i18n mkdir -p $(DESTDIR)$(PREFIX)/share/locale cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale @@ -48,9 +51,11 @@ uninstall: rm -f $(PREFIX)/bin/tazlito rm -f $(PREFIX)/bin/tazlito-wiz - rm -rf /etc/tazlito - rm -rf /usr/share/doc/tazlito - rm -rf /usr/share/applications/tazlito*.desktop + rm -f $(PREFIX)/var/www/tazpanel/menu.d/live + rm -f $(PREFIX)/var/www/tazpanel/live.cgi + rm -rf $(PREFIX)/etc/tazlito + rm -rf $(PREFIX)/usr/share/doc/tazlito + rm -rf $(PREFIX)/usr/share/applications/tazlito*.desktop rm -rf $(PREFIX)/share/locale/*/LC_MESSAGES/tazlito*.mo clean: diff -r 0051c77af248 -r bcdab80798a7 live --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/live Sat Jun 29 20:20:41 2013 +0200 @@ -0,0 +1,11 @@ +cat <$(gettext 'Live') + + +EOT diff -r 0051c77af248 -r bcdab80798a7 live.cgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/live.cgi Sat Jun 29 20:20:41 2013 +0200 @@ -0,0 +1,268 @@ +#!/bin/sh +# +# CGI interface for SliTaz Live systems using Tazlito and TazUSB. +# +# Copyright (C) 2011 SliTaz GNU/Linux - BSD License +# + +if [ "$1" == "call" ]; then + case "$2" in + merge_cleanup) + mv -f $3.merged $3 + for i in $4/*; do + umount -d $i + done + rm -rf $4 + exit ;; + esac +fi + +# Common functions from libtazpanel +. lib/libtazpanel +get_config +header + +TITLE=$(gettext 'TazPanel - Live') + +# Build arguments to create a meta iso using 'tazlito merge' command +merge_args() +{ + tmp=$1 + first=true + i=1 + while [ -n "$(GET input$i)" ]; do + echo "$(stat -c "%s" $(GET input$i)) $(GET input$i) $(GET ram$i)" + $((i++)) + done | sort -nr | while read size file ram; do + if $first; then + cp $file $(GET metaoutput) + echo -n "$ram $(GET metaoutput) " + first=false + continue + fi + dir=$tmp/$(basename $file) + mkdir $dir + mount -o loop,ro $file $dir + echo -n "$ram $dir/boot/rootfs.gz " + done +} + +# +# Commands executed in Xterm first +# + +case " $(GET) " in + *\ write_iso\ *) + $TERMINAL $TERM_OPTS \ + -T "write-iso" \ + -e "tazlito writeiso $(GET write_iso)" & ;; + *\ loramoutput\ *) + $TERMINAL $TERM_OPTS \ + -T "build loram iso" \ + -e "tazlito build-loram $(GET input) $(GET loramoutput) $(GET type)" & ;; + *\ meta\ *) + tmp=/tmp/$(basename $0).$$ + cleanup="sh $0 call merge_cleanup $(GET output) $tmp" + $TERMINAL $TERM_OPTS \ + -T "build meta iso" \ + -e "tazlito merge $(merge_args $tmp); \ + gettext 'ENTER to quit'; read i; \ + $cleanup" & ;; + *\ hybrid\ *) + $TERMINAL $TERM_OPTS \ + -T "build hybrid iso" \ + -e "iso2exe $(GET input)" & ;; +esac + +# +# Commands +# + +case " $(GET) " in + *\ create\ *) + # + # Create a flavor file and ISO in options with all settings + # Step by step interface and store files in cache. + # + gettext 'TODO' ;; + *\ liveusb\ *) + xhtml_header + cat << EOT +
+

$(gettext 'SliTaz LiveUSB')

+

$(gettext 'Create Live USB SliTaz systems')

+

+ +

$(gettext "Generate SliTaz LiveUSB media and boot in RAM! Insert a LiveCD \ +into the cdrom drive, select the correct device and press Generate.")

+ +
+ + $(gettext 'USB Media to use:') + + +
+EOT + if [ "$(GET gen)" ]; then + cat << EOT +

tazusb gen-liveusb $(GET gen)

+
+EOT
+			# No pipe here so output is displayed in realtime
+			yes | tazusb gen-liveusb $(GET gen)
+			echo '
' + fi ;; + *) + # + # Default xHTML content + # + xhtml_header + cat << EOT +
+

$(gettext 'SliTaz Live Systems')

+

$(gettext 'Create and manage Live CD or USB SliTaz systems')

+

+ + + + + + + +

$(gettext 'Live CD tools')

+ +

$(gettext 'Convert ISO to loram')

+ +

$(gettext "This command will convert an ISO image of a SliTaz Live CD to a \ +new ISO image requiring less RAM to run.")

+ +
+ + + + + + + + + + + + + + + + +
$(gettext 'ISO to convert') +
+ +
+ +
+ +
$(gettext 'ISO to create') + +
+ +
+ + +

$(gettext 'Build a hybrid ISO')

+ +

$(gettext "Add a master boot sector and a EXE header to the ISO image. \ +")

+ +
+ + + + +
+ $(gettext 'ISO to convert') + +
+ +
+ +

$(gettext 'Build a meta ISO')

+ +

$(gettext "Combines several ISO flavors like nested Russian dolls. The \ +amount of RAM available at startup will be used to select the utmost one.")

+ +
+ +EOT + i="" + while [ -n "$(GET addmeta)" ]; do + [ -n "$(GET input$i)" ] || break + j=$(($i + 1)) + cat << EOT + + + + +EOT + i=$j + done + metaoutput="$(GET metaoutput)" + [ -n "$metaoutput" ] || metaoutput="/root/meta.iso" + + cat << EOT + + + + + + + +
$(gettext 'ISO number') $j: $(GET input$i) + + $(gettext 'Minimum RAM'): $(GET ram$i) + +
$(gettext 'ISO to add') + + $(gettext 'Minimum RAM') + + +
$(gettext 'ISO to create') + +
+ +
+ +EOT + ;; +esac + +xhtml_footer +exit 0