deb http://cdn.debian.net/debian stretch main
endef
-PACKAGES := ${PACKAGES} apt btrfs-tools busybox-static bzip2 ca-certificates cron debian-archive-keyring deborphan firmware-linux-free gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less make net-tools nmap ntpdate openssh-client psmisc rsync sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip
+PACKAGES := ${PACKAGES} apt busybox-static debian-archive-keyring init systemd
config.mk:
cp "config.example" "$@"
deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi
deb http://archive.raspberrypi.org/debian stretch main
endef
+
PACKAGES := ${PACKAGES} firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel
_target: _umount _partcopy _config _install
! printf '%s\n' "$${VOLUME}" |grep -q '^/dev/' # abort if volume should be real device
dd count=0 of="$${VOLUME}" # truncate
dd bs=1M count=0 seek=$$((3 + ${BOOT_MB} + ${ROOT_MB})) of="$${VOLUME}"
+ chmod g+w "$${VOLUME}"
${PBOOT}: .FORCE
! printf '%s\n' "$${PBOOT}" |grep -q '^/dev/' # abort if volume should be real device
-# image=disk.img squash=rootfs.squash raspi=raspi.img
-# modules=
+## Choose only on of the possible target types
+# image=disk.img
+# squash=rootfs.squash
+# raspi=raspi.img
+## Image size in MB. Needs to be able to hold all software.
+# imagesize=2048
+
+## Additional packages
# packages=chromium,gimp
+
+## Comma separated list of config modules from modules/ directory
+# modules=nodm,xfce
+
+## Root password will be salted and encrypted in image
# rootpass=topsecret
+
+## Comma separated list of users to be set up.
+## User logins will start out with an empty password
+# users=adam,steve
+
+## Wifi configuration, if a Wifi password is given, WPA encryption will be used
+## without the password, the system will try to connect to an open wifi
# wifi=MyWiFi
# wifipass=P4ssW0rD
+
+## Timezone as offered by Debians tzdata selection
+# timezone=Europe/Berlin
+
+## Comma separated list of locales, first one will become default locale
+# locales=de_DE.UTF-8,en_US.UTF-8
+
+## If nodm is installed, you can choose a user to login automatically
+## If no user is given here, then nodm will default to root
+# nodm_user=adam
+
+## If the approxmodule is enabled, then one (and only one) apt-source
+## can be choosen to install packages from
+## See modules/approx.mk if you need more flexibility
+# approx=http://localhost:9000/debian
+ifdef imagesize
+ROOT_MB := $(shell printf '%i\n' "$$(( ${imagesize} - ${BOOT_MB} - 3 ))")
+endif
+
+PACKAGES := ${PACKAGES} btrfs-tools bzip2 ca-certificates cron deborphan firmware-linux-free gzip htop ifupdown iputils-ping irqbalance isc-dhcp-client less make net-tools nmap ntpdate openssh-client psmisc rsync sshfs sudo traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip
+
ifdef packages
-PACKAGES := ${PACKAGES} $(subst ${comma_},${space},${packages})
+PACKAGES := ${PACKAGES} $(subst ${comma_},${space_},${packages})
endif
+export DEBCONF
+
+define DEBCONF :=
+keyboard-configuration keyboard-configuration/model select Generic 105-key (Intl) PC
+keyboard-configuration keyboard-configuration/variant select English (US) - English (Macintosh)
+endef
+
+.PHONY: _debconf_selections
+_install: _debconf_selections
+_debconf_selections: ${SYSROOT}
+ printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections
+
+.PHONY: _timezone _locales
+
+ifdef timezone
+define DEBCONF :=
+${DEBCONF}
+tzdata tzdata/Areas select $(firstword $(subst /,${space_},${timezone}))
+tzdata tzdata/Zones/Europe select $(lastword $(subst /,${space_},${timezone}))
+endef
+PACKAGES := ${PACKAGES} tzdata
+_config: _timezone
+endif
+
+ifdef locales
+define DEBCONF :=
+${DEBCONF}
+locales locales/locales_to_be_generated multiselect ${locales}
+locales locales/default_environment_locale select $(firstword $(subst ${comma_},${space_},${locales}))
+endef
+#$(addsuffix ${space_}UTF-8,$(subst ${comma_},${space_}${comma},${locales}))
+PACKAGES := ${PACKAGES} locales
+_config: _locales
+endif
+
+_timezone: ${CFGROOT}
+ rm "$${CFGROOT}/etc/timezone"
+ chroot "$${CFGROOT}" dpkg-reconfigure --default-priority -u tzdata
+
+_locales: ${CFGROOT}
+ rm "$${CFGROOT}/etc/default/locale" "$${CFGROOT}/etc/locale.gen"
+ chroot "$${CFGROOT}" dpkg-reconfigure --default-priority -u locales
+
+.PHONY: _rootpass _users
+
ifdef rootpass
export rootpass
-.PHONY: _rootpass
_config: _rootpass
-_rootpass: ${CFGROOT}
- chroot "$${CFGROOT}" usermod -p "$$(openssl passwd -salt "$$(($${RANDOM-0} + 10))" "$${rootpass}")" root
endif
-ifdef wifi
-export wifi
-_config: ${CFGROOT}/etc/network/interfaces.d/wifi
+ifdef users
+_config: _users
+endif
+_rootpass: ${CFGROOT}
+ chroot "$${CFGROOT}" usermod -p "$$(openssl passwd "$${rootpass}")" root
+
+_users: ${CFGROOT}
+ #sed -Ei 's;^SHELL=/bin/sh$$;SHELL=/bin/bash;;' "${CFGROOT}/etc/default/useradd"
+ for u in $(subst ${comma_},${space_},${users}); do \
+ chroot "$${CFGROOT}" useradd -m -s /bin/bash -p "$$(openssl passwd "")" "$$u"; \
+ done
+
+ifdef wifi
ifdef wifipass
-export wifipass
+export wifi wifipass
${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT}
printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@
printf ' wpa-ssid "%s"\n wpa-psk "%s"\n' "$$wifi" "$$wifipass" >>$@
else
+export wifi
${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT}
printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@
printf ' wireless-ssid "%s"\n' "$$wifi" >>$@
endif
+_config: ${CFGROOT}/etc/network/interfaces.d/wifi
endif
--- /dev/null
+ifdef raspi
+PACKAGES := ${PACKAGES} nodm xserver-xorg-video-fbturbo xserver-xorg-input-evdev
+else
+PACKAGES := ${PACKAGES} nodm xserver-xorg-video-all xserver-xorg-input-all
+endif
+
+
+define DEBCONF :=
+${DEBCONF}
+nodm nodm/enabled boolean true
+endef
+
+ifdef nodm_user
+_config: _nodm_user
+define DEBCONF :=
+${DEBCONF}
+nodm nodm/user string ${nodm_user}
+endef
+
+endif
+
+.PHONY: _nodm_user
+_nodm_user: ${CFGROOT}
+ rm "$${CFGROOT}/etc/default/nodm"
+ chroot "${CFGROOT}" dpkg-reconfigure --default-priority -u nodm
+ chroot "${CFGROOT}" adduser "${nodm_user}" video
--- /dev/null
+PACKAGES := ${PACKAGES} xfce4 xauth x11-xserver-utils x2x xvkbd blueman xfce4-terminal xfce4-clipman-plugin xfce4-whiskermenu-plugin thunar gvfs gvfs-backends gvfs-fuse xscreensaver
+
+.PHONY: _xfce
+_config: _xfce
+_xfce: ${CFGROOT}
+ cp -a modules/xfce/. "$${CFGROOT}"
--- /dev/null
+xscreensaver.mode: one
+xscreensaver.selected: 151
+xscreensaver.newLoginCommand: /usr/sbin/lxdm -c USER_SWITCH
+
--- /dev/null
+xvkbd.modalKeytop: true
+xvkbd.compact: true
+xvkbd.secure: true
+xvkbd.alwaysOnTop: true
+xvkbd.wmToolbar: true
+
--- /dev/null
+export QT_STYLE_OVERRIDE=Breeze
--- /dev/null
+include "/usr/share/themes/Breeze/gtk-2.0/gtkrc"
--- /dev/null
+[MainWindow]
+Height 900=640
+Width 1440=1024
+
+[MarbleWidget]
+homeLatitude=52.5011
+homeLongitude=13.4658
+homeZoom=3050
+mapTheme=earth/openstreetmap/openstreetmap.dgml
--- /dev/null
+[Added Associations]
+application/ogg=vlc.desktop;audacity.desktop;
+application/pdf=kde4-okularApplication_pdf.desktop;
+audio/flac=vlc.desktop;audacity.desktop;
+audio/mp4=vlc.desktop;audacity.desktop;
+audio/mpeg=vlc.desktop;audacity.desktop;
+audio/ogg=vlc.desktop;audacity.desktop;
+audio/x-flac+ogg=vlc.desktop;audacity.desktop;
+audio/x-m4b=vlc.desktop;audacity.desktop;
+audio/x-ms-wma=vlc.desktop;audacity.desktop;
+audio/x-opus+ogg=vlc.desktop;audacity.desktop;
+audio/x-speex+ogg=vlc.desktop;audacity.desktop;
+audio/x-vorbis+ogg=vlc.desktop;audacity.desktop;
+text/html=firefox-esr.desktop;chromium.desktop;kde4-kfmclient_html.desktop;kde4-kate.desktop;kde4-kwrite.desktop;libreoffice-writer.desktop;kde4-okularApplication_txt.desktop;vim.desktop;
+video/mpeg=vlc.desktop;audacity.desktop;
+video/ogg=vlc.desktop;audacity.desktop;
+video/x-ogm+ogg=vlc.desktop;audacity.desktop;
+video/x-theora+ogg=vlc.desktop;audacity.desktop;
--- /dev/null
+[Desktop Entry]
+Version=1.0
+Name=Keyboard
+Exec=/bin/sh -c "killall xvkbd || xvkbd"
+Icon=blueman-keyboard
--- /dev/null
+favorites=libreoffice-startcenter.desktop,firefox-esr.desktop,clementine.desktop,marble.desktop,audacity.desktop,org.kde.kdenlive.desktop,blender.desktop,inkscape.desktop,org.kde.krita.desktop,xfce4-terminal.desktop
--- /dev/null
+[Configuration]
+BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT
+BackgroundDarkness=0.850000
--- /dev/null
+<?xml varsion="1.0" encoding="UTF-8"?>
+
+<channel name="thunar" version="1.0">
+ <property name="misc-single-click" type="bool" value="true"/>
+</channel>
--- /dev/null
+<?xml varsion="1.0" encoding="UTF-8"?>
+
+<channel name="xfce4-desktop" version="1.0">
+ <property name="desktop-icons" type="empty">
+ <property name="single-click" type="bool" value="true"/>
+ <property name="file-icons" type="empty">
+ <property name="show-trash" type="bool" value="false"/>
+ <property name="show-filesystem" type="bool" value="false"/>
+ <property name="show-home" type="bool" value="false"/>
+ </property>
+ </property>
+</channel>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<channel name="xfce4-panel" version="1.0">
+ <property name="configver" type="int" value="2"/>
+ <property name="panels" type="array">
+ <value type="int" value="1"/>
+ <property name="panel-1" type="empty">
+ <property name="position" type="string" value="p=12;x=662;y=997"/>
+ <property name="size" type="uint" value="32"/>
+ <property name="position-locked" type="bool" value="true"/>
+ <property name="length" type="uint" value="100"/>
+ <property name="background-style" type="uint" value="0"/>
+ <property name="plugin-ids" type="array">
+ <value type="int" value="1"/>
+ <value type="int" value="11"/>
+ <value type="int" value="8"/>
+ <value type="int" value="10"/>
+ <value type="int" value="9"/>
+ <value type="int" value="12"/>
+ <value type="int" value="5"/>
+ <value type="int" value="7"/>
+ <value type="int" value="4"/>
+ <value type="int" value="3"/>
+ <value type="int" value="2"/>
+ </property>
+ </property>
+ </property>
+ <property name="plugins" type="empty">
+ <property name="plugin-1" type="string" value="whiskermenu"/>
+ <property name="plugin-2" type="string" value="clock"/>
+ <property name="plugin-3" type="string" value="systray">
+ <property name="show-frame" type="bool" value="false"/>
+ </property>
+ <property name="plugin-4" type="string" value="pulseaudio">
+ <property name="enable-keyboard-shortcuts" type="bool" value="true"/>
+ </property>
+ <property name="plugin-5" type="string" value="tasklist">
+ <property name="show-handle" type="bool" value="false"/>
+ </property>
+ <property name="plugin-7" type="string" value="separator">
+ <property name="expand" type="bool" value="true"/>
+ <property name="style" type="uint" value="0"/>
+ </property>
+ <property name="plugin-8" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="/usr/share/applications/exo-file-manager.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-9" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="/etc/xdg/xfce4/panel/launcher-xvkbd/xvkbd.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-10" type="string" value="launcher">
+ <property name="items" type="array">
+ <value type="string" value="/usr/share/applications/exo-terminal-emulator.desktop"/>
+ </property>
+ </property>
+ <property name="plugin-11" type="string" value="separator">
+ <property name="style" type="uint" value="1"/>
+ </property>
+ <property name="plugin-12" type="string" value="separator"/>
+ </property>
+</channel>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<channel name="xfwm4" version="1.0">
+ <property name="general" type="empty">
+ <property name="workspace_count" type="int" value="1" />
+ </property>
+</channel>
--- /dev/null
+<!--
+ Default values for the X settings registry as described in
+ http://www.freedesktop.org/wiki/Specifications/XSettingsRegistry
+-->
+
+<?xml version="1.0" encoding="UTF-8"?>
+<channel name="xsettings" version="1.0">
+ <property name="Net" type="empty">
+ <property name="ThemeName" type="string" value="Breeze"/>
+ <property name="IconThemeName" type="string" value="oxygen"/>
+ <property name="DoubleClickTime" type="int" value="400"/>
+ <property name="DoubleClickDistance" type="int" value="5"/>
+ <property name="DndDragThreshold" type="int" value="8"/>
+ <property name="CursorBlink" type="bool" value="true"/>
+ <property name="CursorBlinkTime" type="int" value="1200"/>
+ <property name="SoundThemeName" type="string" value="default"/>
+ <property name="EnableEventSounds" type="bool" value="false"/>
+ <property name="EnableInputFeedbackSounds" type="bool" value="false"/>
+ </property>
+ <property name="Xft" type="empty">
+ <property name="DPI" type="empty"/>
+ <property name="Antialias" type="int" value="-1"/>
+ <property name="Hinting" type="int" value="-1"/>
+ <property name="HintStyle" type="string" value="hintnone"/>
+ <property name="RGBA" type="string" value="none"/>
+ <!-- <property name="Lcdfilter" type="string" value="none"/> -->
+ </property>
+ <property name="Gtk" type="empty">
+ <property name="CanChangeAccels" type="bool" value="false"/>
+ <property name="ColorPalette" type="string" value="black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90"/>
+ <property name="FontName" type="string" value="Sans 10"/>
+ <property name="IconSizes" type="string" value=""/>
+ <property name="KeyThemeName" type="string" value=""/>
+ <property name="ToolbarStyle" type="string" value="icons"/>
+ <property name="ToolbarIconSize" type="int" value="3"/>
+ <!-- <property name="IMPreeditStyle" type="string" value=""/> -->
+ <!-- <property name="IMStatusStyle" type="string" value=""/> -->
+ <!-- <property name="IMModule" type="string" value=""/> -->
+ <property name="MenuImages" type="bool" value="true"/>
+ <property name="ButtonImages" type="bool" value="true"/>
+ <property name="MenuBarAccel" type="string" value="F10"/>
+ <property name="CursorThemeName" type="string" value=""/>
+ <property name="CursorThemeSize" type="int" value="0"/>
+ <property name="DecorationLayout" type="string" value="menu:minimize,maximize,close"/>
+ </property>
+</channel>