-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The idea of the patch is basically described in prevoius post: https://groups.google.com/d/msg/osv-dev/RL2S3AL9TNE/l4XZJo3-lI0J Whis this patch, you will be able to install OSv apps into disk image on "make all" stage. These apps does not require to exist in OSv repository, you can install apps which is on any git repository or svn repository, or on local directory. You'll need to write a config file to add apps, format of the file is JSON. Here's a sample of the file: { "modules":[ { "name":"osv-mruby", "type":"git", "path":"https://github.com/syuu1228/osv-mruby.git", "branch":"master" } ] } If you add "module" on config file, make all calls script/module.py. This scripts perform "git clone" to fetch repository to $(out)/module, and invoke "make module" on each module. "make module" should outputs bootfs.manifest/usr.manifest on module directory, the script merge bootfs.manifest.skel/usr.manifest.skel and module local manifests to single file $(out)/bootfs.manifest/$(out)/usr.manifest. Here's app Makefile example: https://github.com/syuu1228/osv-mruby/blob/master/Makefile It have "module" target, and the target builds all binaries and generates *.manifest. Signed-off-by: Takuya ASADA <syuu@dokukino.com> Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
- Loading branch information
Showing
6 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,4 +76,3 @@ | |
/libzfs.so: libzfs.so | ||
/zfs.so: zfs.so | ||
/tools/mkfs.so: tools/mkfs/mkfs.so | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"modules":[ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/python2 | ||
|
||
import json | ||
import sys | ||
import os | ||
import subprocess | ||
|
||
f = open("../../../config.json") | ||
conf = json.load(f) | ||
f.close() | ||
|
||
mtype = sys.argv[1] | ||
mskel = open("../../../%s.manifest.skel" % mtype) | ||
m = open("../%s.manifest" % mtype, "w") | ||
for l in mskel.readlines(): | ||
m.write(l) | ||
mskel.close() | ||
|
||
for mod in conf["modules"]: | ||
mmod_path = "%s/%s.manifest" % (mod["name"], mtype) | ||
if os.access(mod["name"], os.F_OK) == False: | ||
if mod["type"] == "git": | ||
cmd = "git clone -b %s %s %s" % (mod["branch"], mod["path"], mod["name"]) | ||
elif mod["type"] == "svn": | ||
cmd = "svn co %s %s" % (mod["path"], mod["name"]) | ||
elif mod["type"] == "dir": | ||
cmd = "cp -a %s %s" % (mod["path"], mod["name"]) | ||
else: | ||
raise Exception("%s is unknown type" % mod["type"]) | ||
print cmd | ||
subprocess.call([cmd], shell=True) | ||
if os.access(mmod_path, os.F_OK) == False: | ||
pwd = os.getcwd() | ||
print "cd %s" % mod["name"] | ||
os.chdir(mod["name"]) | ||
cmd = "make module" | ||
subprocess.call([cmd], shell=True) | ||
print "cd -" | ||
os.chdir(pwd) | ||
print "append %s to %s.manifest" % (mmod_path, mtype) | ||
mmod = open(mmod_path) | ||
for l in mmod.readlines(): | ||
m.write(l) | ||
mmod.close() | ||
m.close() |
File renamed without changes.