Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howtos:general_admin:setting_up_a_slackware_chroot [2015/04/09 05:57 (UTC)]
aaditya add link to mkchroot script
howtos:general_admin:setting_up_a_slackware_chroot [2015/11/09 12:56 (UTC)]
dugan
Line 1: Line 1:
-=== Setting up a Slackware chroot ===+==== Setting up a Slackware chroot ​====
  
-//Goal:// I wanted ​to setup a Slackware chroot ​in order to build 32 bit packages on my 64 bit system.+There are multiple reasons why you might want to set up a Slackware chroot
 +  * building ​32-bit packages on 64-bit multilib system 
 +  * building -stable packages on a -current system 
 +  * building (and testing) packages for SBo on a clean system
  
-== Obtaining ​Slackware installation of your desired architecture ==+For this guide, we'll create ​chroot at **/​chroot_folder** from **slackware-14.1-install-dvd.iso**.
  
-For 32 bit chroot I downloaded ​installation ​disks 1 and 2 from http://​www.slackware.com/​getslack/​ via torrent.+=== Obtaining ​Slackware ​installation ​of your desired architecture ===
  
-== Installing the packages ==+Start with a Slackware installation DVD. Download it from from http://​www.slackware.com/​getslack/​ via torrent.
  
-Create a folder which will contain ​the chroot.+=== Installing ​the packages ===
  
-Mount the installation ISO(s). After they have been mounted the packages in them (found under the //​slackware//​ folder) can be installed to the chroot folder with:+== Automatically ==
  
-''​installpkg --root <chroot-folder> a/*.t?z ap/*.t?z l/*.t?z n/*.t?​z''​+You can create your chroot ​and install Slackware into it using the following elegant script: [[http://dawoodfall.net/files/scripts/​bash/​mkchroot]]
  
-''​installpkg --root <​chroot-folder>​ d/*.t?z k/*.t?z t/*.t?z tcl/​*.t?​z''​+== Manually ==
  
-(additional sets can be installed in similar way)+First, create ​folder which will contain the chroot:
  
-An elegant script for the above: [[http://dawoodfall.net/​files/​scripts/​bash/​mkchroot]]+<code bash>​mkdir ​/chroot_folder<​/code>
  
-== Chroot ==+Mount the installation ISO:
  
-After the chroot folder ​has been populated with packages ​we can proceed ​to chroot ​into it ([[howtos:​slackware_admin:​how_to_chroot_from_media#​volume_mounting]]).+<code bash> 
 +mount -o loop slackware-14.1-install-dvd.iso /​mnt/​cdrom 
 +cd /​mnt/​cdrom 
 +</​code>​ 
 + 
 +After the ISO has been mounted, the packages ​(found under the //​slackware//​ or //​slackware64//​ folder) ​can be installed ​to the chroot ​folder with: 
 + 
 +<code bash> 
 +installpkg --root /​chroot-folder */*.t?z 
 +</​code>​ 
 + 
 +Then unmount the ISO: 
 + 
 +<code bash> 
 +umount /​mnt/​cdrom 
 +</​code>​ 
 + 
 +=== Mounting the Chroot === 
 + 
 +To have the chroot mounted permanently,​ add the following to your fstab: 
 + 
 +<​file>​ 
 +/dev             ​chroot_folder/​dev ​            none bind,auto 0 0 
 +/proc            chroot_folder/​proc ​           none bind,auto 0 0 
 +/sys             ​chroot_folder/​sys ​            none bind,auto 0 0 
 +/​etc/​resolv.conf chroot_folder/​etc/​resolv.conf none bind,auto 0 0 
 +</​file>​ 
 + 
 +If you don't want to reboot at this point, then you can mount the chroot manually: 
 + 
 +<code bash> 
 +mount /​chroot_folder 
 +</​code>​ 
 + 
 +Also, refer to: ([[howtos:​slackware_admin:​how_to_chroot_from_media#​volume_mounting]]). 
 + 
 +=== Chrooting into the Chroot === 
 + 
 +Now that the chroot is set up, you can chroot into it: 
 + 
 +<code bash>​chroot /​chroot_folder /​bin/​bash</​code>​
  
 === Updating packages === === Updating packages ===
  
-After that I setup slackpkg and updated ​the packages ([[slackware:​beginners_guide#​configure_a_package_manager]]).+After that, you can run slackpkg and update ​the packages([[slackware:​beginners_guide#​configure_a_package_manager]]).
  
-=== Mounting partitions ​===+=== Exiting ​===
  
-I needed to mount the partition which contained the SlackBuilds for which I wanted to make a packageI used the command:+When you're doneexited ​the chroot by pressing //Ctrl+d//.
  
-''​mount ​-B <​slackware-host-mount-point>​ <​chroot-mount-point>''​+=== One Use: Building 32-bit Packages ===
  
-(http://​www.thegeekstuff.com/​2013/​01/​mount-umount-examples/​)+== Mounting partitions ==
  
-Then built the package ​by executing ​the Slackbuild as follows:+use a chroot to build 32-bit packages on a 64-bit system. I needed to mount the partition which contained the SlackBuilds for which I wanted to make a package, As my Slackware host mount point is (in this example) at /​slackware_host_mount_point,​ I used the command:
  
-''​ARCH=i686 ./<my-package>.SlackBuild''​+<code bash>​mount ​-B /​slackware_host_mount_point /​chroot_folder 
 +</code>
  
-=== Exit and unmounting ===+(http://​www.thegeekstuff.com/​2013/​01/​mount-umount-examples/​) 
 + 
 +Then I built the package by executing the Slackbuild as follows:
  
-Finally I exited the chroot by pressing ​//Ctrl+d//, and unmounted the mount points I had mounted earlier.+<code bash> 
 +ARCH=i686 ./my_package.SlackBuild<​/code>
  
-== Links ==+=== Links ===
  
 http://​www.linuxquestions.org/​questions/​slackware-installation-40/​install-slackware-to-a-folder-using-chroot-825598/#​post4093831 http://​www.linuxquestions.org/​questions/​slackware-installation-40/​install-slackware-to-a-folder-using-chroot-825598/#​post4093831

In Other Languages
QR Code
QR Code howtos:general_admin:setting_up_a_slackware_chroot (generated for current page)