Skip to content

Add Debian packaging files #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ShivamVashisth28
Copy link

Description

This pull request adds the complete Debian packaging directory (debian/) for the Lunatik project, enabling easy building and installation of Lunatik as a Debian package.

  • Includes packaging metadata files (control, changelog, rules, etc.)
  • Adds DKMS support for building kernel modules automatically on kernel upgrades
  • Provides installation scripts and configurations for examples, tests, eBPF, and BTF components
  • Prepares Lunatik for official Debian archive integration and easier maintenance

This initial packaging setup has been tested locally and passes Debian lintian checks with minimal warnings.

Usage

This package requires the Lunatik upstream source code to be available. To build the Debian package locally, clone the Lunatik repository and place the debian/ directory inside the source root:

git clone https://github.com/luainkernel/lunatik.git
cd lunatik
# Copy or add the debian/ directory here
debuild -us -uc

@marcelstanley

Copy link
Collaborator

@marcelstanley marcelstanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShivamVashisth28 I have added just a few minor suggestions. I'm going to test the PR later on.

@marcelstanley
Copy link
Collaborator

marcelstanley commented Jul 6, 2025

As mentioned on luainkernel/lunatik#295 let's add lunatik as a submodule here and adapt the build. Sorry for the confusion, @ShivamVashisth28.

@marcelstanley marcelstanley self-requested a review July 6, 2025 22:43
@marcelstanley
Copy link
Collaborator

@ShivamVashisth28 perhaps we're missing something in the build instructions as well. The build depends on a tarball being available. I've created one but the build still fails. Look at this gist, please: https://gist.github.com/marcelstanley/42e8b352bad008ff700bc2430221e7e1

@ShivamVashisth28
Copy link
Author

@ShivamVashisth28 perhaps we're missing something in the build instructions as well. The build depends on a tarball being available. I've created one but the build still fails. Look at this gist, please: https://gist.github.com/marcelstanley/42e8b352bad008ff700bc2430221e7e1

Hey @marcelstanley , can you try again and follow these steps :-

  1. Clone this repo and get the Debian files
  2. Clone the Lunatik repo
  3. Change the name of Lunatik repo from luantik to lunatik-3.6.2
    mv lunatik lunatik-3.6.2
  4. Create the tar file
    tar -czf lunatik_3.6.2.orig.tar.gz lunatik-3.6.2
  5. Now copy the debian files from this repo to the lunatik-3.6.2 folder
    cp -r lunatik-package/debian lunatik-3.6.2
  6. Now go inside the lunatik-3.6.2 and run the following command
    sudo dpkg-buildpackage -us -uc

@marcelstanley marcelstanley self-requested a review July 9, 2025 02:03
Copy link
Collaborator

@marcelstanley marcelstanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShivamVashisth28 Alright, I was able to build the packages successfully. But, as soon as I worked around the issue with the post install script, I hit the zfs error, which I thought had already been solved.

See the dmesg log excerpt below:

[ 1102.721193] lunatik: loading out-of-tree module taints kernel.
[ 1102.724524] lunatik: module verification failed: signature and/or required key missing - tainting kernel
[ 1103.223582] zfs: module license 'CDDL' taints kernel.
[ 1103.223684] Disabling lock debugging due to kernel taint
[ 1103.224731] zfs: module license taints kernel.
[ 1103.329788] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1103.636236] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1103.912636] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1104.290087] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1104.685103] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1105.077274] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1105.644591] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1105.655329] workqueue: drm_fb_helper_damage_work hogged CPU for >10000us 7 times, consider switching to WQ_UNBOUND
[ 1105.882924] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)
[ 1150.438748] zfs: exports duplicate symbol luaL_argerror (owned by lunatik)

That said, I think you should help with testing/fixing luainkernel/lunatik#298, which may fix the issue..

@@ -0,0 +1,7 @@
#!/bin/sh
set -e
cd /usr/src/lunatik-#MODULE_VERSION#/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems #MODULE_VERSION# is not being properly resolved. The post install script for lunatik-dkms_3.6.2-1_all.deb fails with:

Running the post_install script:
/var/lib/dkms/lunatik/3.6.2/source/dkms_post_install.sh: 3: cd: can't cd to /usr/src/lunatik-#MODULE_VERSION#/
depmod......

I had to do the following to properly wrap up the installation:

cd /usr/src/lunatik-3.6.2/
sudo su
make scripts_install
make ebpf
make ebpf_install
make btf_install

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell me your env and kernel version ?

Copy link
Collaborator

@marcelstanley marcelstanley Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my env:

vboxuser@test-vm:~$ uname -a
Linux test-vm 6.14.0-23-generic #23-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 23:02:20 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
vboxuser@test-vm:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 25.04
Release:        25.04
Codename:       plucky
vboxuser@test-vm:~/development/luainkernel/lunatik-3.6.2$ git status
HEAD detached at v3.6.2
vboxuser@test-vm:~/development/shivam/lunatik_packages$ git status
On branch fix_dkms_package
Your branch is up to date with 'origin/fix_dkms_package'.
```


## Building the Debian Package

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a matter of completeness, you should also refer to the lunatik setup here.

- Debian changelog, rules, control files, and other packaging assets

## Submodule Integration with Lunatik
Copy link
Collaborator

@marcelstanley marcelstanley Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole section should be updated as soon as you add lunatik as a submodule, as requested at #3 (comment)

@ShivamVashisth28
Copy link
Author

hey @marcelstanley, did you build both the packages ??
And are you still facing the issue ??

@marcelstanley
Copy link
Collaborator

hey @marcelstanley, did you build both the packages ?? And are you still facing the issue ??

Yes and yes, @ShivamVashisth28.

Have you checked luainkernel/lunatik#298?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants