wok rev 2346

Add slitaz-eeepc (tazeee, boot script, doc and more...)
author Christophe Lincoln <pankso@slitaz.org>
date Tue Mar 03 22:58:43 2009 +0100 (2009-03-03)
parents 803d63dde91f
children ac38c3a33f71
files slitaz-eeepc/receipt slitaz-eeepc/stuff/applications/tazeee.desktop slitaz-eeepc/stuff/eeepc.html slitaz-eeepc/stuff/eeepc.sh slitaz-eeepc/stuff/images/eeepc-logo.png slitaz-eeepc/stuff/pixmaps/tazeee.png slitaz-eeepc/stuff/tazeee
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/slitaz-eeepc/receipt	Tue Mar 03 22:58:43 2009 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="slitaz-eeepc"
     1.7 +VERSION="1.0"
     1.8 +CATEGORY="system-tools"
     1.9 +SHORT_DESC="SliTaz EeePC scripts and configurations files."
    1.10 +DEPENDS="915resolution dmidecode atl2 atl1e rt2860sta"
    1.11 +MAINTAINER="pankso@slitaz.org"
    1.12 +WEB_SITE="http://www.slitaz.org/"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +	mkdir -p \
    1.18 +		$fs/etc/init.d \
    1.19 +		$fs/etc/skel/Desktop \
    1.20 +		$fs/usr/share/doc/slitaz-flavors \
    1.21 +		$fs/sbin 
    1.22 +	# Tool and boot script
    1.23 +	cp stuff/eeepc.sh $fs/etc/init.d
    1.24 +	cp stuff/tazeee $fs/sbin
    1.25 +	# Images
    1.26 +	cp -a stuff/images $fs/usr/share
    1.27 +	cp -a stuff/pixmaps $fs/usr/share
    1.28 +	# Doc
    1.29 +	cp -a stuff/eeepc.html $fs/usr/share/doc/slitaz-flavors
    1.30 +	# Desktop icon
    1.31 +	cp -a stuff/applications/tazeee.desktop $fs/etc/skel/Desktop
    1.32 +	# Config
    1.33 +	touch $fs/etc/eeepc.conf
    1.34 +	chown -R root.root $fs
    1.35 +}
    1.36 +
    1.37 +pre_install()
    1.38 +{
    1.39 +	. $1/etc/rcS.conf
    1.40 +	sed -i s/'RUN_SCRIPTS="'/'RUN_SCRIPTS="eeepc.sh '/ $1/etc/rcS.conf
    1.41 +	# Load module ac and battery
    1.42 +	sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$LOAD_MODULES ac battery\""/ \
    1.43 +		$1/etc/rcS.conf
    1.44 +}
    1.45 +
    1.46 +pre_remove()
    1.47 +{
    1.48 +	sed -i s/'RUN_SCRIPTS="eeepc.sh '/'RUN_SCRIPTS="'/ /etc/rcS.conf
    1.49 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/slitaz-eeepc/stuff/applications/tazeee.desktop	Tue Mar 03 22:58:43 2009 +0100
     2.3 @@ -0,0 +1,6 @@
     2.4 +[Desktop Entry]
     2.5 +Name=SliTaz EeePC Box
     2.6 +Exec=tazeee box
     2.7 +Icon=tazeee.png
     2.8 +Type=Application
     2.9 +Categories=System
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/slitaz-eeepc/stuff/eeepc.html	Tue Mar 03 22:58:43 2009 +0100
     3.3 @@ -0,0 +1,84 @@
     3.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     3.5 +  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     3.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     3.7 +
     3.8 +<head>
     3.9 +	<title>SliTaz EeePC flavors</title>
    3.10 +	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
    3.11 +	<style type="text/css"><!--
    3.12 +	body { font: 90% sans-serif, vernada, arial; margin: 0; }
    3.13 +	#header { background: #f0ba08; color: black; height: 50px;
    3.14 +		border-top: 1px solid black; border-bottom: 1px solid black; }
    3.15 +	#content { margin: 0px 50px 26px 50px; }
    3.16 +	h1 { margin: 14px 0px 0px 16px; color: #3e1220; }
    3.17 +	h3 { color: #6c0023; }
    3.18 +	li { line-height: 1.4em; }
    3.19 +	pre { padding: 5px; color: black; background: #e1e0b0; }
    3.20 +	pre.script { padding: 10px; color: black; background: #e8e8e8;
    3.21 +		border: 1px inset #333333; }
    3.22 +	code { font-size: 100%; color: #669900; background: transparent; }
    3.23 +	hr { color: white; background: white; height: 1px; border: 0; }
    3.24 +	--></style>
    3.25 +</head>
    3.26 +
    3.27 +<body>
    3.28 +
    3.29 +<div id="header">
    3.30 +<h1>SliTaz GNU/Linux EeePC flavor</h1>
    3.31 +</div>
    3.32 +
    3.33 +<!-- Start content -->
    3.34 +<div id="content">
    3.35 +
    3.36 +<h3>About</h3>
    3.37 +<p>
    3.38 +Welcome to SliTaz EeePC flavor. This Live system can be used from a
    3.39 +cdrom on a standard desktop to create a Live USB system. On the EeePC
    3.40 +you can boot from a USB key or a SD card, just press <code>Esc</code>
    3.41 +when power on to select the wanted device. SliTaz EeePC flavor provide
    3.42 +the tools and drivers used on some EeePC: 701, 901, 1000.
    3.43 +</p>
    3.44 +
    3.45 +<h3>Live USB media</h3>
    3.46 +<p>
    3.47 +To use this system on the EeePC you need to creat a Live USB media, the
    3.48 +simplest option to generate such media is to boot the LiveCD on a standard
    3.49 +desktop and then run: System Tools &rarr; LiveUSB Tool. If you already run
    3.50 +SliTaz from the core LiveCD or an installed system, you can generate the
    3.51 +Live media using directly the ISO image. If you want to creat the media
    3.52 +with the command line, please read the Handbook or TazUSB manual.
    3.53 +</p>
    3.54 +
    3.55 +<h3>Networking</h3>
    3.56 +<p>
    3.57 +When booting the Live system on EeePC the Wireless nerwork interface is
    3.58 +enable by default if the driver is installed. To manage Wireless network
    3.59 +connection you can use Wifibox from the menu: System Tools &rarr; Wireless
    3.60 +networks connections. To use the Ethernet cable connection you can use Netbox
    3.61 +from the menu and start the DHCP client.
    3.62 +</p>
    3.63 +
    3.64 +<h3>Package slitaz-eeepc</h3>
    3.65 +<p>
    3.66 +The package slitaz-eeepc provide the small tool named <code>tazee</code>,
    3.67 +and the boot script to configure EeePC. The configuration is stored in
    3.68 +the file <code>/etc/eeepc.conf</code>, to see current configuration you
    3.69 +can open it in a text editor, use SliTaz EeePC Box from the menu or use
    3.70 +the command: <code>tazeee show-config</code>.
    3.71 +</p>
    3.72 +
    3.73 +<h3>Installation</h3>
    3.74 +<ul>
    3.75 +	<li>Boot from a LiveUSB media</li>
    3.76 +	<li>Start the installer with the dedicated button in Slitaz EeePC Box
    3.77 +	or use this command from a terminal: <code>su -c 'tazeee install'</code>.
    3.78 +	To use the first SSD disk: format /dev/hdc1 (on 901), install GRUB
    3.79 +	and then exit the installer to let tazeee finish the configuration.</li>
    3.80 +	<li>Reboot and enjoy</li>
    3.81 +</ul>
    3.82 +
    3.83 +<!-- End content -->
    3.84 +</div>
    3.85 +
    3.86 +</body>
    3.87 +</html>
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/slitaz-eeepc/stuff/eeepc.sh	Tue Mar 03 22:58:43 2009 +0100
     4.3 @@ -0,0 +1,20 @@
     4.4 +#!/bin/sh
     4.5 +#
     4.6 +# /etc/init.d/eeepc.sh: Script used at boot time to setup screen 
     4.7 +# resolution and configure hardware with tazeee on the EeePC.
     4.8 +# 
     4.9 +
    4.10 +# Setup is run only once.
    4.11 +if [ ! -s /etc/eeepc.conf ]; then
    4.12 +	/sbin/tazeee setup
    4.13 +fi
    4.14 +
    4.15 +. /etc/eeepc.conf
    4.16 +
    4.17 +# 915resolution screen hack.
    4.18 +[ -n "$HACK_915" ] && 915resolution $HACK_915
    4.19 +
    4.20 +# Enable Laptop mode
    4.21 +echo "5" > /proc/sys/vm/laptop_mode
    4.22 +
    4.23 +exit 0
     5.1 Binary file slitaz-eeepc/stuff/images/eeepc-logo.png has changed
     6.1 Binary file slitaz-eeepc/stuff/pixmaps/tazeee.png has changed
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/slitaz-eeepc/stuff/tazeee	Tue Mar 03 22:58:43 2009 +0100
     7.3 @@ -0,0 +1,168 @@
     7.4 +#!/bin/sh
     7.5 +#
     7.6 +# Configure SliTaz for EeePC. Tazee prodide first boot initialisation
     7.7 +# to configure the EeePC model and a GTK box to have quick access to 
     7.8 +# SliTaz EeePC stuff.
     7.9 +#
    7.10 +# 20090301 <pankso@slitaz.org> - GNU gpl v3.
    7.11 +#
    7.12 +: ${DIALOG=dialog}
    7.13 +
    7.14 +check_root()
    7.15 +{
    7.16 +	if test $(id -u) != 0 ; then
    7.17 +		echo -e "\nYou must be root to run `basename $0` with this option."
    7.18 +		echo -e "Please use 'su' and root password to become super-user.\n"
    7.19 +		exit 0
    7.20 +	fi
    7.21 +}
    7.22 +
    7.23 +get_model()
    7.24 +{
    7.25 +	EEEPC_MODEL=`dmidecode -s system-product-name`
    7.26 +	echo "EeePC model detected: $EEEPC_MODEL"
    7.27 +	# Create config file used at boot time by init script.
    7.28 +	cat > /etc/eeepc.conf << _EOF_
    7.29 +# EeePC configuration file for SliTaz GNU/Linux.
    7.30 +#
    7.31 +EEEPC_MODEL="$EEEPC_MODEL"
    7.32 +_EOF_
    7.33 +}
    7.34 +
    7.35 +# Specific model settings.
    7.36 +model_config()
    7.37 +{
    7.38 +	. /etc/eeepc.conf
    7.39 +	case $EEEPC_MODEL in
    7.40 +		701)
    7.41 +			KERNEL_MODULES='atl2'
    7.42 +			SCREEN_SIZE='800x480x24'
    7.43 +			HACK_915='5c 800 480 32' ;;
    7.44 +		901)
    7.45 +			KERNEL_MODULES='atl1e rt2860sta'
    7.46 +			SCREEN_SIZE='1024x600x24'
    7.47 +			HACK_915='54 1024 600 32'
    7.48 +			WIFI_INTERFACE='ra0' ;;
    7.49 +		1000)
    7.50 +			KERNEL_MODULES='atl1e rt2860sta'
    7.51 +			WIFI_INTERFACE='ra0' ;;
    7.52 +		*)
    7.53 +			echo "Skipping EeePC $EEEPC_MODEL setup..." && exit 0 ;;
    7.54 +	esac
    7.55 +	cat >> /etc/eeepc.conf << _EOF_
    7.56 +
    7.57 +# Screen
    7.58 +SCREEN_SIZE="$SCREEN_SIZE"
    7.59 +HACK_915="$HACK_915"
    7.60 +
    7.61 +# Network
    7.62 +KERNEL_MODULES="$KERNEL_MODULES"
    7.63 +WIFI_INTERFACE="$WIFI_INTERFACE"
    7.64 +_EOF_
    7.65 +}
    7.66 +
    7.67 +# Load module now and add them to LOAD_MODULE for next boot if installed
    7.68 +# With this /etc/init.d/network.sh will start the wireless interface.
    7.69 +load_modules()
    7.70 +{
    7.71 +	for mod in $KERNEL_MODULES
    7.72 +	do
    7.73 +		modprobe $mod
    7.74 +	done
    7.75 +	# Add module to rcS.conf and avoid duplication.
    7.76 +	. /etc/rcS.conf
    7.77 +	sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$LOAD_MODULES $KERNEL_MODULES\""/ \
    7.78 +		/etc/rcS.conf
    7.79 +}
    7.80 +
    7.81 +# Active wifi interface it will be configured by network.sh and config 
    7.82 +# LXpanel.
    7.83 +active_wifi()
    7.84 +{
    7.85 +	sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf
    7.86 +	sed -i s/'iface=eth0'/"iface=$WIFI_INTERFACE"/ \
    7.87 +		/etc/lxpanel/default/panels/panel
    7.88 +}
    7.89 +
    7.90 +# Small GTKdialog box the have quick access to slitaz-eeepc stuff.
    7.91 +box()
    7.92 +{
    7.93 +	export EEE_BOX='
    7.94 +<window title="SliTaz EeePC Box" icon-name="computer">
    7.95 +<vbox>
    7.96 +	<vbox>
    7.97 +		<pixmap>
    7.98 +			<input file>/usr/share/images/eeepc-logo.png</input>
    7.99 +		</pixmap>
   7.100 +		<text>
   7.101 +			<label>
   7.102 +"
   7.103 +Small interface to access SliTaz EeePC information and tools
   7.104 +"
   7.105 +			</label>
   7.106 +		</text>
   7.107 +	</vbox>
   7.108 +	<hbox>
   7.109 +		<button>
   7.110 +			<label>Documentation</label>
   7.111 +			<input file icon="help"></input>
   7.112 +			<action>firefox /usr/share/doc/slitaz-flavors/eeepc.html &</action>
   7.113 +		</button>
   7.114 +		<button>
   7.115 +			<label>Show configuration</label>
   7.116 +			<input file icon="computer"></input>
   7.117 +			<action>leafpad /etc/eeepc.conf &</action>
   7.118 +		</button>
   7.119 +		<button>
   7.120 +			<label>SSD/HDD install</label>
   7.121 +			<input file icon="system-installer"></input>
   7.122 +			<action>subox "xterm -e tazeee install" &</action>
   7.123 +		</button>
   7.124 +		<button>
   7.125 +			<label>Exit</label>
   7.126 +			<input file icon="exit"></input>	
   7.127 +			<action type="exit">exit</action>
   7.128 +		</button>
   7.129 +	</hbox>
   7.130 +</vbox>
   7.131 +</window>'
   7.132 +	gtkdialog --center --program=EEE_BOX
   7.133 +}
   7.134 +
   7.135 +case $1 in
   7.136 +	setup)
   7.137 +		check_root
   7.138 +		get_model
   7.139 +		model_config
   7.140 +		load_modules
   7.141 +		[ -n $WIFI_INTERFACE ] && active_wifi
   7.142 +		echo "EeePC setup completed..." ;;
   7.143 +	box)
   7.144 +		box ;;
   7.145 +	show-config)
   7.146 +		echo ""
   7.147 +		cat /etc/eeepc.conf
   7.148 +		echo "" ;;
   7.149 +	install)
   7.150 +		# EeePC havn't got a cdrom so we must fake it.
   7.151 +		echo ""
   7.152 +		echo "Starting SliTaz EeePC installation..."
   7.153 +		echo "Please do not reboot trought the installer, just exit."
   7.154 +		sleep 4
   7.155 +		rmdir /media/cdrom
   7.156 +		ln -s /home /media/cdrom
   7.157 +		slitaz-installer
   7.158 +		# Installer/GBUB see /dev/hdc1 as (hd2,0) --> we need (hd0,0)
   7.159 +		mount /dev/hdc1 /mnt/target 2>/dev/null
   7.160 +		if grep -q 'root=/dev/hdc1' /mnt/target/boot/grub/menu.lst 2>/dev/null; then
   7.161 +			sed -i s/'(hd2,0)'/'(hd0,0)'/ /mnt/target/boot/grub/menu.lst
   7.162 +		fi
   7.163 +		umount /mnt/target 2>/dev/null
   7.164 +		echo ""
   7.165 +		echo "Installation completed. You can now reboot your EeePC"
   7.166 +		echo "" ;;
   7.167 +	*)
   7.168 +		echo -e "\nUsage: `basename $0` [setup|box|show-config|install]\n" ;;
   7.169 +esac
   7.170 +
   7.171 +exit 0