2020-09-28 00:49:26 +09:00
|
|
|
#!/bin/bash
|
2021-03-21 19:03:29 +09:00
|
|
|
set -uex -o pipefail
|
2020-09-28 00:49:26 +09:00
|
|
|
|
2021-03-22 20:08:42 +09:00
|
|
|
if [ ! -v TIMEZONE ]; then
|
|
|
|
TIMEZONE=Asia/Tokyo
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -v CI ]; then
|
|
|
|
CI=false
|
|
|
|
fi
|
2020-09-28 00:49:26 +09:00
|
|
|
|
|
|
|
/debootstrap/debootstrap --second-stage
|
|
|
|
|
2021-02-20 04:29:49 +09:00
|
|
|
if [ "${CI}" == "true" ]; then
|
|
|
|
REPO=deb.debian.org
|
|
|
|
REPO_SECURITY=deb.debian.org
|
|
|
|
else
|
|
|
|
REPO=localhost:65432
|
|
|
|
REPO_SECURITY=localhost:65433
|
|
|
|
fi
|
|
|
|
|
2020-09-28 00:49:26 +09:00
|
|
|
cat <<EOF > /etc/apt/sources.list
|
2021-02-20 04:29:49 +09:00
|
|
|
deb http://${REPO}/debian buster main contrib non-free
|
|
|
|
deb-src http://${REPO}/debian buster main contrib non-free
|
|
|
|
deb http://${REPO}/debian buster-updates main contrib non-free
|
|
|
|
deb-src http://${REPO}/debian buster-updates main contrib non-free
|
|
|
|
deb http://${REPO_SECURITY}/debian-security buster/updates main contrib non-free
|
|
|
|
deb-src http://${REPO_SECURITY}/debian-security buster/updates main contrib non-free
|
2020-09-28 00:49:26 +09:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat <<EOF > /etc/apt/apt.conf.d/90-norecommend
|
|
|
|
APT::Install-Recommends "0";
|
|
|
|
APT::Install-Suggests "0";
|
|
|
|
EOF
|
|
|
|
|
|
|
|
apt update -y
|
|
|
|
apt install -y locales
|
|
|
|
|
|
|
|
echo "$TIMEZONE" > /etc/timezone && \
|
|
|
|
dpkg-reconfigure -f noninteractive tzdata && \
|
2021-03-22 20:08:42 +09:00
|
|
|
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
2020-09-28 00:49:26 +09:00
|
|
|
echo 'LANG="en_US.UTF-8"' > /etc/default/locale && \
|
|
|
|
dpkg-reconfigure -f noninteractive locales && \
|
|
|
|
update-locale LANG=en_US.UTF-8
|
|
|
|
|
|
|
|
echo "brain" > /etc/hostname
|
|
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
|
|
apt install -y dialog sudo \
|
|
|
|
libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev \
|
2021-03-22 20:12:24 +09:00
|
|
|
xserver-xorg xserver-xorg-video-fbdev xserver-xorg-dev xserver-xorg-input-evdev xinput-calibrator xorg-dev x11-apps xinit \
|
|
|
|
openbox obconf obmenu jwm \
|
2020-09-28 00:49:26 +09:00
|
|
|
weston xwayland \
|
|
|
|
bash tmux vim htop \
|
2021-03-22 20:12:24 +09:00
|
|
|
midori pcmanfm lxterminal xterm gnome-terminal fbterm uim-fep uim-anthy fonts-noto-cjk \
|
|
|
|
dbus udev alsa-utils usbutils iw \
|
|
|
|
build-essential flex bison pkg-config autotools-dev libtool autoconf automake device-tree-compiler \
|
2020-10-27 19:27:27 +09:00
|
|
|
python3 python3-dev python3-setuptools python3-wheel python3-pip python3-smbus \
|
2021-03-22 20:12:24 +09:00
|
|
|
resolvconf net-tools ssh openssh-client avahi-daemon curl wget git
|
2020-09-28 00:49:26 +09:00
|
|
|
|
2021-02-23 23:39:40 +09:00
|
|
|
# Fix Midori launch failure
|
|
|
|
sudo update-mime-database /usr/share/mime
|
|
|
|
|
2021-03-22 20:10:33 +09:00
|
|
|
# Setup users
|
|
|
|
adduser --gecos "" --disabled-password --home /home/user user
|
|
|
|
echo user:brain | chpasswd
|
|
|
|
echo "user ALL=(ALL:ALL) ALL" > /etc/sudoers.d/user
|
|
|
|
echo -e "127.0.1.1\tbrain" >> /etc/hosts
|
|
|
|
|
|
|
|
echo root:root | chpasswd
|
|
|
|
|
|
|
|
# Allow root login via UART
|
|
|
|
cat <<EOF >> /etc/securetty
|
|
|
|
ttymxc0
|
|
|
|
EOF
|
|
|
|
|
2020-10-27 19:52:59 +09:00
|
|
|
# Get wild
|
|
|
|
cat <<EOF > /etc/apt/sources.list
|
2021-02-20 04:29:49 +09:00
|
|
|
deb http://deb.debian.org/debian buster main contrib non-free
|
|
|
|
deb-src http://deb.debian.org/debian buster main contrib non-free
|
|
|
|
deb http://deb.debian.org/debian buster-updates main contrib non-free
|
|
|
|
deb-src http://deb.debian.org/debian buster-updates main contrib non-free
|
|
|
|
deb http://deb.debian.org/debian-security buster/updates main contrib non-free
|
|
|
|
deb-src http://deb.debian.org/debian-security buster/updates main contrib non-free
|
2020-10-27 19:52:59 +09:00
|
|
|
EOF
|
|
|
|
|