LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices


By manzdagratiano at 2011-05-26 11:46
This is the second time (the first was the 32-bit version, this time it was a replacement of that by 64-bit) I have succeeded in net-installing Slackware-current from inside another GNU/Linux distribution as a dual boot (well, actually a quintuple boot in my case), and I would like to share a consolidated version of that here, since no one place had all the information I used to that end. The ideas here stem from the following thread:

http://www.linuxquestions.org/questions/slackware-installation-40/install-slackware-to-a-folder-using-chroot-825598/


with thanks of course to Alien Bob and slac-in-the-box

The goal here is a little different from there, where the objective was to install Slackware inside a chroot. In fact, for a dual boot option, I would go so far as to recommend this method always over the traditional method - it is less hassle than with burning disks or writing to a USB drive. Also, for those of us who are lazy and blessed with a broadcom-wifi card, this is the only other alternative to Alien Bob's mini-iso.



I welcome any suggestions for improvements/enhancements.

I shall use Ubuntu/Debian as the host example (although this should, in principle, work for any), with Slackware-current as the target. Note that this requires the installation of Slackware's pkgtools inside Ubuntu/Debian, therefore I suspect that Arch Linux would not be a good place to do this because both Arch and Slackware share the 'makepkg' command, and Slackware's version may overwrite it. That being said, I see no reason why it cannot be overwritten and re-overwritten again.

The target partition was /dev/sda8. I shall be using the ext4 filesystem, and I have set up the system to share swap space with all the other distros. Also, as there need be only one grub on the system, I have not tried to create a separate boot partition.

Ergo, we begin thus:

INSTALLATION:

Quote:

Prepare the target partition:

Code:
$ mkfs.ext4 /dev/sda8
Mount it at the desired location
Code:
$ sudo mount /dev/sda8 /mnt
Grab hold of the pkgtools*.tgz package from a Slackware mirror, under the 'a' directory.

Convert this now to a .deb package, through the use of 'alien' (As of this writing, the latest release version of Slackware is 13.37):
Code:
$ sudo alien -i pkgtools-13.37-noarch-9.tgz
This command creates as .deb package as well as installs it.

Now we need to obtain a local slackware mirror. One can in principle write a script to retrieve packages while installing them, but it amounts to the same thing. Hence, in the Downloads folder, or any other folder, perform:
To create the entire mirror:

Code:
$ wget -m ftp://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware64-current/slackware64/
with the `-m' option implying that we are creating a local mirror of the tree we have chosen.
Change to the directory with the tree (it would be convenient to cut and paste the lowermost directory `slackware64' into the current folder directly to avoid dealing with a huge depth).

It is usually more practical to just download each individual series one wants to install - for instance, kde and kdei may not be required.
The series I myself use to set up a fully functional system are:
a, ap, d, f, k, l, n, tcl, x, xap
and the downloaded packages may be further fine-tuned for a customized system, eg., remove the X input/video drivers that the system does not need.
Therefore:

Code:
$ mkdir slackware64
$ cd slakware 64
$ mkdir {a,ap,d,f,k,l,n,tcl,x,xap}
$ cd a
$ wget -r -np -nd ftp://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware64-...
$ cd ../ap
$ wget -r -np -nd ftp://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware64-current/slackware64/ap
and so on for each series.
The good thing about this also is that one may download two or more series in parallel from different mirrors, speeding up the retrieval process.

Then, commence the installation from the `slackware64' directory:
Code:
$ cd ..
$ sudo installpkg --root /mnt {a,ap,d,f,k,l,n,tcl,x,xap}/*.t?z
CHROOT/SETUP:

Quote:
Now that the system has been installed, we may chroot to it:

Code:
$ sudo mount -t proc proc /mnt/proc
$ sudo mount -t sysfs sys /mnt/sys
$ sudo mount -o bind /dev /mnt/dev
and for network access:

Code:
$ sudo cp -L /etc/resolv.conf /mnt/etc
Code:
$ sudo chroot /mnt /bin/bash
Make system libraries available:

Code:
# ldconfig
The font cache may be updated as (if one wants to start X):

Code:
# fc-cache
Set the root password:

Code:
# passwd
Add a user for everyday use:
Code:
# adduser
and follow the prompts.

Add the user to the /etc/sudoers file:
Code:
# groupadd sudo
# usermod -a -G sudo <user>
# nano -w /etc/sudoers
and uncomment the line
Code:
%sudo ALL=(ALL) ALL
Change the hostname:

Code:
# nano -w /etc/HOSTNAME
Add the hostname alias to the 127.0.0.1 line in /etc/hosts

Create fstab:

Code:
# nano -w /etc/fstab
A good start may be by copying over the host system's fstab and editing it accordingly.
Make sure that all the mount points defined therein are created on the system.

Select a slackware mirror:

Code:
# nano -w /etc/slackpkg/mirrors
The best option is to usually select a dynamic mirror, which keeps fetching packages/updates at top speed, eg.:
http://slackware.mirrors.pair.com/slackware64-current/

Update the slackpkg tree:

Code:
# slackpkg update
OPTIONAL: Install other tools from /extra, like jdk. `emacs' may also now be installed.
NETWORK:

Quote:
I usually like wicd over other interfaces, particularly because of its curses interface options, which I can use even from a TTY.

While inside the chroot, install wicd from the Slackware extras repository.

Code:
# slackpkg install wicd
Add the following to /etc/rc.d/rc.local:
Code:
if [ -x /etc/rc.d/rc.wicd ]; then
/etc/rc.d/rc.wicd start
fi
This allows wicd to start at boot.

Proprietary drivers like the broadcom-sta driver may be installed after reboot.
POST-INSTALL:

Quote:
Do not forget to run:

Code:
$ sudo update-grub
on the host system - as there is no need for more than one bootloader on the system, there is no need for grub/lilo to be installed in Slackware.

Setting up X may be perfomed on the first boot of the OS, by running:

Code:
# xorgsetup
PANIC CONTROL:

Quote:
The first boot actually resulted in kernel panic, with an error:
Code:
not syncing: VFS: unable to mount root FS on unknown-block
This meant that the requred filesystem support was not present in the kernel, and a regeneration of initrd.gz was called for.
Therefore, I reverted back to the chroot and executed:

Code:
# mkinitrd -c -k <kernel-version> -m ext4 -f ext4 -r /dev/sda8
and all was well!

Note that `uname -r` will not work in a chrooted environment.
The kernel version may be found by looking at /lib/modules/


  



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

Main Menu
Advertisement
Advertisement
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
Open Source Consulting | Domain Registration