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 cryptsetup dhclient dkms \
17 fakeroot fio gdb inetutils jq
less linux linux-headers lsscsi nfs-utils \
18 parted pax perf python-packaging python-setuptools qemu-guest-agent ksh \
19 samba 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 cryptsetup curl dbench dh-python dkms \
34 fakeroot fio gdb gdebi git ksh lcov isc-dhcp-client jq libacl1-dev \
35 libaio-dev libattr1-dev libblkid-dev libcurl4-openssl-dev libdevmapper-dev \
36 libelf-dev libffi-dev libmount-dev libpam0g-dev libselinux-dev libssl-dev \
37 libtool 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 cryptsetup curl dbench dkms elfutils-libelf-devel fio \
72 gdb git jq kernel-rpm-macros ksh libacl-devel libaio-devel \
73 libargon2-devel libattr-devel libblkid-devel libcurl-devel libffi-devel \
74 ncompress libselinux-devel libtirpc-devel libtool libudev-devel \
75 libuuid-devel lsscsi mdadm nfs-utils openssl-devel pam-devel pamtester \
76 parted perf python3 python3-cffi python3-devel python3-packaging \
77 kernel-devel python3-setuptools qemu-guest-agent rng-tools rpcgen \
78 rpm-build rsync samba sysstat systemd watchdog wget xfsprogs-devel xxhash \
83 function tumbleweed
() {
84 echo "##[group]Running zypper is TODO!"
89 # Install dependencies
92 echo "##[group]Enable epel and powertools repositories"
93 sudo dnf config-manager
-y --set-enabled powertools
94 sudo dnf
install -y epel-release
97 echo "##[group]Install kernel-abi-whitelists"
98 sudo dnf
install -y kernel-abi-whitelists
101 almalinux9|centos-stream9
)
102 echo "##[group]Enable epel and crb repositories"
103 sudo dnf config-manager
-y --set-enabled crb
104 sudo dnf
install -y epel-release
107 echo "##[group]Install kernel-abi-stablelists"
108 sudo dnf
install -y kernel-abi-stablelists
115 echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
117 echo "##[group]Install Debian specific"
118 sudo apt-get
install -yq linux-perf dh-sequence-dkms
132 echo "##[group]Install Ubuntu specific"
133 sudo apt-get
install -yq linux-tools-common libtirpc-dev \
134 linux-modules-extra-$
(uname
-r)
135 if [ "$1" != "ubuntu20" ]; then
136 sudo apt-get
install -yq dh-sequence-dkms
139 echo "##[group]Delete Ubuntu OpenZFS modules"
140 for i
in $
(find /lib
/modules
-name zfs
-type d
); do sudo
rm -rvf $i; done
145 # This script is used for checkstyle + zloop deps also.
146 # Install only the needed packages and exit - when used this way.
147 test -z "${ONLY_DEPS:-}" ||
exit 0
150 echo "##[group]Enable services"
154 echo 'virtio_load="YES"' | sudo
-E tee -a /boot
/loader.conf
155 for i
in balloon blk console random scsi
; do
156 echo "virtio_${i}_load=\"YES\"" | sudo
-E tee -a /boot
/loader.conf
158 echo "fdescfs /dev/fd fdescfs rw 0 0" | sudo
-E tee -a /etc
/fstab
159 sudo
-E mount
/dev
/fd
160 sudo
-E touch /etc
/zfs
/exports
161 sudo
-E sysrc mountd_flags
="/etc/zfs/exports"
162 echo '[global]' | sudo
-E tee /usr
/local
/etc
/smb4.conf
>/dev
/null
163 sudo
-E service nfsd
enable
164 sudo
-E service qemu-guest-agent
enable
165 sudo
-E service samba_server
enable
168 sudo
-E systemctl
enable nfs-kernel-server
169 sudo
-E systemctl
enable qemu-guest-agent
170 sudo
-E systemctl
enable smbd
173 # All other linux distros
174 sudo
-E systemctl
enable nfs-server
175 sudo
-E systemctl
enable qemu-guest-agent
176 sudo
-E systemctl
enable smb
181 # Setup Kernel cmdline
182 CMDLINE
="console=tty0 console=ttyS0,115200n8"
183 CMDLINE
="$CMDLINE selinux=0"
184 CMDLINE
="$CMDLINE random.trust_cpu=on"
185 CMDLINE
="$CMDLINE no_timer_check"
187 almalinux
*|centos
*|fedora
*)
188 GRUB_CFG
="/boot/grub2/grub.cfg"
189 GRUB_MKCONFIG
="grub2-mkconfig"
190 CMDLINE
="$CMDLINE biosdevname=0 net.ifnames=0"
191 echo 'GRUB_SERIAL_COMMAND="serial --speed=115200"' \
192 | sudo
tee -a /etc
/default
/grub
>/dev
/null
195 GRUB_CFG
="/boot/grub/grub.cfg"
196 GRUB_MKCONFIG
="grub-mkconfig"
197 echo 'GRUB_DISABLE_OS_PROBER="false"' \
198 | sudo
tee -a /etc
/default
/grub
>/dev
/null
201 GRUB_CFG
="/boot/grub/grub.cfg"
202 GRUB_MKCONFIG
="grub-mkconfig"
211 echo "##[group]Edit kernel cmdline"
212 sudo
sed -i -e '/^GRUB_CMDLINE_LINUX/d' /etc
/default
/grub || true
213 echo "GRUB_CMDLINE_LINUX=\"$CMDLINE\"" \
214 | sudo
tee -a /etc
/default
/grub
>/dev
/null
215 sudo
$GRUB_MKCONFIG -o $GRUB_CFG
220 # reset cloud-init configuration and poweroff
221 sudo cloud-init clean
--logs
222 sleep 2 && sudo poweroff
&