diff --git a/README.md b/README.md index 230bf75e..0e89920f 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,13 @@ Install the freedombone commands onto your laptop/desktop: cd freedombone sudo make install -Then install packages needed for building images: +Then install the necessary packages for building images, on a debian based system using: + freedombone-image --setup debian - sudo apt-get -y install build-essential git python-docutils mktorrent - sudo apt-get -y install vmdebootstrap xz-utils dosfstools btrfs-tools extlinux - sudo apt-get -y install python-distro-info mbr qemu-user-static binfmt-support - sudo apt-get -y install u-boot-tools qemu +or on Parabola/Arch + + freedombone-image --setup parabola A typical use case to build an 8GB image for a Beaglebone Black is as follows. You can change the size depending upon the capacity of your microSD card. diff --git a/doc/EN/installation.org b/doc/EN/installation.org index 923668d8..c63c445c 100644 --- a/doc/EN/installation.org +++ b/doc/EN/installation.org @@ -41,9 +41,13 @@ sudo make install Then install packages needed for building images: #+BEGIN_SRC bash -sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils -sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr -sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu +freedombone-image --setup debian +#+END_SRC + +or on an Arch/Parabola system: + +#+BEGIN_SRC bash +freedombone-image --setup parabola #+END_SRC A typical use case to build an 8GB image for a Beaglebone Black is as follows. You can change the size depending upon the capacity of your microSD card. diff --git a/man/freedombone-image.1.gz b/man/freedombone-image.1.gz index 13b4cd8e..3d1d1fd6 100644 Binary files a/man/freedombone-image.1.gz and b/man/freedombone-image.1.gz differ diff --git a/src/freedombone-image b/src/freedombone-image index 2b4d9735..9124e480 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -118,7 +118,81 @@ INSECURE='no' # a new identity at every shutdown/boot AMNESIC='no' -mesh_router_setup_script() { +# Versions used for Arch/Parabola setup +MBR_VERSION='1.1.11' +DEBOOTSTRAP_VERSION='1.0.83' + +function image_setup { + setup_type=$1 + + case $setup_type in + debian|ubuntu|trisquel|mint) + sudo apt-get -y install build-essential libc6-dev-i386 gcc-multilib g++-multilib + sudo apt-get -y install git python-docutils mktorrent vmdebootstrap xz-utils + sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr + sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu + ;; + parabola|arch) + sudo pacman -S --noconfirm libc++ git gcc gcc-libs python-docutils mktorrent patch + sudo pacman -S --noconfirm debootstrap xz dosfstools btrfs-progs syslinux python-pip + sudo pacman -S --noconfirm qemu-static binfmt-qemu-static uboot-tools qemu parted + sudo pacman -S --noconfirm dpkg-devtools bin86 + mkdir ~/develop + if [ ! -d ~/develop/python-cliapp ]; then + git clone git://git.liw.fi/cliapp ~/develop/python-cliapp + fi + sudo pacman -S --noconfirm python2-coverage python2-pytest-cov python2-sphinx + sudo pacman -S --noconfirm autopep8 python2-pylint python2-yaml python2-xdg python2-pip + cd ~/develop/python-cliapp + sudo python2 setup.py install + sudo pip2 install distro-info logging + if [ ! -d ~/develop/mbr ]; then + git clone https://aur.archlinux.org/mbr.git ~/develop/mbr + fi + cd ~/develop/mbr + makepkg + tar -xzvf mbr-${MBR_VERSION}.tar.gz + cd ~/develop/mbr/mbr-${MBR_VERSION} + cp ../*.patch . + patch -p0 < *.patch + ./configure + make + sudo make install + if [ ! -f /usr/local/sbin/install-mbr ]; then + echo $'Failed to install mbr' + return + fi + sudo cp /usr/local/sbin/install-mbr /sbin + if [ ! -d ~/develop/multipath-tools ]; then + git clone https://aur.archlinux.org/multipath-tools.git ~/develop/multipath-tools + fi + sudo pacman -S device-mapper libaio liburcu fakeroot + cd ~/develop/multipath-tools + makepkg + makepkg -i + cd ~/develop + if [ ! -f ~/develop/debootstrap_${DEBOOTSTRAP_VERSION}.tar.gz ]; then + wget http://http.debian.net/debian/pool/main/d/debootstrap/debootstrap_${DEBOOTSTRAP_VERSION}.tar.gz + fi + if [ ! -f ~/develop/debootstrap_${DEBOOTSTRAP_VERSION}.tar.gz ]; then + echo $'Failed to download debootstrap code' + return + fi + if [ ! -d ~/develop/debootstrap/scripts ]; then + tar -xzvf debootstrap_${DEBOOTSTRAP_VERSION}.tar.gz + fi + sudo mv ~/develop/debootstrap/scripts/* /usr/share/debootstrap/scripts + ;; + *) + echo $'Unkown operating system' + return + ;; + esac + + echo $'Setup complete' +} + +function mesh_router_setup_script { # create a setup script for a mesh router mesh_script_filename=$1 echo "MY_USERNAME=${USERNAME}" > $mesh_script_filename @@ -273,6 +347,11 @@ do shift INSECURE="$1" ;; + --setup) + shift + image_setup "$1" + exit 0 + ;; *) # unknown option ;; diff --git a/website/EN/installation.html b/website/EN/installation.html index 13000ce3..1c043898 100644 --- a/website/EN/installation.html +++ b/website/EN/installation.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -77,6 +77,7 @@ pre.src-ledger:before { content: 'Ledger'; } pre.src-lisp:before { content: 'Lisp'; } pre.src-lilypond:before { content: 'Lilypond'; } + pre.src-lua:before { content: 'Lua'; } pre.src-matlab:before { content: 'MATLAB'; } pre.src-mscgen:before { content: 'Mscgen'; } pre.src-ocaml:before { content: 'Objective Caml'; } @@ -254,11 +255,11 @@ for the JavaScript code in this tag. -Building an image for a Single Board Computer or Virtual Machine +Building an image for a Single Board Computer or Virtual Machine -Checklist +Checklist @@ -266,34 +267,34 @@ for the JavaScript code in this tag. -Installation +Installation -Social Key Management - the 'Unforgettable Key' +Social Key Management - the 'Unforgettable Key' -Final Setup +Final Setup -Keydrives +Keydrives -On Client Machines +On Client Machines -Administering the system +Administering the system -
-

Building an image for a Single Board Computer or Virtual Machine

-
+
+

Building an image for a Single Board Computer or Virtual Machine

+

You don't have to trust images downloaded from random internet locations signed with untrusted keys. You can build one from scratch yourself, and this is the recommended procedure for maximum security. For guidance on how to build images see the manpage for the freedombone-image command.

@@ -303,7 +304,6 @@ Install the freedombone commands onto your laptop/desktop:

-
sudo apt-get install git build-essential dialog
 git clone https://github.com/bashrc/freedombone
 cd freedombone
@@ -316,10 +316,16 @@ Then install packages needed for building images:
 

+
freedombone-image --setup debian
+
+
-
sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils
-sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
-sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
+

+or on an Arch/Parabola system: +

+ +
+
freedombone-image --setup parabola
 
@@ -328,7 +334,6 @@ A typical use case to build an 8GB image for a Beaglebone Black is as follows. Y

-
freedombone-image -t beaglebone -s 8G
 
@@ -338,7 +343,6 @@ If you prefer an advanced installation with all of the options available then us

-
freedombone-image -t beaglebone -s 8G --minimal no
 
@@ -348,7 +352,6 @@ To build a 64bit Virtualbox image:

-
freedombone-image -t virtualbox-amd64 -s 8G
 
@@ -358,7 +361,6 @@ To build a 64bit Qemu image:

-
freedombone-image -t qemu-x86_64 -s 8G
 
@@ -372,16 +374,15 @@ If the image build fails with an error such as "Error reading from server. Re

-
freedombone-image -t beaglebone -s 8G -m http://ftp.de.debian.org/debian
 
-
-

Checklist

-
+
+

Checklist

+

Before installing Freedombone you will need a few things.

@@ -395,23 +396,22 @@ Before installing Freedombone you will need a few things.
-
-

Installation

-
+
+

Installation

+

There are three install options: Laptop/Desktop/Netbook, SBC and Virtual Machine.

-
-

On a Laptop, Netbook or Desktop machine

-
+
+

On a Laptop, Netbook or Desktop machine

+

If you have an existing system, such as an old laptop or netbook which you can leave running as a server, then install a new version of Debian Jessie onto it. During the Debian install you won't need the print server or the desktop environment, and unchecking those will reduce the attack surface. Once Debian enter the following commands:

-
su
 apt-get update
 apt-get -y install git dialog build-essential
@@ -424,9 +424,9 @@ freedombone menuconfig
 
-
-

On a single board computer (SBC)

-
+
+

On a single board computer (SBC)

+

Currently the following boards are supported:

@@ -445,7 +445,6 @@ If there is no existing image available then you can build one from scratch. See

-
gpg --verify filename.img.asc
 
@@ -455,7 +454,6 @@ And the hash with:

-
sha256sum filename.img
 
@@ -465,7 +463,6 @@ If the image is compressed then decompress it with:

-
unxz filename.img.xz
 
@@ -475,7 +472,6 @@ Then copy it to a microSD card. Depending on your system you may need an adaptor

-
sudo dd bs=1M if=filename.img of=/dev/sdX conv=fdatasync
 
@@ -485,7 +481,6 @@ Where sdX is the microSD drive. You can check which drive is the microSD

-
ls /dev/sd*
 
@@ -499,7 +494,6 @@ With the board connected and running you can ssh into the system with:

-
ssh fbone@freedombone.local -p 2222
 
@@ -510,15 +504,14 @@ Using the password 'freedombone'. Take a note of the new login password and then
-
-

As a Virtual Machine

-
+
+

As a Virtual Machine

+

Virtualbox and Qemu are supported. You can run a 64 bit Qemu image with:

-
qemu-system-x86_64 -m 1G filename.img
 
@@ -534,42 +527,42 @@ The default login will be username 'fbone' and password 'freedombone'. Take a no
-
-

Social Key Management - the 'Unforgettable Key'

-
+
+

Social Key Management - the 'Unforgettable Key'

+

During the install procedure you will be asked if you wish to import GPG keys. If you don't already possess GPG keys then just select "Ok" and they will be generated during the install. If you do already have GPG keys then there are a few possibilities

-
-

You have the gnupg keyring on an encrypted USB drive

-
+
+

You have the gnupg keyring on an encrypted USB drive

+

If you previously made a master keydrive containing the full keyring (the .gnupg directory). This is the most straightforward case, but not as secure as splitting the key into fragments.

-
-

You have a number of key fragments on USB drives retrieved from friends

-
+
+

You have a number of key fragments on USB drives retrieved from friends

+

-If you previously made some USB drives containing key fragments then retrieve them from your friends and plug them in one after the other. After the last drive has been read then remove it and just select "Ok". The system will then try to reconstruct the key. For this to work you will need to have previously made three or more Keydrives. +If you previously made some USB drives containing key fragments then retrieve them from your friends and plug them in one after the other. After the last drive has been read then remove it and just select "Ok". The system will then try to reconstruct the key. For this to work you will need to have previously made three or more Keydrives.

-
-

You can specify some ssh login details for friends servers containing key fragments

-
+
+

You can specify some ssh login details for friends servers containing key fragments

+

Enter three or more sets of login details and the installer will try to retrieve key fragments and then assemble them into the full key. This only works if you previously were using remote backups and had social key management enabled.

-
-

Final Setup

-
+
+

Final Setup

+

Any manual post-installation setup instructions or passwords can be found in /home/username/README. You should remove any passwords from that file and store them within a password manager such as KeepassX.

@@ -687,22 +680,21 @@ On your internet router, typically under firewall settings, open the following p
-
-

Keydrives

-
+
+

Keydrives

+

After installing for the first time it's a good idea to create some keydrives. These will store your gpg key so that if all else fails you will still be able to restore from backup. There are two ways to do this:

-
-

Master Keydrive

-
+
+

Master Keydrive

+

This is the traditional security model in which you carry your full keyring on an encrypted USB drive. To make a master keydrive first format a USB drive as a LUKS encrypted drive. In Ubuntu this can be done from the Disk Utility application. Then plug it into the Freedombone system, then from your local machine run:

-
ssh myusername@mydomainname -p 2222
 
@@ -712,15 +704,14 @@ Select Administrator controls then Backup and Restore then Back

-
-

Fragment keydrives

-
+
+

Fragment keydrives

+

This breaks your GPG key into a number of fragments and randomly selects one to add to the USB drive. First format a USB drive as a LUKS encrypted drive. In Ubuntu this can be done from the Disk Utility application. Plug it into the Freedombone system then from your local machine run the following commands:

-
ssh myusername@mydomainname -p 2222
 
@@ -735,15 +726,14 @@ Fragments are randomly assigned and so you will need at least three or four keyd
-
-

On Client Machines

-
+
+

On Client Machines

+

You can configure laptops or desktop machines which connect to the Freedombone server in the following way. This alters encryption settings to improve overall security.

-
sudo apt-get update
 sudo apt-get install git dialog haveged build-essential
 git clone https://github.com/bashrc/freedombone
@@ -755,15 +745,14 @@ freedombone-client
 
-
-

Administering the system

-
+
+

Administering the system

+

To administer the system after installation log in via ssh, become the root user and then launch the control panel.

-
ssh myusername@freedombone.local -p 2222