# HG changeset patch # User Christophe Lincoln # Date 1236117523 -3600 # Node ID 10d656b138ba31702d5c7adb9998bfa296928112 # Parent 803d63dde91f3513337b3168624f66333898bbaf Add slitaz-eeepc (tazeee, boot script, doc and more...) diff -r 803d63dde91f -r 10d656b138ba slitaz-eeepc/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-eeepc/receipt Tue Mar 03 22:58:43 2009 +0100 @@ -0,0 +1,46 @@ +# SliTaz package receipt. + +PACKAGE="slitaz-eeepc" +VERSION="1.0" +CATEGORY="system-tools" +SHORT_DESC="SliTaz EeePC scripts and configurations files." +DEPENDS="915resolution dmidecode atl2 atl1e rt2860sta" +MAINTAINER="pankso@slitaz.org" +WEB_SITE="http://www.slitaz.org/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p \ + $fs/etc/init.d \ + $fs/etc/skel/Desktop \ + $fs/usr/share/doc/slitaz-flavors \ + $fs/sbin + # Tool and boot script + cp stuff/eeepc.sh $fs/etc/init.d + cp stuff/tazeee $fs/sbin + # Images + cp -a stuff/images $fs/usr/share + cp -a stuff/pixmaps $fs/usr/share + # Doc + cp -a stuff/eeepc.html $fs/usr/share/doc/slitaz-flavors + # Desktop icon + cp -a stuff/applications/tazeee.desktop $fs/etc/skel/Desktop + # Config + touch $fs/etc/eeepc.conf + chown -R root.root $fs +} + +pre_install() +{ + . $1/etc/rcS.conf + sed -i s/'RUN_SCRIPTS="'/'RUN_SCRIPTS="eeepc.sh '/ $1/etc/rcS.conf + # Load module ac and battery + sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$LOAD_MODULES ac battery\""/ \ + $1/etc/rcS.conf +} + +pre_remove() +{ + sed -i s/'RUN_SCRIPTS="eeepc.sh '/'RUN_SCRIPTS="'/ /etc/rcS.conf +} diff -r 803d63dde91f -r 10d656b138ba slitaz-eeepc/stuff/applications/tazeee.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-eeepc/stuff/applications/tazeee.desktop Tue Mar 03 22:58:43 2009 +0100 @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=SliTaz EeePC Box +Exec=tazeee box +Icon=tazeee.png +Type=Application +Categories=System diff -r 803d63dde91f -r 10d656b138ba slitaz-eeepc/stuff/eeepc.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-eeepc/stuff/eeepc.html Tue Mar 03 22:58:43 2009 +0100 @@ -0,0 +1,84 @@ + + + + + SliTaz EeePC flavors + + + + + + + + + +
+ +

About

+

+Welcome to SliTaz EeePC flavor. This Live system can be used from a +cdrom on a standard desktop to create a Live USB system. On the EeePC +you can boot from a USB key or a SD card, just press Esc +when power on to select the wanted device. SliTaz EeePC flavor provide +the tools and drivers used on some EeePC: 701, 901, 1000. +

+ +

Live USB media

+

+To use this system on the EeePC you need to creat a Live USB media, the +simplest option to generate such media is to boot the LiveCD on a standard +desktop and then run: System Tools → LiveUSB Tool. If you already run +SliTaz from the core LiveCD or an installed system, you can generate the +Live media using directly the ISO image. If you want to creat the media +with the command line, please read the Handbook or TazUSB manual. +

+ +

Networking

+

+When booting the Live system on EeePC the Wireless nerwork interface is +enable by default if the driver is installed. To manage Wireless network +connection you can use Wifibox from the menu: System Tools → Wireless +networks connections. To use the Ethernet cable connection you can use Netbox +from the menu and start the DHCP client. +

+ +

Package slitaz-eeepc

+

+The package slitaz-eeepc provide the small tool named tazee, +and the boot script to configure EeePC. The configuration is stored in +the file /etc/eeepc.conf, to see current configuration you +can open it in a text editor, use SliTaz EeePC Box from the menu or use +the command: tazeee show-config. +

+ +

Installation

+ + + +
+ + + diff -r 803d63dde91f -r 10d656b138ba slitaz-eeepc/stuff/eeepc.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-eeepc/stuff/eeepc.sh Tue Mar 03 22:58:43 2009 +0100 @@ -0,0 +1,20 @@ +#!/bin/sh +# +# /etc/init.d/eeepc.sh: Script used at boot time to setup screen +# resolution and configure hardware with tazeee on the EeePC. +# + +# Setup is run only once. +if [ ! -s /etc/eeepc.conf ]; then + /sbin/tazeee setup +fi + +. /etc/eeepc.conf + +# 915resolution screen hack. +[ -n "$HACK_915" ] && 915resolution $HACK_915 + +# Enable Laptop mode +echo "5" > /proc/sys/vm/laptop_mode + +exit 0 diff -r 803d63dde91f -r 10d656b138ba slitaz-eeepc/stuff/images/eeepc-logo.png Binary file slitaz-eeepc/stuff/images/eeepc-logo.png has changed diff -r 803d63dde91f -r 10d656b138ba slitaz-eeepc/stuff/pixmaps/tazeee.png Binary file slitaz-eeepc/stuff/pixmaps/tazeee.png has changed diff -r 803d63dde91f -r 10d656b138ba slitaz-eeepc/stuff/tazeee --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-eeepc/stuff/tazeee Tue Mar 03 22:58:43 2009 +0100 @@ -0,0 +1,168 @@ +#!/bin/sh +# +# Configure SliTaz for EeePC. Tazee prodide first boot initialisation +# to configure the EeePC model and a GTK box to have quick access to +# SliTaz EeePC stuff. +# +# 20090301 - GNU gpl v3. +# +: ${DIALOG=dialog} + +check_root() +{ + if test $(id -u) != 0 ; then + echo -e "\nYou must be root to run `basename $0` with this option." + echo -e "Please use 'su' and root password to become super-user.\n" + exit 0 + fi +} + +get_model() +{ + EEEPC_MODEL=`dmidecode -s system-product-name` + echo "EeePC model detected: $EEEPC_MODEL" + # Create config file used at boot time by init script. + cat > /etc/eeepc.conf << _EOF_ +# EeePC configuration file for SliTaz GNU/Linux. +# +EEEPC_MODEL="$EEEPC_MODEL" +_EOF_ +} + +# Specific model settings. +model_config() +{ + . /etc/eeepc.conf + case $EEEPC_MODEL in + 701) + KERNEL_MODULES='atl2' + SCREEN_SIZE='800x480x24' + HACK_915='5c 800 480 32' ;; + 901) + KERNEL_MODULES='atl1e rt2860sta' + SCREEN_SIZE='1024x600x24' + HACK_915='54 1024 600 32' + WIFI_INTERFACE='ra0' ;; + 1000) + KERNEL_MODULES='atl1e rt2860sta' + WIFI_INTERFACE='ra0' ;; + *) + echo "Skipping EeePC $EEEPC_MODEL setup..." && exit 0 ;; + esac + cat >> /etc/eeepc.conf << _EOF_ + +# Screen +SCREEN_SIZE="$SCREEN_SIZE" +HACK_915="$HACK_915" + +# Network +KERNEL_MODULES="$KERNEL_MODULES" +WIFI_INTERFACE="$WIFI_INTERFACE" +_EOF_ +} + +# Load module now and add them to LOAD_MODULE for next boot if installed +# With this /etc/init.d/network.sh will start the wireless interface. +load_modules() +{ + for mod in $KERNEL_MODULES + do + modprobe $mod + done + # Add module to rcS.conf and avoid duplication. + . /etc/rcS.conf + sed -i s/"LOAD_MODULES=\"$LOAD_MODULES\""/"LOAD_MODULES=\"$LOAD_MODULES $KERNEL_MODULES\""/ \ + /etc/rcS.conf +} + +# Active wifi interface it will be configured by network.sh and config +# LXpanel. +active_wifi() +{ + sed -i s/'WIFI="no"'/'WIFI="yes"'/ /etc/network.conf + sed -i s/'iface=eth0'/"iface=$WIFI_INTERFACE"/ \ + /etc/lxpanel/default/panels/panel +} + +# Small GTKdialog box the have quick access to slitaz-eeepc stuff. +box() +{ + export EEE_BOX=' + + + + + /usr/share/images/eeepc-logo.png + + + + + + + + + + + + +' + gtkdialog --center --program=EEE_BOX +} + +case $1 in + setup) + check_root + get_model + model_config + load_modules + [ -n $WIFI_INTERFACE ] && active_wifi + echo "EeePC setup completed..." ;; + box) + box ;; + show-config) + echo "" + cat /etc/eeepc.conf + echo "" ;; + install) + # EeePC havn't got a cdrom so we must fake it. + echo "" + echo "Starting SliTaz EeePC installation..." + echo "Please do not reboot trought the installer, just exit." + sleep 4 + rmdir /media/cdrom + ln -s /home /media/cdrom + slitaz-installer + # Installer/GBUB see /dev/hdc1 as (hd2,0) --> we need (hd0,0) + mount /dev/hdc1 /mnt/target 2>/dev/null + if grep -q 'root=/dev/hdc1' /mnt/target/boot/grub/menu.lst 2>/dev/null; then + sed -i s/'(hd2,0)'/'(hd0,0)'/ /mnt/target/boot/grub/menu.lst + fi + umount /mnt/target 2>/dev/null + echo "" + echo "Installation completed. You can now reboot your EeePC" + echo "" ;; + *) + echo -e "\nUsage: `basename $0` [setup|box|show-config|install]\n" ;; +esac + +exit 0