2023-05-01 20:26:40 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
RED="\e[31m"
|
|
|
|
GREEN="\e[32m"
|
|
|
|
YELLOW="\e[33m"
|
|
|
|
ENDCOLOR="\e[0m"
|
|
|
|
|
|
|
|
function message() {
|
|
|
|
case $1 in
|
|
|
|
error)
|
|
|
|
MESSAGE_TYPE="${RED}ERROR${ENDCOLOR}"
|
|
|
|
;;
|
|
|
|
info|*)
|
|
|
|
MESSAGE_TYPE="${GREEN}INFO${ENDCOLOR}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ "$1" == "info" ] || [ "$1" == "error" ]
|
|
|
|
then
|
|
|
|
MESSAGE=$2
|
|
|
|
else
|
|
|
|
MESSAGE=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -e "[${MESSAGE_TYPE}] ${YELLOW}install_base${ENDCOLOR}: $MESSAGE"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
error ()
|
|
|
|
{
|
|
|
|
message error "ERROR!!"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
### hostname setting
|
2023-10-23 23:08:32 +02:00
|
|
|
#echo nanodesk > /etc/hostname
|
2023-05-01 20:26:40 +02:00
|
|
|
|
2023-10-23 23:08:32 +02:00
|
|
|
#message "set hostname in hosts"
|
|
|
|
#sed -i 's/localhost/localhost nanodesk/g' /etc/hosts
|
2023-05-03 18:53:52 +02:00
|
|
|
|
2023-05-01 20:26:40 +02:00
|
|
|
### noninteractive
|
|
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
export DEBIAN_FRONTEND
|
|
|
|
|
2023-05-03 16:30:55 +02:00
|
|
|
##message "activate contrib and non-free repositories"
|
|
|
|
##sed -i 's/main$/main contrib non-free/g' /etc/apt/sources.list || error
|
|
|
|
##
|
|
|
|
##message "activate backports repository"
|
|
|
|
##sed 's/bullseye/bullseye-backports/g' /etc/apt/sources.list > /etc/apt/sources.list.d/bullseye-backports.list || error
|
2023-05-01 20:26:40 +02:00
|
|
|
|
|
|
|
message "apt update"
|
|
|
|
apt update || error
|
|
|
|
|
2023-05-06 12:48:54 +02:00
|
|
|
### install base packages --no-install-recommends
|
|
|
|
message "install nanodesk minimal base packages (apt install --no-install-recommends)"
|
2023-06-12 00:10:01 +02:00
|
|
|
#apt install -y \
|
2023-05-06 12:23:04 +02:00
|
|
|
apt install -y --no-install-recommends \
|
2023-10-22 09:23:44 +02:00
|
|
|
linux-image-amd64 \
|
|
|
|
firmware-linux \
|
|
|
|
firmware-linux-nonfree \
|
|
|
|
firmware-zd1211 firmware-ti-connectivity firmware-realtek-rtl8723cs-bt \
|
|
|
|
firmware-realtek firmware-netxen firmware-netronome firmware-myricom \
|
|
|
|
firmware-libertas firmware-iwlwifi \
|
|
|
|
firmware-intel-sound firmware-cavium firmware-brcm80211 firmware-bnx2x \
|
|
|
|
firmware-bnx2 firmware-atheros firmware-ath9k-htc \
|
|
|
|
live-boot \
|
|
|
|
dialog \
|
|
|
|
sudo \
|
|
|
|
console-data \
|
2023-10-22 03:15:45 +02:00
|
|
|
bash-completion \
|
2023-10-22 09:23:44 +02:00
|
|
|
locales \
|
|
|
|
man \
|
|
|
|
unzip \
|
|
|
|
zip \
|
|
|
|
bzip2 \
|
|
|
|
zstd \
|
|
|
|
host \
|
|
|
|
wireless-tools \
|
|
|
|
unrar \
|
|
|
|
p7zip-full \
|
|
|
|
xz-utils \
|
|
|
|
wpagui \
|
|
|
|
xserver-xorg \
|
|
|
|
xscreensaver \
|
|
|
|
xfonts-75dpi \
|
|
|
|
xfonts-100dpi \
|
2023-10-22 06:10:08 +02:00
|
|
|
fonts-noto-color-emoji \
|
2023-10-22 09:23:44 +02:00
|
|
|
x11-apps \
|
|
|
|
x11-utils \
|
|
|
|
xdg-utils \
|
2023-10-22 05:38:31 +02:00
|
|
|
xdg-user-dirs \
|
2023-10-22 09:23:44 +02:00
|
|
|
xterm \
|
|
|
|
jwm \
|
|
|
|
mc \
|
|
|
|
wget \
|
|
|
|
curl \
|
|
|
|
less \
|
2023-10-22 01:06:44 +02:00
|
|
|
openssh-client \
|
2023-10-22 09:23:44 +02:00
|
|
|
rsync \
|
|
|
|
vim \
|
|
|
|
links2 \
|
|
|
|
ncdu \
|
|
|
|
htop \
|
|
|
|
git \
|
2023-10-22 06:10:08 +02:00
|
|
|
telnet \
|
2023-10-22 06:13:54 +02:00
|
|
|
netcat-traditional \
|
2023-10-22 09:23:44 +02:00
|
|
|
gxmessage \
|
|
|
|
gsimplecal \
|
|
|
|
alsa-utils \
|
|
|
|
volumeicon-alsa \
|
|
|
|
arandr \
|
|
|
|
xfe \
|
|
|
|
xarchiver \
|
2023-10-22 07:25:24 +02:00
|
|
|
qpdfview \
|
2023-10-22 09:23:44 +02:00
|
|
|
lxterminal \
|
2023-10-22 06:10:08 +02:00
|
|
|
lxpolkit \
|
2023-10-22 09:23:44 +02:00
|
|
|
gparted \
|
|
|
|
dillo \
|
|
|
|
falkon \
|
2023-10-22 01:06:44 +02:00
|
|
|
gtk2-engines \
|
|
|
|
gnome-themes-extra \
|
2023-10-22 14:17:03 +02:00
|
|
|
adwaita-qt \
|
|
|
|
adwaita-icon-theme \
|
|
|
|
gnome-icon-theme \
|
|
|
|
lxde-icon-theme \
|
|
|
|
tango-icon-theme \
|
2023-10-22 03:20:01 +02:00
|
|
|
squashfs-tools \
|
2023-10-22 04:52:13 +02:00
|
|
|
synaptic \
|
2023-10-22 09:23:44 +02:00
|
|
|
/tmp/xdgmenumaker*.deb || error
|
2023-05-01 20:26:40 +02:00
|
|
|
|
2023-05-06 21:35:58 +02:00
|
|
|
message "install nanodesk base packages with recommends"
|
|
|
|
apt install -y \
|
2023-10-23 12:13:24 +02:00
|
|
|
network-manager \
|
|
|
|
network-manager-gnome \
|
2023-10-22 09:25:19 +02:00
|
|
|
net-tools \
|
|
|
|
isc-dhcp-client \
|
|
|
|
host \
|
|
|
|
wireless-tools \
|
|
|
|
gvfs-common \
|
|
|
|
pcmanfm \
|
2023-05-06 12:48:54 +02:00
|
|
|
|
2023-05-03 16:30:55 +02:00
|
|
|
#message "install linux-kernel from backports"
|
|
|
|
#apt install -t bullseye-backports -y linux-image-amd64
|
2023-05-01 20:26:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
### Configure timezone and locale
|
|
|
|
#dpkg-reconfigure locales
|
|
|
|
#dpkg-reconfigure console-data
|
|
|
|
#dpkg-reconfigure keyboard-configuration
|
|
|
|
###https://serverfault.com/a/689947
|
|
|
|
|
2023-10-23 23:08:32 +02:00
|
|
|
#message "set locales and tzdata"
|
|
|
|
#echo "Europe/Berlin" > /etc/timezone && \
|
|
|
|
# dpkg-reconfigure -f noninteractive tzdata && \
|
|
|
|
# sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
|
|
|
# echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
|
|
|
|
# dpkg-reconfigure --frontend=noninteractive locales && \
|
|
|
|
# locale-gen en_US.UTF-8 && \
|
|
|
|
# update-locale LANG=en_US.UTF-8
|
2023-05-01 20:26:40 +02:00
|
|
|
|
2023-05-03 18:53:52 +02:00
|
|
|
######
|
|
|
|
####
|
|
|
|
##
|
|
|
|
## customization can be done here
|
2023-05-03 20:04:34 +02:00
|
|
|
##
|
|
|
|
####
|
2023-05-03 18:53:52 +02:00
|
|
|
######
|
|
|
|
|
2023-10-21 20:07:56 +02:00
|
|
|
message "run custom steps from /tmp/install_base.customsteps.sh"
|
2023-05-03 18:53:52 +02:00
|
|
|
. /tmp/install_base.customsteps.sh
|
|
|
|
|
|
|
|
######
|
2023-05-03 20:04:34 +02:00
|
|
|
####
|
|
|
|
##
|
2023-05-03 18:53:52 +02:00
|
|
|
## / customization End /
|
|
|
|
##
|
|
|
|
####
|
|
|
|
######
|
|
|
|
|
2023-05-01 20:26:40 +02:00
|
|
|
### clean cache
|
2023-10-23 23:08:32 +02:00
|
|
|
#message "apt clean"
|
|
|
|
#apt clean
|
2023-05-01 20:26:40 +02:00
|
|
|
|
2023-05-03 00:39:55 +02:00
|
|
|
KERNEL_VER="$(ls -1 /boot/|grep "vmlinuz-"|sed 's/vmlinuz-//'|sort -g|head -n +1)"
|
2023-05-01 20:26:40 +02:00
|
|
|
test -n "$KERNEL_VER" || error
|
2023-05-01 20:56:16 +02:00
|
|
|
message "KERNEL_VER=${YELLOW}${KERNEL_VER}${ENDCOLOR}"
|
2023-05-01 20:26:40 +02:00
|
|
|
|
|
|
|
### but fetch packages for grub and kernel, so we do not need to download them
|
|
|
|
### in case nanodesk get installed to diska
|
2023-10-23 23:08:32 +02:00
|
|
|
#message "apt --download linux-image and grub packages to have them in cache for nanodesk-installer.sh offline installation"
|
|
|
|
#apt -d --reinstall install \
|
|
|
|
# linux-image-amd64 \
|
|
|
|
# linux-image-$KERNEL_VER \
|
|
|
|
# grub-pc grub-pc-bin \
|
|
|
|
# grub-common \
|
|
|
|
# grub2-common \
|
|
|
|
# os-prober || error
|