M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

View File

@ -0,0 +1,30 @@
#Makefile to generate appsboot.mbn
ifeq ($(BOOTLOADER_OUT),.)
APPSBOOTHEADER_DIR := $(BUILDDIR)
else
APPSBOOTHEADER_DIR := $(BOOTLOADER_OUT)/../../
endif
SRC_DIR := target/$(TARGET)/tools
COMPILER := gcc
ifeq ($(BUILD_NANDWRITE), 1)
APPSBOOTHDR_FILES :=
else
APPSBOOTHDR_FILES := appsboot.mbn
endif
APPSBOOTHEADER: $(APPSBOOTHDR_FILES)
appsboot.mbn: appsboothd.mbn $(OUTBIN)
cat $(APPSBOOTHEADER_DIR)/appsboothd.mbn $(OUTBIN) > $(APPSBOOTHEADER_DIR)/appsboot.mbn
rm -rf $(APPSBOOTHEADER_DIR)/appsboothd.mbn
appsboothd.mbn: mkheader $(OUTBIN)
$(SRC_DIR)/mkheader $(OUTBIN) $(APPSBOOTHEADER_DIR)/appsboothd.mbn
mkheader: $(SRC_DIR)/mkheader.c
${COMPILER} $(SRC_DIR)/mkheader.c -o $(SRC_DIR)/mkheader

View File

@ -0,0 +1,55 @@
/* Copyright 2007, Google Inc. */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
int main(int argc, char *argv[])
{
struct stat s;
unsigned size, base;
unsigned magic[10];
int fd;
if(argc != 3) {
fprintf(stderr,"usage: mkheader <bin> <hdr>\n");
return -1;
}
if(stat(argv[1], &s)) {
perror("cannot stat binary");
return -1;
}
size = s.st_size;
base = 0;
magic[0] = 0x00000005; /* appsbl */
magic[1] = 0x00000002; /* nand */
magic[2] = 0x00000000;
magic[3] = base;
magic[4] = size;
magic[5] = size;
magic[6] = size + base;
magic[7] = 0x00000000;
magic[8] = size + base;
magic[9] = 0x00000000;
fd = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644);
if(fd < 0) {
perror("cannot open header for writing");
return -1;
}
if(write(fd, magic, sizeof(magic)) != sizeof(magic)) {
perror("cannot write header");
close(fd);
unlink(argv[2]);
return -1;
}
close(fd);
return 0;
}