[转发] 龙芯loongarch实验(3)--在x86_64主机上构建debian/loong64根
REDEAST
龙芯loongarch实验(3)--在x86_64主机上构建debian/loong64根(续1)
https://blog.51cto.com/u_13752418/7884364
龙芯loongarch实验(3)--在x86_64主机上构建debian/loong64根
https://blog.51cto.com/u_13752418/7436324
吴小白
##
# 2024-06-06 更新
# 以下所有操作均在 debian 12 下面进行,请勿在生产环境进行
sed -i "s@bookworm@trixie@g" /etc/apt/sources.list
apt-get update
apt-get install qemu-system-loongarch64 qemu-user-static debian-ports-archive-keyring debootstrap
systemctl restart systemd-binfmt.service
mkdir /mnt/rootfs
debootstrap --keyring=/etc/apt/trusted.gpg.d/debian-ports-archive-2024.gpg --arch=loong64 --include=debian-ports-archive-keyring sid /mnt/rootfs http://mirror.sjtu.edu.cn/debian-ports
# 挂载
mount -t proc /proc /mnt/rootfs/proc
mount --rbind /dev /mnt/rootfs/dev
mount --make-rslave /mnt/rootfs/dev
mount --rbind /sys /mnt/rootfs/sys
mount --make-rslave /mnt/rootfs/sys
mount --rbind /tmp /mnt/rootfs/tmp
mount --bind /run /mnt/rootfs/run
chroot /mnt/rootfs /bin/bash
# 到此完成, 体验 debian 的世界吧.
# 退出后别忘记 umount, 偷懒就自己写脚本.
exit
umount /mnt/rootfs/proc
umount -R /mnt/rootfs/dev
umount -R /mnt/rootfs/sys
umount /mnt/rootfs/tmp
umount /mnt/rootfs/run
fqucuo
吴小白 一个简单的方法是用qemu-system-loongarch64跑一个archlinux loong64,在arch上debootstrap构建即可,原因是debian12的debootstrap版本不够,不低于131版本就行,感谢TG Loongson社区,附一个我自己用的
"c:\Program Files\qemu\qemu-system-loongarch64.exe" \
-m 4G
-cpu la464-loongarch-cpu \
-machine virt \
-smp 4 \
-bios ./QEMU_EFI_8.0.fd \
-serial stdio \
-device virtio-gpu-pci \
-net nic \
-net user \
-device nec-usb-xhci,id=xhci,addr=0x1b \
-device usb-tablet,id=tablet,bus=xhci.0,port=1 \
-device usb-kbd,id=keyboard,bus=xhci.0,port=2 \
-hda archlinux-minimal-2023.05.10-loong64.qcow2
Arch:
pacman -Syyu
pacman -Sy debootstrap debian-ports-archive-keyring debian-archive-keyring vim
debootstrap \
--verbose \
--keyring=/etc/apt/trusted.gpg.d/debian-ports-archive-2023.gpg \
--include=debian-ports-archive-keying,ca-certificates,apt-transport-https \
--arch=loong64 \
--variant=minbase \
--components=main,non-free,contrib,non-free-firmware \
--extra-suites=unreleased \
unstable \
debian_unstable_loong64 \
https://mirror.sjtu.edu.cn/debian-ports/ \
unstable
吴小白
额,如果你有 debian 12 的话,可以验证一下。
就在今天,usr-is-merged 的问题也已经修复了。
usr-is-merged 的问题目前发现只要使用 qemu 8 版本就不会出现,emmmm。
yetist
在 Arch 上试了一下,依赖有问题,还安装不上:
W: Couldn't download package libselinux1 (ver 3.5-1 arch loong64) at https://mirror.sjtu.edu.cn/debian-ports/pool-loong64/main/libs/libselinux/libselinux1_3.5-1_loong64.deb
...
E: Couldn't download packages: libselinux1
杜比
转个刘世伟的debootstrap用法
debootstrap \
--no-check-gpg \
--extra-suites=unreleased \
--include=libc6 \
unstable ./debian13 \
http://ftp.ports.debian.org/debian-ports
吴小白
杜比
libc6 可以制作 rootfs 完毕后手动安装,如果是制作 docker 的镜像,理论上只需要 debian-ports-archive-keyring
具体依据 https://github.com/debuerreotype/debuerreotype/blob/master/examples/debian.sh#L108
目前尝试准备使用 https://gitlab.com/giomasce/dqib 构建试试,看看缺啥东西
dqib 相关说明:https://people.debian.org/~gio/dqib/
吴小白
yetist 老师,这好像是网络问题,我刚才又试了下,构建没问题。。