原生 Debian X32 虚拟机?

原生 Debian X32 虚拟机?

我正在尝试设置本机 Debian X32 虚拟机。请注意,X32 与 X86 和 X64 不同。有关详细信息,请参阅x86、x32 和 x64 架构之间的区别?在 Stack Overflow 上。其他一些发行版(如 Red Hat)为服务器提供了 X32 版本。

Debian 不提供 X32 ISO。我安装了 Debian 8.2 amd64,内核正在启动到 32 位配置:

$ dmesg | grep -i x32
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=69773d98-b9fa-4695-8392-92759d8e6094 ro syscall.x32=y syscall.x32=y quiet
[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.16.0-4-amd64 root=UUID=69773d98-b9fa-4695-8392-92759d8e6094 ro syscall.x32=y syscall.x32=y quiet
[    0.316500] Enabled x32 syscalls

Debian 的X32 端口 wiki告诉我下一步是设置 QEMU chroot。我想避免 QEMU chroot 并将其转变为本机 X32 安装。

问题:如何将此安装转变为本机 X32 安装?


虽然我正在启动为 X32 配置的内核,但是用户空间工具不是以这种方式配置。例如,编译器可能对我来说是最重要的,但它没有针对 X32 进行配置:

$ g++ -march=native -dM -E - </dev/null | egrep "(x86_64|amd64|ilp)"
#define __x86_64 1
#define __amd64 1
#define __x86_64__ 1
#define __amd64__ 1

我没有看到ILP32__ILP32__,这意味着我没有处于 X32 模式。更改-march=native-mx32没有任何区别。


这是机器:

$ uname -a
Linux debian8-x32q 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux

这是我的sources.list。但不清楚我应该启用什么才能获取 X32 二进制文件而不是 X64 二进制文件:

deb http://ftp.us.debian.org/debian/ jessie main
deb-src http://ftp.us.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ jessie-updates main
deb-src http://ftp.us.debian.org/debian/ jessie-updates main

以下工作:

$ sudo dpkg --add-architecture x32

但它打破了APT:

$ sudo apt-get update
Ign http://ftp.us.debian.org jessie InRelease
Hit http://ftp.us.debian.org jessie-updates InRelease 
Hit http://ftp.us.debian.org jessie Release.gpg                        
Hit http://ftp.us.debian.org jessie Release                            
Hit http://security.debian.org jessie/updates InRelease              
Hit http://ftp.us.debian.org jessie-updates/main Sources             
Get:1 http://ftp.us.debian.org jessie-updates/main amd64 Packages/DiffIndex [367 B]
Get:2 http://ftp.us.debian.org jessie/main Sources [7,058 kB]
Hit http://security.debian.org jessie/updates/main Sources
Hit http://security.debian.org jessie/updates/main amd64 Packages     
Hit http://ftp.us.debian.org jessie/main amd64 Packages 
Fetched 7,058 kB in 3s (2,066 kB/s)          
W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease  Unable to find expected entry 'main/binary-x32/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ftp.us.debian.org/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'main/binary-x32/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ftp.us.debian.org/debian/dists/jessie/Release  Unable to find expected entry 'main/binary-x32/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.

如果重要的话,我会通过 SSH 进入盒子。我不关心窗口管理器和其他未移植的 GUI 程序。我基本上需要内核、基本安装和构建工具处于 X32 模式,这样我就可以在 X32 下测试我的软件。

相关内容