implement redbend flashing

Change-Id: Icad93103ed2321ad8b6aecbbf2e0f2f8fe139c0f
This commit is contained in:
Koushik Dutta 2010-09-13 15:04:54 -07:00
parent 28a41b4df2
commit 68df48c28f
2 changed files with 33 additions and 3 deletions

View File

@ -3,6 +3,7 @@ ifeq ($(BOARD_USES_BMLUTILS),true)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -DBOARD_BOOT_DEVICE=\"$(BOARD_BOOT_DEVICE)\"
LOCAL_SRC_FILES := bmlutils.c
LOCAL_MODULE := libbmlutils
include $(BUILD_STATIC_LIBRARY)

View File

@ -1,4 +1,33 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
#include <linux/input.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/reboot.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/limits.h>
#include <dirent.h>
#include <sys/stat.h>
#include <signal.h>
#include <sys/wait.h>
int
__system(const char *command);
int write_raw_image(const char* partition, const char* filename) {
// flash using redbend_ua here
return 0;
}
char tmp[PATH_MAX];
if (0 != strcmp("boot", partition)) {
return -1;
}
sprintf(tmp, "/sbin/redbend_ua restore %s %s", filename, BOARD_BOOT_DEVICE);
return __system(tmp);
}