Skip to content

Commit 3c03a22

Browse files
add debian files
1 parent 4056cee commit 3c03a22

File tree

12 files changed

+228
-1
lines changed

12 files changed

+228
-1
lines changed

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,39 @@
1-
# lunatik_packages
1+
# Lunatik Packaging
2+
3+
This repository contains the Debian packaging files for **Lunatik** — the kernel Lua scripting framework.
4+
5+
## Contents
6+
7+
- `debian/` directory with all packaging metadata and scripts
8+
- DKMS configuration files for building kernel modules dynamically
9+
- Post-install and helper scripts used during package installation
10+
- Debian changelog, rules, control files, and other packaging assets
11+
12+
## Submodule Integration with Lunatik
13+
This repository is intended to be used as a Git submodule within the main Lunatik repository.
14+
15+
To clone the main Lunatik repository along with this packaging submodule:
16+
17+
```
18+
git clone --recurse-submodules https://github.com/luainkernel/lunatik.git
19+
```
20+
21+
If you've already cloned Lunatik without submodules:
22+
23+
```
24+
git submodule update --init --recursive
25+
```
26+
27+
## Building the Debian Package
28+
29+
Because Debian packaging tools expect the debian/ directory to be at the root, you must first symlink the packaging directory:
30+
31+
```
32+
ln -s lunatik_packages/debian ./debian
33+
```
34+
35+
Then run the build command:
36+
37+
```bash
38+
dpkg-buildpackage -us -uc
39+
```

debian/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
lunatik (3.6.2-1) unstable; urgency=medium
2+
3+
* Lunatik kernel Lua scripting framework for Debian/Ubuntu.
4+
5+
-- Shivam Vashisth <vashisth11shivam@gmail.com> Tue, 01 Jul 2025 19:55:00 +0530

debian/control

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Source: lunatik
2+
Section: kernel
3+
Priority: optional
4+
Maintainer: Shivam Vashisth <vashisth11shivam@gmail.com>
5+
Build-Depends: debhelper-compat (= 13), dkms
6+
Standards-Version: 4.6.2
7+
Homepage: https://github.com/luainkernel/lunatik
8+
9+
Package: lunatik
10+
Architecture: any
11+
Depends: ${shlibs:Depends}, ${misc:Depends}, lua5.4
12+
Description: User-space tools for the Lunatik kernel module
13+
This package provides the lunatik CLI tool for interacting with the Lunatik
14+
kernel module, including running Lua scripts in the kernel and accessing the
15+
REPL. Intended for kernel developers interested in rapid
16+
prototyping and scripting within the kernel space.
17+
18+
Package: lunatik-dkms
19+
Architecture: all
20+
Depends: dkms, ${misc:Depends}
21+
Provides: lunatik-modules
22+
Description: DKMS source for the Lunatik kernel modules
23+
This package provides the source code for the Lunatik kernel modules,
24+
allowing DKMS to automatically build and install them for each kernel.
25+
It does not ship prebuilt modules, but builds them locally for each
26+
installed kernel, ensuring compatibility and easy updates.

debian/copyright

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: Lunatik
3+
Source: https://github.com/luainkernel/lunatik
4+
5+
Files: *
6+
Copyright: 2023-2025 Ring Zero Desenvolvimento de Software LTDA
7+
License: MIT or GPL-2.0-only
8+
9+
Files: debian/*
10+
Copyright: 2025 Shivam Vashisth <vashisth11shivam@gmail.com>
11+
License: MIT
12+
13+
License: MIT
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
.
21+
The above copyright notice and this permission notice shall be included in all
22+
copies or substantial portions of the Software.
23+
.
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
SOFTWARE.
31+
32+
License: GPL-2.0-only
33+
On Debian systems, the complete text of the GNU General Public License
34+
version 2 can be found in "/usr/share/common-licenses/GPL-2".

debian/dkms_post_install.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
set -e
3+
cd /usr/src/lunatik-#MODULE_VERSION#/
4+
make scripts_install
5+
make ebpf
6+
make ebpf_install
7+
make btf_install

debian/files

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lunatik_3.6.2-1_source.buildinfo kernel optional

debian/lunatik-dkms.dkms

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
PACKAGE_NAME="lunatik"
2+
PACKAGE_VERSION="#MODULE_VERSION#"
3+
4+
# Main modules built in root directory
5+
BUILT_MODULE_NAME[0]="lunatik"
6+
BUILT_MODULE_NAME[1]="lunatik_run"
7+
8+
# Library modules built in lib/ subdirectory
9+
BUILT_MODULE_NAME[2]="luadevice"
10+
BUILT_MODULE_NAME[3]="lualinux"
11+
BUILT_MODULE_NAME[4]="luanotifier"
12+
BUILT_MODULE_NAME[5]="luasocket"
13+
BUILT_MODULE_NAME[6]="luarcu"
14+
BUILT_MODULE_NAME[7]="luathread"
15+
BUILT_MODULE_NAME[8]="luafib"
16+
BUILT_MODULE_NAME[9]="luadata"
17+
BUILT_MODULE_NAME[10]="luaprobe"
18+
BUILT_MODULE_NAME[11]="luasyscall"
19+
BUILT_MODULE_NAME[12]="luaxdp"
20+
BUILT_MODULE_NAME[13]="luafifo"
21+
BUILT_MODULE_NAME[14]="luaxtable"
22+
BUILT_MODULE_NAME[15]="luanetfilter"
23+
BUILT_MODULE_NAME[16]="luacompletion"
24+
25+
BUILT_MODULE_LOCATION[0]="."
26+
BUILT_MODULE_LOCATION[1]="."
27+
BUILT_MODULE_LOCATION[2]="lib"
28+
BUILT_MODULE_LOCATION[3]="lib"
29+
BUILT_MODULE_LOCATION[4]="lib"
30+
BUILT_MODULE_LOCATION[5]="lib"
31+
BUILT_MODULE_LOCATION[6]="lib"
32+
BUILT_MODULE_LOCATION[7]="lib"
33+
BUILT_MODULE_LOCATION[8]="lib"
34+
BUILT_MODULE_LOCATION[9]="lib"
35+
BUILT_MODULE_LOCATION[10]="lib"
36+
BUILT_MODULE_LOCATION[11]="lib"
37+
BUILT_MODULE_LOCATION[12]="lib"
38+
BUILT_MODULE_LOCATION[13]="lib"
39+
BUILT_MODULE_LOCATION[14]="lib"
40+
BUILT_MODULE_LOCATION[15]="lib"
41+
BUILT_MODULE_LOCATION[16]="lib"
42+
43+
# All modules go to DKMS updates directory
44+
DEST_MODULE_LOCATION[0]="/updates/dkms"
45+
DEST_MODULE_LOCATION[1]="/updates/dkms"
46+
DEST_MODULE_LOCATION[2]="/updates/dkms"
47+
DEST_MODULE_LOCATION[3]="/updates/dkms"
48+
DEST_MODULE_LOCATION[4]="/updates/dkms"
49+
DEST_MODULE_LOCATION[5]="/updates/dkms"
50+
DEST_MODULE_LOCATION[6]="/updates/dkms"
51+
DEST_MODULE_LOCATION[7]="/updates/dkms"
52+
DEST_MODULE_LOCATION[8]="/updates/dkms"
53+
DEST_MODULE_LOCATION[9]="/updates/dkms"
54+
DEST_MODULE_LOCATION[10]="/updates/dkms"
55+
DEST_MODULE_LOCATION[11]="/updates/dkms"
56+
DEST_MODULE_LOCATION[12]="/updates/dkms"
57+
DEST_MODULE_LOCATION[13]="/updates/dkms"
58+
DEST_MODULE_LOCATION[14]="/updates/dkms"
59+
DEST_MODULE_LOCATION[15]="/updates/dkms"
60+
DEST_MODULE_LOCATION[16]="/updates/dkms"
61+
62+
AUTOINSTALL="yes"
63+
# BTF-enabled build with proper configuration flags
64+
MAKE[0]="make KERNELDIR=/lib/modules/\${kernelver}/build CONFIG_DEBUG_INFO_BTF=y"
65+
CLEAN="make clean"
66+
67+
POST_INSTALL="dkms_post_install.sh"

debian/lunatik.1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.TH LUNATIK 1 "June 2025" "Lunatik 3.6.2" "User Commands"
2+
.SH NAME
3+
lunatik \- Lua scripting framework for the Linux kernel
4+
.SH SYNOPSIS
5+
.B lunatik
6+
.RI [ script.lua ]
7+
.SH DESCRIPTION
8+
Lunatik provides a way to run Lua scripts inside the Linux kernel, enabling rapid prototyping and extension of kernel functionality. This tool allows you to load and manage kernel Lua scripts.
9+
.SH AUTHOR
10+
Shivam Vashisth <Vashisth11shivam@gmail.com>
11+
.SH HOMEPAGE
12+
https://github.com/luainkernel/lunatik

debian/lunatik.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/lunatik usr/bin/

debian/rules

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/make -f
2+
3+
export DEB_VERSION_UPSTREAM := $(shell dpkg-parsechangelog -SVersion | sed 's/-.*//')
4+
5+
%:
6+
dh $@ --with dkms
7+
8+
override_dh_auto_build:
9+
10+
make bin/lunatik
11+
12+
override_dh_auto_install:
13+
14+
make clean
15+
mkdir -p debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/
16+
rsync -a --exclude=debian --exclude=.git --exclude=.gitignore --exclude=.gitmodules ./ debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/
17+
cp debian/lunatik-dkms.dkms debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/dkms.conf
18+
cp debian/dkms_post_install.sh debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/
19+
chmod +x debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/dkms_post_install.sh
20+
find debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/ -name '*.ko' -delete
21+
find debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/ -name '*.o' -delete
22+
find debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/ -name '*.mod.*' -delete
23+
find debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/ -name '*.cmd' -delete
24+
find debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/ -name '*.symvers' -delete
25+
find debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/ -name '*.order' -delete
26+
find debian/lunatik-dkms/usr/src/lunatik-$(DEB_VERSION_UPSTREAM)/ -type f ! -name '*.sh' ! -name '*.lua' ! -name '*.pl' ! -name '*.py' -exec chmod -x {} +
27+
make examples_install
28+
make tests_install
29+
30+
override_dh_dkms:
31+
dh_dkms -V"$(DEB_VERSION_UPSTREAM)"

0 commit comments

Comments
 (0)