upgrade /rootfs to 5.15-bpo5-headers;change apt sourcelist to acosail;make it easier to use

This commit is contained in:
acosail 2023-08-24 21:21:23 +08:00
parent 6de534d6ed
commit c816862f7b
5 changed files with 89 additions and 8 deletions

View File

@ -1,8 +1,22 @@
FROM debian:bullseye-slim
# Update apt and get crossbuild ENV for arm64;
# Update apt source
#RUN echo "deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free" > /etc/apt/source.list
RUN rm -rf /etc/apt/sources.list.d
RUN echo "deb [trusted=yes] http://mirrors.huaweicloud.com/debian/ bullseye main contrib non-free" > /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y crossbuild-essential-arm64 vim
apt-get install -y gpg gpg-agent ca-certificates
RUN apt-get update && \
apt-get install -y bzip2 crossbuild-essential-arm64 vim binfmt-support
RUN echo "deb [trusted=yes] https://repo.acosail.com/acosail/V2_repo/ acosail main non-free" > /etc/apt/sources.list
ADD ./hkdshen_acoinfo.asc /
RUN apt-key add /hkdshen_acoinfo.asc
RUN apt-get update
# Update apt and get crossbuild ENV for arm64;
# Set ENV for crossbuild arm64 app;
ENV CC=aarch64-linux-gnu-gcc
@ -13,16 +27,22 @@ RUN mkdir /app
WORKDIR /app
# Add ARM64 base rootfs into Docker;
ADD ./rootfs_minbase.tar.xz /rootfs
ADD ./rootfs_docker_base.txz /rootfs
ADD ./hkdshen_acoinfo.asc /rootfs
# Make sure we can qemu arm64 inside Docker;
RUN mkdir /rootfs/app
COPY ./qemu-aarch64-static /usr/bin/qemu-aarch64-static
COPY ./qemu-aarch64-static /rootfs/bin/qemu-aarch64-static
# Add some tools to make rootfs useble;
RUN chroot /rootfs bash -c "apt update && \
apt install -y build-essential libncurses5-dev llvm-dev clang cmake "
RUN chroot /rootfs sh -c "echo 'deb [trusted=yes] http://mirrors.huaweicloud.com/debian/ bullseye main contrib non-free' > /etc/apt/sources.list"
RUN chroot /rootfs sh -c "apt-get update && apt-get install -y gpg gpg-agent ca-certificates"
RUN chroot /rootfs sh -c "apt install -y build-essential libncurses5-dev llvm-dev clang cmake bash"
RUN chroot /rootfs sh -c "echo 'deb [trusted=yes] https://repo.acosail.com/acosail/V2_repo/ acosail main non-free' > /etc/apt/sources.list"
RUN chroot /rootfs sh -c "apt-key add /hkdshen_acoinfo.asc"
ADD bashrc /root/.bashrc
# Now we are in AcoSail V2 cross build ENV for arm64.
CMD ["/bin/bash"]

View File

@ -14,7 +14,7 @@ Of cause you need have some crossbuild experience before you using this tool.
You can learn crossbuild on google/github and maybe CSDN.
~~~bash
export PROJECT_DIR
sudo docker run -it --rm -v ${PROJECT_DIR}:/app acosail_v2_cross:1.0
sudo docker run -it --rm --privileged -v ${PROJECT_DIR}:/app acosail_v2_cross:1.0
# Do what ever you want to build an arm64 C/C++ cli program;
# Don't forget to make sure your have set FLAGS -isysroot=/rootfs;
~~~
@ -31,7 +31,7 @@ apt update
# How to RUN this docker for QEMU arm64 native & VERY SLOW build
~~~bash
export PROJECT_DIR
sudo docker run -it --rm -v ${PROJECT_DIR}:/rootfs/app acosail_v2_cross:1.0
sudo docker run -it --rm --privileged -v ${PROJECT_DIR}:/rootfs/app acosail_v2_cross:1.0
#Inside docker
chroot /rootfs/app
# Do what you want to build a native arm64 program;
@ -42,7 +42,7 @@ chroot /rootfs/app
We suppose you have build your progarms already.
~~~bash
export PROJECT_DIR
sudo docker run -it --rm -v ${PROJECT_DIR}:/rootfs/app acosail_v2_cross:1.0
sudo docker run -it --rm --privileged -v ${PROJECT_DIR}:/rootfs/app acosail_v2_cross:1.0
#Insdile docker
chroot /rootfs/app
# Do anything you like to run a native program

20
bashrc Normal file
View File

@ -0,0 +1,20 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
#eval "$(dircolors)"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
update-binfmts --install qemu-aarch64 /usr/bin/qemu-aarch64-static --magic '\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' > /dev/null 2>&1

41
hkdshen_acoinfo.asc Normal file
View File

@ -0,0 +1,41 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBGRI14EBDAC5XenO6GwWSq52P61VNt1s9WMG4pQ7XS0AoHa0O9jQ5allr8u+
x4+mgC+5WaQc4ZmCliKcUyWrwI9OmajsG6yS2RumSafgvQJHzl62xIl/kth7oaBD
AzKh/a5TvpwEJLoAcpfksLzmC47RMEbSMMAqsA3i/DkixiGKx1rayNuFVaYpxZMH
466qYMhUqHi3L6Ejn1ikTkDbBweN1KcXqjmqMjHz2TA4wogBnQB3wqdGUjmIfjaM
3OOamYwSljlJzQn/6IuWmyRQ3WYnb6PLVkV98DR9ZXFBAjFwfJ44i+JiHOVpQshk
mvuiduz2kL3QEochYIkhFp8ZW05QIgYsHshyJKza0Fju3bR2kpVQE83kTvqWgYUB
EV/f9idimZUmmeWge4FdHFGiuDuc/Axi4ILi3iyOUdG1v63t/GFIErY90Wo66ZPD
WIyBpZGn4UsovksvEbxQpZMBRd38RInV32hCD9GGScL/+vHc3rCmmKMM15o1RSat
Z5w35qGWR/EnrnMAEQEAAbQhcWlueGlhbGVpIDxxaW54aWFsZWlAYWNvaW5mby5j
b20+iQHUBBMBCgA+FiEEYMZ+lRjBKgjGJfadaTk8QZtySl0FAmRI14ECGwMFCQPC
ZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQaTk8QZtySl1wdgv8D3Itgbww
w750zsorS4fc2hFKRaDa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