X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FFilesystems%2FInitRD%2FGenerateInitRD.php;h=031ad5907002a338ebba033485ed960e41556b77;hb=c3d486ba13c6cd12558d4c0cf01d3fd93e797d64;hp=d89d6e9cc153241d282ff134d87c415b050ddd6e;hpb=1e25b20fd5d119d3b5673d6a31f60b2da676de98;p=tpg%2Facess2.git diff --git a/Modules/Filesystems/InitRD/GenerateInitRD.php b/Modules/Filesystems/InitRD/GenerateInitRD.php index d89d6e9c..031ad590 100644 --- a/Modules/Filesystems/InitRD/GenerateInitRD.php +++ b/Modules/Filesystems/InitRD/GenerateInitRD.php @@ -1,10 +1,15 @@ + + * Generated $lGenDate */ #include "initrd.h" -$item) { - if(is_array($item[1])) { - + if(is_array($item[1])) + { ProcessFolder("{$prefix}_{$i}", $item[1]); - echo "tInitRD_File {$prefix}_{$i}_entries[] = {\n"; + $gOutput .= "tInitRD_File {$prefix}_{$i}_entries[] = {\n"; foreach($item[1] as $j=>$child) { - if($j) echo ",\n"; - echo "\t{\"".addslashes($child[0])."\",&{$prefix}_{$i}_{$j}}"; + if($j) $gOutput .= ",\n"; + $gOutput .= "\t{\"".addslashes($child[0])."\",&{$prefix}_{$i}_{$j}}"; } - echo "\n};\n"; + $gOutput .= "\n};\n"; $size = count($item[1]); - echo <<$child) { - if($j) echo ",\n"; - echo "\t{\"".addslashes($child[0])."\",&gInitRD_Files_{$j}}"; + if($j) $gOutput .= ",\n"; + $gOutput .= "\t{\"".addslashes($child[0])."\",&gInitRD_Files_{$j}}"; } -echo "\n};\n"; -?> +$gOutput .= "\n};\n"; +$nRootFiles = count($lStack[0][1]); +$gOutput .= <<, + .Size = $nRootFiles, .ImplPtr = gInitRD_Root_Files, .ReadDir = InitRD_ReadDir, .FindDir = InitRD_FindDir }; +EOF; + +$fp = fopen($argv[2], "w"); +fputs($fp, $gOutput); +fclose($fp); +?>