SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Can you use pkgtool to install packages from the installation disc to a chroot directory? Or do you have to manually use installpkg -root /chroot package.t?z.
--target_dir directory
The directory where the target root directory is located. This is '/' when installing on the hard drive, or typically '/mnt' when installing from an install disk.
chmod: cannot access '/mnt/chroot//var': No such file or directory
chmod: cannot access '/mnt/chroot//usr': No such file or directory
chmod: cannot access '/mnt/chroot//tmp': No such file or directory
I created those directories manually, when I issued the command again nothing happened?
I was thinking this would bring up Dialog to let me choose which packages I wanted to install in the chroot directory. Or am I doing something wrong?
I believe it would just be /mnt since that is the mountpoint of / when using the install disk. In other words no /chroot. I honestly can't say for sure since I usually only have a few packages to install from /extra after a full install or I just use slackpkg with a local mirror for updates. From a working system to install a whole series I just mount the slackware disk and cd to the slackware directory and use something like
@damgar, my idea was to use pkgtool dialog for selecting which packages to install in /chroot without using upgradepkg or installpkg commands. Basically like the dialog when you're selecting which packages you want on a fresh install.
Disclaimer: I don't really know what I'm talking about.
Just a thought....
Is your intention to do this to a mounted partition with nothing on it yet? If so, I wonder if perhaps before you use pkgtool you need to use installpkg to install aaa_base. I believe aaa_base is what sets up the root directory tree, so it kind of stands to reason that if that is not installed, other things may have a hard time doing what they are supposed to.
you can try changing two lines of /sbin/pkgtool, like below
Code:
--- pkgtool.orig 2012-08-09 20:38:10.000000000 +0200
+++ pkgtool 2012-10-22 15:47:03.360638344 +0200
@@ -94,8 +94,8 @@
exit
fi
else
- TARGET_DIR=/
- TMP=/var/log/setup/tmp
+ TARGET_DIR=${ROOT:-/}
+ TMP=$ROOT/var/log/setup/tmp
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
this way it should honor the $ROOT environment variable (like installpkg already does) and you can use it to install in the chroot, exporting first ROOT=/chroot (no need for --target_dir, that seems used only in the O.S. install phase).
Thanks ponce, that is exactly what I was looking for. Previously I was using installpkg for individual packages, when I only wanted to miss a couple of packages out.
Maybe slackpkg is a better choice for this kind of tasks, it even supports templates: that's what I use to create my lxc containers.
I had to modify it just a little too to let it honor the $ROOT environment variable and to have the possibility of specifying an alternate configuration folder (in alternative to /etc/slackpkg) with a $CONF variable, to not being tied to the contents of that folder and choose to install, for example, 32bit packages in the container from a slackware64 host, use a custom blacklist and so on.
If you want to try it, it's here
I was looking at your lxc-container blog before your pkgtool reply. I'll try that too, see which is best for me. I've used lxc-containers in the past and your blog was very helpful.
Thanks once again
Last edited by basil_brush; 10-22-2012 at 01:40 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.