• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh -eux
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2018-2024 Petr Vorel <pvorel@suse.cz>
4
5# workaround for missing oldstable-updates repository
6# W: Failed to fetch http://deb.debian.org/debian/dists/oldstable-updates/main/binary-amd64/Packages
7grep -v oldstable-updates /etc/apt/sources.list > /tmp/sources.list && mv /tmp/sources.list /etc/apt/sources.list
8
9apt update
10
11# workaround for Ubuntu impish asking to interactively configure tzdata
12export DEBIAN_FRONTEND="noninteractive"
13
14install="apt install -y --no-install-recommends"
15remove="apt remove -y"
16
17# libc6-dev and libtirpc-dev are hard dependencies for gcc toolchain
18# LTP should be compilable without linux-libc-dev, but we expect kernel headers.
19pkg_minimal="
20	autoconf
21	automake
22	build-essential
23	debhelper
24	devscripts
25	clang
26	gcc
27	git
28	iproute2
29	libc6-dev
30	libtirpc-dev
31	linux-libc-dev
32	lsb-release
33	pkg-config
34"
35
36pkg_nonessential="
37	acl-dev
38	asciidoc-base
39	asciidoc-dblatex
40	asciidoctor
41	libacl1-dev
42	libaio-dev
43	libcap-dev
44	libjson-perl
45	libkeyutils-dev
46	libnuma-dev
47	libmnl-dev
48	libselinux1-dev
49	libsepol-dev
50	libssl-dev
51"
52
53# Missing on Ubuntu 18.04 LTS (Bionic Beaver)
54pkg_maybe_nonessential="ruby-asciidoctor-pdf"
55
56case "$ACTION" in
57	minimal)
58		echo "=== Installing only minimal dependencies ==="
59		$install $pkg_minimal
60		;;
61	remove-nonessential)
62		echo "=== Make sure devel libraries are removed ==="
63		$remove $pkg_nonessential
64		$remove $pkg_maybe_nonessential || true
65		;;
66	*)
67		echo "=== Installing dependencies ==="
68		$install $pkg_minimal $pkg_nonessential
69		$install $pkg_maybe_nonessential || true
70		;;
71esac
72
73df -hT
74