美文网首页
在N1的OpenWRT上安装alpine环境

在N1的OpenWRT上安装alpine环境

作者: wangyeye | 来源:发表于2019-10-05 08:16 被阅读0次
  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

相关文章

网友评论

      本文标题:在N1的OpenWRT上安装alpine环境

      本文链接:https://www.haomeiwen.com/subject/ooupuctx.html