Streamlined Linux Kernel Compilation Tool
sworkflow (sw) is an automated kernel compilation tool designed to streamline the process of compiling the Linux kernel and significantly reduce the overhead involved in setting up the development environment.
- Device-specific build configurations
- Cross-compiler management for ARM64/ARM32/x86
- Clang/LLVM build support
- DTBO image generation
- AnyKernel3 packaging integration
- Interactive config generation
Download the latest .deb from Releases:
sudo dpkg -i sworkflow_*.deb
sudo apt-get install -f # Install dependencies if neededInstalls to ~/.local/ - no root required:
git clone https://github.com/sworkflow-project/sworkflow.git
cd sworkflow
make installEnsure ~/.local/bin is in your PATH:
export PATH="$HOME/.local/bin:$PATH"Installs to /usr/:
git clone https://github.com/sworkflow-project/sworkflow.git
cd sworkflow
sudo make installmake uninstall # Remove user installation
sudo make uninstall # Remove system installationRequired:
- bash (>= 4.0)
- python3
- git
- make
Recommended (for kernel building):
- build-essential
- bc, flex, bison
- libssl-dev, libelf-dev
Optional:
- clang (for LLVM builds)
- device-tree-compiler (for DTBO)
sw <command> [device]| Command | Description |
|---|---|
sw build <device> |
Build kernel for specified device |
sw doctor [device] |
Show available configs and current settings |
sw init |
Generate new device configuration |
sw help |
Display help message |
sw version |
Display version |
Build kernel for a device:
cd /path/to/kernel-source
sw build mainlineGenerate a new device config:
sw initAfter installation, view the full manual:
man swDevice configurations are stored as shell scripts named sworkflow.<device>.config.
Search order:
/etc/sworkflow/(system installation)~/.local/sw/configs/(user installation)- Current directory
./configs/subdirectory
| Variable | Description |
|---|---|
device_arch |
Target architecture (arm64, x86_64) |
kernel_defconfig |
Kernel defconfig file |
cross_compile |
Cross-compiler prefix |
cross_compile_arm32 |
32-bit ARM cross-compiler |
use_clang |
Use Clang/LLVM (set to 1) |
do_modules |
Install kernel modules |
create_dtbo |
Create DTBO image |
do_anykernel |
Package with AnyKernel3 |
See configs/sworkflow_template.config for all options.
sudo apt-get install devscripts debhelper shellcheck
dpkg-buildpackage -us -uc -bThe package will be created in the parent directory.
make tests # Run all tests
make format # Format scripts
make docs # Build documentation
make docs-clean # Clean documentation build
make help # Show all targetssworkflow/
├── sw # Main executable
├── src/ # Source modules
├── configs/ # Device configurations
├── utils/ # Python utilities (mkdtboimg.py)
├── man/ # Man pages
├── docs/ # Sphinx documentation
├── debian/ # Debian packaging
├── tests/ # Test scripts
└── Makefile # Build system
GPL-3.0-or-later
Copyright (c) 2019 Saalim Quadri
Contributions are welcome! Please check issues for a good starting point.