| #!/bin/sh -e |
| |
| # Remove leftover bootstrap log files. |
| rm -f /var/log/bootstrap.log |
| |
| # Fix up our hostname and make sure it can be resolved to something sane |
| echo mendel >/etc/hostname |
| echo 127.0.0.1 mendel >>/etc/hosts |
| |
| # We need spidev stuff loaded so that we get SPI access |
| # XXX: Should this live here? Seems specific to a particular board. |
| echo spidev >> /etc/modules |
| |
| # Choose a locale and regenerate it to eliminate LC warnings. |
| echo en_US.UTF-8 UTF-8 >/etc/locale.gen |
| locale-gen |
| echo LANG=en_US.UTF-8 >/etc/locale.conf |
| |
| # Add the mendel user and give them all the access they need. |
| if ! grep -qE '^mendel:' /etc/passwd; then |
| adduser mendel --home /home/mendel --shell /bin/bash --disabled-password --gecos "" |
| |
| mkdir -p /home/mendel |
| chown mendel:mendel /home/mendel |
| echo 'mendel:mendel' |chpasswd |
| fi |
| |
| # Create group apex to give mendel user r/w privileges to apex devices |
| if ! grep -qE '^apex:' /etc/group; then |
| groupadd apex |
| fi |
| |
| GROUPS="adm audio bluetooth games i2c input plugdev staff sudo users video netdev systemd-journal apex" |
| |
| for group in $GROUPS; do |
| adduser mendel $group |
| done |
| |
| if ! grep -q mendel /etc/sudoers; then |
| echo 'mendel ALL=(ALL) NOPASSWD: ALL' >>/etc/sudoers |
| fi |
| |
| #DEBHELPER# |