1.1.1 dnsmasq 方式
1.1.1.1 安裝dnsmasq
/# sudo apt-get install dnsmasq
1.1.1.2 修改配置文件
/# sudo vim /etc/dnsmasq.conf
Listen-address=192.168.1.1
interface=enp5s0 // 要使用的網(wǎng)卡節(jié)點(diǎn)
bind-interfaces
dhcp-range=192.168.1.10,192.168.1.100,255.255.255.0,8h
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.1
dhcp-option=28,192.168.1.255
dhcp-option=42,0.0.0.0
enable-tftp
dhcp-match=set:Intel_x86PC,option:client-arch,0
dhcp-boot=tag:Intel_x86PC,x86_64-legacy/pxelinux.0
dhcp-match=set:EFI_BC,option:client-arch,7
dhcp-boot=tag:EFI_BC,x86_64-efi/netbootx64.efi
dhcp-match=set:EFI_x86_64,option:client-arch,9
dhcp-boot=tag:EFI_x86_64,x86_64-efi/netbootx64.efi
dhcp-match=set:EFI_Arm64,option:client-arch,11
dhcp-boot=tag:EFI_Arm64,arm64-efi/netbootaa64.efi
dhcp-match=set:Mips,option:client-arch,12
tftp-root=/var/lib/tftpboot // -----提前建好目錄
1.1.1.3 tftpd 中的文件放置
創(chuàng)建tftp 根目錄
/# mkdir /var/lib/tftpboot
arm64.tar.gz //---- 已經(jīng) 獲得
如果目標(biāo)安裝機(jī)器為新四核或者鯤鵬,則將arm64.tar.gz 解壓出來的
arm64-efi 目錄拷貝至tftp 根目錄下;并將系統(tǒng)iso 中casper/下的initrd.img 和Image
放到arm64-efi/casper 下。
請(qǐng)注意對(duì)應(yīng)修改boot/grub/grub.cfg 或pxelinux.cfg/default 或KlConfig.cfg 或
pxelinux.0 或者grub2/grub.cfg 中nfsroot 的IP 地址!
1.1.1.4 啟動(dòng)dnsmasq 服務(wù)
/# sudo systemctl restart dnsmasq
查看服務(wù)狀態(tài):
/# systemctl status dnsmasq
security=
1.1.2 tftp+dhcp 方式
1.1.2.1 tftp 服務(wù)器搭建
安裝tftp 相關(guān)包:
/# sudo apt-get install tftp-hpa tftpd-hpa
修改配置文件:
將/var/lib/tftpboot 設(shè)為tftp 的根目錄
/# vim /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-l -c -s"
如果目標(biāo)安裝機(jī)器為新四核或者鯤鵬,則將arm64.tar.gz 解壓出來的
arm64-efi 目錄拷貝至tftp 根目錄下;并將iso 中casper/下的initrd.img 和Image
放到arm64-efi/casper 下。
請(qǐng)注意對(duì)應(yīng)修改boot/grub/grub.cfg 或pxelinux.cfg/default 或KlConfig.cfg 或
pxelinux.0 或者grub2/grub.cfg 中nfsroot 的IP 地址!
重啟服務(wù):
/# sudo systemctl restart tftpd-hpa
1.1.2.2 tftp 測(cè)試
以arm64-efi/netbootaa64.efi 為例:
/# tftp 127.0.0.1
>get /var/lib/tftpboot/arm64
-efi/netbootaa64.efi
>quit
查看獲取的文件,不報(bào)錯(cuò)且文件大小正常,則說明配置成功。
/# ll netbootaa64.efi
-rw-rw-r-- 1 kylin kylin 1958400 5 月13 15:36 netbootaa64.efi
1.1.2.3 dhcp 服務(wù)器搭建
安裝dhcp 相關(guān)包:
/# sudo apt-get install isc-dhcp-server isc-dhcp-client
修改配置文件:
/# vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
option space PXE;
option client-system-arch code 93 = unsigned integer 16;
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.1.1;
filename "arm64-efi/netbootaa64.efi";
}
設(shè)置使用的網(wǎng)絡(luò)設(shè)備,若使用eth0,則:
/# vim /etc/default/isc-dhcp-server
INTERFACES="eth0"
重啟服務(wù):
/# sudo systemctl restart isc-dhcp-server
1.2 nfs 服務(wù)搭建
1.2.1 安裝nfs 相關(guān)包
/# sudo apt-get install nfs-kernel-server
1.2.2 修改配置文件
將/opt/nfs 設(shè)置為nfs 的根目錄:
/# vim /etc/exports
/opt/nfs *(rw,sync,no_root_squash,no_subtree_check)
1.2.3 文件放置
在/opt/nfs/創(chuàng)建一個(gè)iso 目錄:
目標(biāo)安裝機(jī)器為鯤鵬或者飛騰新四核架構(gòu):
/# mkdir -p /opt/nfs/aarch64-kylin
將整個(gè)iso 掛載后的內(nèi)容對(duì)應(yīng)拷貝至上述目錄下。請(qǐng)注意隱藏文件和隱藏
文件夾的拷貝。
1.2.4 重啟服務(wù)
/# sudo systemctl restart nfs-kernel-server
2 客戶端操作
開機(jī),等待固件就緒,在固件啟動(dòng)階段根據(jù)相應(yīng)提示進(jìn)入PXE 網(wǎng)絡(luò)引導(dǎo)模
式(如無該功能,請(qǐng)聯(lián)系固件提供相應(yīng)支持)。
如果是UEFI PXE,則等待一小段時(shí)間后會(huì)顯示grub 菜單,選擇Net Install
Kylin, 等待進(jìn)入系統(tǒng),開始安裝;
sudo iptables -F
sudo systemctl status nfs-kernel-server
sudo systemctl status tftpd-hpa
sudo systemctl status isc-dhcp-server
sudo systemctl restart nfs-kernel-server
sudo systemctl restart networking
sudo systemctl restart tftpd-hpa
sudo systemctl status tftpd-hpa
sudo systemctl restart isc-dhcp-server
sudo systemctl status isc-dhcp-server
set default=0
set timeout=5
set color_normal=white/black
set color_highlight=black/light-gray
menuentry "GRG Try Kylin-Desktop without installing" {
linux ${root}/casper/Image boot=casper ro locale=zh_CN KEYBOARDTYPE=pc KEYTABLE=us console=tty audit=0 netboot=nfs nfsroot=192.168.1.1:/opt/nfs/aarch64-kylin/ security=
initrd ${root}/casper/initrd.img
}
menuentry "GRG Install Kylin-Desktop" {
linux ${root}/casper/Image boot=casper only-ubiquity ro locale=zh_CN KEYBOARDTYPE=pc KEYTABLE=us console=tty audit=0 netboot=nfs nfsroot=192.168.1.1:/opt/nfs/aarch64-kylin/ security=
initrd ${root}/casper/initrd.img
}
menuentry "GRG Install uos" {
set gfxpayload=keep
linux ${root}/casper-uos/live/vmlinuz console=tty boot=live netboot=nfs nfsroot=192.168.1.1:/opt/nfs/arm64-uos/ components union=overlay locales=zh_CN.UTF-8 livecd-installer --
initrd ${root}/casper-uos/live/initrd.img
}
menuentry "GRG Try uos without installing" {
set gfxpayload=keep
linux ${root}/casper-uos/live/vmlinuz console=tty boot=live union=overlay quiet splash --
initrd ${root}/casper-uos/live/initrd.img
}
menuentry "Install uos" {
set gfxpayload=keep
linux /debian-installer/deepin/live/vmlinuz console=tty boot=live netboot=nfs nfsroot=192.168.0.1:/var/nfs/deepin/ components union=overlay locales=zh_CN.UTF-8 livecd-installer --
initrd /debian-installer/deepin/live/initrd.img
}
menuentry "Try uos without installing" {
set gfxpayload=keep
linux /debian-installer/deepin/live/vmlinuz console=tty boot=live union=overlay quiet splash --
initrd /debian-installer/deepin/live/initrd.img
}
聯(lián)系客服