The debootstrapDebian within Puppy project

A home for all kinds of Puppy related projects
Message
Author
jd7654
Posts: 296
Joined: Mon 06 Apr 2015, 16:10

#41 Post by jd7654 »

Just tried it on Slacko 6.3.2, ran into the /lib error issue. Removed /lib variable and ran the debootstrap and then put it back.

From the base Debian, I just installed x11-apps for a small quick test of xclock and xcalc in the chroot. Yep, that works. Neat!

I put the commands all into one script called enter-chroot inside the target directory so it would automatically clean itself up on exit:

Code: Select all

#!/bin/bash

mount --bind /proc chroot/proc
mount --bind /tmp chroot/tmp
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

chroot chroot
export LC_ALL=C

umount chroot/tmp
umount chroot/proc
umount chroot/dev/pts
umount chroot/dev
umount chroot/sys

Exited Slacko 6.3.2 and rebooted into Tahr 6.0.5 and did the enter-chroot, and the chroot worked right where I left off.

This reminds me of David Schneider's crouton for chroot of ChromeOS with Ubuntu. I had that a few years ago on an old Chromebook, but ended up getting rid of it.
Would be interesting to see if can get this chroot to look and work like that.

Edit: Didn't see that Fred had already made one which is more complete, changed slightly and updated.
Last edited by jd7654 on Thu 10 Aug 2017, 18:59, edited 5 times in total.

jd7654
Posts: 296
Joined: Mon 06 Apr 2015, 16:10

#42 Post by jd7654 »

New test of chroot with Quirky 8.3 frugal looks good.

Have Debian Stretch amd64 with Xfce4 desktop running inside (on top of) Quirky Xerus 8.3 JWM/Rox desktop. It works! Can run any Quirky app alongside Debian/Xfce app on same desktop.

Just so happens that one menu is on top and the other is on the bottom, so can use both. But Desktop JWM/Rox and drive icons are obscured.

Next step would be getting Xfce to run in a window.
Attachments
debian-chroot-in-quirky-800.jpg
(71.01 KiB) Downloaded 569 times

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#43 Post by wiak »

jd7654 wrote:New test of chroot with Quirky 8.3 frugal looks good.

Have Debian Stretch amd64 with Xfce4 desktop running inside (on top of) Quirky Xerus 8.3 JWM/Rox desktop. It works! Can run any Quirky app alongside Debian/Xfce app on same desktop.

Just so happens that one menu is on top and the other is on the bottom, so can use both. But Desktop JWM/Rox and drive icons are obscured.

Next step would be getting Xfce to run in a window.
Good and interesting example builds, jd7654, and crouton project link very informative too. I've linked to your start/stop debootstrapDebian system script in first post of this thread (at end of step 4: making the bind mounts). I like to keep this simple version of the setup (which your script contributes nicely to) but I have also now downloaded crouton with view towards maybe making a version for Puppy/Linux-in general or at least to get ideas from there.

Note that I'm not much of a programmer, though I can bash script reasonably. However, the crouton MAKEFILE is way beyond my level of understanding. That may be a good thing though, since Fred has demonstrated in his DebianDog-like Stretch build system that a simple bash build script is much more usable/modifiable by many Puppy forum members than any more complex system - I'd hope we can do something similar for simply running Linux variants under a Puppy chroot. Of course we can also use the likes of yad for simple GUI (and less likely: gtkdialog, which doesn't seem to be maintained much any longer). I certainly think it is much easier on actual linux systems than getting such to work on Chromium OS (hence so much work in crouton maybe).

Here again is the crouton github link jd7654 gave:

https://github.com/dnschneid/crouton

EDIT: Actually, looking at some of the crouton desktop-related build scripts, you might find some useful stuff in there too for your mklive build script Fred. For example, in crouton-master/targets/ folder.

wiak
Attachments
README.md.tar
crouton README. Just remove the dummy tar.
(14.26 KiB) Downloaded 139 times

jd7654
Posts: 296
Joined: Mon 06 Apr 2015, 16:10

#44 Post by jd7654 »

Yeah, crouton was pretty cool. I guess thats the kind of stuff those Google employees create in their personal time.

I had a vague awareness of chroot, and had used it a few times to do manual Arch Linux install. But never really knew what it could do until I got a chromebook and installed crouton. Very slick. Main benefit is that you cannot easily install Linux on Chromebook with stock BIOS, but with crouton, you didn't really need to. You just use the chromebook for what it does best: Chrome, Gmail and Youtube, and then instantly flip over to Ubuntu chroot and have full apps suite available to you.

jd7654
Posts: 296
Joined: Mon 06 Apr 2015, 16:10

#45 Post by jd7654 »

Just informational:(I'm not really playing around with this anymore)

If simple chroot and run some commands and lite x-apps, chroot exited cleanly.
If launch startxfce4, many stuck processes and /dev,/proc won't unmount. Tried some other mount options but no clean fix found. Others are welcome to try.

Code: Select all

# exit
umount: can't unmount /mnt/sda5/DebStretch/chroot/proc: Device or resource busy
umount: can't unmount /mnt/sda5/DebStretch/chroot/dev: Device or resource busy
# fuser -m chroot/dev
/mnt/sda5/DebStretch/chroot/dev:   408  1714  1726  1753  2154  2952  2974m  3144  3146  3164  3191  3292  3293  3306  3331  3333  3335  3337  3399  3401  3491  3494  3597  3600  3825  3831  3897  5189  5706  5894  5993  5994  8761  8762  8764  8803  8805  8818  8821  8844  8876  8882
# fuser -m chroot/proc
/mnt/sda5/DebStretch/chroot/proc:     2e     4e     5e     6e     7e     8e     9e    10e    11e    12e    13e    14e    15e    16e    17e    18e    19e    20e    21e    22e    23e    24e    25e    26e    27e    28e    29e    30e    31e    56e    57e    58e    59e    60e    61e    62e    63e    64e    65e    66e    67e    68e    69e    70e    71e    72e    73e    74e    75e    76e    77e    78e    79e    80e    81e    82e    83e    85e    86e    87e    88e    97e   100e   113e   114e   115e   120e   123e   188e   199e   221e   257e   274e   406e  1050e  1074e  1108e  1213e  1214e  1215e  1221e  2974  7313e  8326e  8327e  8433e  8818  8876

AndresC2
Posts: 76
Joined: Sun 09 Jul 2017, 02:12

#46 Post by AndresC2 »

Hello jd7654!

Hello Wiak!

/chroot/proc: device is busy.
In some case useful info about processes that uses
the device is found by lsof or fuser.

/chroot/dev: device is busy.
In some case useful info about processes that uses
the device is found by lsof or fuser.

this Work for me.

umount -lf /proc
umount -lf /dev

From Will Haley Create a Custom Debian Live Environment.

umount -lf /proc
umount -lf /sys
umount -lf /dev/pts
umount -lf /dev

umount --help

-l Lazy unmount. Detach the filesystem from the filesystem hierarchy now,
and cleanup all references to the filesystem as soon as it is not busy anymore.
This option allows a "busy" filesystem to be unmounted. (Requires kernel 2.4.11 or later.)

Maybe this can be useful.

https://www.cyberciti.biz/tips/how-do-i ... ition.html

apt-get install lsof

If your device name is /dev/sdx, enter the following command as root user:

lsof | grep '/dev/sdx'

Output:

vi 4453 vivek 3u BLK 8,1 8167 /dev/sdx

Above output tells that user vivek has a vi process running that is using /dev/sdx.
All you have to do is stop vi process and run umount again.
As soon as that program terminates its task,
the device will no longer be busy and you can unmount it with the following command:

umount /dev/sdx

Andresc2

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#47 Post by wiak »

wiak on 10Aug wrote:Or maybe use:

Code: Select all

umount -l fs_to_umount
From umount man page:
-l
Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)
or forced umount:

umount -f ...
-f
Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)
Also: https://serverfault.com/questions/17284 ... ead-chroot

wiak

But maybe getting a bit too off-topic. The export -f chroot_in situation of more interest.
AndresC2 wrote:Hello jd7654!

Hello Wiak!

/chroot/proc: device is busy.
In some case useful info about processes that uses
the device is found by lsof or fuser.

/chroot/dev: device is busy.
In some case useful info about processes that uses
the device is found by lsof or fuser.

this Work for me.

umount -lf /proc
umount -lf /dev

From Will Haley Create a Custom Debian Live Environment.

umount -lf /proc
umount -lf /sys
umount -lf /dev/pts
umount -lf /dev
Yes, I wondered if that would work for you. I was hoping you would post back your results following my post above on the other (Fred mklive-stretch) thread.

Thanks to anikin for first mentioning Will Haley on here. DebianDog's should have listened about debootstrap earlier.

Anyway, it has all given a new enthusiastic life to Puppy forum at the moment with lots of prospects to look forward to. I hope Puppy developers can somehow use some of this work in new Puppy developments somehow; maybe include debootstrap additions to woof-ce in new Puppy build recipes? - especially useful in non-debian/ubuntu-Puppy builds maybe - or perhaps take a look at the archstrap possibilities also that I mentioned earlier:
wiak wrote:By the way, there is also:

arch-bootstrap, pacstrap, arch-chroot, and similar tools/methods for Arch Linux installs. I've also come across a archstrap (via google).

https://github.com/tokland/arch-bootstrap

https://wiki.archlinux.org/index.php/In ... ting_Linux

Or for creating several distributions types there is a Python program:

https://github.com/hartwork/image-bootstrap (also mentioned on the archlinux wiki link above).

wiak
I am particularly happy to see rcrsn51 being so heavily involved (despite a few doubts I had earlier...). His peasywifi works great for me in everything I try it on and many of his peasy apps are just perfect for incorporating into small linux distributions.

My only minor issue with current mklive-stretch (which I mentioned much earlier on in the project) is that the script could do with being more modularised in my opinion - rcrsn51 seems particularly skilled at that kind of thing but maybe too busy to make suggestions about that. My point is that the script is becoming quite long, so more difficult to maintain if not broken down into function-sized chunks (that could be more easily chopped and changed). If that were done it would be easier to have the same script working as a GUI or at the commandline. But this is no major complaint - Fred's script is easy to read still (so very informative) and does the job well.

Anyway, that comment is for that other thread so I should really post it over there, but don't want to interrupt progress there where Fred is already working on incorporating so many suggested changes.

For this particular thread I'm thinking of creating a very small script to increase the convenience of starting up a debootstrapDebian within Puppy in such a way that the Debian system apps are more integrated with the provided Puppy ones - but I don't see that possibility as ultra-important or urgent for implementation or if it would have much use in practice...

wiak
Last edited by wiak on Wed 21 Aug 2019, 02:52, edited 1 time in total.

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

using first post instructions to chroot into Fred's build

#48 Post by wiak »

In case anyone doesn't realise it, the intermediate stretch/chroot system built via the scripts provided in Fred's "Create Debian 9 (Stretch) minimal ISO" thread can itself be immediately chroot into by opening a terminal at the stretch directory and entering the commands (on Puppy or any Linux system really):

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

chroot chroot
When you are finished you can just type exit in your debian 9 terminal and then umount the binds as usual with:

Code: Select all

umount chroot/proc && umount chroot/dev/pts && umount chroot/dev && umount chroot/sys
What you are accessing is not the final iso or even the final /live folder (which is for frugal installs) but rather the underlying chroot/linux_filesystem that was used in the build (but contains all the applications installed). Since in this case you are running that system from your host Linux, you don't get the window manager you would by booting into the /live frugal or iso version. Rather, you are getting the X display, window manager, and kernel/modules provided by your host Linux. You can still however run the underlying apps via a terminal in the usual debootstrapDebian manner (can't run a 64-bit build on a 32-bit host though...). For example, in a terminal in the chroot debian:

Code: Select all

apt-get update
synaptic &
In practice, once Fred's script has created the actual "live" folder and the iso, you no longer need that underlying stretch/chroot system at all anymore for booting purposes, but as long as it is there you can use it!

As far as booting Fred's isodata/live as a frugal install, you can as dancytron suggested in that Debian 9 (Stretch) thread of Fred immediately boot via grub4dos with a menu.lst such as (dancytron's example):

Code: Select all

title stretch/isodata   (sda2) noauto from=/stretch/isodata/ changes=EXIT:/stretch/isodata/
root (hd0,1)
kernel (hd0,1)/stretch/isodata/live/vmlinuz1 noauto from=/stretch/isodata/ changes=EXIT:/stretch/isodata/
initrd (hd0,1)/stretch/isodata/live/initrd1.xz
(just change the partition details to suit where you have it)

wiak

oui

build a real puppy so?

#49 Post by oui »

did some one already build a REAL Puppy with the methode of the debootstrapDebian within Puppy project?

if yes

can the next step, using apt-build, do it from sources, exactly for the own processor and other own hardware and locales, be done?

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#50 Post by rcrsn51 »

wiak wrote: rcrsn51 seems particularly skilled at that kind of thing
No great skill. I just chopped out the YAD stuff in lines 24-76 and set the nine variables like BASE_INSTALL to their corresponding strings.

I then customized those strings for my setup.

Everything from the original line 78 on is unchanged.

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

#51 Post by mikeslr »

Skill, my dear rcrsn51, is what happens when you make something others find difficult seem easy.

So, I'd modify wiak's complement to read skilled and modest. :)

mikesLr


p.s. or perhaps cleverly devious in setting a trap for the unwary. :lol:

oui

#52 Post by oui »

Hm

I am sorry, but I am to come back to my question:

As Woof seems to be a real GREAT TERROR else for talented user like Musher (he is over that really natural English speaker, other not always, the most probably not!) or Rainer (RSH)

(probably because nobody consider with gravity the Puppy Wiki or feed it with really hints and knowledge, it is more somewhat like daily news as only the creator works on it)

Puppy has absolutely no POPULAR BASE AT ALL!

As Barry did leave Puppy for his Quirky's, Warry's, one-block kernel's etc. it was ok.

Now, years after that, the puppyists have anxiety today to try to build puppy and contribute!

An half hand of real contributors participates over the head of the other all. People like Musher and Rainer (RSH) (as well as the great quantity of Puppyists) did finish renouncing!

What is that for a community?

Is this community not able any more to reveal exact and methodical (well maintained wiki), to document, how Puppy is to build ...

... from sources?

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

chroot test a new woof-CE distribution build

#53 Post by wiak »

The following information may be of interest to those who have been trying out woof-CE, following the 'woof-CE needs you' thread:

http://www.murga-linux.com/puppy/viewtopic.php?t=101174

or experimenting with my 'makepup' single script to build a woof-CE Puppy system:

http://www.murga-linux.com/puppy/viewtopic.php?t=111389

NOTE: You can simply cut and paste the following lines into a terminal to try the technique described out:

You can test out some of the operation of your new woof-out_*/sandbox3/build distribution, from the host system you just built it on, by chroot into it and run some of the applications to test if working and generally inspect your new system. Note that running apps within your new build do not use your new build X or desktop but instead pops up windows in the X server/desktop of your host build system. Note also that you cannot chroot into a 64bit system from a 32bit host.

To do the above, first, cd into woof-out_* and then:

Code: Select all

cd sandbox3
Then enter in terminal:

Code: Select all

mkdir rootfs-complete/sys
Then enter in terminal:

Code: Select all

mount --bind /proc rootfs-complete/proc && mount --bind /dev rootfs-complete/dev && mount --bind /sys rootfs-complete/sys && mount -t devpts devpts rootfs-complete/dev/pts && cp /etc/resolv.conf rootfs-complete/etc/resolv.conf
Then enter in terminal:

Code: Select all

chroot rootfs-complete
That will take you into your now running rootfs-complete new woof-CE system (but note that the kernel being used is that of your host build system).

Now enter in terminal:

Code: Select all

export LC_ALL=C
You can now check out your new woof-CE build. For example, run Puppy application pmusic (assuming it has been installed in new woof-CE system):

In terminal enter:

Code: Select all

pmusic &
When you are finished experimenting with your chroot woof-CE system, enter:

Code: Select all

exit
and finally, clean up the chroot mounts with:

Code: Select all

umount rootfs-complete/proc && umount rootfs-complete/dev/pts && umount rootfs-complete/dev && umount rootfs-complete/sys
Note also, that whilst chroot into your new woof-CE distribution rootfs-complete it would also be possible (if you know how) to modify it (create symlinks, edit contents etc) and then rebuild the squashfs files and iso manually from the modified rootfs-complete contents.

wiak

Post Reply