From 9f1b076c2c32b0088c4e108cdeff20a5dec100e3 Mon Sep 17 00:00:00 2001 From: Eudyptula Date: Thu, 2 Jul 2009 14:40:26 -0400 Subject: Added support for EXT2 and JFFS2 images --- backend/modules/gentoo_portage/build.php | 12 ++++++++++++ depend | 2 ++ frontend/modules/gentoo/step3.php | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) 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:
'; + echo 'Image type:
'; } function gentoo_process_step3() { global $S, $request; -- cgit v1.2.3-65-gdbad