Page 1 of 2

compile util-linux from github

PostPosted: 2018-04-27 19:13
by tuxxie
Here running debian testing. How can I compile util-linux from github and make it work?

https://github.com/karelzak/util-linux/

Re: compile util-linux from github

PostPosted: 2018-04-27 20:01
by debiman
a) clone the repo to your machine
b) run ./autogen.sh
c) run make
with a little luck it will Just Work (tm).
i would not install it, since it might conflict with likely already installed util-linux.

Re: compile util-linux from github

PostPosted: 2018-04-27 20:47
by stevepusser
Why exactly do you need the version from git?

If you really need some bug fix that's only available there, my first inclination would be to try to cherry-pick the fix, patch, and rebuild the version you have in Buster. My thoughts are that you can really mess up your system by trying the manual build and install, since it's an essential "required" package, and you cannot remove the Debian version from your system.

Re: compile util-linux from github

PostPosted: 2018-04-27 22:06
by tuxxie
stevepusser wrote:Why exactly do you need the version from git?

If you really need some bug fix that's only available there, my first inclination would be to try to cherry-pick the fix, patch, and rebuild the version you have in Buster. My thoughts are that you can really mess up your system by trying the manual build and install, since it's an essential "required" package, and you cannot remove the Debian version from your system.

How can I exactly get, compile and install the Buster version, provided that I know what exact lines have to be patched?

Re: compile util-linux from github

PostPosted: 2018-04-28 08:19
by debiman
please tell us why you think you need to do this.
"i just want to" is a valid answer, but if you think you need this to fix some problem, your approach is likely wrong.
http://xyproblem.info/

Re: compile util-linux from github

PostPosted: 2018-04-28 09:27
by tuxxie
debiman wrote:please tell us why you think you need to do this.
"i just want to" is a valid answer, but if you think you need this to fix some problem, your approach is likely wrong.
http://xyproblem.info/

i want to test latest commits, which are not yet available with apt install. I've tried installing gentoo but it's a total nightmare with the emerge system and dependencies and masked packages and whatnot.

Tried also compiling directly from github with ./autogen.sh && ./configure && make, but messes the system, had to revert to previous snapshot. I'm used to work on user small programs with git checkout && make install && ldconfig but util-linux is too way embedded on the system.

Re: compile util-linux from github

PostPosted: 2018-04-28 13:40
by debiman
tuxxie wrote:i want to test latest commits, which are not yet available with apt install.
ok.
then see my previous answer.
Tried also compiling directly from github with ./autogen.sh && ./configure && make, but messes the system, had to revert to previous snapshot.
i don't see how this would mess up your system.
all these commands do not require superuser privileges, don't change your system, and do not install anything (as i wrote you shouldn't).
util-linux is too way embedded on the system.

i'll say it a third time, if you don't install it, you can use most utilities straight from the git directory, after compiling.

Re: compile util-linux from github

PostPosted: 2018-04-28 16:30
by stevepusser
Basically rebuilding the present package is the same as backporting, except you're just using the deb-src URL for testing.

https://wiki.debian.org/SimpleBackportCreation

After you have run "apt-get source", you want to go in and change the source files as you wish. Then you back out to the root of the source, and have dpkg-source convert your changes into a patch in debian/patches:

Code: Select all
dpkg-source --commit


After you name your patch, it will open it up in nano for editing, but you can just "Ctrl X" to exit nano without any edits at this point. Make sure to edit your new stanza in debian/changelog and remove the "~", which make it lower than the Debian version, and make yours higher.

Re: compile util-linux from github

PostPosted: 2018-04-28 18:26
by tuxxie
debiman wrote:
util-linux is too way embedded on the system.
i'll say it a third time, if you don't install it, you can use most utilities straight from the git directory, after compiling.

Ok you got me there, didn't know that was possible. I would like to run lsblk, blkid, fdisk and so on. Hope I can run them from my home user folder (with sudo if necessary). If that works I just don't need to make a custom deb.

Re: compile util-linux from github

PostPosted: 2018-04-28 18:47
by debiman
tuxxie wrote:I would like to run lsblk, blkid, fdisk and so on. Hope I can run them from my home user folder (with sudo if necessary). If that works I just didn't need to make a custom deb.

why the "need" of these particular utilities?
previously you said "want", which sounds like some sort of just-for-fun project.
i still suspect an x-y-problem.

Re: compile util-linux from github

PostPosted: 2018-04-28 20:31
by tuxxie
Ok what I need works for now, all utilities are just inside the util-linux/ folder just after compiling. Now I can test the commands properly with sudo ./command

Re: compile util-linux from github

PostPosted: 2018-04-28 22:32
by tuxxie
bypassing the debuild nightmare:
dpkg-buildpackage -b

Re: compile util-linux from github

PostPosted: 2018-04-29 09:36
by tuxxie
This guide is great:
Ubuntu Packaging Guide »

Re: compile util-linux from github

PostPosted: 2018-04-29 16:34
by debiman
tuxxie wrote:This guide is great:
Ubuntu Packaging Guide »

please don't spread unsuitable recommendations.
this is the debian forum, and debian is not compatible with ubuntu: https://wiki.debian.org/DontBreakDebian

imo, x-y-problems are a waste of everyone's time, but it seems you are set to not tell us what problem you are actually trying to solve.
whatever. :shrugs:

Re: compile util-linux from github

PostPosted: 2018-04-29 22:11
by stevepusser
The commands are essentially the same in Ubuntu and Debian, though.