ArchLinux安装指南,模板等。
archinstall的Python项目详细描述
只是另一个引导/自动的Arch Linux安装程序。 安装程序还兼作python库,用于安装archlinux并管理已安装系统(通常来自活动介质)中的服务、包和其他内容。在
预构建的ISO可以在https://archlinux.life上找到,它自动启动archinstall (在安全引导模式下)。在
- archinstalldiscord服务器
- archinstallmatrix.org频道
- 建筑#archinstall@freenode (IRC)
- 架构documentation
- 架构ISO:https://archlinux.life/
安装和使用
$ sudo pip install archinstall
或者简单地git clone
回购,因为它没有外部依赖关系(但有可选的)
或者以archinstall-v[ver].tar.gz
的形式运行每个版本中附加的预编译二进制文件。在
上面所有的场景都有PKGBUILD
。
在非官方的mirrorhttps://archlinux.life上,它们也可以作为archlinux包提供。在
运行guided安装程序
假设您使用的是ArchLinuxLiveISO并引导到EFI模式。在
^{pr2}$编写自己的安装脚本
您可以复制guided.py作为起点。在
但假设您正在构建自己的ISO并希望创建自动安装过程,或者您希望在本地磁盘映像上安装虚拟机。
这可能是您所需要的,关于如何使用archinstall作为Python库进行安装的minimal example。在
importarchinstall,getpass# Select a harddrive and a disk passwordharddrive=archinstall.select_disk(archinstall.all_disks())disk_password=getpass.getpass(prompt='Disk password (won\'t echo): ')witharchinstall.Filesystem(harddrive,archinstall.GPT)asfs:# use_entire_disk() is a helper to not have to format manuallyfs.use_entire_disk('luks2')harddrive.partition[0].format('fat32')witharchinstall.luks2(harddrive.partition[1],'luksloop',disk_password)asunlocked_device:unlocked_device.format('btrfs')witharchinstall.Installer(unlocked_device,hostname='testmachine')asinstallation:ifinstallation.minimal_installation():installation.add_bootloader(harddrive.partition[0])installation.add_additional_packages(['nano','wget','git'])installation.install_profile('workstation')installation.user_create('anton','test')installation.user_set_pw('root','toor')
此安装程序将执行以下操作:
- 提示用户选择磁盘和磁盘密码
- 继续使用
GPT
分区表擦除所选磁盘。在 - 设置带加密的默认100%已用磁盘。在
- 安装Arch Linux(base base devel Linux固件btrfs progs efibootmgr)的基本实例
- 安装并配置分区0的引导加载器。在
- 安装其他软件包(nano,wget,git)
- 安装名为workstation的网络配置文件(有关网络配置文件的详细信息,请参阅文档)
Creating your own ISO with this script on it: Follow ArchISO's guide on how to create your own ISO or use a pre-built guided ISO to skip the python installation step, or to create auto-installing ISO templates. Further down are examples and cheat sheets on how to create different live ISO's.
帮助
在Github上提交问题,或在discord帮助频道中提交帖子。
执行此操作时,请将任何install-session_*.log
附加到可在~/.cache/archinstall/
下找到的问题票据。在
测试
要想在没有实时ISO的情况下进行测试,最简单的方法是使用本地映像并创建循环设备。
这可以通过在本地安装pacman -S arch-install-scripts util-linux
并执行以下操作来完成:
# dd if=/dev/zero of=./testimage.img bs=1G count=5
# losetup -fP ./testimage.img
# losetup -a | grep "testimage.img" | awk -F ":" '{print $1}'
# pip install --upgrade archinstall
# python -m archinstall guided
# qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd
这将创建一个5GBtestimage.img
并创建一个循环设备,我们可以使用它来格式化和安装到该设备。archinstall
在guided mode中安装和执行。安装完成后,
在这个测试中,你不需要使用这个测试的方法
您还可以使用pip和python运行预构建的ISO
# qemu-system-x86_64 -enable-kvm -cdrom /home/user/Downloads/archinstall-2020.07.08-x86_64.iso -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd
一旦进去,就去做
# python -m archlinux guided
- 项目
标签: