Changes between Version 11 and Version 12 of Debian gen8

Show
Ignore:
Timestamp:
05/15/11 13:56:54 (2 years ago)
Author:
divx118
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Debian gen8

    v11 v12  
    329329}}} 
    330330 
    331 More to come... 
     331 
     332== 11) Startup script == 
     333 
     334We are going to make a startup script to automate some of the tasks and to be able to use some modules from archos android. 
     335The script will be started from rc.local, in the future it is probably better to use a /etc/init.d script, but for now it will do.  
     336Edit the script and then use chmod to make it executable. 
     337 
     338{{{ 
     339sudo gedit ./debianlxdefinal/etc/rc.local 
     340sudo chmod +x ./debianlxdefinal/etc/rc.local 
     341}}} 
     342 
     343{{{ 
     344#!sh 
     345#!/bin/sh 
     346# 
     347# rc.local 
     348# 
     349# This script is executed at the end of each multiuser runlevel. 
     350# Make sure that the script will "exit 0" on success or any other 
     351# value on error. 
     352# 
     353# In order to enable or disable this script just change the execution 
     354# bits. 
     355# 
     356# By default this script does nothing. 
     357 
     358# Start loading script and log it 
     359/etc/startup.sh 1> /var/log/startup.log 2>&1 
     360exit 0 
     361 
     362}}} 
     363 
     364I also added a log file which will appear in /var/log/ as startup.log, so we can see if something goes wrong. 
     365 
     366Now the actual startup.sh  
     367 
     368{{{ 
     369#!sh 
     370#!/bin/sh 
     371# 
     372# startup.sh 
     373# 
     374###################################################### 
     375# Script to do get some stuff done before logging in.# 
     376###################################################### 
     377 
     378 
     379echo "mount /dev/mmcblk0p2 on /media/" 
     380mount /dev/mmcblk0p2 /media/ 
     381echo "Mount the android squashfs to steal some modules and other stuff :)" 
     382if [ -d "/android" ]; then 
     383 echo "android exists" 
     384else 
     385mkdir /android 
     386fi 
     387mount -o loop,offset=256 /media/androidmerged.squashfs.secure /android 
     388if [ -d "/media/data" ]; then 
     389 echo "/media/data exists" 
     390else 
     391mkdir /media/data 
     392fi 
     393 
     394echo "mount /dev/mmcblk0p4 on /media/data" 
     395mount /dev/mmcblk0p4 /media/data 
     396echo "copy the ini file and calibration file needed for wifi" 
     397if [ -f "/wifi/wlanconf.nvs" ]; then 
     398 echo "/wifi/wlanconf.nvs exists" 
     399else 
     400cp /media/data/misc/wifi/wlanconf.nvs /wifi 
     401fi 
     402if [ -f "/wifi/tiwlan.ini" ]; then 
     403 echo "/wifi/tiwlan.ini exists" 
     404else 
     405cp /media/data/misc/wifi/tiwlan.ini /wifi 
     406fi 
     407 
     408echo "Make a symlink system in root because batteryd must be run from /system/bin, because archos probably used hardlinks in it" 
     409if [ -L "/system" ]; then 
     410 echo "system exists" 
     411else 
     412ln -s /android/system /system 
     413fi 
     414 
     415echo "run battery daemon at 10 seconds interval" 
     416/system/bin/batteryd -i 10 & 
     417 
     418echo "load the module and firmware for wifi" 
     419insmod /wifi/tiwlan_drv.ko 
     420/wifi/tiwlan_loader -i /wifi/tiwlan.ini -f /wifi/firmware.bin -e /wifi/wlanconf.nvs 
     421echo "End this script :)" 
     422 
     423}}} 
     424 
     425Still not finished yet... 
     426 
     427 
     428 
     429 
     430 
    332431 
    333432