Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hands-on patching a deb package

Ruinland
December 20, 2017

Hands-on patching a deb package

Showing the (out-dated) ways to patch a deb package, and discuss some related topics.
This is presented at Hsinchu Ubuntu 17.10 Release Party.

Ruinland

December 20, 2017

Transcript

12 slides
  1. whoami • 盧英嵐 Ruinland ( 蔡傳資 ) – Random topic

    surfer. • Mostly system software – Now using archlinux-based distro, Manjaro. • Knoppix during junior high • Ubuntu during 1st and 2nd grade of college • Manjaro and archlinux after 3rd grade. – Not a fan of Linux-on-Windows (open sourced solutions are necessary.)
  2. Patch because you can. • Debug • Sh*t happens. –

    Dependency issues. – Something got deprecated. – Non-default build flags. – …… • Especially you guise are smart enough to make tools fit you, not the reverse way.
  3. On archlinux • PKGBUILD rules. • makepkg will run the

    function hooks in PKGBUILD. – Almost full control of EVERYTHING. • I prefer this way. – Yet you can’t always get what you want.
  4. Get the sauce ready. • apt-get source <pcakage name> –

    /etc/apt/source.list • deb-src [repo uri] [package class list] – i.e. main, universe, restricted, multiverse • sudo apt-get build-dep <package name> – Keep this in mind - - build dependencies are different from runtime dependencies.
  5. Time to quilt, not quit • A shell-script tool to

    maintain patchset – Some may argue this is out-dated by VCS. • git-seires is 3rd party https://github.com/git-series/git-series • commands – push, pop, series, new …… blah, blah • Works like this flow: – quilt push -a – quilt new <patch file name> – quilt add <influenced files> – start editing – quilt refresh – quilt pop -a
  6. debuild • Wrapper to run dpkg-buildpackage & lintian (the linter

    to check package’s compliance) • debuild -uc -us [-b|-S] – -uc : unsigned-changes – -us : unsigned-source – -b : build binary package – -S : build source package
  7. Demo • Patching musl (http://musl-libc.org), a MIT licensed c library

    and runtime, to print “Trying to printf()” before every printf(). • musl libc is really portable, easy-to-read, hack-friendly. (I mean “hack” as in customization manner.)

More Decks by Ruinland

Other Decks in Technology