blob: 239b5bba0e76b29cbdc9f01e1487f89379dd6535 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
<?php
function bundle_ext2($I, $W) {
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 '$I/*' '$W/ext2/'");
execute_command('Unmount ext2 image', "umount '$W/ext2'");
execute_command('Compress ext2 image', "gzip '$W/image.ext2'");
return "$W/image.ext2.gz";
}
?>
|