3 ######################################################################
4 # 3) install dependencies for compiling and loading
5 ######################################################################
10 echo "##[group]Running pacman -Syu"
11 sudo btrfs filesystem resize max
/
12 sudo pacman
-Syu --noconfirm
15 echo "##[group]Install Development Tools"
16 sudo pacman
-Sy --noconfirm base-devel
bc cpio dhclient dkms fakeroot \
17 fio gdb inetutils jq
less linux linux-headers lsscsi nfs-utils parted \
18 pax perf python-packaging python-setuptools qemu-guest-agent ksh samba \
19 sysstat rng-tools rsync wget xxhash
24 export DEBIAN_FRONTEND
="noninteractive"
26 echo "##[group]Running apt-get update+upgrade"
27 sudo apt-get update
-y
28 sudo apt-get upgrade
-y
31 echo "##[group]Install Development Tools"
32 sudo apt-get
install -y \
33 acl alien attr autoconf
bc cpio curl dbench dh-python dkms fakeroot \
34 fio gdb gdebi git ksh lcov isc-dhcp-client jq libacl1-dev libaio-dev \
35 libattr1-dev libblkid-dev libcurl4-openssl-dev libdevmapper-dev libelf-dev \
36 libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev libtool \
37 libtool-bin libudev-dev libunwind-dev linux-headers-$
(uname
-r) \
38 lsscsi nfs-kernel-server pamtester parted python3 python3-all-dev \
39 python3-cffi python3-dev python3-distlib python3-packaging \
40 python3-setuptools python3-sphinx qemu-guest-agent rng-tools rpm2cpio \
41 rsync samba sysstat uuid-dev watchdog wget xfslibs-dev xxhash zlib1g-dev
46 export ASSUME_ALWAYS_YES
="YES"
48 echo "##[group]Install Development Tools"
49 sudo pkg
install -y autoconf automake autotools base64 checkbashisms fio \
50 gdb
gettext gettext-runtime git gmake gsed jq ksh93 lcov libtool lscpu \
51 pkgconf python python3 pamtester pamtester qemu-guest-agent rsync xxhash
52 sudo pkg
install -xy \
53 '^samba4[[:digit:]]+$' \
54 '^py3[[:digit:]]+-cffi$' \
55 '^py3[[:digit:]]+-sysctl$' \
56 '^py3[[:digit:]]+-packaging$'
60 # common packages for: almalinux, centos, redhat
62 echo "##[group]Running dnf update"
63 echo "max_parallel_downloads=10" | sudo
-E tee -a /etc
/dnf
/dnf.conf
65 sudo dnf update
-y --setopt=fastestmirror
=1 --refresh
68 echo "##[group]Install Development Tools"
69 sudo dnf group
install -y "Development Tools"
71 acl attr
bc bzip2 curl dbench dkms elfutils-libelf-devel fio gdb git \
72 jq kernel-rpm-macros ksh libacl-devel libaio-devel libargon2-devel \
73 libattr-devel libblkid-devel libcurl-devel libffi-devel ncompress \
74 libselinux-devel libtirpc-devel libtool libudev-devel libuuid-devel \
75 lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester parted perf \
76 python3 python3-cffi python3-devel python3-packaging kernel-devel \
77 python3-setuptools qemu-guest-agent rng-tools rpcgen rpm-build rsync \
78 samba sysstat systemd watchdog wget xfsprogs-devel xxhash zlib-devel
82 function tumbleweed
() {
83 echo "##[group]Running zypper is TODO!"
88 # Install dependencies
91 echo "##[group]Enable epel and powertools repositories"
92 sudo dnf config-manager
-y --set-enabled powertools
93 sudo dnf
install -y epel-release
96 echo "##[group]Install kernel-abi-whitelists"
97 sudo dnf
install -y kernel-abi-whitelists
100 almalinux9|centos-stream9
)
101 echo "##[group]Enable epel and crb repositories"
102 sudo dnf config-manager
-y --set-enabled crb
103 sudo dnf
install -y epel-release
106 echo "##[group]Install kernel-abi-stablelists"
107 sudo dnf
install -y kernel-abi-stablelists
114 echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
116 echo "##[group]Install Debian specific"
117 sudo apt-get
install -yq linux-perf dh-sequence-dkms
131 echo "##[group]Install Ubuntu specific"
132 sudo apt-get
install -yq linux-tools-common libtirpc-dev \
133 linux-modules-extra-$
(uname
-r)
134 if [ "$1" != "ubuntu20" ]; then
135 sudo apt-get
install -yq dh-sequence-dkms
138 echo "##[group]Delete Ubuntu OpenZFS modules"
139 for i
in $
(find /lib
/modules
-name zfs
-type d
); do sudo
rm -rvf $i; done
144 # This script is used for checkstyle + zloop deps also.
145 # Install only the needed packages and exit - when used this way.
146 test -z "${ONLY_DEPS:-}" ||
exit 0
149 echo "##[group]Enable services"
153 echo 'virtio_load="YES"' | sudo
-E tee -a /boot
/loader.conf
154 for i
in balloon blk console random scsi
; do
155 echo "virtio_${i}_load=\"YES\"" | sudo
-E tee -a /boot
/loader.conf
157 echo "fdescfs /dev/fd fdescfs rw 0 0" | sudo
-E tee -a /etc
/fstab
158 sudo
-E mount
/dev
/fd
159 sudo
-E touch /etc
/zfs
/exports
160 sudo
-E sysrc mountd_flags
="/etc/zfs/exports"
161 echo '[global]' | sudo
-E tee /usr
/local
/etc
/smb4.conf
>/dev
/null
162 sudo
-E service nfsd
enable
163 sudo
-E service qemu-guest-agent
enable
164 sudo
-E service samba_server
enable
167 sudo
-E systemctl
enable nfs-kernel-server
168 sudo
-E systemctl
enable qemu-guest-agent
169 sudo
-E systemctl
enable smbd
172 # All other linux distros
173 sudo
-E systemctl
enable nfs-server
174 sudo
-E systemctl
enable qemu-guest-agent
175 sudo
-E systemctl
enable smb
180 # Setup Kernel cmdline
181 CMDLINE
="console=tty0 console=ttyS0,115200n8"
182 CMDLINE
="$CMDLINE selinux=0"
183 CMDLINE
="$CMDLINE random.trust_cpu=on"
184 CMDLINE
="$CMDLINE no_timer_check"
186 almalinux
*|centos
*|fedora
*)
187 GRUB_CFG
="/boot/grub2/grub.cfg"
188 GRUB_MKCONFIG
="grub2-mkconfig"
189 CMDLINE
="$CMDLINE biosdevname=0 net.ifnames=0"
190 echo 'GRUB_SERIAL_COMMAND="serial --speed=115200"' \
191 | sudo
tee -a /etc
/default
/grub
>/dev
/null
194 GRUB_CFG
="/boot/grub/grub.cfg"
195 GRUB_MKCONFIG
="grub-mkconfig"
196 echo 'GRUB_DISABLE_OS_PROBER="false"' \
197 | sudo
tee -a /etc
/default
/grub
>/dev
/null
200 GRUB_CFG
="/boot/grub/grub.cfg"
201 GRUB_MKCONFIG
="grub-mkconfig"
210 echo "##[group]Edit kernel cmdline"
211 sudo
sed -i -e '/^GRUB_CMDLINE_LINUX/d' /etc
/default
/grub || true
212 echo "GRUB_CMDLINE_LINUX=\"$CMDLINE\"" \
213 | sudo
tee -a /etc
/default
/grub
>/dev
/null
214 sudo
$GRUB_MKCONFIG -o $GRUB_CFG
219 # reset cloud-init configuration and poweroff
220 sudo cloud-init clean
--logs
221 sleep 2 && sudo poweroff
&