On Wednesday 03 Mar 2004 09:44, Phil Tomson wrote:
> In article <c231sv$1o0bs3$1 / ID-147067.news.uni-berlin.de>,
>
> Benny  <linux / marcrenearns.de> wrote:
> >
> >damned! I had the same idea. but I would choose FreeBSD as underlying
> >system. a ports-tool (portupgrade) already is in ruby.
>
> Why not go ahead with that idea?  Couldn't you use the rubyx script to
> just as easily build a FreeBSD system (might need some modifications of
> course, but you could probably save a lot of the work that would be
> required to do it from scratch).  I like this idea because, as you say,
> portupgrade is already in ruby (and I like the BSD ports system).  It
> would be really cool if the rubyx script could completely build a *nix
> OS/system including your choice of kernal (be it Linux, or *BSD (even
> including Darwin)).  That would be the ultimate in flexibility.

Well, I'm not familiar with the BSD kernel build process, but there is no 
fundamental reason that  the bsd kernel should not be just another package as 
far as rubyx is concerned. That is all that happens with the linux kernel. 
Same goes for the Hurd, really.

Here is the (edited) linux Package object, for example 
class Pkg_Linux < Package

        def source() return prefix('linux-'+vlabel); end

  def initialize()
                patches={'patch1'=>'','patch2'=>'','patch3'=>'','patch4'=>'','patch5'=>''}
                super(nil,'The linux kernel','2.4.25',
                                        {
                                                '2.4.25'=>{'files'=>[['linux-2.4.24','linux-2.4.24-25.patch']],
                                                        'config'=>(path(RUBYXDIR,'linux-2.4.25.config').flines.join)}.update(patches),

                                                '2.6.3'=>{'files'=>[['linux-2.6.1','linux-2.6.1-3.patch']],
                                                        'config'=>(path(RUBYXDIR,'linux-2.6.3.config').flines.join)}.update(patches),
                                        })

                join('Base')
                dependancy(BUILD_TOOLS,'coreutils','bash','modutils','module-init-tools')
  end

  def build()
                prefix.cd
                unpack().mv('linux-'+vlabel)
                bash('chmod -R u+w linux-'+vlabel)
                ('linux-'+vlabel).cd
                %w{ patch1 patch2 patch3 patch4 patch5 }.each { |p| 
popen("patch -p1",@selected[p]) if @selected[p] != ''}
                bash "make mrproper"
                '.config'.fwrite(@selected['config'])
                bash "cat .config"
                depmod = "/sbin/#{vlabel[2,1]=='4' ? 'mu' : 'mit'}/depmod"
                # Fixup problem with gcc install dirs and use of -nostdinc and 
-iwithprefix by defining GCC_EXEC_PREFIX
                ENV['GCC_EXEC_PREFIX']=$gcc.libdir('gcc-lib')+'/'
                bash "env"
                bash "yes \"\" | make ARCH=#{$host.generic} oldconfig"
                bash "make ARCH=#{$host.generic} -j#{$mj} dep" if 
vlabel[2,1]=='4'
                bash "make ARCH=#{$host.generic} -j#{$mj} bzImage"
                bash "make ARCH=#{$host.generic} -j#{$mj} modules"
                bash "make ARCH=#{$host.generic} INSTALL_MOD_PATH=#{prefix} 
DEPMOD=#{depmod} modules_install",ASROOT
                prefix('kernel').mkdir
                path('arch',
$host.generic,'boot/bzImage').cp(prefix('kernel/bzImage'))
                etcdir('modules.conf').ftouch()
                standardRootOwnership()
  end

end; $linux = Pkg_Linux.new()

>
> question: could the ruby-based init system be used with *BSD as well?
>

Don't see why not

>
> Is there a ruby-command-shell or are you proposing irb be used?
>

I don't think irb is a viable bash replacement. An rshell would be an 
interesting project though. I'm suprised nobody has had a go yet...