Anyone building in a chroot environment?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
2lss
Posts: 225
Joined: Sun 20 Sep 2009, 23:54

Anyone building in a chroot environment?

#1 Post by 2lss »

I thought it would be neat to be able to build and develop stuff from a puppy environment on my ubuntu box so I did the following:

Unpacked the puppy 4.31 main sfs along with the devx into a directory and ran

Code: Select all

sudo chmod -R 777 pupenv-431/
and then chrooted by

Code: Select all

sudo chroot pupenv-431/ /bin/bash
It seems to be working ok, none of the gui stuff will work nor will it build anything (the configure scrips go crazy printing an endless loop of error messages ) but I guess its better than nothing.

I tried setting some variables, like PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, LANG, and a few others but nothing made a difference.

So does anyone else use this method? It seems like it should be possible, there are lots of guides for gentoo but there are a few tools specific to that distro. I found a thread thats similar but I have yet to give it a try http://www.murga-linux.com/puppy/viewto ... 58&t=49512

Would be neat to get working.

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#2 Post by big_bass »

2lss
So does anyone else use this method?
I used that before and few much more complex chroots
what I use is my own scripts that make a new root not a chroot
that one took me quite awhile to figure out how to do

and there werent any how to's to follow so coding it all was the only way



this will get you much further

make it executable and call it quick-init click on it and see the difference :D

Code: Select all

#!/bin/sh
mount /proc
mount /sys
mount /dev/pts

you are already using X so you need a new display number for the GUI stuff

Code: Select all

startx -- :1

a chroot wont be clean since files will be written to your chrooted environment but
for testing its fine to use

Joe

2lss
Posts: 225
Joined: Sun 20 Sep 2009, 23:54

#3 Post by 2lss »

Thanks big_bass,

Unfortunately a storm knocked out my power so it will be a while until I get to test this on my machine. :x

Just out of curiosity, what is the difference between a new root and a chroot?

And do I run your script within the chroot'ed environment, or outside?

Edit: Also, do I need to be working in new vt?

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#4 Post by big_bass »

a chroot is like booting into that folder
so files are generated the same as a frugal install

but a new root allows you to install and remove files without booting into the folder so no personalized configurations based on your hardware are generated

I had to write that code the formatting of pet packages
how they are registered in woof are very different so all my work on this is for pre woof versions of puppy ( I have no plans to modify the code for the new package format )

I also use package tools (slackwares package management)
do I run your script within the chroot'ed environment, or outside
after you chrooted into the folder you run the script I posted above
and the new display for number for X puppy will let you use startx instead of xwin so you dont need to change that

Joe

User avatar
mmmrr
Posts: 184
Joined: Tue 03 Mar 2009, 05:26
Location: vancouver island, canada

#5 Post by mmmrr »

i've been pokiing around trying to find a way to run
puppy inside another linux, mintppc, running on a debian
base on a power pc. so the field of emulators/virtualisers
is drastically reduced. i had found chroot , which seemed
potentially useful.

yr reply to the poster gives me hope, big bass, because
i do not know the code to see if i could get puppy running
with chroot.

thanks, mm

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#6 Post by big_bass »

mmmrr

this is a very advanced way of test building so it it mostly used for a development stage
to boot into a chroot
so you have to understand a quite few things before getting started

1.)if you are booting from another linux distros kernel
you will have different modules loaded before switching into the new root

in a nut shell this is for pre testing ideas before hand
doing this booting slackware with a slackware chroot is much easier
doing this booting puppy and then a puppy chroot is much easier
*I can say that with confidence because I tried it the hard way of having a different kernel and modules
it can be done but it gets much more complex quickly (slaxer pup came from much testing )
so if this sounds interesting to you do the easy way first
to get a feel for what is happening



2.)if you are booting from another distro you have to have squashfs compiled in if you want to mount
sfs but it is not needed if you first decompress the filing system into a folder


3.)since you are in a chroot the display number has to be increased from 0 to 1

this is in no way a complete how to because I always have to tweak many things to get the full
system running

anyway thanks for posting
I hope this clears up some questions
you will have to invest a lot of time


much easier to set up qemu but its slow

Joe

User avatar
mmmrr
Posts: 184
Joined: Tue 03 Mar 2009, 05:26
Location: vancouver island, canada

#7 Post by mmmrr »

thanks for yr reply joe,

i tried qemu, too slow to be useful.
i just wanted to see if i could get a puppy running on a powerpc
and because a port is going slowly for much more informed users
than myself i found a nice linux for powerpc, mintppc.

it's debian based. in the mintppc forum one of their moderators wondered
if anyone had tried running puppy in qemu. that was how i started.
then i found that very few emulators/virtualiser would encompass
a host ppc/linux guest pc/linux setup

i got so far as installing schroot which looked as though it might
make things easier. i have the time to invest and the target compu
is a 'spare' with internet. it's a g4, big old thing with built in handles,
runs in utter silence -disconnected the fans-

in fact i'm not sure that chroot on linux on a powerpc will run a
linux/pc distro like puppy? just thought of that.

cheers, mm

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#8 Post by big_bass »

mmmrr

a suggestion would be to rebuild mintppc lighter
using packages this will save you tons of time
when you decide to upgrade and it will be much more organized
when you search for info using a debian base

you could then build packages on your already running system
as far as what is or what isnt puppy on a ppc
there is no attempt to standardize anything
to be linux compatible on one

the best way would be a small light mintppc full install
then pick only the best smallest apps you need

Joe

User avatar
mmmrr
Posts: 184
Joined: Tue 03 Mar 2009, 05:26
Location: vancouver island, canada

#9 Post by mmmrr »

thanks, joe

i'm not understanding some of yr post

i'm not trying to redo mintppc; it's already running
as the operating system on my powerpc, g4.

i didn't build it in the first place, i just installed it.
sure it's got some apps i don't use but i don't think
that changes things as far chrooting or new-rooting
puppy is concerned

''the best way would be a small light mintppc full install''

that really has me puzzled, full install where?

i'm happy with the present mintppc install. i want to
run puppy inside it.

i appreciate yr help, cheers, mm

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

Re: Anyone building in a chroot environment?

#10 Post by Dougal »

2lss wrote:I tried setting some variables, like PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH, LANG, and a few others but nothing made a difference.
You should just source /etc/profile (assuming bash isn't doing it itself).
This way some, hmm, esoteric things like USER will be set.

Whenever I update my sfs I use chroot for running indexgen.sh and fixmenus and they work fine. For running any serious programs you'll want to do what Joe suggested, 'though what you really want is to run /etc/rc.d/rc.sysinit but without all the module loading... there's all kinds of stuff like setting the hostname etc.
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
mmmrr
Posts: 184
Joined: Tue 03 Mar 2009, 05:26
Location: vancouver island, canada

#11 Post by mmmrr »

after i lay down it occurred to me where i wasn't understanding

joe, were you suggesting that i make a practice run in chroot by
building a mintppc inside the existing mintppc? the more i think
about it the more it makes sense. i do feel slow.

it makes sense but i was hoping to follow the lead of the original
poster, put pup431 plus devx, unpacked from sfs, into a directory,
chmod them, chroot them, following the op's coding

then use yr coding, given in yr first reply, and see where i got.

i'd expect to have to do a bunch of tweaking, as you say, but
i would be using my learning curve on my actual goal, puppy.

anyway, thanks, mm

Post Reply