User:Ixo/Script

From OLPC
< User:Ixo
Revision as of 01:18, 10 February 2008 by Ixo (talk | contribs) (draft it and move get-ixo to separate page.)
Jump to navigation Jump to search


Pencil.png NOTE: The contents of this page are not set in stone, and are subject to change!

This page is a draft in active flux ...
Please leave suggestions on the talk page.

Pencil.png


Various bash scripts, frequently used.

Notes
  • After creating the script, the 'x' execute bit must be set, 'chmod x+a FILENAME'.
  • All submitted under CC-BY-SA-NC 3.0 license.
  • I know bash not python, so if you want to offer python versions, please send them my way. :)
Suggestions
  • Put all scripts in /home/olpc/bin directory
  • add directory to your search path. In .bashrc put ' set path="/home/olpc/bin:$PATH" '

ixo-info

  • xo-sysinfo: Quickly display various useful troubleshooting build information about the XO Laptop


get-ixo

  • get-xo: Get a local copy/backup of your XO Laptop /home/olpc directory.


ixo-update

  • xo-update (& log): Do an olpc-update to specific build (joyride or Update), log results.


ixo-update-log

  • ixo-update: Do an olpc-update to specific build (joyride or Update), log results.



log-update

Summary

  • Do an olpc-update to specific build (joyride or Update), log results.

Description

  • Log various system information during an olpc-update for later examination

Benefits

  • Creates permanent record and timing of update, for later viewing.

First script:


#!/bin/bash
## FILE: log-update ######
# 2008 01 10, Iain Davidson, xo AT myna DOT ws
## RELEASED under CC-BY-SA-NC 3.0 license.
ver="update.1-681"
cd ~olpc
echo "------- $ver -------------------------------------"
date
# Below is various system information nice to log before the update 
# (aka xo-info)
grep -v "garbage-to-ignore" /etc/issue /boot/olpc_build
ls -Ld /versions/* /versions/contents/* /versions/pristine/*  /versions/configs/*
ls -ld /versions/running /versions/boot
#
/usr/sbin/olpc-update $ver
#
date
echo "------- ______________________ $ver"


Second script:

#!/bin/bash
## FILE: log-update-capture #######
# 2008 01 12, Iain Davidson, xo AT myna DOT ws
## RELEASED under CC-BY-SA-NC 3.0 license.
cd ~olpc
./log-update >>log-update.out 2>>log-update.out


NOTES:

Assumed that scripts are in /home/olpc , both have 'x' execute bit set.
Currently need to set manually the version number to update, future feature is passing it along, or picking from list (or latest).