LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices

Reply
 
Search this Thread
Old 08-11-2010, 12:53 PM   #1
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,071

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Install Slackware to a folder using chroot?


Is it possible to somehow install Slackware from DVD to a folder on hdd
somehow using chroot?

I can say take a debian livecd, unsquashfs the filesystem, chroot into that folder and remaster it quickly
Can I somehow do the same with Slackware?
thx
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 08-11-2010, 03:17 PM   #2
tlowk
Member
 
Registered: Nov 2003
Location: Belgium
Distribution: Slackware
Posts: 151

Rep: Reputation: 23
the slackwaretool installpkg has the option '--root' for this, so if you install the required package like that it will be close. but to start it you probably need to use bindmounts for stuff like sysfs, proc, and maybe dev.

I don't know there exists a tool for this. There are on the other hand diskimages for UML (user-mode-linux) that you could mount via the loop option and get the content of that one.

Probably you need to avoid starting stuff like udev in the slackware system since the system that contains the chroot will already have this running.

just my thoughts, I never tried to run slackware on another system in a chroot.
 
Old 08-13-2010, 06:55 AM   #3
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,071

Original Poster
Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
OK
I may have some progress
first; I copy data from Slack livecd to folder on hdd
I have a full slackware install to sda1 and am gonna copy livecd to folder "minimal" on that hdd slackware partition

gonna copy everything to /target/minimal
mount partition example sda1
Code:
mount /dev/sda1 /target
mkdir -p /target/minimal
Code:
cp -R --preserve /bin /target/minimal
cp -R --preserve /boot /target/minimal
cp -R --preserve /dev /target/minimal
cp -R --preserve /etc /target/minimal
cp -R --preserve /home /target/minimal
cp -R --preserve /lib /target/minimal
cp -R --preserve /opt /target/minimal
cp -R --preserve /root /target/minimal
cp -R --preserve /sbin /target/minimal
cp -R --preserve /srv /target/minimal
cp -R --preserve /usr /target/minimal
cp -R --preserve /var /target/minimal
now gotta make other folders there

Code:
mkdir -p /target/minimal/media
mkdir -p /target/minimal/mnt
mkdir -p /target/minimal/opt
mkdir -p /target/minimal/proc
mkdir -p /target/minimal/sys
mkdir -p /target/minimal/tmp
now chroot into filesystem and start Xnest

Code:
mount --bind /dev/ /target/minimal/dev
mount -t proc none /target/minimal/proc
mount -t sysfs none /target/minimal/sys
mount -t devpts none /target/minimal/dev/pts

export HOME=/root
export LC_ALL=C

chroot /target/minimal
have Xnest installed and start it

Code:
Xnest -ac :2 &
env DISPLAY=":2" startfluxbox &
now, how do i get dbus/hal going before I start Xnest?
any ideas?
thx
 
Old 08-19-2010, 02:59 PM   #4
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 89
Quote:
now, how do i get dbus/hal going
Xen is your friend
 
Old 09-10-2010, 03:13 PM   #5
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-14.1
Posts: 160

Rep: Reputation: 26
chroot

I've installed slackware in a chroot before, but I went about it differently:

Instead of copying all the directories and making directories, I let installpkg do it... I just navigated to a directory containing the slackware sets, and then would use installpkg command:

Code:
installpkg --root /chrootarget a/*.txz ap/*.txz d/*.txz k/*.txz l/*.txz n/*.txz x/*.txz xap/*.txz
The first package of the "a" set of packages (aaa_base) creates the /etc, /bin, /sbin, and other needed directories when it is installed...

Sometimes I have some directories on their own partitions (I put /tmp, /var, and /home on their own partitions, because /tmp and /var grow with log files and data, and I don't want them to grow so much that there is no space left on my root partiton; and I keep /home separate so I can back up user data efficiently)... in this situation, I have to manually create /var, /tmp, and /home in the /chrootarget directory, and then manually mount the partitions on those directories before proceeding with the installpkg command.

When installpkg is finished, I bind the system's running directories to their corresponding directories in the chroot with the mount command:

mount -o bind /proc /chrootarget/proc
mount -o bind /sys /chrootarget/sys
mount -o bind /dev /chrootarget/dev

After that I can chroot:

chroot /chrootarget /bin/bash


And I then do things like set root password, add users, setup permissions in /etc/group, configure xorg if necessary, etc.

I have had to install slackware this way on devices with broken cd drives and other obstacles to standard installation, and in the end, I rebooted, and one of the rc scripts sets up the encryption keys for the first time. If you were never planning to boot the system into slackware, but always be running in chroot, then you might need to run what was in those rc scripts manually (i.e. ssh keygen, etc.)
 
4 members found this post helpful.
Old 09-13-2010, 09:34 AM   #6
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware 14.1
Posts: 467

Rep: Reputation: 89
Yes.

Given the simplicity with which Slackware is built, the possibilities on how you may install are many. It shows why a Graphic installer and a fancy package manager would get in your way.
 
2 members found this post helpful.
Old 09-14-2010, 04:21 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,293

Rep: Reputation: Disabled
Quote:
Originally Posted by slac-in-the-box View Post
I've installed slackware in a chroot before, but I went about it differently:

Instead of copying all the directories and making directories, I let installpkg do it... I just navigated to a directory containing the slackware sets, and then would use installpkg command:

Code:
installpkg --root /chrootarget a/*.txz ap/*.txz d/*.txz k/*.txz l/*.txz n/*.txz x/*.txz xap/*.txz
This is exactly how I install Slackware in it's own chroot (a fast and useful method for building clean packages if you do not want to mess with virtual machines).

A few notes before you start a shell in the new chroot (by running "chroot /your_chroot bash -l" instead of actually booting onto your fresh install):
  • you will have to create a etc/fstab file in the chroot manually since you did not use the Slackware setup to have that file created for you
  • When getting the error in a freshly installed chroot: "D-Bus library appears to be incorrectly set up; failed to read machine uuid" , that is because in your chroot the scriipt "rc.messagebus" has not been started, so it has never executed the line
    Code:
    /usr/bin/dbus-uuidgen --ensure
    which populates the file "/var/lib/dbus/machine-id" with a new UUID.
    Copying that file "/var/lib/dbus/machine-id" from the Linux host into the chroot solves the dbus error.

Eric
 
3 members found this post helpful.
Old 09-29-2010, 05:10 PM   #8
alekow
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 127

Rep: Reputation: 17
Quote:
Originally Posted by slac-in-the-box View Post
I've installed slackware in a chroot before, but I went about it differently:

Instead of copying all the directories and making directories, I let installpkg do it... I just navigated to a directory containing the slackware sets, and then would use installpkg command:

Code:
installpkg --root /chrootarget a/*.txz ap/*.txz d/*.txz k/*.txz l/*.txz n/*.txz x/*.txz xap/*.txz
Shouldn't it be
Code:
installpkg --root /chrootarget a/*.t?z ap/*.t?z d/*.t?z k/*.t?z l/*.t?z n/*.t?z x/*.t?z xap/*.t?z
?

There are still few tgz packages in the installation directories.
 
2 members found this post helpful.
Old 09-30-2010, 02:47 AM   #9
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,293

Rep: Reputation: Disabled
Exactly. The .tgz packages which would be missed by the original command, are essential to Slackware's proper functioning.

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
slackware 10.2 chroot/jail ssh zdannar Slackware 3 07-12-2007 05:51 PM
segmentation fault with chroot in Slackware 11 vilnisr Slackware 1 10-30-2006 06:16 PM
Compiling in any folder will install in current or correct folder ? anjanesh Fedora 4 05-10-2006 08:44 AM
There is no chroot folder in red hat enterprise bind Niceman2005 Linux - Software 2 12-14-2005 08:39 PM
Chroot bind 9.3.0 in slackware 10 - noobie houler Linux - Security 8 04-01-2005 05:53 PM


All times are GMT -5. The time now is 01:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration