Skip to content

Commit 1a11211

Browse files
committed
Add Debian bootstrap
1 parent c0d9144 commit 1a11211

13 files changed

Lines changed: 487 additions & 209 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ on:
44
push:
55
paths:
66
- '**/*.sh'
7+
- '.github/workflows/**'
78
- 'bootstrap'
89
- 'arch/**'
10+
- 'debian/**'
911
- 'ubuntu/**'
1012
- 'pop_os/**'
1113
- 'fedora/**'
1214
- 'generic/**'
1315
pull_request:
1416
paths:
1517
- '**/*.sh'
18+
- '.github/workflows/**'
1619
- 'bootstrap'
1720
- 'arch/**'
21+
- 'debian/**'
1822
- 'ubuntu/**'
1923
- 'pop_os/**'
2024
- 'fedora/**'

.github/workflows/test-debian.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Test Debian Bootstrap
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'debian/**'
8+
- 'generic/**'
9+
- 'bootstrap'
10+
- 'test/**'
11+
- '.github/workflows/test-debian.yml'
12+
pull_request:
13+
branches: [ main ]
14+
paths:
15+
- 'debian/**'
16+
- 'generic/**'
17+
- 'bootstrap'
18+
- 'test/**'
19+
workflow_dispatch:
20+
21+
jobs:
22+
shellcheck:
23+
name: ShellCheck Linting
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Run ShellCheck
29+
run: |
30+
sudo apt-get update && sudo apt-get install -y shellcheck
31+
find debian/ generic/ -type f ! -name "*.md" -exec shellcheck -x --severity=error {} \;
32+
shellcheck -x --severity=error bootstrap
33+
34+
docker-test:
35+
name: Docker Test (Debian ${{ matrix.debian-version }})
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
debian-version: ['bookworm', 'trixie']
40+
fail-fast: false
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Build test image
46+
run: |
47+
docker build \
48+
--build-arg DEBIAN_VERSION=${{ matrix.debian-version }} \
49+
-f test/docker/Dockerfile.debian-noninteractive \
50+
-t debian-bootstrap-test:${{ matrix.debian-version }} \
51+
.
52+
53+
- name: Run installer tests
54+
run: |
55+
docker run --rm debian-bootstrap-test:${{ matrix.debian-version }}
56+
57+
- name: Test syntax
58+
run: |
59+
docker run --rm debian-bootstrap-test:${{ matrix.debian-version }} bash -c "
60+
cd /home/testuser/linux-bootstrap && \
61+
bash -n debian/bootstrap && \
62+
bash -n debian/install-packages && \
63+
echo 'All Debian syntax checks passed'
64+
"

Makefile

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
.PHONY: help test test-auto test-interactive test-all test-syntax lint clean build-test-images docker-clean shellcheck
1+
.PHONY: help test test-auto test-interactive test-all test-debian test-debian-all test-syntax lint clean build-test-images build-test-images-debian docker-clean shellcheck
22

33
# Default target
44
.DEFAULT_GOAL := help
55

66
# Ubuntu versions to test
77
UBUNTU_VERSIONS := 24.04 25.10
8+
DEBIAN_VERSIONS := bookworm trixie
89

910
help: ## Show this help message
1011
@echo "Linux Bootstrap Testing Makefile"
@@ -25,6 +26,12 @@ test-interactive: ## Start interactive Docker container for manual testing
2526
test-all: ## Run tests on all Ubuntu versions (24.04, 25.10)
2627
@./test/run-tests.sh all
2728

29+
test-debian: ## Run automated tests on Debian bookworm
30+
@./test/run-tests.sh debian
31+
32+
test-debian-all: ## Run tests on all Debian versions (bookworm, trixie)
33+
@./test/run-tests.sh debian-all
34+
2835
test-syntax: ## Run syntax checks on all bash scripts
2936
@./test/run-tests.sh syntax
3037

@@ -34,6 +41,7 @@ shellcheck: ## Run shellcheck on all scripts
3441
@echo "Running shellcheck..."
3542
@if command -v shellcheck >/dev/null 2>&1; then \
3643
shellcheck -x --severity=error bootstrap; \
44+
find debian/ -type f -exec shellcheck -x --severity=error {} \+; \
3745
shellcheck -x --severity=error ubuntu/bootstrap; \
3846
find ubuntu/ -type f -name 'install-*' -exec shellcheck -x --severity=error {} \+; \
3947
find generic/ -type f -exec shellcheck -x --severity=error {} \+; \
@@ -53,13 +61,24 @@ build-test-images: ## Build Docker test images for all Ubuntu versions
5361
.; \
5462
done
5563

64+
build-test-images-debian: ## Build Docker test images for all Debian versions
65+
@echo "Building test images for Debian versions: $(DEBIAN_VERSIONS)"
66+
@for version in $(DEBIAN_VERSIONS); do \
67+
echo "Building Debian $$version..."; \
68+
docker build \
69+
--build-arg DEBIAN_VERSION=$$version \
70+
-f test/docker/Dockerfile.debian-noninteractive \
71+
-t debian-bootstrap-test:$$version \
72+
.; \
73+
done
74+
5675
clean: docker-clean ## Clean up all test artifacts
5776

5877
docker-clean: ## Remove all test Docker images
5978
@echo "Cleaning up Docker test images..."
60-
@docker images | grep ubuntu-bootstrap-test | awk '{print $$3}' | xargs -r docker rmi || true
79+
@docker images | grep -E 'ubuntu-bootstrap-test|debian-bootstrap-test' | awk '{print $$3}' | xargs -r docker rmi || true
6180
@echo "Cleanup complete"
6281

63-
ci: test-syntax test-all ## Run full CI test suite (syntax + all versions)
82+
ci: test-syntax test-all test-debian-all ## Run full CI test suite (syntax + all versions)
6483

65-
quick: test-syntax test-auto ## Quick check: syntax + single version test
84+
quick: test-syntax test-auto test-debian ## Quick check: syntax + single-version Ubuntu and Debian tests

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ detects the distribution and runs the appropriate set of scripts.
66
## Supported Distributions
77

88
- Arch
9+
- Debian
910
- Fedora
1011
- Pop!_OS
1112
- Ubuntu
@@ -30,9 +31,19 @@ sudo dnf install curl && \
3031
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/bootstrap)
3132
```
3233

33-
## Ubuntu or Pop!_OS
34+
## Debian, Ubuntu, or Pop!_OS
3435

35-
To perform a full bootstrap from a clean Ubuntu or Pop!_OS install do:
36+
On Debian, add your current user to the `sudo` group first, since Debian does not do this by default for all installs:
37+
38+
```sh
39+
su -
40+
/usr/sbin/usermod -aG sudo "$USER"
41+
exit
42+
```
43+
44+
Then log out and log back in before running the bootstrap command.
45+
46+
To perform a full bootstrap from a clean Debian, Ubuntu, or Pop!_OS install do:
3647

3748
```sh
3849
sudo apt-get update && sudo apt-get install -y curl git && \

bootstrap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ then
1818
elif [[ "$ID" == "arch" ]]
1919
then
2020
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/arch/bootstrap)
21+
elif [[ "$ID" == "debian" ]]
22+
then
23+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/bootstrap)
2124
else
2225
echo "Unsupported Linux distribution."
2326
fi

debian/bootstrap

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
# Performs a full bootstrap of Debian, running all of the other scripts
4+
# in this directory.
5+
# Usage:
6+
# source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/bootstrap)
7+
8+
# Check if we're running on Debian
9+
source /etc/os-release
10+
if [[ "$ID" != "debian" ]]
11+
then
12+
echo "Not running Debian, exiting."
13+
exit 1
14+
fi
15+
16+
# Create an ssh key
17+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/create-ssh-key)
18+
19+
# Install packages
20+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-packages)
21+
22+
# Desktop packages
23+
read -p "Install desktop apps? " -n 1 -r
24+
echo
25+
if [[ $REPLY =~ ^[Yy]$ ]]
26+
then
27+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-desktop-packages)
28+
29+
read -p "Install makemkv? " -n 1 -r
30+
echo
31+
if [[ $REPLY =~ ^[Yy]$ ]]
32+
then
33+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-makemkv)
34+
fi
35+
fi
36+
37+
# Zsh customizations
38+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/install-zsh-customizations)
39+
40+
# Create directories
41+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/create-directories)
42+
43+
# Install JetBrains Toolbox
44+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/install-jetbrains-tools)
45+
46+
# Authenticate to GitHub
47+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-login)
48+
49+
# Add user to groups
50+
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/add-user-to-groups)

debian/install-desktop-packages

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
# source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-desktop-packages)
3+
4+
# Install Microsoft repo for VS Code
5+
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
6+
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
7+
rm -f microsoft.gpg
8+
9+
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
10+
11+
# Install Griffo repo for various packages
12+
curl -sS https://debian.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/debian.griffo.io.gpg
13+
14+
echo "deb https://debian.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/debian.griffo.io.list
15+
16+
# Update package repos
17+
sudo apt-get update
18+
19+
# Install graphical desktop packages
20+
sudo apt-get install -y \
21+
audacity \
22+
code \
23+
darktable \
24+
evolution \
25+
evolution-ews \
26+
fonts-cascadia-code \
27+
fonts-firacode \
28+
ghostty \
29+
gimp \
30+
gnome-browser-connector \
31+
gnome-shell-extension-caffeine \
32+
gnome-shell-extension-dashtodock \
33+
gnome-shell-extension-freon \
34+
gnome-tweaks \
35+
handbrake \
36+
kdiff3 \
37+
libavcodec-extra \
38+
libfontconfig1 \
39+
mesa-utils \
40+
obs-studio \
41+
pipx \
42+
xclip
43+
44+
# Install Gnome extension tooling and selected extensions
45+
pipx install gnome-extensions-cli --system-site-packages
46+
"$HOME"/.local/bin/gext install clipboard-history@alexsaveau.dev
47+
"$HOME"/.local/bin/gext enable clipboard-history@alexsaveau.dev
48+
49+
# Move window buttons to the left
50+
if command -v gsettings >/dev/null 2>&1; then
51+
gsettings get org.gnome.desktop.wm.preferences button-layout || true
52+
gsettings set org.gnome.desktop.wm.preferences button-layout close,minimize,maximize: || true
53+
fi

debian/install-makemkv

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
# source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/ubuntu/install-makemkv)
3+
4+
# Install makemkv
5+
if ! type makemkv
6+
then
7+
MAKEMKV_VERSION="1.18.2"
8+
mkdir -p /tmp/makemkv-build
9+
pushd /tmp/makemkv-build || exit
10+
11+
curl -O "https://www.makemkv.com/download/makemkv-bin-$MAKEMKV_VERSION.tar.gz"
12+
curl -O "https://www.makemkv.com/download/makemkv-oss-$MAKEMKV_VERSION.tar.gz"
13+
curl -O https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
14+
15+
tar xzvf "makemkv-bin-$MAKEMKV_VERSION.tar.gz"
16+
tar xzvf "makemkv-oss-$MAKEMKV_VERSION.tar.gz"
17+
tar xjvf ffmpeg-snapshot.tar.bz2
18+
19+
popd || exit
20+
21+
sudo apt-get install -y \
22+
build-essential \
23+
pkg-config \
24+
libc6-dev \
25+
libssl-dev \
26+
libexpat1-dev \
27+
libavcodec-dev \
28+
libgl1-mesa-dev \
29+
qtbase5-dev \
30+
zlib1g-dev \
31+
yasm \
32+
libfdk-aac-dev \
33+
nasm
34+
35+
pushd /tmp/makemkv-build/ffmpeg || exit
36+
./configure --prefix=/tmp/ffmpeg --enable-static --disable-shared --enable-pic --enable-libfdk-aac
37+
make install
38+
popd || exit
39+
40+
pushd "/tmp/makemkv-build/makemkv-oss-$MAKEMKV_VERSION" || exit
41+
PKG_CONFIG_PATH=/tmp/ffmpeg/lib/pkgconfig ./configure
42+
make
43+
sudo make install
44+
popd || exit
45+
46+
pushd "/tmp/makemkv-build/makemkv-bin-$MAKEMKV_VERSION" || exit
47+
make
48+
sudo make install
49+
popd || exit
50+
fi

0 commit comments

Comments
 (0)