I think it was anikin's post in Dec 2013 that first brought Will Haley's tutorial (Sept 2013 wordpress) on debootstrap to everyone's attention on Puppy forum. Will Haley's tutorial does a great job of explaining everything including mount /proc and so on, chroot, debootstrap and producing final iso using the likes of xorriso:
http://l3net.wordpress.com/2013/09/21/h ... an-livecd/
http://willhaley.com/blog/create-a-cust ... vironment/
However, it is Debian themselves that deserve the main thanks for providing simple-to-use debootstrap in the first case:
http://www.murga-linux.com/puppy/viewto ... 097#743097
Fred of DebianDog has recently started a project to script build a Stretch DebianDog on top of a base debootstrap build:
http://www.murga-linux.com/puppy/viewtopic.php?t=111199
Just a note that you can also use chroot into a new woof-CE build for testing it from its host build system (or any other Linux):
http://www.murga-linux.com/puppy/viewto ... 512#966512
8Aug2017: By the way, there is also arch-bootstrap, pacstrap, arch-chroot, and similar tools/methods for Arch Linux installs within another Linux such as Puppy. And a Python program for several distribution installs (image-bootstrap). I've also come across archstrap (via google):
http://www.murga-linux.com/puppy/viewto ... 658#963658
James B of murga Puppy forum has also usefully provided how to run one OS inside another using a chroot:
http://www.lightofdawn.org/wiki/wiki.cg ... koInFatdog
I recognised, however, that the official Debian debootstrap program/script can be used directly on Puppy Linux systems without needing to use it to thereafter build a DebianDog. I therefore decided to open this more general purpose project thread, since Debian's debootstrap build system has nothing to do with DebianDog per se, but is provided by Debian to be used on pretty much any Linux system including Puppy itself.
What does Debian's debootstrap provide? It gives a method of building a base Debian (or Ubuntu) system (such as Stretch) within a folder on your running Puppy Linux or other Linux system (debootstrap is just a set of shell scripts whose only real dependency is wget). You don't need to build a DebianDog out of it. Rather, the provided debootstrap is pure Debian; it's just debootstrap as provided straight from Debian afterall but attached here as a dotpet for Puppy use.
This thread is started with a view to that versatility of possibility since Puppy forum members may find alternative ways to build upon this official Debian-provided debootstrap facility.
How to use the provided debootstrap system:
EDIT 6Aug2017: Got Debian Stretch built and chroot running under Puppy Racy 5.5 (Racy kernel 3.0.66) now. I'll post image soon. I'll also try Puppy 4.3.1 since old kernel, but I have my doubts...! Note that to get a clean build under Racy (or Puppy Linux 4.3.1 for that matter, you must first remove /lib: from the LD_LIBRARY_PATH - no such complicated measure is needed for Slacko64 or tiny core linux). Details are given just before step 3 below.
The following example assumes being on a running Puppy Slacko64 ver 6.3.2 system but the method should work on most any recent Puppy. Note that the Puppy system must be already Internet-connected (wifi connection or ethernet will do - I only had a wifi connection on my Slacko64 system).
1. Install the attached debootstrap dotpet.
2. Make a directory on a Linux filesystem somewhere to hold your Debian build. Example is for Stretch (a couple of GB is probably enough disk space for the build):
Code: Select all
mkdir -p stretch/chroot
3. Change directory (cd) into dir stretch. On a few systems, at this stage, you may need to deal with a /lib in LD_LIBRARY_PATH issue that the debootstrap program doesn't like. Check details in this link before proceeding:
http://www.murga-linux.com/puppy/viewto ... 323#963323
On Slacko I didn't have that issue, however, and next just run the Debian debootstrap command:
Code: Select all
debootstrap --arch=i386 --variant=minbase stretch chroot http://ftp.us.debian.org/debian/
http://www.murga-linux.com/puppy/viewto ... 369#963369
Wait patiently and your 32-bit i386 Debian base system will then be built. Note that from Slacko64 I found you could alternatively build a 64-bit amd64 Debian base system by using --arch=amd64 in command above instead.
4. You now need to bind mount a few key system resources (you can of course put the following into a script - I just entered the commands manually). These are pretty standard commands for using a chroot:
Code: Select all
mount --bind /proc chroot/proc
mount --bind /dev chroot/dev
mount --bind /sys chroot/sys
mount -t devpts devpts chroot/dev/pts
cp /etc/resolv.conf chroot/etc/resolv.conf
Code: Select all
mount --bind /proc chroot/proc && mount --bind /dev chroot/dev && mount --bind /sys chroot/sys && mount -t devpts devpts chroot/dev/pts && cp /etc/resolv.conf chroot/etc/resolv.conf
http://www.murga-linux.com/puppy/viewto ... 780#963780
5. Now chroot into your debian filesystem (on your Puppy):
Code: Select all
chroot chroot
Code: Select all
export LC_ALL=C
Code: Select all
apt-get update
Code: Select all
apt-get install file
Example script from jd7654 for starting and stopping you debootstrapDebian created system:
http://www.murga-linux.com/puppy/viewto ... 780#963780
8. Cleaning up:
As AndresCS mentions below, it is important to clean up the bind mounts once you have finished playing with the chroot Debian system.
8a. You can exit out of the terminal you have chroot into using command:
Code: Select all
exit
8b.
Code: Select all
umount chroot/proc
umount chroot/dev/pts
umount chroot/dev
umount chroot/sys
Code: Select all
umount chroot/proc && umount chroot/dev/pts && umount chroot/dev && umount chroot/sys
NOTE: This may or may not be obvious, but you CAN share the same debootstrap built Debian system between other Linuxes. For example, I sometimes boot into Slacko64 or into XenialPup or slitaz or into tiny core linux - I can use the same stretch/chroot debootstrap built Debian on any of them just by doing the same mount --bind commands followed by chroot chroot (or using a simple script to do that...) - you don't need to rebuild the debootstrap Debian system each time, it is always there once built... See linked post below for some extra info about getting X apps to run from the debootstrapDebian when host is not a Pup (i.e. where host user is not 'root'); example in the post is for tiny core linux host where user is usually user tc:
http://www.murga-linux.com/puppy/viewto ... 175#963175
wiak