原生 Debian X32 虛擬機器?

原生 Debian X32 虛擬機器?

我正在嘗試設定本機 Debian X32 虛擬機器。請注意,X32 與 X86 和 X64 不同。詳細資訊請參見x86、x32 和 x64 架構之間的差異?在堆疊溢位上。其他一些發行版(例如 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 連接埠維基告訴我下一步是設定 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 下測試我的軟體。

相關內容