diff --git a/scripts/build-in-chroot.sh b/scripts/build-in-chroot.sh index 24c6690..3c08eb4 100755 --- a/scripts/build-in-chroot.sh +++ b/scripts/build-in-chroot.sh @@ -57,6 +57,7 @@ apt-get install -y \ i2c-tools \ device-tree-compiler \ unzip \ + openssh-server \ sudo # setup locale @@ -73,6 +74,9 @@ fi mkdir -p /etc/cloud/cloud.cfg.d printf 'preserve_hostname: true\n' >/etc/cloud/cloud.cfg.d/99-preserve-hostname.cfg +echo "====> enabling mdns hostname advertisement" +systemctl enable avahi-daemon.service + echo "====> configuring bluetooth for Matter commissioning" mkdir -p /etc/systemd/system/bluetooth.service.d cat >/etc/systemd/system/bluetooth.service.d/10-matter.conf <<'EOBT' @@ -128,10 +132,11 @@ systemctl enable systemd-networkd.service systemctl enable systemd-resolved.service echo "====> creating toes user" +groupadd -f audio if id -u toes >/dev/null 2>&1; then - usermod -aG sudo toes + usermod -aG sudo,audio toes else - useradd -m -s /bin/bash -G sudo toes + useradd -m -s /bin/bash -G sudo,audio toes fi echo 'toes:nicetrywiseguy' | chpasswd @@ -140,6 +145,17 @@ printf 'toes ALL=(ALL) NOPASSWD:ALL\n' >/etc/sudoers.d/90-toes chmod 0440 /etc/sudoers.d/90-toes visudo -cf /etc/sudoers.d/90-toes +echo "====> configuring ssh password login" +mkdir -p /etc/ssh/sshd_config.d +cat >/etc/ssh/sshd_config.d/10-toes-password-login.conf <<'EOSSH' +PasswordAuthentication yes +EOSSH +printf 'ssh_pwauth: true\n' >/etc/cloud/cloud.cfg.d/99-ssh-password-auth.cfg +mkdir -p /run/sshd +sshd -t +sshd -T | grep -qx 'passwordauthentication yes' +systemctl enable ssh.service + # enable serial over usb echo 'g_serial' >/etc/modules-load.d/usb-serial-gadget.conf systemctl enable serial-getty@ttyGS0.service @@ -228,6 +244,12 @@ echo "====> Installing toes service" install -m 644 "$TOES_HOME/toes/scripts/toes.service" /etc/systemd/system/toes.service systemctl enable toes.service +echo "====> setting initial volume" +amixer -c toesaudio sset 'Speaker Analog' 80% +amixer -c toesaudio sset 'DAC' 50% +amixer -c toesaudio sset 'Speaker Driver' 0 +alsactl store + EOF sudo chmod +x mnt/root/tmp/image-build.sh