summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hosts/logi1/conf41
-rw-r--r--hosts/logi1/pkgs336
-rw-r--r--hosts/logi1/postinst170
3 files changed, 547 insertions, 0 deletions
diff --git a/hosts/logi1/conf b/hosts/logi1/conf
new file mode 100644
index 0000000..cf2d02e
--- /dev/null
+++ b/hosts/logi1/conf
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# start,size,id,bootable
+part_script='
+ 1024,+,83,*
+ '
+
+# fs mp type options dump pass
+fstab='
+ @DEV1@ / ext4 errors=remount-ro 0 1
+ /var/swap swap swap defaults,pri=100 0 0
+ '
+
+mirror='http://deb.debian.org/debian'
+suite='stretch'
+arch='amd64'
+extra_pkgs='
+ grub-pc
+ linux-image-amd64
+ sysvinit-core
+ '
+
+locale='en_US'
+supported_locales='en_US.UTF-8 en_DK.UTF-8'
+
+time_zone='UTC'
+
+passwd_shadow='on'
+root_passwd_crypted='$6$XMSNMQ6H8G0$9J.jbKWARqSLj51uC1L3J9y0nO/E6.7/l6JdUAwL6Dn.KVeaYbmA2H4EBHT.d55a49gifPkF0AuUnziKN45rF.'
+root_login=true
+user_make=true
+user_name='pj'
+user_full_name='P. J. McDermott'
+user_groups='adm cdrom floppy sudo audio dip video plugdev netdev lpadmin'
+user_passwd_crypted='$6$.4kiiaCvfP$WZtL6RXtWtW0lIRnx2GyJwaN1OdkQUEHOulzxyXlS.dKTClhaI9Hkq3.bdE6TC613VqgEekwPgm3.T1D9CCuk0'
+
+debconf_selections='
+ keyboard-configuration keyboard-configuration/layout select English (US)
+ keyboard-configuration keyboard-configuration/variant select English (US)
+ wireshark-common wireshark-common/install-setuid boolean true
+ '
diff --git a/hosts/logi1/pkgs b/hosts/logi1/pkgs
new file mode 100644
index 0000000..cd3b92c
--- /dev/null
+++ b/hosts/logi1/pkgs
@@ -0,0 +1,336 @@
+# Base system utilities
+ bc
+ busybox
+ time
+# Shells
+ bash
+ bash-completion
+ ksh
+ mksh
+ zsh
+# Administrative daemons
+ anacron
+# Administrative utilities
+ adduser
+ sudo
+# Hardware sensor monitoring and fan control utilities
+ fancontrol
+ lm-sensors
+# Hardware listing utilities
+ pciutils
+ usbutils
+# Block device utilities
+ gddrescue
+ kpartx
+# File and file system utilities
+ lsof
+ ncdu
+ nocache
+ ntfs-3g
+# Archival utilities
+ p7zip
+ unar
+ unzip
+ zip
+# User configuration management utilities
+ vcsh
+ myrepos
+# Editors, pagers, and documentation readers
+ bvi
+ info
+ less
+ vbindiff
+ vim
+ wdiff
+# Version control systems
+ bzr
+ git
+ gitk
+ mercurial
+ subversion
+# Patch management utilities
+ patch
+ quilt
+# Build system utilities
+ autoconf
+ autoconf-doc
+ automake
+ bmake
+ cmake
+ pkg-config
+# Build utilities
+ bison
+ build-essential
+ flex
+ gdb
+# Debian development tools
+ debootstrap
+ devscripts
+ dh-autoreconf
+ lintian
+ sbuild
+# Code analytics and QA utilities
+ sloccount
+ valgrind
+# coreboot and GRUB build dependencies
+ acpica-tools
+ gnat
+ libfreetype6-dev
+ libpci-dev
+ zlib1g-dev
+# flashrom build dependencies
+ libusb-1.0-0-dev
+ libusb-dev
+# Firmware utilities
+ dis51
+ radare2
+# U-Boot and Android-related utilities
+ android-tools-adb
+ android-tools-fastboot
+ heimdall-flash
+ u-boot-tools
+# Flashing utilities
+ flashrom
+# AVR build and flashing utilities and C library
+ avr-libc
+ avrdude
+ binutils-avr
+ gcc-avr
+# Hypervisors
+ qemu-system-x86
+# Database management systems
+ sqlite3
+# Graphics and document utilities
+ graphviz
+ imagemagick
+ librsvg2-bin
+ llgal
+ m4
+ markdown
+ optipng
+ paps
+ pdftk
+ xcftools
+# Public-key cryptography utilities
+ gnupg
+ gnupg-agent
+ openssl
+# Networking utilities
+ dnsutils
+ ftp
+ iperf3
+ whois
+ wget
+ wireshark
+# Network communication utilities
+ netcat-openbsd
+ openssh-client
+ openssh-server
+ rsync
+# DNS service discovery daemon and NSS module
+ avahi-daemon
+ libnss-mdns
+# Wi-Fi utilities
+ iw
+# Wicd
+ wicd-cli
+ wicd-curses
+ wicd-daemon
+ wicd-gtk
+# Time utilities
+ faketime
+ ntp
+# System monitoring utilities
+ htop
+ iotop
+ powerstat
+ powertop
+# ALSA
+ alsa-base
+ alsa-utils
+# CUPS, etc.
+ cups
+ printer-driver-hpcups
+ system-config-printer
+# X.org X server, drivers, and utilities
+ x11-xserver-utils
+ xinput
+ xorg
+ xserver-xorg-input-libinput
+ xserver-xorg-input-synaptics
+ xserver-xorg-video-nouveau
+# Window manager and panel
+ clipit
+ compton
+ fbpager
+ fbpanel
+ fluxbox
+# Display manager, screensaver daemon, etc.
+ scrot
+ unclutter
+ xdm
+ xscreensaver
+# Desktop artwork, utilities, etc.
+ desktop-base
+ xdg-utils
+# GNOME themes
+ gnome-themes-standard
+# Terminal utilities
+ minicom
+ roxterm-gtk3
+ screen
+# Ergonomics applications
+ gtk-redshift
+ workrave
+# Image, font, and tileset viewers and editors
+ dia
+ fontforge
+ gimp
+ gpicview
+ inkscape
+ tiled
+# Multimedia players and editors
+ audacity
+ mpc
+ mpd
+ mpdscribble
+ mpv
+ ncmpcpp
+ sox
+ youtube-dl
+# Disc and image utilities
+ brasero
+ eject
+ genisoimage
+ syslinux-utils
+ wodim
+# Web browsers
+ lynx
+ midori
+ w3m
+# Mail client
+ claws-mail
+ claws-mail-fancy-plugin
+ claws-mail-pgpinline
+ claws-mail-pgpmime
+ claws-mail-spam-report
+ html2ps
+# Messaging and collaboration applications
+ gobby
+ mumble
+ pidgin
+# Mathematics applications
+ gnome-calculator
+ units
+# Office, productivity, and accounting applications
+ evince
+ ledger
+ libreoffice
+ planner
+# Solid CAD applications
+ gerbv
+ meshlab
+ openscad
+# Ncurses, SDL, Lua, GTK+, WebKitGTK+, etc. libraries
+ gtk-3-examples
+ libcairo2-dev
+ libcairo2-doc
+ libgtk-3-dev
+ libgtk-3-doc
+ liblua5.1-0-dev
+ libncurses5-dev
+ librsvg2-dev
+ librsvg2-doc
+ libsdl-image1.2-dev
+ libsdl1.2-dev
+ libwebkit2gtk-4.0-dev
+ libwebkit2gtk-4.0-doc
+# Perl distributions
+ libautovivification-perl
+ libcgi-ssi-perl
+ libcrypt-rijndael-perl
+ libcurses-ui-perl
+ libdbd-sqlite3-perl
+ libdbi-perl
+ libdevel-cover-perl
+ libdevel-repl-perl
+ libdigest-sha-perl
+ libemail-mime-perl
+ libemail-sender-perl
+ libhtml-template-perl
+ libhtml-template-perl
+ libhtml-tree-perl
+ libjavascript-beautifier-perl
+ libjson-xs-perl
+ libmail-rfc822-address-perl
+ libmodule-starter-perl
+ libparse-recdescent-perl
+ libperl-critic-perl
+ libplack-perl
+ libtest-pod-coverage-perl
+ libtest-pod-perl
+ libtest-script-perl
+ libtime-fake-perl
+ liburi-perl
+ libwww-perl
+ libxml-sax-expatxs-perl
+ libxml-sax-perl
+ perl-doc
+ starman
+# JavaScript utilities
+ libmozjs-24-bin
+ mocha
+# Lua libraries
+ lua-ldoc
+ lua-markdown
+ lua-posix
+# Epson Inkjet Printer Driver (ESC/P-R) build dependencies
+ libcups2-dev
+ libcupsimage2-dev
+ pyppd
+# Inkscape build dependencies
+ libboost-dev
+ libgc-dev
+ libgdl-3-dev
+ libgsl-dev
+ libgtkmm-3.0-dev
+ libpoppler-dev
+ libpoppler-private-dev
+ libpopt-dev
+ libsoup2.4-dev
+ libxslt1-dev
+# Font families
+ fonts-croscore
+ fonts-dejavu
+ fonts-droid-fallback
+ fonts-freefont-ttf
+ fonts-lato
+ fonts-liberation
+ fonts-linuxlibertine
+ fonts-mplus
+ fonts-ubuntu-title
+ ttf-unifont
+# Dictionary word lists
+ wamerican-huge
+ wamerican-insane
+ wamerican-large
+# Educational applications
+ kanatest
+# Toys
+ cowsay
+ fortune-mod
+ fortunes-bofh-excuses
+ fortunes-min
+# Games, etc.
+ bsdgames
+ desmume
+ freedink
+ freedoom
+ micropolis
+ openttd
+ prboom-plus
+ pychess
+ python-pygame
+ python-six
+ vba
+ wesnoth
diff --git a/hosts/logi1/postinst b/hosts/logi1/postinst
new file mode 100644
index 0000000..48981e5
--- /dev/null
+++ b/hosts/logi1/postinst
@@ -0,0 +1,170 @@
+#!/bin/sh
+
+# Make swap file and set vm.swappiness.
+# mkswap needs to be given the full path to the swap file including the
+# root file system's mount point, or else this false error happens:
+# mkswap: error: /var/swap is mounted; will not make swapspace
+fallocate -l 4GiB "${target}/var/swap" || return 1 # TODO: Increase
+chmod 0600 "${target}/var/swap" || return 1
+mkswap "${target}/var/swap" || return 1
+printf 'vm.swappiness = 10\n' >"${target}/etc/sysctl.d/vm-swappiness.conf"
+
+# Hibernation.
+root="UUID=$(blkid -o value -s UUID "${dev}1")"
+offset="$(in_target filefrag -v /var/swap | sed -n '
+ /physical_offset:/{
+ n;
+ s/^[ 0-9.]*:[ 0-9.]*: *\([0-9][0-9]*\)...*$/\1/;
+ p;
+ q;
+ };')"
+cmdline="quiet iommu=pt resume=${root} resume_offset=${offset}"
+# TODO: cmdline="${cmdline} nouveau.config=NvBios=vbios.rom"
+cp -p "${target}/etc/default/grub" "${target}/etc/default/grub.dist"
+sed 's|^\(GRUB_CMDLINE_LINUX_DEFAULT\)=.*$|\1="'"${cmdline}"'"|;' \
+ "${target}/etc/default/grub.dist" >"${target}/etc/default/grub"
+
+# Disable ast Linux driver module.
+cat >"${target}/etc/modprobe.d/ast.conf" <<-EOF
+ blacklist ast
+ EOF
+
+# Set up fancontrol.
+cat >"${target}/etc/modules" <<-EOF
+ w83795
+ EOF
+# TODO: /etc/fancontrol
+
+# Disable mpd service.
+in_target update-rc.d mpd disable
+
+# Add "deb-src" line as well as backports and debug symbols archives.
+cat >"${target}/etc/apt/sources.list" <<-EOF
+ deb http://deb.debian.org/debian stretch main
+ deb-src http://deb.debian.org/debian stretch main
+ EOF
+cat >"${target}/etc/apt/sources.list.d/stretch-backports.list" <<-EOF
+ deb http://deb.debian.org/debian stretch-backports main
+ deb-src http://deb.debian.org/debian stretch-backports main
+ EOF
+cat >"${target}/etc/apt/sources.list.d/stretch-debug.list" <<-EOF
+ deb http://deb.debian.org/debian-debug stretch-debug main
+ EOF
+in_target apt-get update || return 1
+in_target apt-get -q -y install kicad/stretch-backports || return 1
+in_target apt-get -q -y install tor/stretch-backports torsocks || return 1
+in_target apt-get -q -y install libglib2.0-0-dbgsym libgtk-3-0-dbgsym || \
+ return 1
+
+# Set default x-www-browser.
+in_target update-alternatives --set x-www-browser /usr/bin/midori
+
+# Purge systemd.
+in_target apt-get -q -y purge libpam-systemd systemd || return 1
+in_target apt-get -q -y --purge autoremove || return 1
+
+# Remove packages from APT cache.
+in_target apt-get clean || return 1
+
+# Add user to groups created by postinst_pkgs.
+in_target adduser pj scanner || return 1
+in_target adduser pj wireshark || return 1
+in_target adduser pj sbuild || return 1
+
+# Add udev rule for USBtinyISP(-compatible) programmers.
+cat >"${target}/etc/udev/rules.d/10-usbtinyisp.rules" <<-EOF
+ SUBSYSTEM=="usb", ATTR{idVendor}=="1781", ATTR{idProduct}=="0c9f", MODE="0660", GROUP="adm"
+ EOF
+
+# Add udev rule for CH341A-based programmers.
+cat >"${target}/etc/udev/rules.d/10-ch341a.rules" <<-EOF
+ SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="0666"
+ EOF
+
+# Install Vertex themes.
+in_target apt-get -q -y install gnome-themes-standard gtk2-engines-murrine \
+ libgtk-3-dev
+in_target sudo -u pj sh <<-EOF
+ set -e
+ git clone https://github.com/horst3180/vertex-theme \
+ /home/pj/src/vertex-theme/
+ cd /home/pj/src/vertex-theme/
+ ./autogen.sh --prefix=/home/pj/.local
+ make install
+ ln -s .local/share/themes/ /home/pj/.themes
+ EOF
+[ ${?} -ne 0 ] && return 1
+
+# Download wallpaper.
+in_target sudo -u pj wget -O /home/pj/.wallpaper \
+ http://product-files.libiquity.com/taurinus/boot-splash/x200/background.png
+
+# Use temporary configuation SSH key.
+install -d -o 1000 -g 1000 -m 0700 "${target}/home/pj/.ssh" || return 1
+cat >"${target}/home/pj/.ssh/id_rsa" <<-EOF
+ -----BEGIN RSA PRIVATE KEY-----
+ MIICXAIBAAKBgQCzAF0zqeS2X0TuVOIxqMec3lMzZy/MHQswPP+BQkmc2D3YVb2x
+ px1YAAweQnfZ27pGJkDztStOtMQJeaOsnAVdm2NSe+hEdaKAOxf9p6t+F930HM/w
+ 1wkm1ddlsnCaaCipzGVOM77Q/brEItWvuq8G0+/fgN1o4pZzl4Bub/4D4QIDAQAB
+ AoGAS+wKnAAiXuv3m7LrIa75w2JVHcdVcZicB0DICnYoLNtXF+v+AlzkSE/009zT
+ YtccoeZVxEiCbuajA3XRY0PlzgGHTbsGn1BWqI9cjdXTiotnjzOH8zr3JiMZMWwf
+ hqwbtleP+yruNPHMxQ8dKVXv875NKJW+aArmQWtjeMOy/vECQQDdsvPJ4bUu8M7/
+ MXqGtz8CJbrRp+ZMKUw0WuwSwTfHRs/Jp27mWf5+t/u+RN8WK/RRD8FHvz4azLhr
+ sNUFiE69AkEAzrI/DFBFOM5mUECujs2UvCCeWZiAi9QoJ7kDrrAkcG+hMalpNUU3
+ SUZ76stBUk3hZNpc82aq0a0o8ac0VrBd9QJAB3nbYrlrxLN2J4Dhot1XEJl5HUzO
+ JU9XNITEZTWCzgODSkeNI9NxE5DcumPUKgk9aeZgHC1EyN6ScX87D76y+QJAL8DE
+ ii69X1toDeBzs7BRTYlnrCFsiWGRiWPYMvKk6IkRv6x5DwKXvEkZdexRghdWHHvK
+ f71Xd6u+yt2rXN/QRQJBALv6SwbokdXp5qKJV48QG452dSOT7FQEINnCsIeNUKP6
+ 9YyaZxqLia6pEbEKTSRdztXaMqRsrmOG8E084sFg8DQ=
+ -----END RSA PRIVATE KEY-----
+ EOF
+in_target chown pj:pj '/home/pj/.ssh/id_rsa'
+in_target chmod 0600 '/home/pj/.ssh/id_rsa'
+
+# Set up SSH known hosts.
+cat >"${target}/home/pj/.ssh/known_hosts" <<-EOF
+ |1|fypb7kn7NH0fqHGj9Xs/rdpO71s=|SCtg2BdMNB9zL5bAPYkJy1uiNSM= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCXcG5BuZi4947D9WqY1L6CzaH4Qjw7YA7Dja+09y0nZjLVDd1saZCPkTjo1PEHxVCvSHvc0VmRqIZ2wUGtuqIlgGPMphCPAtdHN63YcNXqIhjEygLsaSZgy1Qz33YQF+YSANbeZQ4vnqiYr3C1IA7Cw4km/0s1BvP3t9yJf/iYODZqjVqUhqB4hzXJcBZHrgnM4LmPD4NH81fCqpwfRviNQNFAqd/aT1YTvgdn46HTVz7dV8ahW6SLXBTJZvO9dLAAKOPPZwuluaRphBqjPLC83zsihQ884SAH+AKcpN1ne73UZUuA1Gyk3HW+a/ngbzm1nmoeC0Sm1nNlTvC4WrLD
+ |1|z7it+otnWcn/98YKdeaBCXl+ug8=|NFRpdQZBMTAuWbUDAqXLptFR5Ao= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCXcG5BuZi4947D9WqY1L6CzaH4Qjw7YA7Dja+09y0nZjLVDd1saZCPkTjo1PEHxVCvSHvc0VmRqIZ2wUGtuqIlgGPMphCPAtdHN63YcNXqIhjEygLsaSZgy1Qz33YQF+YSANbeZQ4vnqiYr3C1IA7Cw4km/0s1BvP3t9yJf/iYODZqjVqUhqB4hzXJcBZHrgnM4LmPD4NH81fCqpwfRviNQNFAqd/aT1YTvgdn46HTVz7dV8ahW6SLXBTJZvO9dLAAKOPPZwuluaRphBqjPLC83zsihQ884SAH+AKcpN1ne73UZUuA1Gyk3HW+a/ngbzm1nmoeC0Sm1nNlTvC4WrLD
+ EOF
+in_target chown pj:pj '/home/pj/.ssh/known_hosts'
+in_target chmod 0600 '/home/pj/.ssh/known_hosts'
+
+# Bootstrap vcsh and mr.
+rm -f "${target}/home/pj/.profile" "${target}/home/pj/.bashrc" \
+ "${target}/home/pj/.bash_logout"
+in_target sudo -u pj vcsh clone ssh://git@git.pehjota.net/dotfiles/mr.git mr \
+ || return 1
+in_target sudo -u pj mr update || return 1
+in_target sudo -u pj /home/pj/bin/dfen claws-mail clipit fluxbox gpicview gimp \
+ gtk kicad midori mpd mpv redshift roxterm xdg-user-dirs xscreensaver
+
+# Create XDG directories.
+sed 's/#.*$//; /^$/d;' "${target}/home/pj/.config/user-dirs.dirs" | \
+ while IFS='=' read var val; do
+ HOME='/home/pj'
+ eval "mkdir '${target}/'${val}"
+ done
+
+# Add empty folder list to prevent Claws Mail wizard from running.
+cat >"${target}/home/pj/.claws-mail/folderlist.xml" <<-EOF
+ <?xml version="1.0" encoding="UTF-8"?>
+ <folderlist>
+ <folder type="imap" sort="0" collapsed="0" account_id="1" name="pj@pehjota.net">
+ </folder>
+ <folder type="imap" sort="0" collapsed="0" account_id="2" name="patrick.mcdermott@libiquity.com">
+ </folder>
+ </folderlist>
+ EOF
+
+# Generate target's SSH keypair.
+rm -f "${target}/home/pj/.ssh/id_rsa" "${target}/home/pj/.ssh/id_rsa.pub" || \
+ return 1
+install -o 1000 -g 1000 -m 0600 '/home/pj/.ssh/id_rsa' \
+ "${target}/home/pj/.ssh/id_rsa" || return 1
+install -o 1000 -g 1000 -m 0600 '/home/pj/.ssh/id_rsa.pub' \
+ "${target}/home/pj/.ssh/id_rsa.pub" || return 1
+#in_target ssh-keygen -b 4096 -C pj@alsvid200 -t rsa -f /home/pj/.ssh/id_rsa \
+# </dev/null || return 1
+#cp "${target}/home/pj/.ssh/id_rsa.pub" 'pj@alsvid200.pub' || return 1
+
+return 0