summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEudyptula <eitan@mosenkis.net>2009-07-02 14:40:26 -0400
committerEudyptula <eitan@mosenkis.net>2009-07-02 14:40:26 -0400
commit9f1b076c2c32b0088c4e108cdeff20a5dec100e3 (patch)
tree31ca427b2c38be6fbbd37a717619e128e078864a
parentUpdate both parts for proper modularity, start catalyst-based backend, code c... (diff)
downloadingenue-9f1b076c2c32b0088c4e108cdeff20a5dec100e3.tar.gz
ingenue-9f1b076c2c32b0088c4e108cdeff20a5dec100e3.tar.bz2
ingenue-9f1b076c2c32b0088c4e108cdeff20a5dec100e3.zip
Added support for EXT2 and JFFS2 images
-rw-r--r--backend/modules/gentoo_portage/build.php12
-rw-r--r--depend2
-rw-r--r--frontend/modules/gentoo/step3.php2
3 files changed, 15 insertions, 1 deletions
diff --git a/backend/modules/gentoo_portage/build.php b/backend/modules/gentoo_portage/build.php
index 693a85c..f23408f 100644
--- a/backend/modules/gentoo_portage/build.php
+++ b/backend/modules/gentoo_portage/build.php
@@ -70,6 +70,18 @@ function gentoo_portage_build(&$build, &$opts, &$W) {
// mkisofs -J -R -l ${mkisofs_zisofs_opts} -V "${clst_iso_volume_id}" -o ${1} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ${clst_target_path}
execute_command('Create ISO image', "mkisofs -J -R -l -V 'Ingenue Build $build->id' -o '$W/image.iso' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table '$W/cd'");
rename("$W/image.iso", COMPLETED.'/build-'.$build->id.'.iso') || throw_exception('rename failed');
+ } elseif ($imgtype == 'jffs2') {
+ execute_command('Create JFFS2 image', "mkfs.jffs2 -x lzo -n -e 0x20000 -l -p -r '$W/image' -o '$W/image.jffs2'");
+ rename("$W/image.jffs2", COMPLETED.'/build-'.$build->id.'.jffs2') || throw_exception ('rename failed');
+ } elseif ($imgtype == 'ext2') {
+ execute_command('Make blank file for ext2 image', "dd if=/dev/zero of='$W/image.ext2' bs=1024 count=1048576");
+ execute_command('Make ext2 filesystem', "mke2fs -t ext2 -F '$W/image.ext2'");
+ makedir('ext2');
+ execute_command('Mount ext2 image', "mount -o loop -t ext2 '$W/image.ext2' '$W/ext2'");
+ execute_command('Copy files to ext2', "cp -va '$W/image/*' '$W/ext2/'");
+ execute_command('Unmount ext2 image', "umount '$W/ext2'");
+ execute_command('Compress ext2 image', "gzip '$W/image.ext2'");
+ rename("$W/image.ext2.gz", COMPLETED.'/build-'.$build->id.'.ext2.gz') || throw_exception('rename failed');
} else {
throw_exception('invalid image type: '.$imgtype);
}
diff --git a/depend b/depend
index 0913499..9a48688 100644
--- a/depend
+++ b/depend
@@ -3,3 +3,5 @@ sys-apps/fakeroot ?
sys-apps/portage # In case you use paludis
www-servers/apache APACHE2_MODULES=rewrite?
sys-fs/squashfs-tools(-4.0?)
+JFFS2: sys-fs/mtd-utils
+EXT2: sys-fs/genext2fs
diff --git a/frontend/modules/gentoo/step3.php b/frontend/modules/gentoo/step3.php
index f9b83fc..d1d152d 100644
--- a/frontend/modules/gentoo/step3.php
+++ b/frontend/modules/gentoo/step3.php
@@ -3,7 +3,7 @@ function gentoo_init_step3() {
return array('title' => 'Step 3 - Image Format');
}
function gentoo_body_step3() {
- echo 'Image type: <select name="image_type"><option value="tgz">Tar/Gzip</option><option value="tbz2">Tar/Bzip2</option><option value="installcd">Installer CD with Tar/Bzip2 image</option><option value="livecd">LiveCD</option></select><br/>';
+ echo 'Image type: <select name="image_type"><option value="tgz">Tar/Gzip</option><option value="tbz2">Tar/Bzip2</option><option value="installcd">Installer CD with Tar/Bzip2 image</option><option value="livecd">LiveCD</option><option value="ext2">ext2</option><option value="jffs2">jffs2</option></select><br/>';
}
function gentoo_process_step3() {
global $S, $request;