Installing Debian as an upgrade/script


Jump to: navigation, search

The following script, which only follows the instructions on Installing Debian as an upgrade, should install Debian on your XO. Just copy/paste it into a file on the XO, chmod +x, and run. I just tested it, and it worked. YMMV. It will stop midway if there is any error, including in the wget image download.

So in steps:
1. Highlight script below that starts with "#!/bin/bash ex ......." and copy (Ctrl+C)
2. Enter Terminal and become root by typing "su" and return.
3. Make a script file by typing "nano install-script", nano should launch, then
4. Paste the script into nano by clicking on the tab at the top of the Terminal Activity titled "Edit" and click on the right hand icon that has an arrow pointing down (Paste).
5. Exit and Save from nano with Ctrl+X, then selecting "y"
6. Then change the script file into an executable script file by typing: "chmod +x install-script"
7. Execute the script by typing "./install-script" and enter, kick back for awhile and watch it go.(~15 minutes or so? until it finally displays "bash-3.2#" or something ending in "...#"
(However I just ran it and it stopped at line 28, just after "+ chmod a+rx" perhaps because of excess spaces in the next command line)
(I got same error!)

By the way, it's totally unsafe to run code from a wiki like this without reading it.

#!/bin/bash -ex


cd /versions/pristine
mkdir debian
cd debian

# wget -O- "$tgz_url" | tar xz
wget -q -O- "$tgz_url" | tar xvz

cp /etc/{hosts,fstab} /versions/pristine/debian/etc/
cp -r /lib/modules/* /versions/pristine/debian/lib/modules
cp -r /lib/firmware/* /versions/pristine/debian/lib/firmware
mkdir -p /versions/pristine/debian/{versions,security,var/cache/apt/cache}
rm -rf /versions/pristine/debian/boot
cp -r /boot /versions/pristine/debian

cat <<END > /versions/pristine/debian/etc/rcS.d/
#! /bin/sh
mount -t sysfs /sys /sys
echo 0 > /sys/devices/platform/dcon/freeze
umount /sys

chmod a+rx /versions/pristine/debian/etc/rcS.d/

echo 'tmpfs /var/cache/apt/cache tmpfs defaults 0 0' >> /versions/pristine/debian/etc/fstab 

cat <<END > /versions/pristine/debian/etc/apt/apt.conf.d/00-tmpfs-cache
 Dir {
  Cache "var/cache/apt/" {
   srcpkgcache "cache/srcpkgcache.bin";
   pkgcache "cache/pkgcache.bin";

cd /versions/boot
rm -rf alt
ln -s /versions/pristine/debian alt
cp -rl /versions/pristine/debian /versions/run/debian
/usr/sbin/setattr -R --iunlink /versions/run/debian
echo 'Debian is installed!  Reboot and hold down the game key labelled "O"'

  • Note: After Rebooting you must do the networking part
modprobe usb8xxx
iwconfig eth0 essid <your-access-point>
Personal tools
  • Log in
  • Login with OpenID
About OLPC
About the laptop
About the tablet
OLPC wiki
In other languages