我在找关于如何手动安装Linux的指南.
如果没有经典的辅助装置..。
通过将文件从源复制到目标媒体.
并配置最低要求的设置。
(这是供教育用的)
任何现代发行版,如拱门/高山/卡利/乌班图-最小/.
?有人能告诉我关于这个话题的一些文件/视频吗?
谢谢
发布于 2020-04-11 10:24:19
您可以从引导映像开始。这里有一些名字和尺寸不同的。
]# ls *.iso -dsh
607M OL-x86_64-boot-uek.iso
603M archlinux-2019.01.01-x86_64.iso
258M install-gentoo_minimal.iso
2.6G slackware64-14.2-install-dvd.iso
882M ubuntu-18.10-live-server-amd64.iso即使没有-o loop (但首先使用mkdir MNTPOINT,即目录),也可以循环挂载这样的ISO映像:
]# mount install-gentoo_minimal.iso iso
mount: /root/sda1/LINUX/iso: WARNING: device write-protected, mounted read-only.
]# ls iso
README.txt boot gentoo.efimg grub image.squashfs isolinux livecd这些档案是必不可少的:
]# ls -lh iso/isolinux/gentoo* iso/gentoo.efimg iso/image.squashfs
-rw-r--r-- 1 root root 6.4M Jan 9 2019 iso/gentoo.efimg
-rw-r--r-- 1 root root 236M Jan 9 2019 iso/image.squashfs
-rw-r--r-- 1 root root 3.8M Jan 9 2019 iso/isolinux/gentoo
-rw-r--r-- 1 root root 5.1M Jan 9 2019 iso/isolinux/gentoo.igz再次声明:创建挂载点(dir)后的mount [-o loop] iso/gentoo.efimg img/ (例如"img/“)。然后你得到:
]# file img/EFI/BOOT/*
img/EFI/BOOT/BOOTIA32.EFI: PE32 executable (EFI application) Intel 80386 (stripped to external PDB), for MS Windows
img/EFI/BOOT/BOOTX64.EFI: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
img/EFI/BOOT/grubia32.efi: PE32 executable (EFI application) Intel 80386 (stripped to external PDB), for MS Windows
img/EFI/BOOT/grubx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
img/EFI/BOOT/mmia32.efi: PE32 executable (EFI application) Intel 80386 (stripped to external PDB), for MS Windows
img/EFI/BOOT/mmx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows这些是EFI引导加载器的不同变体。另一种选择是使用Uefi (或MBR.)。但这是BOOTX64.EFI等人。
这是一个Squashfs filesystem,根据扩展和file命令。因此,您(循环)挂载它就像一个iso映像。
它包含根分区的文件。
]# ldd sq/bin/bash
linux-vdso.so.1 (0x00007fffe97ef000)
libreadline.so.7 => not found
libc.so.6 => /usr/lib/libc.so.6 (0x00007f0d4e221000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f0d4e6c5000)
]# ./sq/bin/bash
./sq/bin/bash: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directory这表明普通的/bin/bash还需要一些库、版本和链接。
]# file iso/isolinux/gentoo
iso/isolinux/gentoo: Linux kernel x86 boot executable bzImage, version 4.14.83-gentoo (root@catalyst) #1 SMP Wed Jan 9 01:58:22 UTC 2019, RO-rootFS, swap_dev 0x3, Normal VGA内核(bzImage)。使用Uefi,您只需将其复制到ESP。否则(MBR)到一些dir然后grub-.,
压缩的initrd。使用xz和cpio -t,您可以列出:
]# xz -cd iso/isolinux/gentoo.igz | cpio -t lib/modu\*
lib/modules
lib/modules/4.14.83-gentoo
lib/modules/4.14.83-gentoo/modules.order
lib/modules/4.14.83-gentoo/modules.symbols
...在iso上有一个grub/grub.cfg。
menuentry 'Boot LiveCD (kernel: gentoo)' --class gnu-linux --class os {
linux /isolinux/gentoo root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs
initrd /isolinux/gentoo.igz在将bash和四个库/依赖项(参见上面的ldd )复制到格式化分区sdXY之后,您将得到以下3个引导参数:
gentoo
root=/dev/sdXY
init=/bin/bash
initrd=gentoo.igz您的要点3)和4) (dir和config文件)是次要的,为了进行最小的实验。如果不是那么少,那就等于创造了一个新的发行版.
主要的困难是引导过程本身,仅仅因为有许多可能性,再加上MBR和UEFI。我遗漏了一个init/systemd和登录。分区也是,但这是(或应该,逻辑上)脱离安装无论如何。事实上,除了/bin/bash之外,我遗漏了所有的东西。
这是一种避免“经典辅助设置”的方法,并从零开始执行除编译之外的所有操作。
我以gentoo为例,仅仅是因为它是建议的。除了大小之外,顶部列出的.iso文件非常相似。您可以从任何一个二进制文件中提取二进制文件,如图所示。
https://unix.stackexchange.com/questions/579306
复制相似问题