seb diff seb @ rev 25

Tiny edits
author Paul Issott <paul@slitaz.org>
date Sun Mar 12 14:02:57 2017 +0000 (2017-03-12)
parents e7d8e4a84d42
children cb51498760ab
line diff
     1.1 --- a/seb	Wed Mar 08 00:57:02 2017 +0100
     1.2 +++ b/seb	Sun Mar 12 14:02:57 2017 +0000
     1.3 @@ -15,6 +15,7 @@
     1.4  [ "$work" ]  || work="$(pwd)"
     1.5  [ "$iso" ]   || iso="seb-os-$(date '+%Y%m%d').iso"
     1.6  [ "$linux" ] || linux="/boot/vmlinuz-$(uname -r)"
     1.7 +[ "$port" ] || port="8940"
     1.8  
     1.9  rootfs="$work/rootfs"
    1.10  rootiso="$work/rootiso"
    1.11 @@ -67,12 +68,14 @@
    1.12    -l  lsfs       List all files in rootfs (-type f)
    1.13    -v  vdisk      Create, mount or unmount a virtual disk
    1.14    -e  emu        Emulate ISO image with Qemu
    1.15 +  -w  web        Start seb graphical web interface
    1.16        env        Print current seb environment
    1.17  
    1.18  $(boldify "Options:")
    1.19    --work=        Path to build directory
    1.20    --iso=         Specify SliTaz Embedded ISO image name
    1.21    --linux=       Path to a custom Linux kernel
    1.22 +  --port=        Httpd port for the web interface
    1.23    --all          Clean all files including sebfs
    1.24    --emu          Emulate ISO image after build
    1.25    --check        Check a virtual disk image
    1.26 @@ -204,7 +207,7 @@
    1.27  		 "/lib/libresolv*" "/lib/libpthread*" "/lib/libdl*"
    1.28  
    1.29  	# Busybox applets
    1.30 -	action "Installing: busybox"
    1.31 +	echo -n "Installing: busybox"
    1.32  	cp -a /bin/busybox ${rootfs}/bin
    1.33  	chroot ${rootfs} /bin/busybox --install -s; check
    1.34  
    1.35 @@ -221,7 +224,7 @@
    1.36  	dumpkmap > ${rootfs}/usr/share/kmap/default; check
    1.37  	
    1.38  	# Kilo editor (20K) with syntax highlight and search (Thanks Paul :-)
    1.39 -	action "Installing: kilo text editor"
    1.40 +	echo -n "$(colorize 034 'Installing: kilo text editor')"
    1.41  	cp -a ${tools}/kilo ${rootfs}/usr/bin; check
    1.42  	
    1.43  	# Ncursesw && dialog for sebos and additional tools
    1.44 @@ -233,7 +236,7 @@
    1.45  	# /lib/libseb.sh & sebos config tool
    1.46  	echo -n "Installing: /lib/libseb.sh"
    1.47  	cp ${libseb} ${rootfs}/lib; check
    1.48 -	action "Installing: sebos config tool"
    1.49 +	echo -n "$(colorize 034 'Installing: sebos config tool')"
    1.50  	cp ${tools}/sebos ${rootfs}/usr/bin; check
    1.51  	
    1.52  	# httphelper.sh for amazing CGI/Shell functions
    1.53 @@ -286,7 +289,7 @@
    1.54  	chmod 0600 ${rootfs}/etc/busybox.conf
    1.55  
    1.56  	# Rootfs archive: lzma e -si -so
    1.57 -	action "Creating the initramfs..."
    1.58 +	echo -n "$(colorize 034 'Creating the initramfs...')"
    1.59  	cd ${rootfs}
    1.60  	find . -print | cpio -o -H newc | xz -9 --format=lzma \
    1.61  		> ${rootiso}/boot/rootfs.xz 2>/dev/null
    1.62 @@ -381,7 +384,7 @@
    1.63  	else
    1.64  		echo "Creating virtual disk image..."
    1.65  		dd if=/dev/zero of=${vdisk} bs=1M count=${vsize}
    1.66 -		action "Creating ext3 filesystem..."; echo
    1.67 +		colorize 034 "Creating ext3 filesystem..."
    1.68  		mkfs.ext3 -L "SebOShome" ${vdisk}
    1.69  	fi
    1.70  	
    1.71 @@ -445,6 +448,26 @@
    1.72  		title "Emulating: $iso"
    1.73  		emulate ${work}/${iso} 
    1.74  		footer ;;
    1.75 +	
    1.76 +	-w|web)
    1.77 +		pid=$(ps | grep 8940 | grep -v grep | awk '{print $1}')
    1.78 +		if [ "$stop" ] && [ "$pid" ]; then
    1.79 +			echo -n "Stopping Web interface... pid:"
    1.80 +			kill ${pid}; info 035 "$pid"; exit 0
    1.81 +		fi
    1.82 +		# Need the cgi script in server root
    1.83 +		if [ ! -f "$work/seb.cgi" ]; then
    1.84 +			cp ${tools}/web/seb.cgi .
    1.85 +		fi
    1.86 +		if [ "$pid" ]; then
    1.87 +			echo -n "Web interface is already running with pid:"
    1.88 +			info 035 "$pid"
    1.89 +		else
    1.90 +			echo -n "Starting web interface on port:"; info 035 "$port"
    1.91 +			httpd -p ${port} -u 0:0 -h ${work} \
    1.92 +				-c ${tools}/web/httpd.conf
    1.93 +		fi 
    1.94 +		tazweb --notoolbar http://localhost:${port}/ & ;;
    1.95  
    1.96  	env)
    1.97  		title "SEB environment"
    1.98 @@ -465,8 +488,12 @@
    1.99  		footer ;;
   1.100  	
   1.101  	-t|testsuite)
   1.102 -		# Development purpose
   1.103 -		${tools}/libseb.sh ;;
   1.104 +		# Development/debug purpose
   1.105 +		if [ -x "./libseb.sh" ]; then
   1.106 +			./libseb.sh
   1.107 +		else
   1.108 +			/lib/libseb.sh 
   1.109 +		fi ;;
   1.110  
   1.111  	*) help ;;
   1.112