ubuntu cross compile

USER=lindyang
DIRECTORY=/opt/arm64

sudo apt install -y debootstrap qemu-user-static binfmt-support schroot
sudo debootstrap --arch=arm64 --foreign --include=gcc,g++ bionic $DIRECTORY
sudo cp /usr/bin/qemu-aarch64-static $DIRECTORY/usr/bin

cat < /etc/apt/sources.list <<'EOF'
deb http://ports.ubuntu.com/ubuntu-ports bionic main restricted
deb http://ports.ubuntu.com/ubuntu-ports bionic-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports bionic universe
deb http://ports.ubuntu.com/ubuntu-ports bionic-updates universe
deb http://ports.ubuntu.com/ubuntu-ports bionic multiverse
deb http://ports.ubuntu.com/ubuntu-ports bionic-updates multiverse
deb http://ports.ubuntu.com/ubuntu-ports bionic-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports bionic-security universe
deb http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse
EOF

apt update;
apt install -y git curl;

mkdir -p ~;
git clone https://gitee.com/pyenv/pyenv.git ~/.pyenv;
cat >> ~/.bashrc <<'EOF'
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
EOF
source ~/.bashrc;

mkdir ~/.pip;
cat > ~/.pip/pip.conf <

你可能感兴趣的:(ubuntu cross compile)