LTSP客户端启动过程

英文原文摘自《LTSPManual.pdf》,是非常重要的一本无盘启动参考资料。
The boot process of a thin client
1. 加载Linux核到瘦客户端的内存。最流行的一种加载方式是PXE,很多网卡或者主板内置了PXE启动支持。
Load the Linux kernel into the memory of the thin client. This can be done several different ways, either by using PXE, gPXE, Etherboot, or yaboot.
Each of the above booting methods will be explained later. But for now, it should be noted that the most common booting method will usually be PXE, as many network cards, and almost all current motherboards with on-board ethernet cards support PXE booting.
2. 内核加载到内存后,便开始执行。
Once the kernel has been loaded into memory, it will begin executing.
3. 内核会初始化必要的底层设备(如:RAM)。当内核下载完后,继续下载initramfs(初始的RAM文件系统),它包含一些客户端启动需要的应用程序和shell脚本。
The kernel will initialize any low-level devices it needs, such as ram disks. When the kernel downloaded, it also downloads an "initramfs", or "initial ram filesystem", which contains some utilities and shell scripts the thin client needs to get started.
4. 内核通过执行一个小的Shell脚本使系统开始运行。该Shell脚本被称为/init,保存在initramfs的root目录下。
The kernel begins its work by executing a small shell script which will kick off the system. This shell script is called /init, and lives in the root of the initramfs.
5. /init脚本从mount /proc和/sys开始,启动udev来发现和初始化硬件,特别是网卡,它在后面启动过程中的各个方面都需要。同时,/init还创建一个小的RAM磁盘,任何需要本地存储的(如:/var 文件系统)都可以写在里面。
The /init script begins by mounting /proc and /sys, starts udev to discover and initialize hardware, especially the network card, which is needed for every aspect of the boot from here on. As well, it creates a small ram disk, where any local storage that is needed (for the /var filesystem, for instance) can be written to.
6. 配置环回的网络接口(IP: 127.0.0.1)。
The loopback network interface is configured. This is the networking interface that has 127.0.0.1 as its IP address.
7. 然后一个被称为ipconfig的DHCP客户端开始运行,向DHCP服务器发起一个查询。这个查询获取到dhcpd.conf文件提供的网关等参数信息。
A small DHCP client called ipconfig will then be run, to make another query from the DHCP server. This separate user-space query gets information supplied in the dhcpd.conf file, like the default gateway and other important parameters.
8. 当ipconfig获取到响应,响应中的信息被用来配置网络接口,和确定被mount到root的服务器。
When ipconfig gets a reply from the server, the information it receives is used to configure the Ethernet interface, and determine the server to mount the root from.
9. 到此为止,root文件系统成为一个RAM磁盘。/init脚本将通过NBD或者NFS mount一个新的root文件系统。如果是NBD,通常下载/opt/ltsp/images/i386.img映像;如果是NFS,从服务器导出的典型目录是/opt/ltsp/i386。它不能直接mount新文件系统为/,必须先mount到一个不同的目录,然后执行一次初始化,把当前的root文件系统和新的文件系统做一个交换,完成之后,文件系统就mount到/了。此时,任何正常启动过程中要写的目录,如/tmp、/var等都在这个时候从RAM磁盘mount了。
Up to this point, the root filesystem has been a ram disk. Now, the /init script will mount a new root filesystem via either NBD or NFS. In the case of NBD, the image that is normally loaded is /opt/ltsp/images/i386.img. If the root is mounted via NFS, then the directory that is exported from the server is typically /opt/ltsp/i386. It can’t just mount the new filesystem as /. It must first mount it to a separate directory.
Then, it will do a run-init, which will swap the current root filesystem for a new filesystem. When it completes, the filesystem will be mounted on /. At this point, any directories that need to be writable for regular start up to occur, like /tmp, or /var, are mounted from the ram disk at this time.
10. 一旦新的文件系统挂载完成,/init脚本的工作便做完了,开始调用真正的/sbin/init程序。
Once the mounting of the new root filesystem is complete, we are done with the /init shell script and we need to invoke the real /sbin/init program.
11. 初始化程序开始设置瘦客户端环境,并从/etc/rcS.d读取启动命令。
The init program will begin setting up the thin client environment, and reading the start up commands in /etc/rcS.d.
12. 它将执行ltsp-client-setup命令配置各种客户端环境,如:启动NBD交换、设置远程syslogging、下载一些指定的内核模块等等。
It will execute the ltsp-client-setup command which will configure many aspects of the thin client environment, such as enabling NBD swap, setting up remote syslogging, loading any specified kernel modules, etc.
13. 下一步,初始化程序将开始执行/etc/rc2.d目录中的命令。
Next, the init program will begin to execute commands in the /etc/rc2.d directory
14. 其中一个命令是ltsp-client-core,它将在客户端启动过程中运行。
One of the items in the /etc/rc2.d directory is the ltsp-client-core command that will be run while the thin client is booting.
15. lts.conf文件将被解析,文件中的属于本客户端的参数将被设置为环境变量供S20ltsp-client-core脚本使用。
The lts.conf file will be parsed, and all of the parameters in that file that pertain to this thin client will be set as environment variables for the S20ltsp-client-core script to use.
16. 如果声音被配置,则脉冲音频监控被启动,支持远端音频从服务器进行连接并在客户端播放。
If Sound is configured at this point, the pulseaudio daemon is started, to allow remote audio connections from the server to connect and play on the thin client.
17. 如果客户端启用了本地设备支持,则启动ltspfsd程序来支持服务器从本地设备(如:内存、CD-ROM等)读取数据。
If the thin client has local device support enabled, the ltspfsd program is started to allow the server to read from devices such as memory sticks or CD-Roms attached to the thin client.
18. 此时,lts.conf中定义的screen sessions会被执行,screen sessions是你希望在终端所有的虚拟显示器上启动的会话。这就是所有GNU/Linux分布式操作系统都有的标准的虚拟屏幕,即Alt+F1到Alt+F10。默认,一个标准的基于字符界面的getty将在screen 1上运行起来(lts.conf中配置的SCREEN_01)。
最好还是,如果没有其它任何东西在lts.conf中指定,一个ldm screen脚本将会在SCREEN_07上运行。LTSP显示管理器是LTSP默认的登录管理器。
At this point, any of the screen sessions you’ve defined in your lts.conf will be executed.
Screen sessions are what you want to launch on all of the virtual screens on your terminal. These are the standard virtual screens that all GNU/Linux distros have, i.e. Alt-F1, through Alt-F10. By default, a standard character based getty will be run on screen 1 (SCREEN_01 in the lts.conf file).
As well, if nothing else is specified in the lts.conf file, an ldm screen script is run on SCREEN_07. The LTSP Display Manager (ldm) is the default login manager for LTSP.
19. 如果SCREEN_07被设置为ldm,或者startx,那么X Windows系统将会被启动,给你一个图形的用户接口。
默认情况下,Xorg服务器将会自动探测硬件卡,创建一个默认的/etc/X11/xorg.conf文件在终端的ram-disk上,并且根据它(作为自定义的配置)启动xorg。
If SCREEN_07 is set to a value of ldm, or startx, then the X Windows System will be launched, giving you a graphical user interface.
By default, the Xorg server will auto-probe the card, create a default /etc/X11/xorg.conf file on the ram-disk in the terminal, and start up xorg with that custom config.
20. 如果是ldm,X server将启动一个到服务器的密文通道;如果是startx,发起一个到LTSP服务器的XDMCP查询。任何一种方式,都会在终端显示一个登录窗口。
The X server will either start an encrypted ssh tunnel to the server, in the case of ldm, or an an XDMCP query to the LTSP server, in the case of startx. Either way, a login box will appear on the terminal.
21. 此时,用户能够登录了。他们将会在服务器上获得一个会话。
这一点开始让很多人很迷惑。他们坐在瘦客户端前面,但是能够在服务器上运行一个会话。
所有他们运行的命令都将会在服务器上运行,但是输出将会显示到瘦客户端上。
At this point, the user can log in. They’ll get a session on the server.
This confuses a lot of people at first. They are sitting at a thin client, but they are running a session on the server.
All commands they run will be run on the server, but the output will be displayed on the thin client.

你可能感兴趣的:(职场,客户端,休闲,ltsp)