Add debian building, run multiple pipelines at once
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Tyler
2022-03-06 15:58:11 -05:00
parent 199464dde3
commit 04d0e492dc
7 changed files with 258 additions and 2 deletions

61
debian/scripts/cleanup.sh vendored Normal file
View File

@ -0,0 +1,61 @@
#!/bin/sh -eux
echo "remove linux-headers"
dpkg --list \
| awk '{ print $2 }' \
| grep 'linux-headers' \
| xargs apt-get -y purge;
echo "remove specific Linux kernels, such as linux-image-4.9.0-13-amd64 but keeps the current kernel and does not touch the virtual packages"
dpkg --list \
| awk '{ print $2 }' \
| grep 'linux-image-[234].*' \
| grep -v `uname -r` \
| xargs apt-get -y purge;
echo "remove linux-source package"
dpkg --list \
| awk '{ print $2 }' \
| grep linux-source \
| xargs apt-get -y purge;
echo "remove all development packages"
dpkg --list \
| awk '{ print $2 }' \
| grep -- '-dev\(:[a-z0-9]\+\)\?$' \
| xargs apt-get -y purge;
echo "remove X11 libraries"
apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6;
echo "remove obsolete networking packages"
apt-get -y purge ppp pppconfig pppoeconf;
echo "remove popularity-contest package"
apt-get -y purge popularity-contest;
echo "remove installation-report package"
apt-get -y purge installation-report;
echo "autoremoving packages and cleaning apt data"
apt-get -y autoremove;
apt-get -y clean;
echo "remove /var/cache"
find /var/cache -type f -exec rm -rf {} \;
echo "truncate any logs that have built up during the install"
find /var/log -type f -exec truncate --size=0 {} \;
echo "blank netplan machine-id (DUID) so machines get unique ID generated on boot"
truncate -s 0 /etc/machine-id
echo "remove the contents of /tmp and /var/tmp"
rm -rf /tmp/* /var/tmp/*
echo "force a new random seed to be generated"
rm -f /var/lib/systemd/random-seed
echo "clear the history so our install isn't there"
rm -f /root/.wget-hsts
export HISTSIZE=0

9
debian/scripts/networking.sh vendored Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh -eux
# Disable Predictable Network Interface names and use eth0
sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces;
sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub;
update-grub;
# Adding a 2 sec delay to the interface up, to make the dhclient happy
echo "pre-up sleep 2" >> /etc/network/interfaces

4
debian/scripts/systemd.sh vendored Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh -eux
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751636
apt-get install libpam-systemd

28
debian/scripts/update.sh vendored Normal file
View File

@ -0,0 +1,28 @@
#!/bin/sh -eux
arch="`uname -r | sed 's/^.*[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-[0-9]\{1,2\}\)-//'`"
debian_version="`lsb_release -r | awk '{print $2}'`";
major_version="`echo $debian_version | awk -F. '{print $1}'`";
# Disable systemd apt timers/services
systemctl stop apt-daily.timer;
systemctl stop apt-daily-upgrade.timer;
systemctl disable apt-daily.timer;
systemctl disable apt-daily-upgrade.timer;
systemctl mask apt-daily.service;
systemctl mask apt-daily-upgrade.service;
systemctl daemon-reload;
# Disable periodic activities of apt
cat <<EOF >/etc/apt/apt.conf.d/10periodic;
APT::Periodic::Enable "0";
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";
EOF
apt-get update;
apt-get -y upgrade linux-image-$arch;
apt-get -y install linux-headers-`uname -r`;