Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Community Edition More Modular?

 
Post new topic   Reply to topic    Syllable Forum Index -> Community Project
View previous topic :: View next topic  
Author Message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Thu Apr 09, 2015 1:39 am    Post subject: Community Edition More Modular? Reply with quote

I would like to make the Community Edition more modular - as programming is not my strong point may I ask

The Ruby install script has ( I added sIDE for the community edition )

Packages = {
"Webster" => ["1.0a", "webster-%s.bin.zip"],
"Whisper" => ["1.0a", "whisper-%s.bin.zip"],
"sIDE" => ["0.4.9-1", "sIDE-%s.i586.zip"],
}

Packages.sort_by{|name, info| name}.each {|pkgname, info|
puts "Installing #{pkgname}"
pkg = sprintf(info[1], info[0])
system "unzip", "/boot/Packages/net/#{pkg}", "-d", "/inst/Applications/"
}

That's is all good for adding an application. My question is about adding a package.
Currently I enter system build mode on a Syllable install
mkdir -p system/stage/image/
cd system/stage/image/
I unpack the base package in there logged in as the root user to preserve the attributes on the files.
Unzip extra packages I want to add into the resources/ directory in the Syllable image. To have Packager symlink them,
package register /home/nos/system/stage/image/resources/PACKAGE /home/nos/system/stage/image/resources/index
It will detect that it is a system image and adjust the symlinks appropriately.

It looks like the Ruby install script is doing something similar with
Dir.mkdir "/inst"
system "/system/bin/mount", "-t", "afs", $part, "/inst"

retval = system "unzip", "-K", "-d", "/inst/", "/boot/Packages/base/base-syllable.zip"
system "sync"

Is that the equivalent of entering system build mode from the live CD so I could have package.zip on the cd and registered with its symlinks appropriately either by Ruby or maybe calling the install.sh script out of each package.zip. If possible Ruby would be the best option something along the lines of

system "package register","/inst/", "/boot/Packages/base/resources/PACKAGE/#{pkgname}", "/boot/Packages/base/resources/index/"
Back to top
View user's profile Send private message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Thu Apr 09, 2015 2:46 am    Post subject: Reply with quote

"inst" is the mounted partition? so I think that would more look like.

system "package register", "/boot/Packages/base/resources/PACKAGE/#{pkgname}", "/inst/resources/index/"
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2201
Location: Friesland

PostPosted: Thu Apr 09, 2015 9:06 am    Post subject: Reply with quote

Good to hear you're working on a new Community Edition. Smile

Yes, /inst/ is the mounted installation partition.

That looks almost right.

PACKAGE and #{pkgname} mean the same thing, don't they? I think you overlooked that you should only use #{pkgname} in a Ruby script.

Installing a separate resource package is trickier than the base package, indeed because the base package is a system image that already includes all the symlinks. That makes installation much faster.

Packager wasn't meant to be used during system installation, but I think I made it flexible enough that it can do it. You need to retain the system/stage/ component in the source path. That's how Packager detects that it is working from a staging area, and should chop off the prefix from the symlinks. Since you have already installed the package in the installation partition, you can make a path including system/stage/ that symlinks to the installation partition, and use that as the source path to Packager.
Back to top
View user's profile Send private message Visit poster's website
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Fri Apr 10, 2015 2:14 am    Post subject: Reply with quote

Good to hear you're working on a new Community Edition.

It would be better to think of this as investigation and research. As you said the base package is a system image so I would be up against a speed penalty if this way did work so in one sense the base image would always be the preferred route but there are a couple of benefits to me on the community edition were I feel a speed penalty might be ok.

"You need to retain the system/stage/ component in the source path. That's how Packager detects that it is working from a staging area, and should chop off the prefix from the symlinks. Since you have already installed the package in the installation partition, you can make a path including system/stage/ that symlinks to the installation partition, and use that as the source path to Packager."

ok Very Happy

One last question not relate to this topic - to remove something from a system/stage/ area it is just the reverse.

package unregister name
delete directory name out of the system/stage/resources directory
and its cleanly removed out of the image nothing left behind and is it acceptable to play with a base image that way or must you do a clean install of base image to a staging area and just always add into it.
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2201
Location: Friesland

PostPosted: Fri Apr 10, 2015 10:01 am    Post subject: Reply with quote

You'd have to provide the long paths to package again, but yes, that should work.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Community Project All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group