Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
upgradepkg:
- Removed /sbin when installpkg and removepkg are called (it calls installpkg and removepkg from the first dir of PATH, ergo /tools/bin)
- Changed input of root dir (upgradepkg --root foo instead of ROOT=dir upgradepkg foo)
installpkg:
- Removed warn, infobox, terse, menu, ask, priority, tagfile, md5sum options (i think we don't need this, i keep just the --root)
- Adjusted output (i removed the slack-desc support)
- Removed tar control (tar-1.13 or tar-1.blahblah, is it really important?)
removepkg:
- Changed input of root dir (removepkg --root foo instead of ROOT=dir removepkg foo)
makepkg:
- Added auto-fixing non-gzipped pages (to have a slackware-style gzipping man and info)
- Removed description (same as installpkg)
- Added strip option (auto-stripping binaries with --strip y or -s y)
I know that there are less flexible than original, but i think they are more useful than.
Usage (if you don't know it): when you have to do "make install", just create a temporary dir (such as /tmp/foodir) and launch
Code:
make install DESTDIR=/tmp/foo
make the package with
Code:
cd /tmp/foo
makepkg -l y -c n -s y /root/foo-versionnumber-arch-build.txz
Sorry if this sounds ignorant, but what are the benefits of using this over Tukaani pkgtools?
It's great work you have done, but why? Why change the pkgtools Slack has already? It's not like they impose Slackware limitations on your system. Same with Tukaaki's pkgtools.
I am developing an Linux flavor based off LFS that will eventually be it's own monster; thats why I ask these questions.
Hi,
i don't know tukaani pkgtools, but i have read now the page, and they have too much things.
My goal is to write an essential pkgtool suite to give a way to install-remove packages from a LFS, from the toolchain to the main system.
I don't want to add things.
Slackware's pkgtools also have too much things, that are useless inside an LFS (like slack-desc)
And they use some commands (like rev) that they aren't into the toolchain, so i have to write some workarounds.
Original pkgtools are unusable on a raw LFS.
Ok, guys, now i have the first problem
when i try removepkg, all works, but at the end i have this:
Code:
WARNING: Unique directory /usr/ contains new files
WARNING: Unique directory /./ contains new files
On the head, i have this
Code:
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
Any ideas?
Last edited by jimmy_page_89; 11-15-2011 at 11:55 AM.
Ok, now i've solved some issues:
I have to create a package that recreate the tree in / (the manual creation was the cause of the warnings)
The /bin/sh must be modified in /tools/bin/sh ('cause i don't create the links manually, and i don't need it)
Now there is only one "problem": removepkg works fine, but i have this output:
Code:
WARNING: Unique directory /./ contains new files
it doesn't make anything, but is so UGLY
If you want to help me, all the files are on the github
Last edited by jimmy_page_89; 11-16-2011 at 01:33 AM.
The problem is that makepkg is expecting to use tar 1.13 and this version of tar stored sub directories of '.' differently. Here is a comparison so you can see the difference.
You removed tar from your custom version but did not account for this change. This means all the packages you have created thus far are invalid.
On the plus side it is relatively trivial to work around this problem using tar's transform option and a regex to make modern tar save the directories in tar 1.13 format, e.g.:
By the way, you could use spkg (Edit: the source package offered by the main site seems to be broken right now. You can fetch a non-broken version here: spkg-1.0.tar.gz) instead of your patched Pkgtools. It is a reimplementation of Slackware pkgtools optimised for speed (it is very fast) and is actually used by some Slackware derivatives, like SalixOS. Because it is an actual program and not a shell script it has a few extra dependencies but they are not outrageous. Additionally it has an option to compile statically. That way you can make a binary on a machine that has the required dependencies and then move this to your more minimal LFS setup and it will continue to work whether those libs are present in your LFS install or not, meaning you can use it right from the beginning.
The only thing that spkg is missing is a makepkg equivalent but it is possible to do without this. The two major things that makepkg does for you are converting symlinks to shell script code (in the format that pkgtools/spkg expect) and making sure you output tar packages that use tar 1.13 directory formatting.
Since you already know how to do the latter, here is one way to do the former:
Code:
find . -type l -printf "%f@-&%h@-&" -exec readlink {} \; | sed "s,^\(.*\)@-&\(.*\)@-&\(.*\)$,( cd \2 ; rm -rf \1 )\n( cd \2 ; ln -sf \3 \1 ),;s,\(( cd \)\./,\1,g"
Just save the result in your doinst.sh and then delete all symlinks before you tar up into a package. An easy way to delete all the symlinks would be:
Code:
find . -type l -delete
Here is a minimal makepkg that I quickly knocked up that implements these two ideas.
Have fun!
Last edited by ruario; 12-23-2011 at 06:55 AM.
Reason: added link to working source package
The Slackware 'pkgtools' can be used on any Linux OS.
Just make sure, you have an executable copy of the binary 'tar-1.13' in /bin/.
You don't need it. You just need to use a transform in makepkg to force tar-1.13 directory format and to alter 'installpkg' to not use '-l' '-U' on extraction.
There is a whole thread about why tar 1.13 is used. It is long but an interesting read.
The key bits if you can't be bothered to read it all are that you can use a modern tar if you make those changes. Patrick doesn't do this as it is less maintenance to stick with one version of tar that reacts exactly as his tools expect, rather than having to update them again every time the GNU tar authors decide to change (or break) something.
Slackware's pkgtools also have too much things, that are useless inside an LFS (like slack-desc)
I see little point in removing this. slack-desc is optional anyway. Just don't write them if you don't need them. However, if for some package of other you decide you do want to record notes (even if it is just a link to the website) you can use the slack-desc.
Quote:
Originally Posted by jimmy_page_89
On the head, i have this
Code:
find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
Any ideas?
Swap the order of the '-type f' and '-maxdepth 1' find options in removepkg. I had to do the same thing when I customised pkgtools myself. It will get rid of the warning.
Last edited by ruario; 12-23-2011 at 12:25 PM.
Reason: added a comment about slack-desc
Now there is only one "problem": removepkg works fine, but i have this output:
Code:
WARNING: Unique directory /./ contains new files
it doesn't make anything, but is so UGLY
If you want to help me, all the files are on the github
Quote:
Originally Posted by ruario
You removed tar from your custom version but did not account for this change. This means all the packages you have created thus far are invalid.
Sorry for the multitude of replies but a workaround for this suddenly occurred to me. You could fix your log files using the same regex I suggested in the tar transform. Previously installed packages would then uninstall cleanly, without a warning.
I haven't tested the following but I am 99% sure it will work, nonetheless backup the files in /var/log/packages/ first, then issue the following as root:
Code:
sed -i "s,^\./\(.\),\1," /var/log/packages/*
Now the logs will look like they were installed with packages made by tar 1.13 and hence will remove cleanly without warnings.
Last edited by ruario; 12-23-2011 at 12:01 AM.
Reason: fixed quoting
Hi guys,
my goal is to use pkgtools with tar-1.26 without add anything
spkg wants Judy, so i exclude it
@ruario your solution with --transform is so clean, thank you. I will adopt it.
For the find problem, i'm arrived to your same solution, so the problem is fixed.
Just in case, if you have seen oh github, i've added:
- auto-stripping option (-s y|n)
- "--root" standard parameter (now i don't remember which ones, but one of them wants --root, another one wants ROOT=/mnt/blahblah foopkg, i think it was soooo ugly)
- auto-fixing for man-pages, info-pages and doc-pages (i put it respectively in /usr/man, /usr/info and /usr/doc, and i've put an auto-gzip for man and info pages, in fully Slackware-style)
Now i want to edit the "pkgtool" script to remove all unnecessary things and have a comfortable tool to select the package you want to remove. It will works on a working LFS (not toolchain).
I'll keep you updated. Stay tuned!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.