slitaz-tools diff tinyutils/tazhw @ rev 578

Update scpbox.pt & subox.pt
author Claudinei Pereira <claudinei@slitaz.org>
date Fri Apr 29 16:10:46 2011 +0000 (2011-04-29)
parents 7d7b2a312362
children 49323f31a7a5
line diff
     1.1 --- a/tinyutils/tazhw	Tue Feb 23 16:22:49 2010 +0000
     1.2 +++ b/tinyutils/tazhw	Fri Apr 29 16:10:46 2011 +0000
     1.3 @@ -8,18 +8,22 @@
     1.4  #
     1.5  # (c) 2009 SliTaz GNU/Linux - GNU gpl v3
     1.6  #
     1.7 +# Authors : Christophe Lincoln <pankso@slitaz.org>
     1.8 +#			Rohit Joshi <jozee@slitaz.org>
     1.9 +#
    1.10  
    1.11  usage()
    1.12  {
    1.13  	echo -e "\nSliTaz Hardware configuration\n
    1.14  \033[1mUsage: \033[0m `basename $0` [command] [--option]
    1.15  \033[1mCommands: \033[0m\n
    1.16 -  usage             Print this short usage.
    1.17 -  box               Start in graphical mode.
    1.18 -  init              Used at boot time to configure devices.
    1.19 -  detect-pci        Detect all PCI devices.
    1.20 -  detect-usb        Detect all USB devices.
    1.21 -  detected-modules  List all detected Kernel modules.
    1.22 +  usage			Print this short usage.
    1.23 +  box			Start in graphical mode.
    1.24 +  init			Used at boot time to configure devices.
    1.25 +  setup			Setup hardware devices.
    1.26 +  detect-pci		Detect all PCI devices.
    1.27 +  detect-usb		Detect all USB devices.
    1.28 +  detected-modules	List all detected Kernel modules.
    1.29    
    1.30  \033[1mOptions: \033[0m\n
    1.31    --get-firmware    Get and install non-free firmware (PCI and USB).\n"
    1.32 @@ -164,46 +168,146 @@
    1.33  	fi
    1.34  }
    1.35  
    1.36 +box_setup_devices()
    1.37 +{
    1.38 +	SETUP_OPTIONS=""
    1.39 +	if [ $INSTALL_NON_FREE == true ]; then 
    1.40 +		SETUP_OPTIONS="$SETUP_OPTIONS --non-free"				
    1.41 +	fi
    1.42 +	if [ $AUTO_INSTALL_SUGGESTED == true ]; then
    1.43 +		SETUP_OPTIONS="$SETUP_OPTIONS --suggested"	
    1.44 +	elif [ $CONFIRM_INSTALL_SUGGESTED == true ]; then
    1.45 +		SETUP_OPTIONS="$SETUP_OPTIONS --confirm"		
    1.46 +	fi	
    1.47 +	xterm -geometry 80x24 -T "$DEVICE Setup" \
    1.48 +		-e "$0 setup $DEVICE $SETUP_OPTIONS; \
    1.49 +		echo -e \"----\nPress ENTER to close...\"; \
    1.50 +		read i; exit 0"    	
    1.51 +}
    1.52 +
    1.53  box()
    1.54  {
    1.55  	export BIN=$0
    1.56  	export MAIN_DIALOG='
    1.57 -<window title="Tazhw Box" icon-name="computer">
    1.58 +<window title="Tazhw box" icon-name="computer">
    1.59  <vbox>
    1.60 + 	<text width-chars="54" use-markup="true">
    1.61 +		<label>"
    1.62 +			<b>Hardware auto-detection and configuration tool</b>
    1.63 +		"</label>
    1.64 +	</text>		
    1.65 +	<frame Loaded Kernel Modules>
    1.66 +		<vbox>
    1.67 +			<tree>
    1.68 +				<width>470</width><height>180</height>
    1.69 +				<variable>MODULE</variable>
    1.70 +				<label>Module|Description</label>
    1.71 +				<input>$BIN box_list</input>
    1.72 +				<action>refresh:MODULE</action>
    1.73 +			</tree>
    1.74 +			<hbox>
    1.75 +				<checkbox>
    1.76 +					<label>Auto install non-free Firmware       </label>
    1.77 +					<variable>INSTALL_FIRMARE</variable>
    1.78 +					<default>true</default>
    1.79 +				</checkbox>
    1.80 +				<button>
    1.81 +					<label>Discover PCI/USB devices</label>
    1.82 +					<input file icon="folder-saved-search"></input>
    1.83 +					<action>$BIN box_detect_devices</action>
    1.84 +					<action>refresh:MODULE</action>
    1.85 +				</button>		
    1.86 +			</hbox>
    1.87 +		</vbox>
    1.88 +	</frame>
    1.89 +	<frame Hardware Setup>
    1.90 +		<hbox>
    1.91 +				<button>
    1.92 +					<label>Printer</label>
    1.93 +					<input file icon="printer"></input>
    1.94 +					<action>export DEVICE="printer";$BIN box_setup_devices</action>
    1.95 +				</button>	
    1.96 +				<button>
    1.97 +					<label>Scanner</label>
    1.98 +					<input file icon="x-office-document"></input>
    1.99 +					<action>export DEVICE="scanner";$BIN box_setup_devices</action>
   1.100 +				</button>				
   1.101 +				<button>
   1.102 +					<label>3G-Modem</label>
   1.103 +					<input file icon="network-transmit-receive"></input>
   1.104 +					<action>export DEVICE="3g-modem";$BIN box_setup_devices</action>
   1.105 +				</button>	
   1.106 +				<button>
   1.107 +					<label>Nvidia</label>
   1.108 +					<input file icon="video-display"></input>
   1.109 +					<action>export DEVICE="nvidia";$BIN box_setup_devices</action>
   1.110 +				</button>
   1.111 +				<button>
   1.112 +					<label>ATI Radeon</label>
   1.113 +					<input file icon="video-display"></input>
   1.114 +					<action>export DEVICE="ati";$BIN box_setup_devices</action>
   1.115 +				</button>				
   1.116 +				
   1.117 +			</hbox>
   1.118 +			<hbox>
   1.119 +			   <button>
   1.120 +					<label>Webcam     </label>
   1.121 +					<input file icon="camera-video"></input>
   1.122 +					<action>export DEVICE="webcam";$BIN box_setup_devices</action>
   1.123 +				</button>
   1.124 +				
   1.125 +					<button>
   1.126 +					<label>Digital Camera    </label>
   1.127 +					<input file icon="camera-photo"></input>
   1.128 +					<action>export DEVICE="camera";$BIN box_setup_devices</action>
   1.129 +				</button>
   1.130 +				 <button>
   1.131 +					<label>Bluetooth   </label>
   1.132 +					<input file icon="preferences-desktop-multimedia"></input>
   1.133 +					<action>export DEVICE="bluetooth";$BIN box_setup_devices</action>
   1.134 +				</button>
   1.135 +				
   1.136 +				<button>
   1.137 +					<label>Firewall    </label>
   1.138 +					<input file icon="gtk-network"></input>
   1.139 +					<action>export DEVICE="firewall";$BIN box_setup_devices</action>
   1.140 +				</button>
   1.141 +			
   1.142 +			</hbox>	
   1.143 +			<hbox>
   1.144 +				<checkbox>
   1.145 +					<label>Install non-free packages      </label>
   1.146 +					<variable>INSTALL_NON_FREE</variable>
   1.147 +					<default>true</default>					
   1.148 +				</checkbox>
   1.149 +				<checkbox>
   1.150 +					<label>Auto-install all optional packages    </label>
   1.151 +					<variable>AUTO_INSTALL_SUGGESTED</variable>
   1.152 +					<default>false</default>					
   1.153 +				</checkbox>
   1.154 +											
   1.155 +			</hbox>
   1.156 +			<hbox>			
   1.157 +				<checkbox>
   1.158 +					<label>Choose optional packages to install</label>
   1.159 +					<variable>CONFIRM_INSTALL_SUGGESTED</variable>
   1.160 +					<default>false</default>					
   1.161 +				</checkbox>	
   1.162 +			</hbox>
   1.163  	
   1.164 -	<text width-chars="54" use-markup="true">
   1.165 -		<label>"
   1.166 -<b>Hardware auto-detection and configuration tool</b>
   1.167 -		"</label>
   1.168 -	</text>
   1.169 -	<tree>
   1.170 -		<width>520</width><height>180</height>
   1.171 -		<variable>MODULE</variable>
   1.172 -		<label>Kernel Module|Description</label>
   1.173 -		<input>$BIN box_list</input>
   1.174 -		<action>refresh:MODULE</action>
   1.175 -	</tree>
   1.176 +	</frame>
   1.177  	<hbox>
   1.178 -		<checkbox>
   1.179 -			<label>Auto install non-free Firmware</label>
   1.180 -			<variable>INSTALL_FIRMARE</variable>
   1.181 -			<default>true</default>
   1.182 -		</checkbox>
   1.183  		<button>
   1.184 -			<label>Detect PCI/USB devices</label>
   1.185 -			<input file icon="forward"></input>
   1.186 -			<action>$BIN box_detect_devices</action>
   1.187 -			<action>refresh:MODULE</action>
   1.188 -		</button>
   1.189 -		<button>
   1.190 -			<label>Exit</label>
   1.191 -			<input file icon="exit"></input>
   1.192 -			<action type="exit">Exit</action>
   1.193 -		</button>
   1.194 -	</hbox>
   1.195 +				<label>Exit</label>
   1.196 +				<input file icon="exit"></input>
   1.197 +				<action type="exit">Exit</action>
   1.198 +			</button>
   1.199 +    </hbox>
   1.200 +
   1.201  </vbox>
   1.202  </window>'
   1.203 -	gtkdialog --center --program=MAIN_DIALOG >/dev/null
   1.204 +   
   1.205 +   	gtkdialog --center --program=MAIN_DIALOG >/dev/null
   1.206  }
   1.207  
   1.208  # Get firmware used by check_firmware()
   1.209 @@ -231,6 +335,9 @@
   1.210  		rm -f /var/lib/detected-usb-modules
   1.211  		detect_usb_devices
   1.212  		display_line && echo "" ;;
   1.213 +	setup) 
   1.214 +		SETUP_OPTIONS=`echo "$@" | sed 's/setup//' `
   1.215 +		hwsetup $SETUP_OPTIONS ;;
   1.216  	box*)
   1.217  		box_check_root
   1.218  		$1 ;;