2020-04-17 12:53:48 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Configure environment... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
mount none -t proc /proc
|
|
|
|
mount none -t sysfs /sys
|
|
|
|
mount none -t devpts /dev/pts
|
2020-04-17 19:31:32 +03:00
|
|
|
|
2020-04-17 12:53:48 +03:00
|
|
|
export HOME=/root
|
|
|
|
export LC_ALL=C
|
|
|
|
|
2023-05-03 14:23:56 +03:00
|
|
|
echo "kubuntu-lunar-live" >/etc/hostname
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Configure and update apt... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
cat <<EOF >/etc/apt/sources.list
|
2023-04-30 16:12:53 +03:00
|
|
|
deb http://archive.ubuntu.com/ubuntu/ lunar main restricted universe multiverse
|
|
|
|
deb-src http://archive.ubuntu.com/ubuntu/ lunar main restricted universe multiverse
|
|
|
|
deb http://archive.ubuntu.com/ubuntu/ lunar-security main restricted universe multiverse
|
|
|
|
deb-src http://archive.ubuntu.com/ubuntu/ lunar-security main restricted universe multiverse
|
|
|
|
deb http://archive.ubuntu.com/ubuntu/ lunar-updates main restricted universe multiverse
|
|
|
|
deb-src http://archive.ubuntu.com/ubuntu/ lunar-updates main restricted universe multiverse
|
2020-04-17 12:53:48 +03:00
|
|
|
EOF
|
|
|
|
apt-get update
|
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Install systemd and Ubuntu MBP Repo... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-17 19:31:32 +03:00
|
|
|
apt-get install -y systemd-sysv gnupg curl wget
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-17 19:31:32 +03:00
|
|
|
mkdir -p /etc/apt/sources.list.d
|
2022-09-29 16:25:08 +03:00
|
|
|
curl -s --compressed "https://adityagarg8.github.io/t2-ubuntu-repo/KEY.gpg" | gpg --dearmor | tee /etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg >/dev/null
|
|
|
|
curl -s --compressed -o /etc/apt/sources.list.d/t2.list "https://adityagarg8.github.io/t2-ubuntu-repo/t2.list"
|
2020-04-17 19:31:32 +03:00
|
|
|
apt-get update
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Configure machine-id and divert... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
dbus-uuidgen >/etc/machine-id
|
2020-04-17 12:53:48 +03:00
|
|
|
ln -fs /etc/machine-id /var/lib/dbus/machine-id
|
|
|
|
dpkg-divert --local --rename --add /sbin/initctl
|
|
|
|
ln -s /bin/true /sbin/initctl
|
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Install packages needed for Live System... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
|
2023-05-03 14:23:56 +03:00
|
|
|
kde-standard \
|
2020-05-03 16:04:34 +03:00
|
|
|
sudo \
|
2020-04-24 13:19:37 +03:00
|
|
|
casper \
|
|
|
|
discover \
|
|
|
|
laptop-detect \
|
|
|
|
os-prober \
|
|
|
|
network-manager \
|
|
|
|
resolvconf \
|
|
|
|
net-tools \
|
|
|
|
wireless-tools \
|
|
|
|
locales \
|
|
|
|
initramfs-tools \
|
|
|
|
binutils \
|
|
|
|
linux-generic \
|
2020-05-26 08:53:27 +03:00
|
|
|
linux-headers-generic \
|
2020-05-03 16:04:34 +03:00
|
|
|
grub-efi-amd64-signed \
|
|
|
|
intel-microcode \
|
2022-02-07 20:14:40 +03:00
|
|
|
thermald \
|
2022-02-13 11:59:18 +03:00
|
|
|
grub2 \
|
|
|
|
nautilus-admin
|
2020-04-24 13:19:37 +03:00
|
|
|
|
2022-10-17 19:33:21 +03:00
|
|
|
curl -L https://github.com/t2linux/T2-Ubuntu-Kernel/releases/download/vKVER-PREL/linux-headers-KVER-${ALTERNATIVE}_KVER-PREL_amd64.deb > /tmp/headers.deb
|
|
|
|
curl -L https://github.com/t2linux/T2-Ubuntu-Kernel/releases/download/vKVER-PREL/linux-image-KVER-${ALTERNATIVE}_KVER-PREL_amd64.deb > /tmp/image.deb
|
2021-11-20 09:12:54 +03:00
|
|
|
file /tmp/*
|
2022-08-19 13:37:39 +03:00
|
|
|
apt install /tmp/headers.deb /tmp/image.deb
|
2021-11-21 07:16:21 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Install window manager... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
|
2022-11-08 10:52:10 +03:00
|
|
|
plymouth-theme-spinner \
|
2023-05-03 14:23:56 +03:00
|
|
|
plymouth-theme-kubuntu-logo \
|
|
|
|
plymouth-theme-kubuntu-text \
|
2022-11-08 10:52:10 +03:00
|
|
|
plymouth-theme-ubuntu-text \
|
2023-05-03 14:23:56 +03:00
|
|
|
kde-plasma-desktop \
|
|
|
|
kubuntu-desktop \
|
|
|
|
kubuntu-settings-desktop \
|
|
|
|
kubuntu-wallpapers \
|
|
|
|
kde-plasma-desktop \
|
|
|
|
sddm-theme-breeze \
|
|
|
|
snapd \
|
|
|
|
software-properties-common \
|
2020-04-24 13:19:37 +03:00
|
|
|
|
|
|
|
echo >&2 "===]> Info: Install Graphical installer... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
|
|
|
|
ubiquity \
|
|
|
|
ubiquity-casper \
|
|
|
|
ubiquity-frontend-gtk \
|
2023-05-03 14:23:56 +03:00
|
|
|
ubiquity-slideshow-kubuntu \
|
2020-04-24 13:19:37 +03:00
|
|
|
ubiquity-ubuntu-artwork
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2022-09-29 16:25:08 +03:00
|
|
|
echo >&2 "===]> Info: Install useful applications and sound configuration... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
|
2020-04-24 13:19:37 +03:00
|
|
|
git \
|
|
|
|
curl \
|
|
|
|
nano \
|
|
|
|
make \
|
2020-05-26 08:53:27 +03:00
|
|
|
gcc \
|
2020-10-18 15:26:37 +03:00
|
|
|
dkms \
|
2022-09-29 16:25:08 +03:00
|
|
|
iwd \
|
2022-11-06 14:44:05 +03:00
|
|
|
apple-t2-audio-config
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Change initramfs format (for grub)... "
|
|
|
|
sed -i "s/COMPRESS=lz4/COMPRESS=gzip/g" "/etc/initramfs-tools/initramfs.conf"
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2022-01-22 19:03:30 +03:00
|
|
|
echo >&2 "===]> Info: Configure drivers... "
|
2020-04-17 19:31:32 +03:00
|
|
|
|
2020-05-26 08:53:27 +03:00
|
|
|
# thunderbolt is working for me.
|
|
|
|
#printf '\nblacklist thunderbolt' >>/etc/modprobe.d/blacklist.conf
|
2020-04-24 13:19:37 +03:00
|
|
|
|
2022-02-06 08:27:08 +03:00
|
|
|
printf 'apple-bce' >>/etc/modules-load.d/t2.conf
|
2023-02-22 23:12:19 +03:00
|
|
|
#printf '\n### apple-bce start ###\nsnd\nsnd_pcm\napple-bce\n### apple-bce end ###' >>/etc/initramfs-tools/modules
|
|
|
|
#printf '\n# display f* key in touchbar\noptions apple-ib-tb fnmode=1\n' >> /etc/modprobe.d/apple-tb.conf
|
2022-02-06 08:27:08 +03:00
|
|
|
#printf '\n# delay loading of the touchbar driver\ninstall apple-ib-tb /bin/sleep 7; /sbin/modprobe --ignore-install apple-ib-tb' >> /etc/modprobe.d/delay-tb.conf
|
2022-02-03 16:16:56 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Update initramfs... "
|
2020-04-17 19:31:32 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
## Add custom drivers to be loaded at boot
|
|
|
|
/usr/sbin/depmod -a "${KERNEL_VERSION}"
|
|
|
|
update-initramfs -u -v -k "${KERNEL_VERSION}"
|
2020-04-17 19:31:32 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Remove unused applications ... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
apt-get purge -y -qq \
|
2020-04-24 13:19:37 +03:00
|
|
|
transmission-gtk \
|
|
|
|
transmission-common \
|
|
|
|
gnome-mahjongg \
|
|
|
|
gnome-mines \
|
|
|
|
gnome-sudoku \
|
|
|
|
aisleriot \
|
|
|
|
hitori \
|
|
|
|
xiterm+thai \
|
|
|
|
make \
|
|
|
|
gcc \
|
|
|
|
vim \
|
2020-05-03 16:04:34 +03:00
|
|
|
binutils \
|
|
|
|
linux-generic \
|
2023-04-30 16:12:53 +03:00
|
|
|
linux-headers-6.2.0-20 \
|
|
|
|
linux-headers-6.2.0-20-generic \
|
2020-05-03 16:04:34 +03:00
|
|
|
linux-headers-generic \
|
2023-04-30 16:12:53 +03:00
|
|
|
linux-image-6.2.0-20-generic \
|
2020-05-03 16:04:34 +03:00
|
|
|
linux-image-generic \
|
2023-04-30 16:12:53 +03:00
|
|
|
linux-modules-6.2.0-20-generic \
|
|
|
|
linux-modules-extra-6.2.0-20-generic \
|
2023-05-03 14:23:56 +03:00
|
|
|
sddm-theme-debian-maui \
|
2023-01-18 13:19:54 +03:00
|
|
|
gedit
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
apt-get autoremove -y
|
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Reconfigure environment ... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
locale-gen --purge en_US.UTF-8 en_US
|
2020-04-24 13:19:37 +03:00
|
|
|
printf 'LANG="C.UTF-8"\nLANGUAGE="C.UTF-8"\n' >/etc/default/locale
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
cat <<EOF >/etc/NetworkManager/NetworkManager.conf
|
2020-04-17 12:53:48 +03:00
|
|
|
[main]
|
|
|
|
plugins=ifupdown,keyfile
|
2021-12-26 07:52:26 +03:00
|
|
|
|
2020-04-17 12:53:48 +03:00
|
|
|
[ifupdown]
|
|
|
|
managed=false
|
2021-12-26 07:52:26 +03:00
|
|
|
|
|
|
|
[device]
|
|
|
|
wifi.scan-rand-mac-address=no
|
2020-04-17 12:53:48 +03:00
|
|
|
EOF
|
|
|
|
dpkg-reconfigure network-manager
|
2020-10-18 15:26:37 +03:00
|
|
|
|
|
|
|
echo >&2 "===]> Info: Configure Network Manager to use iwd... "
|
|
|
|
mkdir -p /etc/NetworkManager/conf.d
|
2022-01-17 14:54:16 +03:00
|
|
|
printf '#[device]\n#wifi.backend=iwd\n' > /etc/NetworkManager/conf.d/wifi_backend.conf
|
2020-05-26 08:53:27 +03:00
|
|
|
#systemctl enable iwd.service
|
2020-04-17 12:53:48 +03:00
|
|
|
|
2020-04-24 13:19:37 +03:00
|
|
|
echo >&2 "===]> Info: Cleanup the chroot environment... "
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
truncate -s 0 /etc/machine-id
|
|
|
|
rm /sbin/initctl
|
|
|
|
dpkg-divert --rename --remove /sbin/initctl
|
|
|
|
apt-get clean
|
|
|
|
rm -rf /tmp/* ~/.bash_history
|
2020-04-17 19:31:32 +03:00
|
|
|
rm -rf /tmp/setup_files
|
2020-04-17 12:53:48 +03:00
|
|
|
|
|
|
|
umount -lf /dev/pts
|
|
|
|
umount -lf /sys
|
|
|
|
umount -lf /proc
|
|
|
|
|
|
|
|
export HISTSIZE=0
|