D3D Live ISO
Instructions
These instructions are compiled from the file File:USB INSTALLATION.txt, and other documentation at porteus home page.
- Download 299 MiB 32-bit iso without OpenSCAD or 613 MiB 32-bit iso with OpenSCAD. The larger version requires at least 1GiB USB storage and 4GiB RAM.
- Attach USB stick to computer
- Backup data already on USB stick
Ubuntu-instructions
- Optional: Format USB stick to ext4. Most USB sticks are preformatted with FAT filesystems. This complicates writing to the USB from within Porteus.
- Follow this guide, except format to ext4 instead of fat32.
- Open iso with Archive Manager, extract contents to USB folder
- Run the script Porteus-installer-for-Linux.com. It resides in the directory called boot on your USB stick. Root privileges (sudo) might be required, depending on your system.
- Navigate to USB directory
cd /media/<user>/<USB-stick-name>/boot
- Once in USB boot directory
sudo ./Porteus-installer-for-Linux.com
Porteus-instructions
- Open Porteus Installer program
- Open the Start Menu (top left corner)
- Choose "System"
- Choose "Porteus Installer"
Other systems
See porteus.org's official installation instructions.
Introduction
The D3D Thesis project aims to provide participants a Live ISO. This is an operating system that resides on a CD, DVD or USB stick that can run on all common computers, independent of the state of their computer's hard drives, thereby bypassing installation procedures for 3D printing related programs.
The idea is that we do 2 things to make the D3D Distributive Enterprise spread far and wide, which is part of Viral Replication Criteria:
- Enable an average user with clear instructions for downloading our ISO, and installing on a USB drive in Linux, Windows, and Mac.
- Providing USB sticks at the workshop to users who have not already installed the 3D printer software. The assumption is that we will preload the firmware onto the controller board.
Links
Tobben's Notes While Developing ISO
Porteus uses modules, Slackware style. We want our ISO to have modules for
- Printrun (most importantly Pronterface)
- Slic3r
- Point-and-klick environment like KDE
- GNU IceCat Web browser (see Wikipedia article)
We need three separate ISOs:
- USB stick, 32-bit
- CD, 32-bit
- DVD, 32-bit
New ISO's are created within Portheus with script /mnt/sdXN/porteus/make_iso.sh.
Maybe useful:
save-changes - dump whole changes from the live session into a module
Wrote ISO to USB stick
sudo dd if=Porteus-KDE4-v3.1-x86_64.iso of=/dev/sdc
Didn't work. Re-formatted USB stick, extracted contents of ISO file and put it on USB stick. Mounted USB-stick, copied Portheus files over there and ran the script
/media/torbjorn/Porteus/Porteus/boot/Porteus-installer-for-Linux.com
This produced a final message:
Installation finished successfully. You may reboot your PC now and start using Porteus. Please check the /boot/docs folder for additional information about the installation process, Porteus requirements and booting parameters. In case of making tweaks to the bootloader config, please edit: /media/torbjorn/Porteus/Porteus/boot/syslinux/porteus.cfg file.
Didn't work. Made new ISO with following changes
- UEFI support
- 32-bit
- FAT32 filesystem on stick
That did work, but FAT32 prevented anything from being stored on USB stick while in Porteus. Changed to ext4. Worked fine.
Guide to package creation and manipulation at porteus.org
Created xzm package that allows Pronterface to be run from source. File:Pront-package-incomplete.xzm
Made changes to /boot/syslinux/porteus.cfg to tailor a boot-mode for D3D Workshops.
Old ISO images
32-bit
Porteus_with_Pronterface_Slic3r_Arduino_and_D3D_Conf_v0.iso.
Communications
Torbjorn: Configured a 32-bit (64-bit machines can also use it) Porteus Live OS ISO today, taking up 412 MiB space, but looks quite good (KDE4), runs very very fast, includes Pronterface source code and starts Pronterface on boot.
I'm on a slow connection, so iso will take another hour to upload...
See if you can get it to work. We can step through it at the meeting tomorrow. http://opensourceecology.org/wiki/D3D_Live_ISO#ISO_images
Mac Work
Steps to boot Porteus on Macbook Air 2011
- Shut Down computer
- Insert USB thumb drive with Porteus 64-bit and EFI support installed (D3D ISO will be uploaded soon)
- Hold left "alt"-key while turning on the computer.
- Keep holding alt pressed for several seconds. A boot screen should eventually appear.
- The Porteus USB thumbstick will be represented by a yellow icon (sometimes with the text "windows", see picture). Choose Porteus using arrow keys and enter.
- The Macbook air should now boot Porteus
Above steps tested and shown to work by Tobben on Feb 22 2016.
Research
Ubuntu.com article
http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx
States:
Most Macs with Intel processors will work with either 64-bit or Mac images. If the 64-bit image doesn't work, try the Mac image.
Their DVD instructions simply consist of burning the iso onto the DVD with Disk Utility.
Recommends CD instead of USB.
Converts iso to an .img or .dmg file before using Disk Destroyer to burn the image onto the USB.
Makeuseof.com article
http://www.makeuseof.com/tag/how-to-boot-a-linux-live-usb-stick-on-your-mac/
Tested on 2011 Macbook pro.
Uses FAT32 ant master boot record partition.
Uses EFI boot.
Uses iso images that are somehow customized for mac.
support.apple.com article
https://support.apple.com/en-us/HT201663
Says we need GUID partition
rEFInd article
http://www.rodsbooks.com/refind/
Explains difference between boot manager and boot loader.
Says this about (U)EFI
Prior to mid-2011, few computers outside of Intel-based Macs used EFI; but starting in 2011, computer manufacturers began adopting UEFI in droves, so most computers bought since then use EFI.
Randomtutor article
http://randomtutor.blogspot.co.uk/2014/01/installing-ubuntu-on-retina-macbook-pro_19.html
Uses Ubuntu USB for Mac OS X article mentioned above with 64-bit Mac iso image.
Installs and uses the rEFInd boot manager:
cd ~/Downloads/refind-bin-0.7.7 ./install.sh --alldrivers
NOTE: If you have Mac OS X 10.10 (Yosemite) installed, then the rEFInd installation needs to be handled differently. See [1].
Porteus Forum Thread 1
http://forum.porteus.org/viewtopic.php?f=81&t=4177
Says that Porteus-installer-for-Linux.com script installs a boot loader.
rEFInd Forum Thread 1
https://sourceforge.net/p/refind/discussion/general/thread/b9c7cefa/
Suggests we should try rEFInd and Porteus with EFI boot first. Note that Roderick W. Smith is the rEFInd dev himself.
Earlier Work
http://rafaelalcocer.com/downloads/index.php?dirpath=./3D-printer&order=0
A Porteus user that created a lot of related i486 xzm packages. His blog: [2].
The aruino.xzm of D3D Porteus uses his packages jre-7u40-i586-1.xzm and 010-avr-package-v0.3-1-1b.xzm to back up Arduino.
Stripping it down
Time order | Change | Measured in | MiB saved |
---|---|---|---|
0 | Replaced KDE with Xfce | iso size | 41 |
1 | Removed dictionaries from Firefox | Deployed size | 0.6 |
2 | Removed developer tools (make, gcc, etc) | iso size | 72 |
3 | Removed changes folder | Deployed size | 80 |
4 | Removed optional packages | Deployed size | 1.7 |
5 | Removed unused geany scripts in avr package | Deployed size | 0.1 |
6 | Removed geany plugins docs in avr package | Deployed size | 6.4 |
7 | Removed man pages in avr package | Deployed size | 5.6 |
8 | Removed kicad from avr package | Deployed size | 17 |
9 | Removed /usr/share/doc from avr package | Deployed size | 13 |
10 | Removed /usr/share/geany and geany-plugins from avr package | Deployed size | 2.6 |
11 | Removed /usr/share/locale from avr package | Deployed size | 4.4 |
12 | Removed geany binary from avr package | Deployed size | 2.3 |
13 | Removed pcbnew and eeschema rests from kicad in avr package | Deployed size | 4.4 |
14 | Removed kontrollerlab binary from avr package | Deployed size | 1.3 |
15 | Removed ponyprog2000 from avr package | Deployed size | 0.8 |
16 | Removed remaining kicad files from avr package | Deployed size | 1 |
17 | Removed usr/lib/geany and geany-plugins from avr package | Deployed size | 1.5 |
18 | Removed folder x86_64-unknown-linux-gnu from /opt/arduino/hardware/tools/avr | Deployed size | 0.9 |
19 | Removed /opt/arduino/reference | Deployed size | 25 |
20 | Removed /usr/doc and man from python deps package | Deployed size | 53 |
21 | Removed locales from /usr/share/locale in python deps package | Deployed size | 9 |
22 | Removed gtk-doc in python deps package | Deployed size | 14 |
Choice of Compiler Version
Porteus v3.1 that we're building upon ships with gcc-4.3.2 by default (inside the devel-package). D3D Porteus versions with OpenSCAD pre-installed ship with an additional gcc-5.3.0 package, because of this bug: SegFault: Linux, gcc-4.8.2 #514
Creating the gcc-5.3.0.xzm Package in D3D Porteus
These instructions are compiled from Installing GCC found on gnu.org.
Compiling GCC From Source Within Porteus 64-bit
- The devel-package in Porteus v3.1 contains the prerequisities we need, make sure it is activated.
- Download the source code to a hard drive. I use my computer's installed SDD disk found on /mnt/sda. See list of mirrors for download.
- See list of gcc5 changes to know what you're installing. Note for example the new ABI for libstdc++. This could play a role in Porteus V3.1 since the package manager's binaries are probably compiled with gcc4. Be careful when using multiple compilers.
- Create a build directory (called objdir in the gcc documentation) separate from the directory containing gcc source code (called srcdir in gcc documentation)
mkdir /path/to/objdir cd /path/to/objdir
- Configure while still standing in objdir. These flags are just the ones I use. See the documentation for what they mean.
/path/to/srcdir configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --infodir=/usr/info \ --enable-shared --enable-bootstrap --enable-languages=c,c++,lto,fortran --enable-threads=posix \ --enable-checking=release --with-system-zlib --with-python-dir=/lib/python2.7/site-packages \ --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --with-gnu-ld \ --verbose --disable-gtktest --disable-multilib
- Make the executables You could just run 'make' here (without the quotes). This command will take a while to finish.
make -j 2 BOOT_CFLAGS='-O2' bootstrap-lean
Installing to Staging area (fake root) and Packaging
- Create a directory that will act as the fake root
mkdir /path/to/fakeRoot
- Make sure you're still standing in objdir and do the install
make DESTDIR=/path/to/fakeRoot install
- Create the compressed package
dir2xzm /path/to/fakeRoot gcc-5.3.0-x86_64.xzm
- Move the package to your USB thumbdrive
mv gcc-5.3.0-x86_64.xzm /mnt/sdX1/porteus/optional
CAD Software
Compilation of OpenSCAD
- Create a basedir to compile dependencies in later
mkdir -p openscadBasedir
- Set the BASEDIR variable for the setenv-unibuild.sh to use later.
BASEDIR=/path/to/openscadBasedir
- Get source code. The files will be quite big, so cd to a hard drive before preceeding.
git clone https://github.com/openscad/openscad.git cd openscad
Compile OpenSCAD Dependencies
The Ones That the Repos Give us
- Note that superuser privileges might be needed to execute some of the following commands. Change to super user with 'su'. Change back with 'exit'.
- Start with git
usm -u all usm -g git
- Save and activate git
mv /tmp/usm/git-something.xzm /mnt/sdX1/porteus/modules activate /mnt/sdX1/porteus/modules/git-something.xzm
- Any qt-4 package usm gives you is good enough.
usm -g qt-4
- Save and activate qt-4
mv /tmp/usm/qt-4.x.x_something.xzm /mnt/sdX1/porteus/modules activate /mnt/sdX1/porteus/modules/qt-4.x.x_something.xzm
- To get around the SegFault: Linux, gcc-4.8.2 #514, use any other C/C++-compiler than gcc4.8.2, gcc4.8.1, clang3.3 or clang3.4 when compiling from source. If you've compiled gcc-5.3.0 like explained above do
activate /mnt/sdX1/porteus/optional/gcc-5.3.0-x86_64.xzm
The Ones That Openscad Helps Us Compile
- Openscad has scripts helping to install other dependencies. Run scripts from the openscad folder. First set variables and such with
source ./scripts/setenv-unibuild.sh
- We need an empty file in gtk-doc to work around a quirk in ragel's build script:
mkdir -p /usr/share/gtk-doc/data touch /usr/share/gtk-doc/data/gtk-doc.notmpl.make
- Then run the script that downloads and installs all necessary dependencies to the BASEDIR. This will download a lot of source code and do lots of compilation. It will take a while.
./scripts/uni-build-dependencies.sh
- Clean up the 1.5 GB of source code
rm -r $BASEDIR/src
The One We Need to Fix Ourselves
- The script does not build QScintilla for us, so that needs to be built from source as well.
wget http://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-2.9.1/QScintilla-gpl-2.9.1.tar.gz tar -xzvf QScintilla-gpl-2.9.1.tar.gz cd QScintilla-gpl-2.9.1/Qt4Qt5 qmake qscintilla.pro PREFIX=/usr make INSTALL_ROOT=$BASEDIR make install
- Package up, move to USB thumbdrive and activate
dir2xzm $BASEDIR/.. openscad-deps-x86_64.xzm mv openscad-deps-x86_64.xzm /mnt/sdX1/porteus/optional activate /mnt/sdX1/porteus/optional/openscad-deps-x86_64.xzm
- Check if dependencies are OK. This might fail to discover our qt-4 installation, in wich case you can run 'qmake -v' or 'pkg-config -modversion QtCore' to check manually.
./scripts/check-dependencies.sh
Compile OpenSCAD Itself
- Create the Makefile
qmake openscad.pro PREFIX=/usr
- Compile the binary. This takes a while.
make
- Test the binary
./openscad
- Move files over to basedir
INSTALL_ROOT=$BASEDIR make install
Create the OpenSCAD Package
- Create a desktop icon
mkdir -p $BASEDIR/home/guest/Desktop echo -e '#!/usr/bin/env xdg-open\n[Desktop Entry]\nEncoding=UTF-8\nName=OpenSCAD\nExec=openscad\nIcon=openscad\nType=Application' > $BASEDIR/home/guest/Desktop/OpenSCAD.desktop
- Fix the permissions and ownership of files
chown -R guest $BASEDIR/home/guest chgrp -R guest $BASEDIR/home/guest chmod a+x $BASEDIR/home/guest/Desktop/OpenSCAD.desktop
- Create the package and move it
dir2xzm $BASEDIR openscad-with-deps-x86_64.xzm mv openscad-with-deps-x86_64.xzm /mnt/sdX1/porteus/modules
- If you want you can remove the openscad-deps-x86_64.xzm package from the porteus/optional folder now.
- Reboot and see it it worked