Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ on:
push:
paths:
- '**/*.sh'
- '.github/workflows/**'
- 'bootstrap'
- 'arch/**'
- 'debian/**'
- 'ubuntu/**'
- 'pop_os/**'
- 'fedora/**'
- 'generic/**'
pull_request:
paths:
- '**/*.sh'
- '.github/workflows/**'
- 'bootstrap'
- 'arch/**'
- 'debian/**'
- 'ubuntu/**'
- 'pop_os/**'
- 'fedora/**'
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/test-debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test Debian Bootstrap

on:
push:
branches: [ main ]
paths:
- 'debian/**'
- 'generic/**'
- 'bootstrap'
- 'test/**'
- '.github/workflows/test-debian.yml'
pull_request:
branches: [ main ]
paths:
- 'debian/**'
- 'generic/**'
- 'bootstrap'
- 'test/**'
workflow_dispatch:

jobs:
shellcheck:
name: ShellCheck Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run ShellCheck
run: |
sudo apt-get update && sudo apt-get install -y shellcheck
find debian/ generic/ -type f ! -name "*.md" -exec shellcheck -x --severity=error {} \;
shellcheck -x --severity=error bootstrap

docker-test:
name: Docker Test (Debian ${{ matrix.debian-version }})
runs-on: ubuntu-latest
strategy:
matrix:
debian-version: ['bookworm', 'trixie']
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Build test image
run: |
docker build \
--build-arg DEBIAN_VERSION=${{ matrix.debian-version }} \
-f test/docker/Dockerfile.debian-noninteractive \
-t debian-bootstrap-test:${{ matrix.debian-version }} \
.

- name: Run installer tests
run: |
docker run --rm debian-bootstrap-test:${{ matrix.debian-version }}

- name: Test syntax
run: |
docker run --rm debian-bootstrap-test:${{ matrix.debian-version }} bash -c "
cd /home/testuser/linux-bootstrap && \
bash -n debian/bootstrap && \
bash -n debian/install-packages && \
echo 'All Debian syntax checks passed'
"
27 changes: 23 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.PHONY: help test test-auto test-interactive test-all test-syntax lint clean build-test-images docker-clean shellcheck
.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

# Default target
.DEFAULT_GOAL := help

# Ubuntu versions to test
UBUNTU_VERSIONS := 24.04 25.10
DEBIAN_VERSIONS := bookworm trixie

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

test-debian: ## Run automated tests on Debian bookworm
@./test/run-tests.sh debian

test-debian-all: ## Run tests on all Debian versions (bookworm, trixie)
@./test/run-tests.sh debian-all

test-syntax: ## Run syntax checks on all bash scripts
@./test/run-tests.sh syntax

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

build-test-images-debian: ## Build Docker test images for all Debian versions
@echo "Building test images for Debian versions: $(DEBIAN_VERSIONS)"
@for version in $(DEBIAN_VERSIONS); do \
echo "Building Debian $$version..."; \
docker build \
--build-arg DEBIAN_VERSION=$$version \
-f test/docker/Dockerfile.debian-noninteractive \
-t debian-bootstrap-test:$$version \
.; \
done

clean: docker-clean ## Clean up all test artifacts

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

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

quick: test-syntax test-auto ## Quick check: syntax + single version test
quick: test-syntax test-auto test-debian ## Quick check: syntax + single-version Ubuntu and Debian tests
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ detects the distribution and runs the appropriate set of scripts.
## Supported Distributions

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

## Ubuntu or Pop!_OS
## Debian, Ubuntu, or Pop!_OS

To perform a full bootstrap from a clean Ubuntu or Pop!_OS install do:
On Debian, add your current user to the `sudo` group first, since Debian does not do this by default for all installs:

```sh
su -
/usr/sbin/usermod -aG sudo "$USER"
exit
```

Then log out and log back in before running the bootstrap command.

To perform a full bootstrap from a clean Debian, Ubuntu, or Pop!_OS install do:

```sh
sudo apt-get update && sudo apt-get install -y curl git && \
Expand Down
3 changes: 3 additions & 0 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ then
elif [[ "$ID" == "arch" ]]
then
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/arch/bootstrap)
elif [[ "$ID" == "debian" ]]
then
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/bootstrap)
else
echo "Unsupported Linux distribution."
fi
50 changes: 50 additions & 0 deletions debian/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

# Performs a full bootstrap of Debian, running all of the other scripts
# in this directory.
# Usage:
# source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/bootstrap)

# Check if we're running on Debian
source /etc/os-release
if [[ "$ID" != "debian" ]]
then
echo "Not running Debian, exiting."
exit 1
fi

# Create an ssh key
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/create-ssh-key)

# Install packages
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-packages)

# Desktop packages
read -p "Install desktop apps? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-desktop-packages)

read -p "Install makemkv? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-makemkv)
fi
fi

# Zsh customizations
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/install-zsh-customizations)

# Create directories
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/create-directories)

# Install JetBrains Toolbox
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/install-jetbrains-tools)

# Authenticate to GitHub
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-login)

# Add user to groups
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/add-user-to-groups)
53 changes: 53 additions & 0 deletions debian/install-desktop-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env bash
# source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/debian/install-desktop-packages)

# Install Microsoft repo for VS Code
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
rm -f microsoft.gpg

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

# Install Griffo repo for various packages
curl -sS https://debian.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/debian.griffo.io.gpg

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

# Update package repos
sudo apt-get update

# Install graphical desktop packages
sudo apt-get install -y \
audacity \
code \
darktable \
evolution \
evolution-ews \
fonts-cascadia-code \
fonts-firacode \
ghostty \
gimp \
gnome-browser-connector \
gnome-shell-extension-caffeine \
gnome-shell-extension-dashtodock \
gnome-shell-extension-freon \
gnome-tweaks \
handbrake \
kdiff3 \
libavcodec-extra \
libfontconfig1 \
mesa-utils \
obs-studio \
pipx \
xclip

# Install Gnome extension tooling and selected extensions
pipx install gnome-extensions-cli --system-site-packages
"$HOME"/.local/bin/gext install clipboard-history@alexsaveau.dev
"$HOME"/.local/bin/gext enable clipboard-history@alexsaveau.dev

# Move window buttons to the left
if command -v gsettings >/dev/null 2>&1; then
gsettings get org.gnome.desktop.wm.preferences button-layout || true
gsettings set org.gnome.desktop.wm.preferences button-layout close,minimize,maximize: || true
fi
50 changes: 50 additions & 0 deletions debian/install-makemkv
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
# source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/ubuntu/install-makemkv)

# Install makemkv
if ! type makemkv
then
MAKEMKV_VERSION="1.18.2"
mkdir -p /tmp/makemkv-build
pushd /tmp/makemkv-build || exit

curl -O "https://www.makemkv.com/download/makemkv-bin-$MAKEMKV_VERSION.tar.gz"
curl -O "https://www.makemkv.com/download/makemkv-oss-$MAKEMKV_VERSION.tar.gz"
curl -O https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2

tar xzvf "makemkv-bin-$MAKEMKV_VERSION.tar.gz"
tar xzvf "makemkv-oss-$MAKEMKV_VERSION.tar.gz"
tar xjvf ffmpeg-snapshot.tar.bz2

popd || exit

sudo apt-get install -y \
build-essential \
pkg-config \
libc6-dev \
libssl-dev \
libexpat1-dev \
libavcodec-dev \
libgl1-mesa-dev \
qtbase5-dev \
zlib1g-dev \
yasm \
libfdk-aac-dev \
nasm

pushd /tmp/makemkv-build/ffmpeg || exit
./configure --prefix=/tmp/ffmpeg --enable-static --disable-shared --enable-pic --enable-libfdk-aac
make install
popd || exit

pushd "/tmp/makemkv-build/makemkv-oss-$MAKEMKV_VERSION" || exit
PKG_CONFIG_PATH=/tmp/ffmpeg/lib/pkgconfig ./configure
make
sudo make install
popd || exit

pushd "/tmp/makemkv-build/makemkv-bin-$MAKEMKV_VERSION" || exit
make
sudo make install
popd || exit
fi
Loading
Loading