This commit is contained in:
victor 2025-09-27 00:34:18 +02:00
parent 4df22a038f
commit 6daf9c499f
505 changed files with 110256 additions and 68 deletions

View File

@ -1,32 +1,37 @@
CC = clang
SRC_DIR := src
SRC := $(SRC_DIR)/main.c
SRC := $(SRC_DIR)/*.c
BUILD_DIR := build
ASSETS := assets
TARGET := $(BUILD_DIR)/hello
INCLUDE := /usr/include/
CTOOLS := $(SRC_DIR)/ctools
LIBFT_DIR := $(CTOOLS)/libft
LIBFT := $(LIBFT_DIR)/lib/libft.a
LIB := $(LIBFT)
LIB := $(LIBFT) $(LIBGPIOD)
TOOLCHAIN_DIR := $(HOME)/.local/toolchains
TOOLCHAIN := $(TOOLCHAIN_DIR)/aarch64-linux-musl-cross
TOOLCHAIN_BIN := $(TOOLCHAIN)/bin
MUSL_LD := $(TOOLCHAIN_BIN)/aarch64-linux-musl-ld
CC := $(TOOLCHAIN_BIN)/aarch64-linux-musl-gcc
CFLAGS := -Wall -Wextra -Werror --target=aarch64-linux-musl \
--sysroot=$(TOOLCHAIN) \
--ld-path=$(MUSL_LD)
LIBGPIOD_INCLUDE := $(TOOLCHAIN)/include
LIBGPIOD := $(TOOLCHAIN)/lib/libgpiod.a
CFLAGS := -Wall -Wextra -Werror -I$(LIBGPIOD_INCLUDE)
DOCKER_CMD := /bin/sh #-c 'hello "host.docker.internal" "8000"'
MINIROOTFS := $(ASSETS)/minirootfs.tar.gz
LINKER_FLAGS := -L$(TOOLCHAIN)/lib -lgpiod
ALPINE := alpine
ALPINE_KERNEL := alpine/boot/vmlinuz-rpi
ALPINE_INITFRAM_FS := alpine/boot/initramfs-rpi
@ -44,8 +49,7 @@ SSH_AUTH_KEYS := $(ALPINE)/authorized_keys
all: $(TARGET)
$(TARGET): $(TOOLCHAIN) $(SRC) $(BUILD_DIR) $(LIB)
echo $(HOME)
$(TARGET): $(SRC) $(BUILD_DIR) $(LIB) $(LIBGPIOD)
$(CC) $(CFLAGS) -o $(TARGET) $(SRC) $(LIB)
get: $(ASSETS) $(ALPINE_TAR) $(ALPINE_HEADLESS)
@ -53,17 +57,9 @@ get: $(ASSETS) $(ALPINE_TAR) $(ALPINE_HEADLESS)
tar xvf $(ALPINE_TAR) -C $(ALPINE)
cp $(ALPINE_HEADLESS) $(ALPINE)
qemu: $(ALPINE_CUSTOM_IMG) img
$(QEMU_VM) -machine raspi3ap -cpu cortex-a53 -smp 4 -m 512M \
-drive format=raw,file=$(ALPINE_CUSTOM_IMG) \
-nographic
#$(QEMU_VM) -M virt -cpu cortex-a72 -smp 2 -m 1G \
# -kernel $(ALPINE_KERNEL) \
# -initrd $(ALPINE_INITFRAM_FS) \
# -append "console=ttyAMA0 root=/dev/vda rw" \
# -drive format=raw,file=fat:rw:$(ALPINE)/ \
# -nographic \
# -virtfs local,path=$(BUILD_DIR),mount_tag=$(BUILD_DIR),security_model=none
sync: $(TARGET)
rsync -avz root@pi:/media/mmcblk0p1/ ./image
rsync -avz ./build/* root@pi:/root/build/
img: get $(ALPINE) $(BUILD_DIR)
$(QEMU_IMG) create -f raw $(ALPINE_CUSTOM_IMG) 512M
@ -79,6 +75,19 @@ bootable: $(ALPINE) $(WPA_CONFIG) get
$(ALPINE_HEADLESS):
wget https://github.com/macmpi/alpine-linux-headless-bootstrap/raw/98728731299f262eab270941c522138d6c5cea73/headless.apkovl.tar.gz -O $(ALPINE_HEADLESS)
$(LIBGPIOD):
git clone https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git && \
cd libgpiod && \
./autogen.sh && \
./configure --host=aarch64-linux-musl \
--prefix=/home/victor/.local/toolchains/aarch64-linux-musl-cross \
--enable-tools=no \
--enable-bindings-cxx=no && \
make && make install && \
cd .. && \
rm -rf libgpiod
$(TOOLCHAIN): | $(TOOLCHAIN_DIR)
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar xvf aarch64-linux-musl-cross.tgz -C $(TOOLCHAIN_DIR)

0
image/apks/.boot_repository Executable file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
image/apks/aarch64/iw-6.9-r0.apk Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More