mirror of
				https://github.com/Tasssadar/kexec-tools
				synced 2025-11-04 13:55:51 +08:00 
			
		
		
		
	Build in Android repository as static binaries
This commit is contained in:
		
				
					committed by
					
						
						Vojtech Bocek
					
				
			
			
				
	
			
			
			
						parent
						
							e4fcc5d126
						
					
				
				
					commit
					f297fb892e
				
			
							
								
								
									
										49
									
								
								Android.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								Android.mk
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,49 @@
 | 
			
		||||
LOCAL_PATH := $(call my-dir)
 | 
			
		||||
 | 
			
		||||
include $(CLEAR_VARS)
 | 
			
		||||
LOCAL_MODULE                  := kdump_static
 | 
			
		||||
LOCAL_MODULE_TAGS             := optional
 | 
			
		||||
LOCAL_C_INCLUDES              := $(LOCAL_PATH)/include
 | 
			
		||||
LOCAL_SRC_FILES               := kdump/kdump.c
 | 
			
		||||
LOCAL_FORCE_STATIC_EXECUTABLE := true
 | 
			
		||||
LOCAL_STATIC_LIBRARIES        := libc
 | 
			
		||||
include $(BUILD_EXECUTABLE)
 | 
			
		||||
 | 
			
		||||
include $(CLEAR_VARS)
 | 
			
		||||
LOCAL_MODULE      := libutil_kt
 | 
			
		||||
LOCAL_MODULE_TAGS := optional
 | 
			
		||||
LOCAL_C_INCLUDES  := $(LOCAL_PATH)/util_lib/include
 | 
			
		||||
LOCAL_SRC_FILES   := util_lib/compute_ip_checksum.c util_lib/sha256.c
 | 
			
		||||
include $(BUILD_STATIC_LIBRARY)
 | 
			
		||||
 | 
			
		||||
include $(CLEAR_VARS)
 | 
			
		||||
LOCAL_MODULE                  := kexec_static
 | 
			
		||||
LOCAL_MODULE_TAGS             := optional
 | 
			
		||||
LOCAL_C_INCLUDES              := $(LOCAL_PATH)/include \
 | 
			
		||||
                                 $(LOCAL_PATH)/util_lib/include \
 | 
			
		||||
                                 $(LOCAL_PATH)/kexec/arch/arm/include \
 | 
			
		||||
                                 external/zlib
 | 
			
		||||
LOCAL_SRC_FILES               := kexec/kexec.c kexec/ifdown.c \
 | 
			
		||||
                                 kexec/kexec-elf.c kexec/kexec-elf-exec.c \
 | 
			
		||||
                                 kexec/kexec-elf-core.c \
 | 
			
		||||
                                 kexec/kexec-elf-rel.c \
 | 
			
		||||
                                 kexec/kexec-elf-boot.c \
 | 
			
		||||
                                 kexec/kexec-iomem.c \
 | 
			
		||||
                                 kexec/firmware_memmap.c \
 | 
			
		||||
                                 kexec/crashdump.c kexec/crashdump-xen.c \
 | 
			
		||||
                                 kexec/phys_arch.c kexec/lzma.c \
 | 
			
		||||
                                 kexec/zlib.c kexec/proc_iomem.c \
 | 
			
		||||
                                 kexec/virt_to_phys.c \
 | 
			
		||||
                                 kexec/arch/arm/phys_to_virt.c \
 | 
			
		||||
                                 kexec/add_segment.c kexec/add_buffer.c \
 | 
			
		||||
                                 kexec/arch_reuse_initrd.c \
 | 
			
		||||
                                 kexec/arch_init.c \
 | 
			
		||||
                                 kexec/arch/arm/kexec-elf-rel-arm.c \
 | 
			
		||||
                                 kexec/arch/arm/kexec-zImage-arm.c \
 | 
			
		||||
                                 kexec/arch/arm/kexec-uImage-arm.c \
 | 
			
		||||
                                 kexec/arch/arm/kexec-arm.c \
 | 
			
		||||
                                 kexec/arch/arm/crashdump-arm.c \
 | 
			
		||||
                                 kexec/kexec-uImage.c kexec/purgatory.c
 | 
			
		||||
LOCAL_FORCE_STATIC_EXECUTABLE := true
 | 
			
		||||
LOCAL_STATIC_LIBRARIES        := libutil_kt libz libc
 | 
			
		||||
include $(BUILD_EXECUTABLE)
 | 
			
		||||
@@ -18,7 +18,7 @@ clean += $(KDUMP_OBJS) $(KDUMP_DEPS) $(KDUMP) $(KDUMP_MANPAGE)
 | 
			
		||||
$(KDUMP): CC=$(TARGET_CC)
 | 
			
		||||
$(KDUMP): $(KDUMP_OBJS)
 | 
			
		||||
	@$(MKDIR) -p $(@D)
 | 
			
		||||
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $(KDUMP_OBJS)
 | 
			
		||||
	$(CC) $(LDFLAGS) -o $@ $(KDUMP_OBJS)
 | 
			
		||||
 | 
			
		||||
$(KDUMP_MANPAGE): kdump/kdump.8
 | 
			
		||||
	$(MKDIR) -p     $(MANDIR)/man8
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
 | 
			
		||||
		int count;
 | 
			
		||||
		if (memory_ranges >= MAX_MEMORY_RANGES)
 | 
			
		||||
			break;
 | 
			
		||||
		count = sscanf(line, "%Lx-%Lx : %n",
 | 
			
		||||
		count = sscanf(line, "%llx-%llx : %n",
 | 
			
		||||
			&start, &end, &consumed);
 | 
			
		||||
		if (count != 2)
 | 
			
		||||
			continue;
 | 
			
		||||
 
 | 
			
		||||
@@ -97,13 +97,13 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
 | 
			
		||||
	}
 | 
			
		||||
	if (!fgets(line, sizeof(line), fp))
 | 
			
		||||
		die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
 | 
			
		||||
	count = sscanf(line, "%Lx", &temp);
 | 
			
		||||
	count = sscanf(line, "%llx", &temp);
 | 
			
		||||
	if (count != 1)
 | 
			
		||||
		die("Cannot parse %s: %s\n", crash_notes, strerror(errno));
 | 
			
		||||
	*addr = (uint64_t) temp;
 | 
			
		||||
	*len = MAX_NOTE_BYTES; /* we should get this from the kernel instead */
 | 
			
		||||
#if 0
 | 
			
		||||
	printf("crash_notes addr = %Lx\n", *addr);
 | 
			
		||||
	printf("crash_notes addr = %llx\n", *addr);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	fclose(fp);
 | 
			
		||||
@@ -125,7 +125,7 @@ static int get_vmcoreinfo(const char *kdump_info, uint64_t *addr, uint64_t *len)
 | 
			
		||||
 | 
			
		||||
	if (!fgets(line, sizeof(line), fp))
 | 
			
		||||
		die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
 | 
			
		||||
	count = sscanf(line, "%Lx %Lx", &temp, &temp2);
 | 
			
		||||
	count = sscanf(line, "%llx %llx", &temp, &temp2);
 | 
			
		||||
	if (count != 2)
 | 
			
		||||
		die("Cannot parse %s: %s\n", kdump_info, strerror(errno));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ int kexec_iomem_for_each_line(char *match,
 | 
			
		||||
		die("Cannot open %s\n", iomem);
 | 
			
		||||
 | 
			
		||||
	while(fgets(line, sizeof(line), fp) != 0) {
 | 
			
		||||
		count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
 | 
			
		||||
		count = sscanf(line, "%llx-%llx : %n", &start, &end, &consumed);
 | 
			
		||||
		if (count != 2)
 | 
			
		||||
			continue;
 | 
			
		||||
		str = line + consumed;
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,6 @@
 | 
			
		||||
#define KEXEC_SYSCALL_H
 | 
			
		||||
 | 
			
		||||
#define __LIBRARY__
 | 
			
		||||
#include <syscall.h>
 | 
			
		||||
#include <sys/syscall.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user