Commit 52c89bc4 authored by Eddy Beaupre's avatar Eddy Beaupre Committed by Alejandro Mery
Browse files

Convert project to autoconf/automake and add a man page.

Doesn't change much to the result but it make the tools
compatible with packagers and is a bit more friendly for
newbies.

configure should check to figure out if arm-none-eabi is
installed. I will do that later.
parent b3984566
...@@ -5,5 +5,24 @@ bootinfo ...@@ -5,5 +5,24 @@ bootinfo
fel fel
pio pio
nand-part nand-part
nand-part-a20
phoenix_info
fel-pio.bin
jtag-loop.bin
fel-sdboot.bin
boot_head_sun4i.bin
boot_head_sun5i.bin
adb-devprobe.sh
fel-gpio
usb-boot
*.o *.o
*.swp *.swp
*~
Makefile.in
/autom4te.cache
/aclocal.m4
/compile
/configure
/depcomp
/install-sh
/missing
CC = gcc AUTOMAKE_OPTIONS = foreign
CFLAGS = -g -O0 -Wall -Wextra CFLAGS = -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/
CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L
CFLAGS += -Iinclude/
TOOLS = fexc bin2fex fex2bin bootinfo fel pio TOOLS = fexc bin2fex fex2bin bootinfo fel pio nand-part nand-part-a20 phoenix_info
TOOLS += nand-part nand-part-a20 BINARIES = fel-pio.bin jtag-loop.bin fel-sdboot.bin boot_head_sun4i.bin boot_head_sun5i.bin adb-devprobe.sh fel-gpio usb-boot
MISC_TOOLS = phoenix_info bin_PROGRAMS = $(TOOLS)
exampledir = $(datarootdir)/doc/@PACKAGE@
example_DATA = $(BINARIES) bin/fel-sdboot.sunxi bin/jtag-loop.sunxi bin/ramboot.scr bin/ramboot.uboot-sh README
CROSS_COMPILE ?= arm-none-eabi- fexc_SOURCES = bootinfo.c fel-copy.c fel-sdboot.c jtag-loop.c phoenix_info.c script_bin.c script_fex.c fel.c fel-pio.c fexc.c nand-part.c pio.c script.c script_uboot.c common.h fexc.h nand-part-a20.h nand-part.h script_bin.h script_fex.h script.h script_uboot.h include/endian_compat.h include/types.h
EXTRA_DIST = boot_head.S jtag-loop.S boot_head.lds fel-pio.lds fel-sdboot.lds jtag-loop.lds sunxi-tools.7 adb-devprobe.sh fel-gpio usb-boot bin/fel-pio.bin bin/fel-pio.nm bin/fel-sdboot.sunxi bin/jtag-loop.sunxi bin/ramboot.scr bin/ramboot.uboot-sh
.PHONY: all clean
all: $(TOOLS) nodist_bin2fex_SOURCES = bin2fex.c
nodist_fex2bin_SOURCES = fex2bin.c
nodist_nand_part_a20_SOURCES = nand-part-a20.c
misc: $(MISC_TOOLS) man_MANS = sunxi-tools.7
clean:
@rm -vf $(TOOLS) $(MISC_TOOLS) *.o *.elf *.sunxi *.bin *.nm *.orig
CROSS_COMPILE ?= arm-none-eabi-
$(TOOLS): Makefile common.h clean-local:
rm -f boot_head_sun4i.elf boot_head_sun5i.elf fel-sdboot.elf fel-pio.elf fel-pio.nm jtag-loop.elf boot_head_sun4i.bin boot_head_sun5i.bin fel-sdboot.bin fel-pio.bin jtag-loop.bin *~
fex2bin bin2fex: fexc fexc: fexc.h script.h script.c script_uboot.h script_uboot.c script_bin.h script_bin.c script_fex.h script_fex.c
ln -s $< $@
fexc: fexc.h script.h script.c \ fex2bin: fexc
script_uboot.h script_uboot.c \ ln -sf fexc fex2bin
script_bin.h script_bin.c \
script_fex.h script_fex.c
LIBUSB = libusb-1.0 bin2fex: fexc
LIBUSB_CFLAGS = `pkg-config --cflags $(LIBUSB)` ln -sf fexc bin2fex
LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)`
fel: fel.c fel: fel.c
$(CC) $(CFLAGS) $(LIBUSB_CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS) $(LIBUSB_LIBS) $(CC) $(CFLAGS) $(LIBUSB_CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS) $(LIBUSB_LIBS)
...@@ -91,6 +87,6 @@ boot_head_sun5i.bin: boot_head_sun5i.elf ...@@ -91,6 +87,6 @@ boot_head_sun5i.bin: boot_head_sun5i.elf
bootinfo: bootinfo.c bootinfo: bootinfo.c
.gitignore: Makefile .gitignore: Makefile
@for x in $(TOOLS) '*.o' '*.swp'; do \ @for x in $(TOOLS) $(BINARIES) '*.o' '*.swp' '*~' '.deps/*' Makefile.in /autom4te.cache /aclocal.m4 /compile /configure /depcomp /install-sh /missing; do \
echo "$$x"; \ echo "$$x"; \
done > $@ done > $@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([sunxi-tools], [1.0], [https://github.com/linux-sunxi/sunxi-tools])
AC_CONFIG_SRCDIR([fel-copy.c])
# automake initialisation and check for minimal automake API version 1.9
AM_INIT_AUTOMAKE([1.9])
# Checks for programs.
AC_PROG_CC
AC_PROG_LN_S
# Checks for libraries.
PKG_CHECK_MODULES([LIBUSB], libusb-1.0 >= 1.0.0,, AC_MSG_ERROR([*** Required libusb-1.0 >= 1.0.0 not installed ***]))
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/mount.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset munmap strchr strerror strtol strtoul])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
...@@ -3,5 +3,3 @@ ...@@ -3,5 +3,3 @@
. = 0x0030; . = 0x0030;
.text : { *(.text) } .text : { *(.text) }
} }
.TH SUNXI-TOOLS "7" "August 2013" "Sunxi-Tools for allWinner's A10/A20"
.SH NAME
sunxi-tools \- Tools to help hacking Allwinner A10 (aka sun4i) based devices
and possibly it's successors, that's why the 'x' in the package name.
.SH SYNOPSIS
.B fexc
[\fI-vq\fR] [\fI-I <fex|bin>\fR] [\fI-O <bin|fex>\fR] [\fI<input> \fR[\fI<output>\fR]]
.PP
(de)compiler for `.fex` configuration file.
.PP
.B fex2bin
[\fI-vq\fR] [\fI<input> \fR[\fI<output>\fR]]
.PP
Compatibility shortcut to call `fexc` to decompile an script.bin
blob back into `.fex` format used by allwinner's SDK to configure
the boards
.PP
.B bin2fex
[\fI-vq\fR] [\fI<input> \fR[\fI<output>\fR]]
.PP
Compatiblity shortcut to call `fexc` to compile a `.fex` file into
the binary form used by the sun4i kernel.
.PP
.B fel
\fIcommand arguments\fR [\fIcommand arguments\fR ...]
.PP
Script interface for talking to the FEL USB handler built in to
the CPU. You activate FEL mode by pushing the usboot/recovery
button at poweron.
.PP
.B pio
[\fI-m\fR|\fI-i input\fR] [\fI-o output\fR] \fIpin\fR ...
.PP
Manipulate PIO register dumps
.PP
.B nand-part
\fInand-device '\fIname2\fR \fIlen2\fR [\fIusertype2\fR]' ['\fIname3 len3\fR [\fIusertype3\fR]'] ...
.br
.B nand-part
\fInand-device [\fI-f\fR] \fIstart1\fR '\fIname1 len1\fR [\fIusertype1\fR]' ['\fIname2 len2\fR [\fIusertype2\fR]'] ...
.PP
Tool for manipulating Allwinner A10 NAND partition tables.
.PP
.B nand-part-a20
\fInand-device '\fIname2\fR \fIlen2\fR [\fIusertype2\fR]' ['\fIname3 len3\fR [\fIusertype3\fR]'] ...
.br
.B nand-part-a20
\fInand-device [\fI-f\fR] \fIstart1\fR '\fIname1 len1\fR [\fIusertype1\fR]' ['\fIname2 len2\fR [\fIusertype2\fR]'] ...
.PP
Tool for manipulating Allwinner A20 NAND partition tables
.PP
.B bootinfo
[\fI--type=<sd|nand>\fR] \FIfilename\FR
.PP
Dump information from Allwinner boot files (boot0/boot1)
.PP
.B phoenix_info
[\FI-v\FR] [\FI-q\FR] [\FI-p N\FR] [\FI-o X\FR] [\FI-s\FR] [\FIphoenix_image\FR]
.PP
Gives information about a phoenix image created by the
phoenixcard utility and optionally extracts the embedded boot
code & firmware file from their hidden partitions.
.PP
.SH DESCRIPTION
.\" Add any additional description here
See the help of each tool for more information about its usage (\FI-?\FR).
.SH AUTHOR
Written by Alejandro Mery <amery@geeks.cl>
.SH "REPORTING BUGS"
Report bugs at https://github.com/linux-sunxi/sunxi-tools
.SH COPYRIGHT
Copyright \(co 2012 Alejandro Mery
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment