The Northwestern MS Robotics Personal Package Archive
MSR PPA
A personal package archive (PPA) is a way for users of Ubuntu to distribute personal packages. Northwestern MS in Robotics has a PPA at https://launchpad.net/~numsr/+archive/ubuntu/robotics.
This document describes how to make a PPA and provides details about the NU MSR PPA.
The following steps should be done from Ubuntu LTS
How To Make A PPA
- Sign up for a launchpad.net account
- Create an OpenPGP key:
gpg --full-gen-key - See the keys with
gpg --list-keys - Send your key to the Ubuntu keyserver:
gpg --send-keys --keyserver keyserver.ubuntu.com <keyid> - Wait 10 minutes for the server to update
- In your launchpad profile, add the pgp key (use
gpg --fingerprintto get the fingerprint you needed) - Assuming your email is not setup with
gpg, copy the encrypted message to a file and decrypt withgpg -d, then follow the instructions. - While logged into launchpad, assign (or affirm) the Code of Conduct
References
How To Rebuild a Debian Package
From a Source Debian
- Make sure the
pgpkeys are setup on the system you are building the package on. - Install the
devscriptspackage - Add
deb-srcto theTypes:stanza in/etc/apt/sources.list.d/ubuntuIt should look likeTypes: deb deb-src sudo apt updateapt build-dep <packagename>installs the build dependencies- Create a working directory
<workdir>andcd <workdir>. apt source <packagename>downloads the source package to<workdir>.- The debian build process likes to spew and refer to files in the parent directory.
- To help with this it makes sense to copy the workdir when issuing a new
debuildcommand.
- To help with this it makes sense to copy the workdir when issuing a new
- The package download should have created a directory with the upstream package name and version
<package>. Enter this directory - Most debian packages use the Quilt patch management system to manage patches
- Use
quilt push -ato make sure the package is up-to-date - You can also track things as patches using quilt if you would like:
quilt new patchname.patchcreates a new patchquilt add filenameadds a file to the patchset. This must be done prior to editing the file- When done editing use
quilt refreshto apply the patch.
- Use
- Use
dchto editdebian/changelog, adding a new entry for yourself outlining the changes you made- Be sure to boost the version number in the changelog.
- If you have just made changing to the packaging, change the debian version (the part after the
-) - Appending a
~<N>makes the package be considered less new than the version without the~<N>appended. - Name and email address should likely be consistent with the pgp key you use to sign the ppa.
- These packages are very finicky about the version naming scheme, and various items have different semantic meanings. For my purpose, incrementing the revision number seems to work best.
- The
debian/controlhas information about package dependencies - When ready to build run
debuild -k<your-pgp-key-id> -b(from a new<workspace>directory)- You may wish to install and test the package.
- The key id is listed on the ppa homepage (e.g., https://launchpad.net/~numsr for NU MSR's ppa) under OpenPGP keys
- When ready to upload to the ppa run:
debuild -k<your-pgp-key-id> -S -sa - If the source built successfully upload the packages using
dput ppa:<username>/<ppaname> <package_name>.changes(according to the instructions on the ppa page). - Refresh your ppa homepage. It may take a little while. If the build failed, you will get an email with some diagnostic information.
- There is no need to keep track of your changes in git: once uploaded to launchpad you can see the source and your changes to it by downloading the source package.
- Essentially, your changes are being tracked in launchpad. This is fine for changes to the packaging itself, but if you are changing source code you likely want to make the changes in a fork or even submit them to the upstream project.
Package Format
There are two package formats, as specified in debian/source/format
3.0 (quilt)this uses the quilt patch system and assumes source code is provided as a separate tarball from thedebian/folder3.0 (native)this mode allows thedebian/folder to be directly in the repository- The downside of
nativeis that the full source code becomes part of the debian source package, making it harder to track what Ubuntu-specific changes were made - There is worse Launchpad performance since the full code must be uploaded even if only the
debian/directory changes.
- The downside of
Quilt Packages
- Fork the package to
package. - Make the original tarball:
tar --exclude=.git --exclude=debian/ -czf package_name_version.orig.tar.gz git_folder_name/ .
- Commit to your modification branch
- Use
git format-patchcommit to create a patch set and save it somewhere - On the original (non-fork) branch create the
debian/directory and required files
4.. export QUILT_PATCHES=debian/patches
- Use
quilt importon each patch to apply the patches
RT Kernel
- Get RT Kernel sources (must get via git to make the debian source package) git clone https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git/ Checkout the latest rt branch
- Make menu config and setup the kernel.
- I made a custom version based on the config available in /boot/config
- The kernel is designed for x86 systems and removes support for a lot of legacy hardwaree tc
- It's nto fully minimal as it tries to stay close to ubuntu defaults
- In kernel source tree: make menuconfig
- To build a debian package: make deb-pkg
- Test this by installing it
- To prepare for the ppa
- Use make srcdeb-pkg to make the source package
- This creates a gzip of the package directory.
- The original source is the orig.tar.gz file
- What we need to do is
- Extract the orig.tar.gz file to a file that matches the name of what you actually want to call the package
- Unpack the source package to a new directory
- tar czvf name_of_package.orig.tar.gz source_dir
- This creates the original tarball
- Extract the source tarball into the extracted source directory
- Edit control and changelog to set the version and the package name that you want
- debuild -k<KEYID> -S -sa to build the source package that can be uploaded to the ppa
Realsense
There are two Realsense packages in the PPA
realsense-dkms
- The realsense has some slightly modified kernel drivers to help it report timing information better.
- The realsense will work without this package, but it timestamp information is more reliable if you use it.
- The process by which Intel releases it's kernel patches is not entirely clear, but the build process involves scripts and patches under the
librealsense2/scriptsdirectory - Intel has it's own apt repository that contains binary packages for the
dkmsdriver- Each of these packages belongs to a specific kernel
- The version I provide on the PPA is for the 6.8.0 kernel. It was created by
- Downloading and extracting the files from the binary librealsense2-dkms package
- Recreating the source package from scratch from the binary package
librealsense2
- This version now matches the upstream version, and differs only from the
ros-<version>-librealsense2package based on it's compilation options- CUDA is enabled (in tests of e.g., aligning frames, this results in a 10x speedup)
- Python bindings are provided
- The intel realsense utilities are provided
- The udev rules are installed
Uncloud-init
- A replacement for cloud-init that serves the purpose of providing the minimal cloud-init functionality needed to perform an installation of Ubuntu.
- The
README.mdin the package provides the details
Network Manager
- Removes dependencies of Network Manager on netplan.io