blob: d8a40fdc95e28bb587d0b442bec55180d72b39aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<?php
function bundle_livecd($I, $W, &$opts) {
$profile=new sql_gentoo_profile($opts['profile']);
$headers=$profile->get_headers();
if (strpos($headers['chost'], 'x86_64') === false)
$minimaliso=CACHE.'/cd/install-x86-minimal-20090623.iso';
else
$minimaliso=CACHE.'/cd/install-amd64-minimal-20090625.iso';
makedir("$I/boot");
execute_command('Extract kernel, initrd, and squashfs from CD image ', LIB."/bkisofs-cli '$minimaliso' extract /isolinux/gentoo '$I/boot/kernel' extract /isolinux/gentoo.igz '$I/boot/initrd' extract /image.squashfs '$W/'");
file_put_contents("$W/unsquashfs-files", "/lib64/modules\n/lib/modules\n");
execute_command('Extract kernel modules from SquashFS', "unsquashfs -i -d '$W/modules' -e '$W/unsquashfs-files' '$W/image.squashfs'");
execute_command('Copy extracted modules to image', "cp -av '$W/modules/*' '$I/'");
execute_command('Compress finished image to squashfs', "mksquashfs '$I' '$W/image.squashfs' -noappend -info");
execute_command('Create ISO image', LIB."/bkisofs-cli '$minimaliso' replace /image.squashfs '$W/image.squashfs' write '$W/image.iso'");
return "$W/image.iso";
}
?>
|