在N1的OpenWRT上安装alpine环境

2019-10-05  本文已影响0人  wangyeye
  1. 创建磁盘镜像
cd /mnt/data
dd if=/dev/zero of=alpine.img bs=1M count=1024
mkfs.ext4 alpine.img
mkdir /alpine
mount alpine.img /alpine
  1. 安装alpine
cd /alpine
#wget ${mirror}/latest-stable/main/${arch}/apk-tools-static-${version}.apk
wget http://dl-cdn.alpinelinux.org/alpine/latest-stable/main/aarch64/apk-tools-static-2.10.4-r2.apk
#tar -xzf apk-tools-static-*.apk
tar -xzf apk-tools-static-2.10.4-r2.apk
#./sbin/apk.static -X ${mirror}/latest-stable/main -U --allow-untrusted --root ${chroot_dir} --initdb add alpine-base
./sbin/apk.static -X http://dl-cdn.alpinelinux.org/latest-stable/main -U --allow-untrusted --root /alpine --initdb add alpine-base

  1. 进入alpine环境
mount -o bind /dev /alpine/dev
mount -o bind /dev/pts /alpine/dev/pts
mount -o bind /proc /alpine/proc
mount -o bind /sys /alpine/sys
mkdir -p /alpine/etc/apk
echo "http://dl-cdn.alpinelinux.org/latest-stable/main" > /alpine/etc/apk/repositories
chroot /alpine /bin/sh -i

  1. alpine环境下
apk update
上一篇下一篇

猜你喜欢

热点阅读