Skip to content

Bauermann's clone of Bdale Garbee's tool for building an image for a Freedombox device. The official repository is at

License

Notifications You must be signed in to change notification settings

bauermann/freedom-maker

Repository files navigation

Freedom-Maker  -  Bdale's building tools for the FreedomBox project

The general idea for now is that we're going to populate a USB stick 
with a Debian 'wheezy' system that can be used to boot a DreamPlug.  Once 
the plug is running on the USB stick, a script on the stick can be used to 
copy the stick contents to the internal 2gb microSD card.

***
*** Warning!  There are no "training wheels" here .. read the scripts and
***           understand what they're going to do before you run them...
***

Install required build packages:
	apt-get install multistrap qemu-user-static u-boot-tools

Partition a USB stick to have a small FAT partition and large ext3 partition,
create a /media/freedom mount point, and add entries to /etc/fstab like:

  /dev/sdb1 /media/freedom/boot vfat	user,noauto	0	0
  /dev/sdb2 /media/freedom	ext3	user,noauto	0	0

This will allow the Makefile to mount and unmount the stick at will.

Update the file fbx-base.conf setting the source= line to your favorite
Debian mirror.

To populate the stick with bits for a DreamPlug, just plug it in to your 
computer and type:

	make

This will build a file tree under build/dreamplug, representing the
contents of a root file system, then that content will be copied to the stick.

Move the USB stick to the DreamPlug, obtain a serial console, and hit reset.
A good way to access the serial console (actually USB serial emulation
provided by the optional JTAG dongle), is to use 'screen', like so:

	screen /dev/ttyUSB0 115200

Interrupt the boot by pressing a key during the autoboot countdown, and type 
the following to boot from the USB stick:

	setenv bootcmd '${x_bootcmd_usb}; ${x_bootcmd_kernel}; ${x_bootcmd_initrd}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000 0x6900000;'
	setenv x_bootcmd_kernel fatload usb 2 0x6400000 uImage 
	setenv x_bootcmd_initrd fatload usb 2 0x6900000 uInitrd
	setenv x_bootargs_root root=/dev/sdc2 rootdelay=10
	boot

The system should boot to a login prompt, using only the bits on the stick.

The default root password is 'freedom'

- - - - -

To set things up to boot from the internal microSD card, once you're logged 
into the system booted from root on USB stick you can use:

	/sbin/copy2dream

Note that if you don't have a reasonable system date and time set in the 
DreamPlug before running this command, you may see a long stream of warnings
from tar about timestamps being in the future.  It is safe to ignore these.

On reboot, you may want to interrupt the boot and type the following to ensure
you boot from the internal microSD by default.  This bootcmd line elides the 
time-consuming attempts to boot grom gigE, which makes boot go much faster:

	setenv bootcmd '${x_bootcmd_usb}; ${x_bootcmd_kernel}; ${x_bootcmd_initrd}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000 0x6900000;'
	setenv x_bootcmd_kernel fatload usb 0 0x6400000 uImage 
	setenv x_bootcmd_initrd fatload usb 0 0x6900000 uInitrd
	setenv x_bootargs_root root=/dev/sda2 rootdelay=10
	saveenv
	reset

- - - - -

Be aware that this is a *very* imcomplete solution for now, suitable only
for developers .. you will want to at least do things like create unique 
ssh host keys for your device!

- - - - -

About

Bauermann's clone of Bdale Garbee's tool for building an image for a Freedombox device. The official repository is at

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages