#!/bin/sh # start,size,id,bootable part_script=' ,+,83,* ' # fs mp type options dump pass fstab=' @DEV1@ / ext4 errors=remount-ro 0 1 /var/swap swap swap defaults 0 0 ' mirror='http://httpredir.debian.org/debian' suite='jessie' arch='amd64' extra_pkgs=' linux-image-amd64 sysvinit-core ' hostname='alsvid200' 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' 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 ' postinst_pkgs=' bash mksh ksh zsh bash-completion screen sudo adduser nocache vcsh myrepos vim bvi less wdiff vbindiff git gitk build-essential autoconf automake patch quilt sbuild devscripts lintian debootstrap kpartx genisoimage syslinux-utils qemu-system-x86 u-boot-tools heimdall-flash android-tools-adb android-tools-fastboot flashrom markdown gnupg gnupg-agent openssl xorg xserver-xorg-video-intel xserver-xorg-input-evdev xserver-xorg-input-synaptics desktop-base x11-xserver-utils xdg-utils avahi-daemon libnss-mdns anacron eject iw alsa-utils alsa-base fluxbox fbpanel fbpager clipit compton xdm xscreensaver scrot rxvt-unicode gtk-redshift workrave mpd mpc ncmpcpp mpdscribble mpv sox audacity wodim youtube-dl gpicview gimp inkscape dia fontforge tiled librsvg2-bin xcftools imagemagick kanatest pidgin mumble gobby claws-mail claws-mail-fancy-plugin claws-mail-pgpmime claws-mail-spam-report html2ps openssh-server openssh-client rsync netcat-openbsd kicad gerbv openscad libreoffice evince planner ledger minicom htop ntp ncdu wicd-daemon wicd-gtk wicd-curses wicd-cli wireshark gnome-calculator units fonts-mplus fonts-linuxlibertine fonts-freefont-ttf fonts-dejavu fonts-liberation fonts-droid fonts-ubuntu-title fonts-lato ttf-unifont libhtml-tree-perl libhtml-template-perl libemail-mime-perl libemail-sender-perl libhtml-template-perl libjson-xs-perl libwww-perl libparse-recdescent-perl libplack-perl liburi-perl libcrypt-rijndael-perl starman bsdgames fortune-mod fortunes-min fortunes-bofh-excuses ' do_postinst() { # Add "deb-src" line and backports. cat >"${target}/etc/apt/sources.list" <<-EOF deb http://httpredir.debian.org/debian jessie main deb-src http://httpredir.debian.org/debian jessie main EOF cat >"${target}/etc/apt/sources.list.d/jessie-backports.list" <<-EOF deb http://httpredir.debian.org/debian jessie-backports main deb-src http://httpredir.debian.org/debian jessie-backports main EOF in_target apt-get update || return 1 in_target apt-get -q -y install midori || return 1 in_target apt-get -q -y purge libpam-systemd systemd || return 1 in_target apt-get -q -y --purge autoremove || return 1 in_target apt-get clean || return 1 in_target adduser pj scanner || return 1 in_target adduser pj wireshark || return 1 in_target adduser pj sbuild || return 1 # Use host's SSH keypair temporarily. install -d -o pj -g pj -m 0700 "${target}/home/pj/.ssh" || return 1 install -o pj -g pj -m 0600 '/home/pj/.ssh/id_rsa' \ "${target}/home/pj/.ssh/id_rsa" || return 1 install -o pj -g pj -m 0600 '/home/pj/.ssh/id_rsa.pub' \ "${target}/home/pj/.ssh/id_rsa.pub" || return 1 # 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. 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 clipit fluxbox gpicview midori \ redshift xdg-user-dirs # Generate target's SSH keypair. rm -f "${target}/home/pj/.ssh/id_rsa" \ "${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