X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FFilesystems%2FInitRD%2FGenerateInitRD.php;h=e7cd4f7e416fb2d3c7267e429a8e41b0d6291350;hb=a2495c6ea4f4cab16b5d339ae511428e92e89e73;hp=03b7d81a3591fe0e07fb7f5b32b129e828c1ba6a;hpb=3545d4228478c0bd19b2426366b2f2af5a06ee07;p=tpg%2Facess2.git diff --git a/Modules/Filesystems/InitRD/GenerateInitRD.php b/Modules/Filesystems/InitRD/GenerateInitRD.php index 03b7d81a..e7cd4f7e 100644 --- a/Modules/Filesystems/InitRD/GenerateInitRD.php +++ b/Modules/Filesystems/InitRD/GenerateInitRD.php @@ -15,7 +15,8 @@ $ARCH = getenv("ARCH"); $gInputFile = $argv[1]; $gOutputFile = $argv[2]; -$gDepFile = ($argc > 3 ? $argv[3] : false); +$gOutputLDOptsFile = $argv[3]; +$gDepFile = ($argc > 4 ? $argv[4] : false); $gDependencies = array(); @@ -66,11 +67,13 @@ function hd8($fp) } $inode = 0; +$gSymFiles = array(); function ProcessFolder($prefix, $items) { global $gOutput, $gDependencies; global $ACESSDIR, $ARCH; global $inode; + global $gSymFiles; foreach($items as $i=>$item) { $inode ++; @@ -95,8 +98,7 @@ tVFS_Node {$prefix}_{$i} = { .Size = $size, .Inode = {$inode}, .ImplPtr = {$prefix}_{$i}_entries, - .ReadDir = InitRD_ReadDir, - .FindDir = InitRD_FindDir + .Type = &gInitRD_DirType }; EOF; @@ -108,6 +110,7 @@ EOF; // Parse path components $path = str_replace("__BIN__", "$ACESSDIR/Usermode/Output/$ARCH", $path); $path = str_replace("__FS__", "$ACESSDIR/Usermode/Filesystem", $path); + $path = str_replace("__SRC__", "$ACESSDIR", $path); echo $path,"\n"; // --- @@ -118,10 +121,12 @@ EOF; exit(1); } $size = filesize($path); - + +/* + $_sym = $prefix."_".$i."_data"; $fp = fopen($path, "rb"); - $gOutput .= "Uint8 {$prefix}_{$i}_data[] = {\n"; + $gOutput .= "Uint8 $_sym[] = {\n"; for( $j = 0; $j + 16 < $size; $j += 16 ) { $gOutput .= "\t"; $gOutput .= hd8($fp).",".hd8($fp).","; @@ -140,6 +145,13 @@ EOF; } fclose($fp); $gOutput .= "\n};\n"; +*/ + +//* + $_sym = "_binary_".str_replace(array("/","-","."), "_", $path)."_start"; + $gOutput .= "extern Uint8 {$_sym}[];"; + $gSymFiles[] = $path; +//*/ $gOutput .= <<$file) +{ + fputs($fp, "$file\n"); +// fputs($fp, "--defsym $sym=_binary_".$sym_filename."_start\n"); +} +fclose($fp); if($gDepFile !== false) {