From 3ef14fa6f60183ac11f8d2d433b7b52b215cce33 Mon Sep 17 00:00:00 2001 From: Warren Toomey Date: Thu, 10 Mar 2016 12:54:46 +1000 Subject: [PATCH] Oops, I forgot to actually write the file contents into the filesystem image. --- tools/mkfs7 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/mkfs7 b/tools/mkfs7 index 65399bc..fa3fa2d 100755 --- a/tools/mkfs7 +++ b/tools/mkfs7 @@ -323,6 +323,18 @@ sub add_file { # Allocate enough blocks for the file my @blklist = allocate_blocks($size); + # Put the contents of the file into the blocks + my ($blocknum, $offset)= ($blklist[0], 0); + dprint("Filling block $blocknum with content from $extfile\n"); + foreach my $i (0 .. $size-1) { + $Block[$blocknum][$offset++]= $buf[$i]; + if ( $offset == WORDSPERBLK ) { + $offset = 0; + $blocknum++; + dprint("Filling block $blocknum with content from $extfile\n"); + } + } + # If it's too big, allocate indirect blocks my $large = 0; my @indblocks;