Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/coolsnowwolf/lede
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Sep 12, 2022
2 parents 61c803e + 1f4a901 commit 420f56a
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 21 deletions.
5 changes: 4 additions & 1 deletion include/prereq-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ $(STAGING_DIR_HOST)/bin/mkhash: $(SCRIPT_DIR)/mkhash.c
mkdir -p $(dir $@)
$(CC) -O2 -I$(TOPDIR)/tools/include -o $@ $<

prereq: $(STAGING_DIR_HOST)/bin/mkhash
$(STAGING_DIR_HOST)/bin/xxd: $(SCRIPT_DIR)/xxdi.pl
$(LN) $< $@

prereq: $(STAGING_DIR_HOST)/bin/mkhash $(STAGING_DIR_HOST)/bin/xxd

# Install ldconfig stub
$(eval $(call TestHostCommand,ldconfig-stub,Failed to install stub, \
Expand Down
66 changes: 66 additions & 0 deletions scripts/xxdi.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env perl
#
# xxdi.pl - perl implementation of 'xxd -i' mode
#
# Copyright 2013 Greg Kroah-Hartman <[email protected]>
# Copyright 2013 Linux Foundation
#
# Released under the GPLv2.
#
# Implements the "basic" functionality of 'xxd -i' in perl to keep build
# systems from having to build/install/rely on vim-core, which not all
# distros want to do. But everyone has perl, so use it instead.
#

use strict;
use warnings;

my $indata;
my $var_name = "stdin";
my $full_output = (@ARGV > 0 && $ARGV[0] eq '-i') ? shift @ARGV : undef;

{
local $/;
my $fh;

if (@ARGV) {
$var_name = $ARGV[0];
open($fh, '<:raw', $var_name) || die("xxdi.pl: Unable to open $var_name: $!\n");
} elsif (! -t STDIN) {
$fh = \*STDIN;
undef $full_output;
} else {
die "usage: xxdi.pl [-i] [infile]\n";
}

$indata = readline $fh;

close $fh;
}

my $len_data = length($indata);
my $num_digits_per_line = 12;
my $outdata = "";

# Use the variable name of the file we read from, converting '/' and '.
# to '_', or, if this is stdin, just use "stdin" as the name.
$var_name =~ s/\//_/g;
$var_name =~ s/\./_/g;
$var_name = "__$var_name" if $var_name =~ /^\d/;

$outdata = "unsigned char $var_name\[] = { " if $full_output;

for (my $key= 0; $key < $len_data; $key++) {
if ($key % $num_digits_per_line == 0) {
$outdata = substr($outdata, 0, -1)."\n ";
}
$outdata .= sprintf("0x%.2x, ", ord(substr($indata, $key, 1)));
}

$outdata = substr($outdata, 0, -2);
$outdata .= "\n";

$outdata .= "};\nunsigned int $var_name\_len = $len_data;\n" if $full_output;

binmode STDOUT;
print $outdata;
1 change: 1 addition & 0 deletions target/linux/generic/config-5.15
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
# CONFIG_ARM64_ERRATUM_843419 is not set
# CONFIG_ARM64_ERRATUM_845719 is not set
# CONFIG_ARM64_ERRATUM_858921 is not set
# CONFIG_ARM64_ERRATUM_2441009 is not set
# CONFIG_ARM64_HW_AFDBM is not set
# CONFIG_ARM64_LSE_ATOMICS is not set
# CONFIG_ARM64_MODULE_PLTS is not set
Expand Down
2 changes: 1 addition & 1 deletion tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tools-y += autoconf autoconf-archive automake bc bison cmake cpio dosfstools
tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt
tools-y += libressl libtool lzma m4 make-ext4fs meson missing-macros mkimage
tools-y += mklibs mm-macros mtd-utils mtools ninja padjffs2 patch-image
tools-y += patchelf pkgconf quilt squashfskit4 sstrip ucl upx xxd zip zlib zstd
tools-y += patchelf pkgconf quilt squashfskit4 sstrip ucl upx zip zlib zstd
tools-$(BUILD_B43_TOOLS) += b43-tools
tools-$(BUILD_ISL) += isl
tools-$(BUILD_TOOLCHAIN) += expat gmp mpc mpfr
Expand Down
19 changes: 0 additions & 19 deletions tools/xxd/Makefile

This file was deleted.

0 comments on commit 420f56a

Please sign in to comment.