天天看點

LTSP用戶端啟動過程 翻譯sinojelly2009-09-13 00:05:00評論(0

英文原文摘自《LTSPManual.pdf》,是非常重要的一本無盤啟動參考資料。

<b>The boot process of a thin client</b><b></b>

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.

本文轉sinojelly51CTO部落格,原文連結:http://blog.51cto.com/sinojelly/201322,如需轉載請自行聯系原作者

繼續閱讀