Building NanoBSD with ports and packages

View: New views
7 Messages — Rating Filter:   Alert me  

Building NanoBSD with ports and packages

by Jordan Coleman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can anyone suggest a way to pre-install ports in a NanoBSD system at  
build time?  Ideally, I'd like to be able to add a customize_cmd to  
my NanoBSD configuration file so that the finished disk images can be  
made to include anything in ports.

Suggestions?

Thanks.

++Jordan

_______________________________________________
freebsd-small@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."

Re: Building NanoBSD with ports and packages

by Eugene Grosbein :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Apr 20, 2007 at 06:07:50AM -0400, Jordan Coleman wrote:

> Can anyone suggest a way to pre-install ports in a NanoBSD system at  
> build time?  Ideally, I'd like to be able to add a customize_cmd to  
> my NanoBSD configuration file so that the finished disk images can be  
> made to include anything in ports.
>
> Suggestions?

Just add to your nanobsd.conf:

NANO_CUSTOMIZE="/path/to/localfiles"

Place packages to /path/to/Pkg subdirectory.

Here comes the script "localfiles":

#!/bin/sh -e

# save pointer to packages, there should be $src/Pkg directory
# with packages ready to install
src=$(dirname `realpath $0`)
pkgs="$src/Pkg"

# go to Nano world
cd "$NANO_WORLDDIR"

# start from the beginning
dirs="usr/local tmp/Pkg var/db/pkg"
rm -rf $dirs
mkdir $dirs

trap "umount $pkgs" SIGHUP SIGINT SIGTERM
mount_nullfs -o ro "$pkgs" tmp/Pkg
chroot "$NANO_WORLDDIR" sh -c "cd /tmp/Pkg && pkg_add -vF *"
umount "$pkgs"
rmdir tmp/Pkg
_______________________________________________
freebsd-small@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."

Re: Building NanoBSD with ports and packages

by Jean Milanez Melo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jordan Coleman wrote:

> Can anyone suggest a way to pre-install ports in a NanoBSD system at
> build time?  Ideally, I'd like to be able to add a customize_cmd to my
> NanoBSD configuration file so that the finished disk images can be made
> to include anything in ports.
>
> Suggestions?
>
> Thanks.
>
> ++Jordan
>
> _______________________________________________
> freebsd-small@... mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-small
> To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."

Hello,

Try to use TinyBSD in -current, it can do it for you.

Please take a look at:

http://www.freebsd.org/cgi/getmsg.cgi?fetch=11295+16283+/usr/local/www/db/text/2006/freebsd-small/20061105.freebsd-small

--
Jean
_______________________________________________
freebsd-small@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."

Re: Building NanoBSD with ports and packages

by Jordan Coleman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, accidentally replied privately at first.  Here it is again...

On Apr 20, 2007, at 8:09 AM, Eugene Grosbein wrote:

> Just add to your nanobsd.conf:
>
> NANO_CUSTOMIZE="/path/to/localfiles"
>
> Place packages to /path/to/Pkg subdirectory.
>
> Here comes the script "localfiles":
[...]

Okay, neat.  Looks like it'll do the trick.  This is pretty close to  
(but better thought-out than) the approach I had been thinking about.

I'm wondering, is it possible/practical/safe to do port "make  
install"s inside the chroot to avoid having to have pre-built  
packages?  Is there a simpler way?

Thanks.

++Jordan

_______________________________________________
freebsd-small@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."

Re: Building NanoBSD with ports and packages

by Olivier Gautherot-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jordan!

On Friday 20 April 2007 22:35, Jordan Coleman wrote:
> [...]
> I'm wondering, is it possible/practical/safe to do port "make
> install"s inside the chroot to avoid having to have pre-built
> packages?  Is there a simpler way?

I don't have first-hand experience with NanoBSD but jails did
miracles with FreeSBIE. It is definitely worth a try as long as
your target machine uses the same architecture as your host
(avoid compiling mplayer with optimized flags on an AMD64
if your target is a i486, for instance...)

Cheers
--
Olivier Gautherot
Email:    olivier@...
LinkedIn: http://www.linkedin.com/in/ogautherot
MSN:      ogautherot@...
_______________________________________________
freebsd-small@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."

Re: Building NanoBSD with ports and packages

by Eugene Grosbein :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jordan Coleman wrote:

> > Just add to your nanobsd.conf:
> >
> > NANO_CUSTOMIZE="/path/to/localfiles"
> >
> > Place packages to /path/to/Pkg subdirectory.
> >
> > Here comes the script "localfiles":
> [...]
>
> Okay, neat.  Looks like it'll do the trick.  This is pretty close to
> (but better thought-out than) the approach I had been thinking about.
>
> I'm wondering, is it possible/practical/safe to do port "make
> install"s inside the chroot to avoid having to have pre-built
> packages?  Is there a simpler way?

I prefer to keep pre-built packages. It takes less time to rebuild Nano
image then. And makes software behavour more stable.
And takes less space in the NANO_WORLDDIR. You can always build
a port outside of Nano world and obtain a package using 'pkg_create -b'.

Eugene Grosbein
_______________________________________________
freebsd-small@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."

Parent Message unknown Re: Building NanoBSD with ports and packages

by David N-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can create packages from your ports tree by going into your desire ports eg.
/usr/ports/editor/nano
make install package-recursive

and the packages will be placed into
1. Current directory or
2. /usr/ports/packages if you create the directory before hand
(recommended). All the files will be in /usr/ports/packages/All/

Then you got prebuilt packages that you can get installed at build
time using Eugen's script. or the one from
http://www.pean.org/files/uchman.conf
its at the end, looks like its from phk

I haven't tried this yet, but i will be soon. Good luck

Cheers
David
_______________________________________________
freebsd-small@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-small
To unsubscribe, send any mail to "freebsd-small-unsubscribe@..."