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">
- +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: +
+ ++@@ -328,7 +334,6 @@ A typical use case to build an 8GB image for a Beaglebone Black is as follows. Yfreedombone-image --setup parabola-@@ -338,7 +343,6 @@ If you prefer an advanced installation with all of the options available then usfreedombone-image -t beaglebone -s 8G-@@ -348,7 +352,6 @@ To build a 64bit Virtualbox image:freedombone-image -t beaglebone -s 8G --minimal no-@@ -358,7 +361,6 @@ To build a 64bit Qemu image:freedombone-image -t virtualbox-amd64 -s 8G-@@ -372,16 +374,15 @@ If the image build fails with an error such as "Error reading from server. Refreedombone-image -t qemu-x86_64 -s 8G-freedombone-image -t beaglebone -s 8G -m http://ftp.de.debian.org/debian
Before installing Freedombone you will need a few things.
@@ -395,23 +396,22 @@ Before installing Freedombone you will need a few things.There are three install options: Laptop/Desktop/Netbook, SBC and Virtual 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
Currently the following boards are supported:
@@ -445,7 +445,6 @@ If there is no existing image available then you can build one from scratch. Seegpg --verify filename.img.asc
sha256sum filename.img
unxz filename.img.xz
sudo dd bs=1M if=filename.img of=/dev/sdX conv=fdatasync
ls /dev/sd*
ssh fbone@freedombone.local -p 2222
Virtualbox and Qemu are supported. You can run a 64 bit Qemu image with:
qemu-system-x86_64 -m 1G filename.img
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
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.
-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.
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.
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 pAfter 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:
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
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
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
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