make_disc_trees.pl: create /firmware/dep11/README.txt and count it

Move the README.txt creation from generate_firmware_patterns to its
caller, so that it's done just once, and so that added blocks are
counted properly.
This commit is contained in:
Cyril Brulebois 2023-01-25 01:38:34 +01:00
parent b56af4dbcc
commit 957ee269b4
2 changed files with 7 additions and 3 deletions

View File

@ -162,9 +162,6 @@ sub generate_patterns_for_firmware_sof_intel_workaround {
die "missing output directory $output_dir"
if ! -d $output_dir;
write_file("$output_dir/README.txt",
"These files help Debian Installer detect helpful firmware packages (via hw-detect).\n");
# Search for the specified package in the Components-* files, and
# generate patterns when it's found:
my $done;

View File

@ -12,6 +12,7 @@ use File::Find;
use File::Path qw(make_path remove_tree);
use File::Basename;
use Compress::Zlib;
use File::Slurp;
my %pkginfo;
my ($basedir, $mirror, $tdir, $codename, $archlist, $mkisofs, $maxcds,
@ -1211,6 +1212,12 @@ sub add_firmware_stuff {
mkdir "$dir/firmware" or die "mkdir $dir/firmware failed $!\n";
mkdir "$dir/firmware/dep11" or die "mkdir $dir/firmware/dep11 failed $!\n";
$blocks_added += 2;
# In case anyone wonders about those files:
write_file("$dir/firmware/dep11/README.txt",
"These files help Debian Installer detect helpful firmware packages (via hw-detect).\n")
or die "unable to create $dir/firmware/dep11/README.txt";
$blocks_added += get_file_blocks("$dir/firmware/dep11/README.txt");
}
msg_ap(0, "Symlink fw package $p into /firmware\n");