Introduction
Create an SD card for the Dreamplug.
If, like me, you want to follow Nick's instructions for building a fresh image, here's the 18 step procedure I followed. An alternative is to download a ready-made image and copy it to an SD card.
I have a little sysadmin skill but I've never used multistrap or other esoteric build tools.
I boooted the new image and got as far as the console login.
An alternative is to install pre-built images : see FreedomBox/DreamPlug/Images
Get ready
- Start your workstation.
Use a Debian Wheezy OS (my host is called cms01). A virtual image, such as a VirtualBox image, is fine. Usually.
- Use the root account.
One-off tasks
You only have to set up the environment once, such as when you are working with a freshly installed Debian OS.
- Get the general tools.
apt-get install build-essential
- Install image building tools.
apt-get install multistrap qemu-user-static u-boot-tools git mercurial
- Install the code management system.
root@cms01:~# apt-get install git Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: git-man liberror-perl rsync Suggested packages: git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb The following NEW packages will be installed: git git-man liberror-perl rsync 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 8,086 kB of archives. After this operation, 15.3 MB of additional disk space will be used. Do you want to continue [Y/n]? Get:1 http://ftp.uk.debian.org/debian/ wheezy/main liberror-perl all 0.17-1 [23.6 kB] … root@cms01:~#
repeat for every new image
Follow these steps every time you want to make a new card.
Prepare an SD card.
- Find a microSD card with SD card holder. It must be at least 2GB in size.
- Insert the card into your workstation.
- Install a partition editor. Install parted if you are a masochist.
apt-get install parted
- Create 2 partitions. Use cfdisk, parted, gparted or similar.
cfdisk /dev/sdb
- First partition: 128meg (no smaller or the kernel copy will run out of room and make - see below - will end with an error).
- Second partition: 2GB (more or less, it doesn't matter).
- Make a note of the SD card’s device name. Mine is /dev/sdb (my workstation’s layout is simple: one disk called /dev/sda and nothing else defined).
- Format the two partitions.
- First partition: FAT. Command is mkdosfs /dev/sdb1
- Second partition: ext3. Command is mkfs.ext3 /dev/sdb2
- Create a mountpoint on your workstation.
mkdir /media/freedom
- Mount the second partition.
mount /dev/sdb2 /media/freedom/
- Mount the first partition.
mount /dev/sdb1 /media/freedom/boot/
- Check your work.
root@cms01:/media/freedom# mount sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) … /dev/sdb2 on /media/freedom type ext3 (rw,relatime,errors=continue,barrier=1,data=ordered) /dev/sdb1 on /media/freedom/boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed,errors=remount-ro) root@cms01:/media/freedom#
Clone the git repository.
- Clone Nick Daly’s repository.
root@cms01:~# git clone https://github.com/NickDaly/freedom-maker.git Cloning into 'freedom-maker'... remote: Counting objects: 377, done. remote: Compressing objects: 100% (174/174), done. remote: Total 377 (delta 193), reused 366 (delta 182) Receiving objects: 100% (377/377), 46.40 MiB | 175 KiB/s, done. Resolving deltas: 100% (193/193), done. root@cms01:~#
Create the Debian OS.
- navigate to your new repository.
root@cms01:~# cd /root/freedom-maker/ root@cms01:~/freedom-maker#
- Kick off.
make weekly-card
the build process
It's automated from here on in. To find out what's involved, start with /root/freedom-maker/README
The next part took about an hour, but required no input from me. Packages were downloaded. Commands like this were run.
... apt-get -o Apt::Architecture=armel -o Dir::Etc::TrustedParts=/root/freedom-maker/build/dreamplug/etc/apt/trusted.gpg.d -o Dir::Etc::Trusted=/root/freedom-maker/build/dreamplug/etc/apt/trusted.gpg.d/trusted.gpg -o Apt::Get::Download-Only=true -o Apt::Install-Recommends=false -o Dir=/root/freedom-maker/build/dreamplug/ -o Dir::Etc=/root/freedom-maker/build/dreamplug/etc/apt/ -o APT::Default-Release=* -o Dir::State=/root/freedom-maker/build/dreamplug/var/lib/apt/ -o Dir::State::Status=/root/freedom-maker/build/dreamplug/var/lib/dpkg/status -o Dir::Cache=/root/freedom-maker/build/dreamplug/var/cache/apt/ update ...
What does that mean? I don’t know.
Errors like this occurred.
... Setting up sysvinit (2.88dsf-22.1) ... sysvinit: creating /run/initctl sysvinit: restarting...init: timeout opening/writing control channel /run/initctl .init: timeout opening/writing control channel /run/initctl .init: timeout opening/writing control channel /run/initctl .init: timeout opening/writing control channel /run/initctl .init: timeout opening/writing control channel /run/initctl .init: timeout opening/writing control channel /run/initctl .init: timeout opening/writing control channel /run/initctl .init: timeout opening/writing control channel /run/initctl failed. ...
What does that mean? I still don’t know.
There was good news like this.
... Multistrap system installed successfully in /root/freedom-maker/build/dreamplug/. Copying the source directory to the FreedomBox root. ...
There was an enormous amount of this.
...
bin/bash
818092 100% 7.07MB/s 0:00:00 (xfer#1, to-check=1102/1123)
bin/cat
42736 100% 362.91kB/s 0:00:00 (xfer#2, to-check=1101/1123)
bin/chgrp
54996 100% 383.62kB/s 0:00:00 (xfer#3, to-check=1100/1123)
...This stuff runs on and on for thousands of lines, until
…
var/log/prosody/prosody.err
402 100% 0.90kB/s 0:00:00 (xfer#31612, to-check=4/40089)
var/log/prosody/prosody.log
859 100% 1.92kB/s 0:00:00 (xfer#31613, to-check=3/40089)
var/mail/
var/opt/
var/spool/
var/spool/mail -> ../mail
var/spool/rsyslog/
var/tmp/
var/www/
var/www/index.html
177 100% 0.40kB/s 0:00:00 (xfer#31614, to-check=0/40089)
sent 295603363 bytes received 632817 bytes 1145981.35 bytes/sec
total size is 593183522 speedup is 2.00
...File copying seems to have finished. Then it’s onto the kernel.
... cp kernel/* /media/freedom/boot/ cp build/dreamplug/boot/* /media/freedom/boot/ sudo rm /media/freedom/sbin/copy2dream
And finally
... sudo sh -c "sed -e 's/sdc1/sda1/g' < source/etc/fstab > /media/freedom/etc/fstab" sync sleep 1 umount /media/freedom/boot umount /media/freedom Build complete.
There is one more stage where an image is copied from the SD card and zipped up.
... dd if=/dev/sdb of="freedombox-unstable_`date +%Y.%m%d`.img" bs=1M 3781+1 records in 3781+1 records out 3965190144 bytes (4.0 GB) copied, 266.174 s, 14.9 MB/s Image copied. The microSD card may now be removed. tar -cjvf "freedombox-unstable_`date +%Y.%m%d`.tar.bz2" "freedombox-unstable_`date +%Y.%m%d`.img" freedombox-unstable_2012.0705.img root@cms01:~/freedom-maker#
The end. Hooray! The SD card is ready for the DreamPlug.
Older instructions
Clone the git repo and follow the instructions in the README file:
$ git clone http://anonscm.debian.org/git/freedombox/freedom-maker.git/
