diff --git a/src/recipes/minimal/hook/customize.sh b/src/recipes/minimal/hook/customize.sh new file mode 100755 index 0000000..51386fc --- /dev/null +++ b/src/recipes/minimal/hook/customize.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +printf "Customize hook script for mmdebstrap %s\n\n" "$RECIPE" + +printf "Remove root password\n" +#echo "root:root" | chpasswd +passwd -d root + +printf "Add MNT repository and key\n" +chroot $1 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 376511EB67AD7BAF +echo "deb https://mntre.com/reform-debian sid/" | chroot $1 tee /etc/apt/sources.list.d/mntre.list +chroot $1 apt update + +printf "Install MNT packages\n" +chroot $1 apt install -y reform-tools reform-handbook + +source="${RECIPE}/hook/data/overlay" +printf "Sync overlay directory from %s to %s\n" "$source" "$1" +if [ -d $source ] +then + printf " -> source exist\n" + cp -Raf ${RECIPE}/hook/data/overlay/* $1 +else + printf "Can't find %s directory\n" "$source" +fi + +#Start hw setur service +chroot $1 systemctl enable reform-hw-setup.service +#mask hibernation / sleep target +chroot $1 systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target + +exit 0 diff --git a/src/recipes/minimal/hook/data/overlay/etc/hostname b/src/recipes/minimal/hook/data/overlay/etc/hostname new file mode 100644 index 0000000..4010da7 --- /dev/null +++ b/src/recipes/minimal/hook/data/overlay/etc/hostname @@ -0,0 +1,2 @@ +reform + diff --git a/src/recipes/minimal/hook/data/overlay/etc/hosts b/src/recipes/minimal/hook/data/overlay/etc/hosts new file mode 100644 index 0000000..6cf6b00 --- /dev/null +++ b/src/recipes/minimal/hook/data/overlay/etc/hosts @@ -0,0 +1,4 @@ +127.0.0.1 localhost reform +::1 localhost ip6-localhost ip6-loopback reform +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/src/recipes/minimal/hook/data/overlay/etc/motd b/src/recipes/minimal/hook/data/overlay/etc/motd new file mode 100644 index 0000000..863dd24 --- /dev/null +++ b/src/recipes/minimal/hook/data/overlay/etc/motd @@ -0,0 +1,14 @@ +%G + + ▒ ▒ ▒ + ██▒ ██▒ ██▒ Welcome to Debian GNU/Linux + ████▒ ████▒ ████▒ ██████▒ on MNT Reform + ██████▒ ██████▒ ██████▒ ██████▒ System Image: 2021-03-04 + ███████████████████████████ + ███▒███████▒███████▒███████ https://mntre.com/reform + ███ ▒█████ ▒█████ ▒█████ https://www.debian.org + ▒███ ▒███ ▒███ + ▒█ ▒█ ▒█ ████████████████████████ + + + diff --git a/src/recipes/minimal/hook/data/overlay/etc/systemd/system/reform-hw-setup.service b/src/recipes/minimal/hook/data/overlay/etc/systemd/system/reform-hw-setup.service new file mode 100644 index 0000000..e355c4f --- /dev/null +++ b/src/recipes/minimal/hook/data/overlay/etc/systemd/system/reform-hw-setup.service @@ -0,0 +1,11 @@ +[Unit] +Description=MNT Reform Hardware Defaults Setup + +[Service] +Type=oneshot +ExecStart=/usr/sbin/reform-hw-setup.sh +StandardOutput=journal + +[Install] +WantedBy=sysinit.target + diff --git a/src/recipes/minimal/hook/data/overlay/usr/share/pulseaudio/alsa-mixer/paths/analog-input-reform.conf b/src/recipes/minimal/hook/data/overlay/usr/share/pulseaudio/alsa-mixer/paths/analog-input-reform.conf new file mode 100644 index 0000000..e2147f0 --- /dev/null +++ b/src/recipes/minimal/hook/data/overlay/usr/share/pulseaudio/alsa-mixer/paths/analog-input-reform.conf @@ -0,0 +1,98 @@ +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +; Analog input path for MNT Reform, which has a headset mic input +; that is only on the left channel (mono). + +[General] +priority = 100 + +[Element Capture] +switch = mute +volume = ignore + +[Element Mic] +required-absent = any + +[Element Mic Boost] +required-absent = any + +[Element Dock Mic] +required-absent = any + +[Element Dock Mic Boost] +required-absent = any + +[Element Front Mic] +required-absent = any + +[Element Front Mic Boost] +required-absent = any + +[Element Int Mic] +required-absent = any + +[Element Int Mic Boost] +required-absent = any + +[Element Internal Mic] +required-absent = any + +[Element Internal Mic Boost] +required-absent = any + +[Element Rear Mic] +required-absent = any + +[Element Rear Mic Boost] +required-absent = any + +[Element Headset] +required-absent = any + +[Element Headset Mic] +required-absent = any + +[Element Headset Mic Boost] +required-absent = any + +[Element Headphone Mic] +required-absent = any + +[Element Headphone Mic Boost] +required-absent = any + +[Element Line] +required-absent = any + +[Element Line Boost] +required-absent = any + +[Element Aux] +required-absent = any + +[Element Video] +required-absent = any + +[Element Mic/Line] +required-absent = any + +[Element TV Tuner] +required-absent = any + +[Element FM] +required-absent = any + +.include analog-input.conf.common diff --git a/src/recipes/minimal/hook/data/overlay/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf b/src/recipes/minimal/hook/data/overlay/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf new file mode 100644 index 0000000..603aab1 --- /dev/null +++ b/src/recipes/minimal/hook/data/overlay/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf @@ -0,0 +1,24 @@ +[General] +auto-profiles = yes + +[Mapping stereo-out] +device-strings = hw:0 +fallback = yes +channel-map = left,right +paths-output = analog-output analog-output-speaker analog-output-headphones +direction = output +priority = 1 + +[Mapping headset-mono-in] +device-strings = hw:0 +fallback = yes +channel-map = mono +paths-input = analog-input-reform +direction = input +priority = 1 + +[Profile output:stereo-out+input:mono-in] +description = MNT Reform +output-mappings = stereo-out +input-mappings = headset-mono-in + diff --git a/src/recipes/minimal/hook/data/overlay/var/lib/alsa/asound.state b/src/recipes/minimal/hook/data/overlay/var/lib/alsa/asound.state new file mode 100644 index 0000000..b8c162a --- /dev/null +++ b/src/recipes/minimal/hook/data/overlay/var/lib/alsa/asound.state @@ -0,0 +1,701 @@ +state.wm8960audio { + control.1 { + iface MIXER + name 'Capture Volume' + value.0 39 + value.1 39 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 63' + dbmin -1725 + dbmax 3000 + dbvalue.0 1200 + dbvalue.1 1200 + } + } + control.2 { + iface MIXER + name 'Capture Volume ZC Switch' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 1' + } + } + control.3 { + iface MIXER + name 'Capture Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.4 { + iface MIXER + name 'Left Input Boost Mixer LINPUT3 Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -9999999 + dbmax 600 + dbvalue.0 -9999999 + } + } + control.5 { + iface MIXER + name 'Left Input Boost Mixer LINPUT2 Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -9999999 + dbmax 600 + dbvalue.0 -9999999 + } + } + control.6 { + iface MIXER + name 'Right Input Boost Mixer RINPUT3 Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -9999999 + dbmax 600 + dbvalue.0 -9999999 + } + } + control.7 { + iface MIXER + name 'Right Input Boost Mixer RINPUT2 Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -9999999 + dbmax 600 + dbvalue.0 -9999999 + } + } + control.8 { + iface MIXER + name 'Right Input Boost Mixer RINPUT1 Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 3' + dbmin 0 + dbmax 2900 + dbvalue.0 0 + } + } + control.9 { + iface MIXER + name 'Left Input Boost Mixer LINPUT1 Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 3' + dbmin 0 + dbmax 2900 + dbvalue.0 0 + } + } + control.10 { + iface MIXER + name 'Playback Volume' + value.0 215 + value.1 215 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 255' + dbmin -9999999 + dbmax 0 + dbvalue.0 -2000 + dbvalue.1 -2000 + } + } + control.11 { + iface MIXER + name 'Headphone Playback Volume' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 127' + dbmin -9999999 + dbmax 600 + dbvalue.0 -9999999 + dbvalue.1 -9999999 + } + } + control.12 { + iface MIXER + name 'Headphone Playback ZC Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.13 { + iface MIXER + name 'Speaker Playback Volume' + value.0 101 + value.1 101 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 127' + dbmin -9999999 + dbmax 600 + dbvalue.0 -2000 + dbvalue.1 -2000 + } + } + control.14 { + iface MIXER + name 'Speaker Playback ZC Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.15 { + iface MIXER + name 'Speaker DC Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 5' + } + } + control.16 { + iface MIXER + name 'Speaker AC Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 5' + } + } + control.17 { + iface MIXER + name 'PCM Playback -6dB Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.18 { + iface MIXER + name 'ADC Polarity' + value 'No Inversion' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'No Inversion' + item.1 'Left Inverted' + item.2 'Right Inverted' + item.3 'Stereo Inversion' + } + } + control.19 { + iface MIXER + name 'ADC High Pass Filter Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.20 { + iface MIXER + name 'DAC Polarity' + value 'No Inversion' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'No Inversion' + item.1 'Left Inverted' + item.2 'Right Inverted' + item.3 'Stereo Inversion' + } + } + control.21 { + iface MIXER + name 'DAC Deemphasis Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.22 { + iface MIXER + name 'DAC Slope' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.23 { + iface MIXER + name '3D Filter Upper Cut-Off' + value High + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 High + item.1 Low + } + } + control.24 { + iface MIXER + name '3D Filter Lower Cut-Off' + value Low + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Low + item.1 High + } + } + control.25 { + iface MIXER + name '3D Volume' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.26 { + iface MIXER + name '3D Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.27 { + iface MIXER + name 'ALC Function' + value Off + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Off + item.1 Right + item.2 Left + item.3 Stereo + } + } + control.28 { + iface MIXER + name 'ALC Max Gain' + value 7 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.29 { + iface MIXER + name 'ALC Target' + value 4 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.30 { + iface MIXER + name 'ALC Min Gain' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.31 { + iface MIXER + name 'ALC Hold Time' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.32 { + iface MIXER + name 'ALC Mode' + value ALC + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 ALC + item.1 Limiter + } + } + control.33 { + iface MIXER + name 'ALC Decay' + value 3 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.34 { + iface MIXER + name 'ALC Attack' + value 2 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 15' + } + } + control.35 { + iface MIXER + name 'Noise Gate Threshold' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 31' + } + } + control.36 { + iface MIXER + name 'Noise Gate Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.37 { + iface MIXER + name 'ADC PCM Capture Volume' + value.0 195 + value.1 195 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 255' + dbmin -9999999 + dbmax 3000 + dbvalue.0 0 + dbvalue.1 0 + } + } + control.38 { + iface MIXER + name 'Left Output Mixer Boost Bypass Volume' + value 2 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -2100 + dbmax 0 + dbvalue.0 -1500 + } + } + control.39 { + iface MIXER + name 'Left Output Mixer LINPUT3 Volume' + value 2 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -2100 + dbmax 0 + dbvalue.0 -1500 + } + } + control.40 { + iface MIXER + name 'Right Output Mixer Boost Bypass Volume' + value 2 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -2100 + dbmax 0 + dbvalue.0 -1500 + } + } + control.41 { + iface MIXER + name 'Right Output Mixer RINPUT3 Volume' + value 2 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -2100 + dbmax 0 + dbvalue.0 -1500 + } + } + control.42 { + iface MIXER + name 'ADC Data Output Select' + value 'Left Data = Left ADC; Right Data = Right ADC' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'Left Data = Left ADC; Right Data = Right ADC' + item.1 'Left Data = Left ADC; Right Data = Left ADC' + item.2 'Left Data = Right ADC; Right Data = Right ADC' + item.3 'Left Data = Right ADC; Right Data = Left ADC' + } + } + control.43 { + iface MIXER + name 'DAC Mono Mix' + value Stereo + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Stereo + item.1 Mono + } + } + control.44 { + iface MIXER + name 'Left Boost Mixer LINPUT2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.45 { + iface MIXER + name 'Left Boost Mixer LINPUT3 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.46 { + iface MIXER + name 'Left Boost Mixer LINPUT1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.47 { + iface MIXER + name 'Right Boost Mixer RINPUT2 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.48 { + iface MIXER + name 'Right Boost Mixer RINPUT3 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.49 { + iface MIXER + name 'Right Boost Mixer RINPUT1 Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.50 { + iface MIXER + name 'Left Input Mixer Boost Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.51 { + iface MIXER + name 'Right Input Mixer Boost Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.52 { + iface MIXER + name 'Left Output Mixer PCM Playback Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.53 { + iface MIXER + name 'Left Output Mixer LINPUT3 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.54 { + iface MIXER + name 'Left Output Mixer Boost Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.55 { + iface MIXER + name 'Right Output Mixer PCM Playback Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.56 { + iface MIXER + name 'Right Output Mixer RINPUT3 Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.57 { + iface MIXER + name 'Right Output Mixer Boost Bypass Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.58 { + iface MIXER + name 'Mono Output Mixer Left Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.59 { + iface MIXER + name 'Mono Output Mixer Right Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } +} diff --git a/src/recipes/minimal/hook/essential.sh b/src/recipes/minimal/hook/essential.sh new file mode 100755 index 0000000..e0fd04e --- /dev/null +++ b/src/recipes/minimal/hook/essential.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +printf "Essential hook script for mmdebstrap\n\n" +printf "Configure locales\n" +chroot $1 ln --force --symbolic /usr/share/zoneinfo/Europe/Paris /etc/localtime +echo "locales locales/default_environment_locale select en_US.UTF-8" | chroot $1 debconf-set-selections +echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | chroot $1 debconf-set-selections +chroot $1 dpkg --configure -a + +exit 0 diff --git a/src/recipes/minimal/hook/extract.sh b/src/recipes/minimal/hook/extract.sh new file mode 100755 index 0000000..7972e97 --- /dev/null +++ b/src/recipes/minimal/hook/extract.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +printf "Extract hook script for mmdebstrap\n\n" + +exit 0 diff --git a/src/recipes/minimal/hook/setup.sh b/src/recipes/minimal/hook/setup.sh new file mode 100755 index 0000000..8bce97c --- /dev/null +++ b/src/recipes/minimal/hook/setup.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +printf "Setup hook script for mmdebstrap\n\n" + +exit 0 diff --git a/src/recipes/minimal/packages/packages.list b/src/recipes/minimal/packages/packages.list new file mode 100644 index 0000000..ffab1d0 --- /dev/null +++ b/src/recipes/minimal/packages/packages.list @@ -0,0 +1,36 @@ +alsa-utils +bash-completion +brightness-udev +brightnessctl +busybox +ca-certificates +console-data +console-setup +coreutils +curl +debian-archive-keyring +dosfstools +e2fsprogs +fbset +file +git +gnupg +iproute2 +isc-dhcp-client +iwd +kbd +less +libpam-systemd +lm-sensors +locales +man-db +ntp +ntpdate +parted +pciutils +procps +pulseaudio +readline-common +systemd +systemd-sysv +usbutils