Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e283ca29 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Add "fastboot --version".

So bug reporters can actually tell us what they're running.

Bug: http://b/21558406
Bug: http://b/21583225
Change-Id: If2a4ae97b4792aa321566603ce2c354a72d32307
(cherry picked from commit 379646b2)
parent 71aebefe
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -14,6 +14,8 @@


LOCAL_PATH:= $(call my-dir)
LOCAL_PATH:= $(call my-dir)


fastboot_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android

include $(CLEAR_VARS)
include $(CLEAR_VARS)


LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../mkbootimg \
@@ -25,14 +27,15 @@ LOCAL_MODULE_TAGS := debug
LOCAL_CONLYFLAGS += -std=gnu99
LOCAL_CONLYFLAGS += -std=gnu99
LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code


LOCAL_CFLAGS += -DFASTBOOT_REVISION='"$(fastboot_version)"'

ifeq ($(HOST_OS),linux)
ifeq ($(HOST_OS),linux)
  LOCAL_SRC_FILES += usb_linux.c util_linux.c
  LOCAL_SRC_FILES += usb_linux.c util_linux.c
endif
endif


ifeq ($(HOST_OS),darwin)
ifeq ($(HOST_OS),darwin)
  LOCAL_SRC_FILES += usb_osx.c util_osx.c
  LOCAL_SRC_FILES += usb_osx.c util_osx.c
  LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit \
  LOCAL_LDLIBS += -lpthread -framework CoreFoundation -framework IOKit -framework Carbon
	-framework Carbon
  LOCAL_CFLAGS += -Wno-unused-parameter
  LOCAL_CFLAGS += -Wno-unused-parameter
endif
endif


+6 −2
Original line number Original line Diff line number Diff line
@@ -964,8 +964,9 @@ int main(int argc, char **argv)
        {"page_size", required_argument, 0, 'n'},
        {"page_size", required_argument, 0, 'n'},
        {"ramdisk_offset", required_argument, 0, 'r'},
        {"ramdisk_offset", required_argument, 0, 'r'},
        {"tags_offset", required_argument, 0, 't'},
        {"tags_offset", required_argument, 0, 't'},
        {"help", 0, 0, 'h'},
        {"help", no_argument, 0, 'h'},
        {"unbuffered", 0, 0, 0},
        {"unbuffered", no_argument, 0, 0},
        {"version", no_argument, 0, 0},
        {0, 0, 0, 0}
        {0, 0, 0, 0}
    };
    };


@@ -1037,6 +1038,9 @@ int main(int argc, char **argv)
            if (strcmp("unbuffered", longopts[longindex].name) == 0) {
            if (strcmp("unbuffered", longopts[longindex].name) == 0) {
                setvbuf(stdout, NULL, _IONBF, 0);
                setvbuf(stdout, NULL, _IONBF, 0);
                setvbuf(stderr, NULL, _IONBF, 0);
                setvbuf(stderr, NULL, _IONBF, 0);
            } else if (strcmp("version", longopts[longindex].name) == 0) {
                fprintf(stdout, "fastboot version %s\n", FASTBOOT_REVISION);
                return 0;
            }
            }
            break;
            break;
        default:
        default: