[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

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 revisionPrevious revision
Next revision
Previous revision
howtos:general_admin:setting_up_a_slackware_chroot [2020/09/12 04:18 (UTC)] divehowtos:general_admin:setting_up_a_slackware_chroot [2020/11/16 12:54 (UTC)] (current) – [See also] fix formatting aaditya
Line 1: Line 1:
-==== Setting up a Slackware chroot ====+===== Setting up a Slackware chroot =====
  
 There are multiple reasons why you might want to set up a Slackware chroot: There are multiple reasons why you might want to set up a Slackware chroot:
Line 8: Line 8:
 For this guide, we'll create a chroot at **/chroot_folder** from **slackware-14.1-install-dvd.iso**. For this guide, we'll create a chroot at **/chroot_folder** from **slackware-14.1-install-dvd.iso**.
  
-=== Obtaining a Slackware installation of your desired architecture ===+==== Obtaining a Slackware installation of your desired architecture ====
  
 Start with a Slackware installation DVD. Download it from from http://www.slackware.com/getslack/ via torrent. Start with a Slackware installation DVD. Download it from from http://www.slackware.com/getslack/ via torrent.
  
-=== Installing the packages ===+==== Installing the packages ====
  
-== Automatically ==+=== Automatically ===
  
 You can create your chroot and install Slackware into it using the following elegant script: [[http://tty1.uk/scripts/slackware/mkchroot]] You can create your chroot and install Slackware into it using the following elegant script: [[http://tty1.uk/scripts/slackware/mkchroot]]
  
-== Manually ==+=== Manually ===
  
 First, create a folder which will contain the chroot: First, create a folder which will contain the chroot:
Line 43: Line 43:
 </code> </code>
  
-=== Mounting the Chroot ===+=== Setting up required files ===
  
-To have the chroot mounted permanently, add the following to your fstab:+== fstab == 
 + 
 +The following minimal snippet can be used for ///chroot_folder/etc/fstab// 
 + 
 +<file> 
 +# <file system> <mount point>   <type>  <options>       <dump>  <pass> 
 +tmpfs           /dev/shm        tmpfs    defaults        0      0 
 +devpts          /dev/pts        devpts   noexec,nosuid,gid=tty,mode=0620  0      0 
 +sysfs           /sys            sysfs    defaults        0      0 
 +proc            /proc           proc     defaults        0      0 
 +</file> 
 + 
 +==== Entering the Chroot ==== 
 + 
 +=== Automatic mount === 
 + 
 +To have the chroot mounted permanently, add the following to your __host system's__ ///etc/fstab//:
  
 <file> <file>
Line 54: Line 70:
 </file> </file>
  
-If you don't want to reboot at this point, then you can mount the chroot manually:+And reboot. Then run the following command to mount the chroot folder:
  
 <code bash> <code bash>
Line 60: Line 76:
 </code> </code>
  
-Also, refer to: ([[howtos:slackware_admin:how_to_chroot_from_media#volume_mounting]]).+=== Manual mount ===
  
-=== Chrooting into the Chroot ===+Refer to: ([[howtos:slackware_admin:how_to_chroot_from_media#volume_mounting]]).
  
-Now that the chroot is set up, you can chroot into it:+=== Entering the Chroot === 
 + 
 +Now that the chroot is set up, one can chroot into it:
  
 <code bash>chroot /chroot_folder /bin/bash</code> <code bash>chroot /chroot_folder /bin/bash</code>
 +
 +**Note**
 +
 +Wrote a small script to automate the chroot steps.
 +
 +https://raw.githubusercontent.com/aadityabagga/scripts/master/chroot.sh
  
 === Updating packages === === Updating packages ===
Line 76: Line 100:
 When you're done, exited the chroot by pressing //Ctrl+d//. When you're done, exited the chroot by pressing //Ctrl+d//.
  
-=== One Use: Building 32-bit Packages ===+==== Usecase: Building 32-bit Packages ====
  
-== Mounting partitions ==+=== Mounting partitions ===
  
 I 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: I 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:
Line 92: Line 116:
 ARCH=i686 ./my_package.SlackBuild</code> ARCH=i686 ./my_package.SlackBuild</code>
  
-=== Links === +=== An alternative way to build other ARCH packages ===
- +
-http://www.linuxquestions.org/questions/slackware-installation-40/install-slackware-to-a-folder-using-chroot-825598/#post4093831 +
- +
-== Notes == +
- +
-Wrote a small script to automate these steps. +
- +
-https://raw.githubusercontent.com/aadityabagga/scripts/master/chroot.sh +
- +
- +
-== An alternative way to build other ARCH packages ==+
  
 Instead of using `ARCH=i686' before running a slackbuild, we can use a program Instead of using `ARCH=i686' before running a slackbuild, we can use a program
Line 111: Line 124:
 ARCH as `i686'. ARCH as `i686'.
  
 +**SYNOPSIS**
 <code> <code>
-<b>SYNOPSIS</b> 
   setarch arch [options] [program [argument...]]   setarch arch [options] [program [argument...]]
 </code> </code>
Line 135: Line 148:
 -- --
 Dave Dave
 +
 +====== See also ======
 +
 +  * https://wiki.archlinux.org/index.php/Chroot
 +  * http://www.linuxquestions.org/questions/slackware-installation-40/install-slackware-to-a-folder-using-chroot-825598/#post4093831
  
 ====== Sources ====== ====== Sources ======
 howtos:general_admin:setting_up_a_slackware_chroot ()