pacstrapit
pacstrapit copied to clipboard
Btrfs on LUKS
btrfs on luks
| Last tested | 2014-11-27 with archlinux-2014.11.01-dual.iso |
pacstrapit is meant for provisioning physical hardware. It assumes
you have no need for dual-booting Windows, and that you are comfortable
working on the command line.
Instructions
- Burn LiveCD/LiveUSB with latest Arch ISO
- Boot from LiveCD/LiveUSB
- Connect to the Internet:
wifi-menu -o - Download pacstrapit:
curl -k https://codeload.github.com/atweiden/{pacstrapit}/{tar.gz}/{0.10.0} -o "#1-#3.#2" - Extract:
tar xvzf pacstrapit-0.10.0.tar.gz - Customize defaults (recommended even if using cmdline flags or environment variables)
WARNING: failure to give appropriate values could cause catastrophic data loss and system instability.
Defaults:
| Target partition | /dev/sda |
| Type of processor | other |
| Type of graphics card | Intel |
| Type of hard drive | HDD |
| Locale | en_US |
| Keymap | us |
| Timezone | America/Los_Angeles (PST) |
| Root password | secret |
| User name | guru |
| User password | secret |
| LUKS name | lux |
| LUKS password | secret |
| Hostname | luxor |
| Hosts allowed | 192.168.0. (LAN - SSH is disabled by default) |
cd pacstrapit-0.10.0 && $EDITOR pacstrapit
Done.
Usage
Run pacstrapit for a capable headless persistent USB installation
in /dev/sdb:
./pacstrapit start --bundle "base" \
--username "newusername" \
--userpass "your new user's password" \
--rootpass "your root password" \
--lukspass "your LUKS password" \
--hostname "yourhostname" \
--partition "/dev/sdb" \
--processor "other" \
--graphics "intel" \
--disk "usb" \
--luksname "infinity" \
--locale "en_US" \
--keymap "us" \
--timezone "America/Los_Angeles"
...use the select option instead of bundle for more control:
./pacstrapit start --select "base gui python nim" \
--dotfiles \
--username "newusername" \
--userpass "your new user's password" \
--rootpass "your root password" \
--lukspass "your LUKS password" \
--hostname "yourhostname" \
--partition "/dev/sdb" \
--processor "other" \
--graphics "intel" \
--disk "usb" \
--luksname "infinity" \
--locale "en_US" \
--keymap "us" \
--timezone "America/Los_Angeles"
Tip:
Omit
--bundleand--selectto create a very minimal headless system.The
basebundle adds CLI, vim, grsec and bitcoin pkgsThe
litebundle includes the base bundle plus GUI pkgs and dotfilesThe
fullbundle includes all pkgs and dotfiles
Run pacstrapit interactively:
./pacstrapit start -i
Tip:
Interactive mode allows you to manually select all important options. Use concealed mode (
--concealed|-c) if you're only interested in manually inputting your user password, root password and LUKS password without echoing it to console.
...with ssh access to target machine enabled:
./pacstrapit start -i -s
...with verbose output:
./pacstrapit start -i -s -V
Run pacstrapit using default variables in config section, but with
interactive password input:
./pacstrapit start --concealed
...with logging:
./pacstrapit start 2>&1 | tee pacstrapit.log
Run pacstrapit with username and password set from environment variables:
export USERNAME="sky"
export USERPASS="sailing"
./pacstrapit start
Run pacstrapit for a workstation installation:
./pacstrapit start --bundle "full" \
--username "newusername" \
--hostname "yourhostname" \
--partition "/dev/sda" \
--processor "intel" \
--graphics "nvidia" \
--disk "ssd" \
--luksname "infinity" \
--locale "en_US" \
--keymap "us" \
--timezone "America/Los_Angeles" \
--concealed
If the script exits with an error, it's best to reboot and start fresh
with a blank disk (shred -fvz -n 0 /dev/sdX).
Optional: sshd
If you intend to enable SSH access, you'll want to reset the
values of _electrum_pubkey_default, _user_pubkey_default, and
_user_pubkey_sig_default.
Before setting _ssh to 1...
On the control machine:
Make keys directory.
$ mkdir -p ~/keys
Generate ssh keys.
$ ssh-keygen -t ed25519 -b 521 -f ~/keys/id_ed25519
Get Electrum.
$ sudo pacman -S electrum
Generate an Electrum wallet.
$ electrum create -o
Pick an Electrum address for signing.
$ address_for_signing=$(electrum listaddresses | sed -n '2p' | tr -d '[:punct:]' | awk '{print $1}')
$ echo ${address_for_signing} > ~/keys/id_secp256k1.pub
$ electrum signmessage ${address_for_signing} "$(cat ~/keys/id_ed25519.pub)" > ~/keys/id_ed25519.pub.sig
Upload id_ed25519.pub, id_ed25519.pub.sig and id_secp256k1.pub to
GitHub, or any other file hosting service reachable via curl.
Save the exact URL for each keyfile to the corresponding
variable (_electrum_pubkey_default, _user_pubkey_default,
_user_pubkey_sig_default).
Default packages
Minimum packages installed (excluding dependencies, base and
base-devel groups):
| abs | Utilities to download and work with the Arch Build System (ABS). |
| arch-install-scripts | Scripts to aid in installing Arch. |
| arch-luks-suspend | Lock encrypted root volume on suspend. |
| bash-completion | Programmable completion for the bash shell. |
| btrfs-progs | Btrfs filesystem utilities. |
| ca-certificates | Common CA certificates. |
| cronie | Daemon that runs specified programs at scheduled times and related tools. |
| dhclient | Standalone DHCP client. |
| dialog | Tool to display dialog boxes from shell scripts. |
| dnscrypt-proxy | Tool for securing communications between a client and a DNS resolver. |
| ed | Line-oriented text editor. |
| ethtool | Utility for controlling network drivers and hardware. |
| expect | Tool for automating interactive applications. |
| gptfdisk | Text-mode partitioning tool that works on GUID Partition Table (GPT) disks. |
| grub-bios | GNU GRand Unified Bootloader. |
| haveged | Entropy harvesting daemon using CPU timings. |
| intel-ucode | Microcode update files for Intel CPUs. |
| iproute2 | IP Routing Utilities. |
| iptables | Linux kernel packet control tool. |
| iw | nl80211 based CLI configuration utility for wireless devices. |
| kbd | Keytable files and keyboard utilities. |
| kexec-tools | Load another kernel from the currently executing Linux kernel. |
| net-tools | Configuration tools for Linux networking. |
| openresolv | resolv.conf management framework (resolvconf). |
| openssh | SSH connectivity tools. |
| pacaur | Fast workflow AUR helper. |
| python2 | High-level scripting language v2. |
| reflector | Retrieve and filter the latest Pacman mirror list. |
| rsync | A file transfer program to keep remote files in sync. |
| sshpass | Fool ssh into accepting an interactive password non-interactively. |
| systemd-swap | Create hybrid swap space from zram swaps, swap files and swap partitions. |
| tmux | Terminal multiplexer. |
| unzip | Extract and view files in zip archives. |
| wget | Retrieve files from the Web. |
| wireless_tools | Wireless tools. |
| wpa_actiond | Daemon that connects to wpa_supplicant and handles connect and disconnect events. |
| wpa_supplicant | Utility providing key negotiation for WPA wireless networks. |
| zip | Create and modify zipfiles. |
| zsh | Very advanced and programmable shell. |
Optional packages
Base packages (use --bundle "base" to include):
| ack | Grep replacement. |
| ansible | Radically simple IT automation platform. |
| appjail | Sandboxing tool to protect private data from untrusted applications. |
| archversion | Archlinux Version Controller. |
| arch-wiki-lite | Offline Arch Wiki, easily searched and viewable on console. |
| asignify | Yet another signify tool. |
| autochown | Monitor multiple directories using glob patterns and automatically adjust file ownership and permissions. |
| avahi | Multicast/unicast DNS-SD framework. |
| bind-tools | The ISC DNS tools. |
| bluez | Bluetooth support. |
| bluez-firmware | Firmware for Broadcom BCM203x and STLC2300 Bluetooth chips. |
| ccrypt | Command-line utility for encrypting and decrypting files and streams. |
| check-pacman-mtree | Locate files that have changed on disk (size/md5/sha256). |
| colordiff | Syntax highlighting for diff. |
| commacd | A faster way to move around Bash. |
| corkscrew | A tool for tunneling SSH through HTTP proxies. |
| create_ap | Create a NATed/Bridged Software Access Point (aka WiFi). |
| cronwhip | Run missed cronjobs. |
| cryfs | Cryptographic filesystem for the cloud. |
| darkhttpd | Small and secure static webserver. |
| devtools | Tools for package maintainers. |
| downgrade | Downgrade software to an earlier version. |
| dtags | Directory tags for lazy programmers. |
| dvd+rw-tools | DVD burning tools. |
| easytether | EasyTether Internet access drivers. |
| elinks | Text mode web browser. |
| entr | Run arbitrary commands when files change. |
| facadefs | FUSE-based filesystem sandbox. |
| facron | fanotify cron system. |
| findx | Wrapper to extend the Unix find command. |
| f-irc | User-friendly IRC client for the console/terminal. |
| firejail | Sandbox any type of process. |
| fzf | Fuzzy finder for your shell. |
| fzf-extras | Extra keybindings for fzf. |
| geturl | Filepicker.io CLI tool to get a public link for any file. |
| git | Fast distributed version control system. |
| git-appraise | Distributed code review system for Git repositories. |
| git-extras | Git utilities. |
| git-lfs | An open source Git extension for versioning large files. |
| gitlint | Git commit message linter. |
| gnupg1 | GNU Privacy Guard. |
| hexgrep | Versatile grep-like binary stream and file search tool. |
| httpie | cURL for humans. |
| hub | CLI interface for Github. |
| icdiff | Improved colored diff. |
| idemptables | Idempotent iptables wrapper for appending and deleting rules. |
| imgurbash | Imgur.com CLI uploader. |
| ipset | Store multiple IP addresses or port numbers and match against the collection with iptables in one swoop. |
| ipw2100-fw | Intel Centrino Drivers firmware for IPW2100. |
| ipw2200-fw | Firmware for the Intel PRO/Wireless 2200BG. |
| irssi | Modular text mode IRC client with Perl scripting. |
| irssi-otr | OTR support for Irssi. |
| irssi-script-sasl | Freenode SASL support for Irssi. |
| ix | Client for the ix.io pastebin. |
| jq | CLI JSON processor. |
| keybase | CLI tool for GPG with keybase.io. |
| ledger.py | CLI double-entry accounting. |
| libfaketime | Report arbitrary dates and times to programs. |
| libusb-compat | USB device support. |
| lrzip | Multi-threaded file compression. |
| lsgrp | A simple command-line utility to list all members of a group. |
| lynx | Text mode Web browser. |
| macchanger | Change your NIC's MAC address. |
| makedep | Convert Pacman optional dependencies to real dependencies. |
| mawk | Minimal-featured Awk designed for speed of execution over functionality. |
| mdp | A command-line based Markdown presentation tool. |
| mercurial | Scalable distributed SCM tool. |
| mlocate | Locate files easily. |
| moby-thesaurus | The Project Gutenberg Etext of Moby Thesaurus II by Grady Ward. |
| moreutils | A growing collection of the unix tools that nobody thought to write thirty years ago. |
| mosh | Mobile shell, survives disconnects. |
| myrepos | Multiple Repository management tool. |
| nawk | The One True Awk. |
| ncurses | Text mode user interface support. |
| nyan | Simple netcat wrapper. |
| openvpn | An easy-to-use, robust, and highly configurable VPN. |
| ottools | Tools for encrypting files with one-time pads. |
| p7zip | 7zip file archiver. |
| pacdep | List package dependencies. |
| package-query | Query ALPM and AUR. |
| packer | Bash wrapper for Pacman and AUR. |
| paclog | List recent commits for Arch Linux packages. |
| pacmatic | Pacman with less surprises. |
| pacnew_scripts | A collection of scripts to help merge changes in .pacnew files. |
| pacserve | Easily share Pacman packages between computers. |
| pacupg | Script that wraps package and AUR upgrades in btrfs snapshots as well as providing an easy way to roll them back. |
| paexec | Parallel executor. |
| parallel | Execute jobs in parallel. |
| parcimonie-sh | Safely refresh your GnuPG keyring. |
| pbget | Retrieve PKGBUILDs and local source files from Git, ABS and the AUR for makepkg. |
| pdfgrep | A tool to search text in PDF files. |
| perl-image-exiftool | Alter EXIF data easily. |
| pipe-logger | Log rotation of stdout & stderr. |
| pipexec | Handle pipe of commands like a single command. |
| pkgbuild-introspection | Tools for generating .AURINFO files and PKGBUILD data extraction. |
| pkgcacheclean | Clean the Pacman cache to save on disk space. |
| pkg_scripts | A collection of pacman and package-related utilities. |
| progress | Show running coreutils basic commands and display stats. |
| proxychains-ng | Run programs from behind a proxy server. |
| puppet | Server automation framework and application. |
| python2-pbp | Simple crypto tool. |
| python3-aur | AUR-related modules and helper utilities. |
| q | Run SQL directly on CSV or TSV files. |
| qrencode | Encode data in a QR code. |
| quickserve | A simple HTTP server for quickly sharing files. |
| quixand | Create single-use unrecoverable encrypted sandboxes. |
| ranger | A simple, Vim-like file manager. |
| recollect | Keep local copies of remote files updated. |
| repo-add_and_sign | Easily create signed Pacman package repositories. |
| repoman | The pacman of repository managers. |
| reptyr | Utility for taking an existing running program and attaching it to a new terminal. |
| rfkill | Tool for enabling and disabling wireless devices. |
| rlwrap | Add readline-style editing and history to programs. |
| rtorrent | Rakshasa's BitTorrent client. |
| salt-raet | Central system and configuration manager. |
| sdcv | StarDict Console Version. |
| seq2gif | Convert a ttyrec record into a gif animation directly. |
| sfk | Swiss File Knife. |
| shmig | Database migration tool. |
| sift | A fast and powerful open source alternative to grep. |
| signify | Sign and verify signatures on files. |
| snapper | The ultimate snapshot tool for Linux. |
| socat | Multipurpose relay. |
| spiped | Secure pipe daemon. |
| sshuttle | Poor man's VPN. |
| ssss | CLI tool for Shamir's Secret Sharing Scheme. |
| steghide | Embed a message in a file. |
| subrepo | Git & Mercurial subrepos done right. |
| synclinks | A tool that synchronizes hierarchies of symlinks. |
| tcplay | CLI TrueCrypt implementation. |
| terminfo-italics | Common terminfo formats patched to support italics. |
| the_platinum_searcher | Code searching tool similar to the_silver_searcher. |
| the_silver_searcher | Code searching tool. |
| timedatectl-restorer | Restore system time across reboots when the internal clock is dead. |
| tor | Anonymizing overlay network. |
| torsocks | Safely torify applications. |
| toxic | Text mode instant messaging client for Tox. |
| tree | Show the contents of a directory in a depth-indented list of files. |
| ttyrec | A tty recorder and player. |
| tup | A fast, file-based build system. |
| units | Convert quantities expressed in various systems of measurement to their equivalents in other systems of measurement. |
| usb_modeswitch | Activate switchable USB devices. |
| usbmuxd | USB Multiplex Daemon. |
| websocketd | Turn any application that uses STDIO/STDOUT into a WebSocket server. |
| words | A collection of International 'words' files for /usr/share/dict. |
| xinetd | A secure replacement for inetd. |
| youtube-dl | YouTube.com CLI video downloader. |
Additional packages are available.
| AS | Packages for programming in ActionScript |
| Ada | Packages for programming in Ada |
| Analysis | Packages for system analysis |
| Android | Packages for Android programming |
| Assembly | Packages for programming in Assembly |
| BEAM | Packages for programming in Erlang / Elixir |
| C | Packages for programming in C / C++ / Obj-C |
| Crystal | Packages for programming in Crystal |
| D | Packages for programming in D |
| DotNet | Packages for programming in .NET |
| Fonts | Fonts with internationalization |
| Go | Packages for programming in Go |
| Gobi | Gobi 3G / mobile network connection firmware |
| Grsec | Packages for Grsecurity / PaX |
| Haskell | Packages for programming in Haskell |
| Haxe | Packages for programming in Haxe |
| Julia | Packages for programming in Julia |
| JVM | Packages for programming in Java / Clojure / Groovy / Scala / Kotlin |
| LaTeX | Packages for writing in LaTeX |
| Lisp | Packages for programming in Lisp / Scheme / Racket |
| Lua | Packages for programming in Lua |
| Markdown | Packages for writing in Markdown |
| Nim | Packages for programming in Nim |
| OCaml | Packages for programming in OCaml |
| Perl | Packages for programming in Perl |
| Perl6 | Packages for programming in Perl6 |
| PHP | Packages for programming in PHP |
| Python | Packages for programming in Python |
| RST | Packages for writing in reStructuredText |
| Ruby | Packages for programming in Ruby |
| Rust | Packages for programming in Rust |
| Swift | Packages for programming in Swift |
| Vala | Packages for programming in Vala |
| Vbox | Packages for VirtualBox |
| Webdev | HTML, Haml, Jade, Jinja, Mustache/Handlebars, Slim; CSS, LESS, Sass, SCSS, Stylus; JS/Node |
Selecting all packages (GUI included) adds over 1.1 GB to the download and over 5.5 GB to the system image size. This is something to be aware of if installing on a slow Internet connection or to a small USB stick. An 8GB USB stick should work perfectly well, but free space would be very limited with all GUI packages included.
Optional: dotfiles
Set _dotfiles to 1 for:

Licensing
This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.