Zobrazují se příspěvky se štítkemfedora. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemfedora. Zobrazit všechny příspěvky

neděle 22. října 2017

How to recompile Fedora kernel with the custom patch

I has been asked how to recompile Fedora kernel with the custom patch, so here is the tutorial:

At first install the needed packages:

# dnf install fedpkg dnf-plugins-core

Install build requirements for the kernel package:

# dnf builddep kernel

Clone the kernel dist-git module for the desired Fedora version, i.e. if you want to recompile the kernel for the Fedora 26, add the '-b f26' or respective version (--anonymous is used for the anonymous checkout, i.e. read only checkout):

$ fedpkg co --anonymous -b f26 kernel

Change the working directory to the cloned dist-git module:

$ cd kernel

Copy the desired patch (e.g. my.patch) to the working directory:

$ cp DIR/my.patch .

Make sure your my.patch has been generated by the 'git format-patch' if not, you need to manually add the header containing lines From:, Subject:, so proceed the following step just only if such header is not presented in your patch (of course edit the strings as needed):

$ echo "From: Joe Hacker <joe.hacker@hacker.org>" > header
$ echo "Subject: My patch" >> header
$ echo >> header
$ cat header my.patch > patch
$ mv patch my.patch

Edit the kernel.spec, locate the string '# END OF PATCH DEFINITIONS', and add the following string just before it:

Patch9999: my.patch

where make sure that the number 9999 is not used by any previous Patch keyword. If it's already used, keep increasing the number until you will find the highest unused number and use it with your patch. Save the spec file.

Recompile the kernel:

$ fedpkg local

Install/re-install the newly builds kernel RPMs from the ARCH directory, i.e. if you compiled the kernel for the x86_64, the ARCH directory is x86_64.

Reverted patch

In case you have upstream kernel patch you need to revert (let's say upstream.patch, do the previous steps up-to the installation of the my.patch, then unpack the kernel sources:

$ fedpkg prep

Make the reverted patch of the upstream.patch (replace the DIR in commands below by directory where you store your patches):

$ pushd kernel-*/linux-*
$ git commit -am Flush
$ cp DIR/upstream.patch .
$ patch -p1 -R < upstream.patch
$ git commit -am "Upstream reverted patch"
$ git format-patch --stdout HEAD~1 > DIR/upstream-reverted.patch
$ popd

Then install the upstream-reverted.patch instead of the my.patch and proceed with the compilation as described above.

středa 9. března 2016

Remote web monitoring of 3D printers through Pronterface

I have recently dug into Pronterface code and realized that there is simple RPC server built-in. It listens on localhost and it's really cool feature for remote monitoring, so I hacked KISS (Keep It Simple and Stupid) PHP code that allows querying the RPC server through the web. The code can query multiple running Pronterfaces and it's no problem to monitor multiple 3D printers which are connected to the same host. Running instances of Pronterface are automatically detected. It also queries all connected V4L compatible webcameras, which means that you can check progress of printers visually. With the current code you can check temperatures (bed, extruder), Z position, status of the current print task including task/file name, ETA, finished percentage.

The code with instructions is available from github: https://github.com/yarda/printrun-webmon/. Feel free to pull request patches.

pátek 29. srpna 2014

Firefox: Re-enable prompt asking you whether you want to save your tabs on exit

Firefox usually asks whether you want to save your tabs on exit if you have browser.showQuitWarning = true in your about:config. If you check "Do not ask next time" it will not ask you again. The question is how to re-enable this prompt. You already set the following:

browser.showQuitWarning = true
browser.tabs.warnOnClose = true
browser.tabs.warnOnCloseOtherTabs = true
browser.warnOnQuit = true

But it still doesn't show the prompt. The corresponding setting is hidden behind browser.startup.page. Just locate it in about:config, right click on it and select "Reset". Restart Firefox and viola, the prompt is back. You can also re-enable this through the UI, go to "Edit -> Preferences -> General -> When Firefox starts" and change "Show my windows and tabs from last time" to "Show my home page" or "Show a blank page". A bit illogical on the first sight, but it works. This was tested on Firefox 31.0.

středa 26. září 2012

Datovka - Interface to Czech Databox (AKA Datové schránky)

Recently, I packaged "Datovka" for Fedora. It's GUI application for access to Czech Databox (AKA Datové schránky) - an electronic communication interface endorsed by the Czech government. There is also python-dslib library for accessing the databox programatically. It was implemented by CZ.NIC. You can also access the databox from WWW interface now as it was recently redesigned to work without Windows plugin, but this GUI application and library could bring you more comfort and automation possibility.