User:Kevgor/Mavrothal scripts for XO 1.0: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
== Overview == |
== Overview == |
||
mavrothal and mav2 scripts are invoked one time at |
mavrothal and mav2 scripts are invoked one time at install in XO1 version of installrpms.sh<br /> |
||
rc.local file is invoked at every boot |
rc.local file is invoked at every boot. |
||
su - |
|||
bash /media/PATRIOT/installsh.rpms |
|||
== Make room script == |
== Make room script == |
||
Line 62: | Line 61: | ||
OSVER=`ls /versions/pristine` |
OSVER=`ls /versions/pristine` |
||
# Make sure we do not delete needed files |
# Make sure we do not delete needed files |
||
# Pristine Versions |
|||
mv /versions/pristine/"$OSVER"/lib/firmware/usb8388.bin . |
|||
mv /versions/pristine/"$OSVER"/usr/share/locale/"$LANGVER"* . |
mv /versions/pristine/"$OSVER"/usr/share/locale/"$LANGVER"* . |
||
mv /versions/pristine/"$OSVER"/usr/share/locale/locale.alias . |
mv /versions/pristine/"$OSVER"/usr/share/locale/locale.alias . |
||
# Do delete what we do not need |
# Do delete what we do not need |
||
rm -rf /versions/pristine/"$OSVER"/lib/firmware/* |
|||
rm -rf /versions/pristine/"$OSVER"/usr/share/locale/* |
rm -rf /versions/pristine/"$OSVER"/usr/share/locale/* |
||
rm -rf /versions/pristine/"$OSVER"/usr/lib/dri/* |
rm -rf /versions/pristine/"$OSVER"/usr/lib/dri/* |
||
rm -rf /versions/pristine/"$OSVER"/usr/share/icons/*/256x256 |
rm -rf /versions/pristine/"$OSVER"/usr/share/icons/*/256x256 |
||
# Restore needed |
# Restore needed |
||
mv usb8388.bin /versions/pristine/"$OSVER"/lib/firmware/ |
|||
mv "$LANGVER"* /versions/pristine/"$OSVER"/usr/share/locale/ |
mv "$LANGVER"* /versions/pristine/"$OSVER"/usr/share/locale/ |
||
mv locale.alias /versions/pristine/"$OSVER"/usr/share/locale/ |
mv locale.alias /versions/pristine/"$OSVER"/usr/share/locale/ |
||
# Run Versions |
|||
mv /versions/run/"$OSVER"/lib/firmware/usb8388.bin . |
|||
mv /versions/run/"$OSVER"/usr/share/locale/"$LANGVER"* . |
mv /versions/run/"$OSVER"/usr/share/locale/"$LANGVER"* . |
||
mv /versions/run/"$OSVER"/usr/share/locale/locale.alias . |
mv /versions/run/"$OSVER"/usr/share/locale/locale.alias . |
||
# Do delete what we do not need |
# Do delete what we do not need |
||
rm -rf /versions/run/"$OSVER"/lib/firmware/* |
|||
rm -rf /versions/run/"$OSVER"/usr/share/locale/* |
rm -rf /versions/run/"$OSVER"/usr/share/locale/* |
||
rm -rf /versions/run/"$OSVER"/usr/lib/dri/* |
rm -rf /versions/run/"$OSVER"/usr/lib/dri/* |
||
rm -rf /versions/run/"$OSVER"/usr/share/icons/*/256x256 |
rm -rf /versions/run/"$OSVER"/usr/share/icons/*/256x256 |
||
# Restore needed |
# Restore needed |
||
mv usb8388.bin /versions/run/"$OSVER"/lib/firmware/ |
|||
mv "$LANGVER"* /versions/run/"$OSVER"/usr/share/locale/ |
mv "$LANGVER"* /versions/run/"$OSVER"/usr/share/locale/ |
||
mv locale.alias /versions/run/"$OSVER"/usr/share/locale/ |
mv locale.alias /versions/run/"$OSVER"/usr/share/locale/ |
||
Line 117: | Line 116: | ||
== Mavrothal Start Swap script == |
== Mavrothal Start Swap script == |
||
rc.local - Assumes linux-swap partition already created on SD card |
rc.local - Assumes linux-swap partition already created on 'esternal SD card which exists as /dev/mmcblk0p2 |
||
#!/bin/sh |
#!/bin/sh |
Latest revision as of 20:35, 17 November 2011
Mavrothal XO1 Scripts
October 2011
Overview
mavrothal and mav2 scripts are invoked one time at install in XO1 version of installrpms.sh
rc.local file is invoked at every boot.
Make room script
mav2.sh
#!/bin/sh # This script will remove extra localization, dri, firmware and # 256x256 icon files from the F14-based OLPC builds for the XO-1. # Will also prevent installation of additional locales by new rpms # # mavrothal, GPL2, 2011 # # No warranties. # # version 6. Works with jffs2 # Check if it is an XO-1 XOVER=`cat /sys/class/dmi/id/product_version` if [ "$XOVER" != "1" ] ; then echo " This script is for the XO-1 only" exit 0 fi # Check if it is an OLPC build BUILDORG=`cat /etc/issue | grep OLPC` if [ "$BUILDORG" = "" ] ; then echo " This script is for OLPC builds only" exit 0 fi # Check if it is an F14 build KERNVER=`uname -r | cut -d "." -f 3` if [ "$KERNVER" != "35" ] ; then echo " This is script is for F14 builds only" exit 0 fi # Make sure we have language set LANGVER=`cat /home/olpc/.i18n | cut -d "\"" -f2 | cut -d "_" -f 1` if [ "$LANGVER" = "" ] ; then echo " There is no language set!" echo " Please set language in the control panel" echo " and then reboot and run this script again" sleep 5 exit 0 fi # How much space do we have available before deletions AVAILBEF=`df -B M / | awk 'END {print $4}' | tr -d 'M'` # Delete extra locales, dri and firmware files OSVER=`ls /versions/pristine` # Make sure we do not delete needed files # Pristine Versions mv /versions/pristine/"$OSVER"/lib/firmware/usb8388.bin . mv /versions/pristine/"$OSVER"/usr/share/locale/"$LANGVER"* . mv /versions/pristine/"$OSVER"/usr/share/locale/locale.alias . # Do delete what we do not need rm -rf /versions/pristine/"$OSVER"/lib/firmware/* rm -rf /versions/pristine/"$OSVER"/usr/share/locale/* rm -rf /versions/pristine/"$OSVER"/usr/lib/dri/* rm -rf /versions/pristine/"$OSVER"/usr/share/icons/*/256x256 # Restore needed mv usb8388.bin /versions/pristine/"$OSVER"/lib/firmware/ mv "$LANGVER"* /versions/pristine/"$OSVER"/usr/share/locale/ mv locale.alias /versions/pristine/"$OSVER"/usr/share/locale/ # Run Versions mv /versions/run/"$OSVER"/lib/firmware/usb8388.bin . mv /versions/run/"$OSVER"/usr/share/locale/"$LANGVER"* . mv /versions/run/"$OSVER"/usr/share/locale/locale.alias . # Do delete what we do not need rm -rf /versions/run/"$OSVER"/lib/firmware/* rm -rf /versions/run/"$OSVER"/usr/share/locale/* rm -rf /versions/run/"$OSVER"/usr/lib/dri/* rm -rf /versions/run/"$OSVER"/usr/share/icons/*/256x256 # Restore needed mv usb8388.bin /versions/run/"$OSVER"/lib/firmware/ mv "$LANGVER"* /versions/run/"$OSVER"/usr/share/locale/ mv locale.alias /versions/run/"$OSVER"/usr/share/locale/ # Prevent additional locales being installed by new RPMs LANGVERLONG=`cat /home/olpc/.i18n | cut -d "\"" -f2 | cut -d "." -f 1` echo "%_install_langs "$LANGVER":"$LANGVERLONG"" > /etc/rpm/macros.lang sleep 1 # How much space do we have available after deletions AVAILAFT=`df -B M / | awk 'END {print $4}' | tr -d 'M'` # How much did we delete DELETED=`expr $AVAILAFT - $AVAILBEF` echo " An additional $DELETED MB of disk space is now available" sleep 3 exit 0
Copy persistent Start Swap script
mavrothal.sh - One time at install from USB into boot init area
#!/bin/sh echo Mavrothal swap and cleanup cp /media/PATRIOT/rc.local /etc/rc.d/rc.local sync echo Mavrothal Done exit 0
Mavrothal Start Swap script
rc.local - Assumes linux-swap partition already created on 'esternal SD card which exists as /dev/mmcblk0p2
#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local sleep 3 /sbin/swapon /dev/mmcblk0p2