如果您有DVD刻录机,可以选择从 Loongnix 镜像站点下载Loongnix系统镜像,然后使用刻录工具刻录镜像(推荐Loongnix自带刻录工具brasero)。
建议使用大于4G的U盘,从 Loongnix镜像站点下载系统镜像,然后在Linux下使用DD命令制作安装U盘。 Loongnix系统可启动终端,使用dd命令进行镜像制作。镜像制作命令如下:
dd if=镜像文件地址 of=/dev下识别的U盘设备 bs=8M && sync
镜像制作举例:
镜像文件为:/home/loongson/Loongnix-20.3.livecd.mate.loongarch64.iso系统下识别的U盘设备: /dev/sdb (可通过fdisk -l或者lsblk命令查看)镜像制作命令:dd if=/home/loongson/Loongnix-20.3.livecd.mate.loongarch64.iso of=/dev/sdb bs=8M && sync
可以选择从 Loongnix镜像站点 下载Loongnix系统网络安装镜像进行网络安装。
PXE全称是Pre-boot Execution Environment,即预启动执行环境,是工作在基于Client/Server的网络模式下,PXE支持客户机通过网络从远端服务器下载启动镜像,并由此通过网络引导启动并安装操作系统。目前只支持在UEFI、昆仑中固件上使用PXE安装,同时UEFI固件还要支持从网卡启动,同时网卡还必须要支持PXE功能,安装网络环境中至少还要有一台服务器,需要在服务器上部署DHCP服务、TFTP服务和HTTP/NFS服务。
1、配置apt源
echo "deb http://pkg.loongnix.cn/loongnix DaoXiangHu-stable main contrib non-free" >> /etc/apt/sources.list apt-get update
2、安装dhcp服务
apt-get install -y isc-dhcp-server
3、配置dhcp服务
DHCP服务所有参数都是通过修改/etc/dhcp/dhcpd.conf 文件来实现,安装后dhcpd.conf 是没有做任何配置的,需要进行配置,如下是/etc/dhcp/dhcpd.conf文件中试例:
option domain-name "loongson.org"; subnet 192.168.0.0 netmask 255.255.255.0 { ignore-client-uids on; next-server 192.168.0.1; range 192.168.0.10 192.168.0.20; option routers 192.168.0.254; filename "boot/EFI/loongarch-efi/core.efi"; default-lease-time 600; max-lease-time 7200; }
注:core.efi文件将在2.4节介绍。
1、安装tftp服务
apt-get install -y tftpd-hpa
2、配置tftp服务
将下列配置项配置到/etc/default/tftpd-hpa文件中:
TFTP_USERNAME="tftp"TFTP_DIRECTORY="/srv/tftp"TFTP_ADDRESS="0.0.0.0:69"TFTP_OPTIONS="--secure"
注:对于 tftpd-hpa 有两种方式可以启动服务。它可以通过系统的 inetd 守护程序启动(需要修改/etc/inet.conf文件),或者设置为独立的守护程序。这可以在安装软件包的时候选择,也可以用重新配置软件包方式修改,当前方法为后者,使用重新配置软件方法。
1、安装http服务
apt-get install -y apache2
2、搭建apt本地源
通过挂载镜像的方式创建本地源
mount Loongnix-20.3.netinst.mate.loongarch64.iso /var/www/html
1、创建core.efi文件
grub-mkimage -v -o core.efi -O loongarch64-efi -p /boot/EFI ext2 fat iso9660 part_msdos part_gpt configfile cat echo sleep test halt reboot minicmd search font loadenv linux efinet tftp
注意:如拥有镜像,可直接挂载镜像至/var/www/html/目录下,命令如下:
mount Loongnix-20.3.netinst.mate.loongarch64.iso /var/www/htmlcp /var/www/html/boot /srv/tftp/ -a
下列是/srv/tftp目录结构
srv└── tftp └── boot ├── EFI │ ├── BOOT │ │ └── BOOTLOONGARCH.EFI │ ├── grub.cfg │ └── loongarch-efi │ └── core.efi ├── initrd.netboot.gz ├── initrd.pxe.cn.gz ├── initrd.pxe.en.gz └── vmlinuz.41990
下列是/srv/tftp/boot/EFI/grub.cfg文件示例
set default="0"set timeout=5function load_video { insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video}load_videoinsmod gzioinsmod part_gptinsmod ext2search --no-floppy --set=root -l 'LOONGSONISO'menuentry 'PXE Install Chinese Loongnix' --class gnu-linux --class gnu --class os { echo 'Loading kernel ...' linux /boot/vmlinuz.41990 debconf/priority=critical preseed/url=http://192.168.0.1/preseed.txt echo 'Loading initrd ...' initrd /boot/initrd.pxe.cn.gz boot}menuentry 'PXE Install English Loongnix' --class gnu-linux --class gnu --class os { echo 'Loading kernel ...' linux /boot/vmlinuz.41990 debconf/priority=critical preseed/url=http://192.168.0.1/preseed.txt echo 'Loading initrd ...' initrd /boot/initrd.pxe.en.gz boot}menuentry 'Netboot Install Loongnix' --class gnu-linux --class gnu --class os { echo 'Loading kernel ...' linux /boot/vmlinuz.41990 echo 'Loading initrd ...' initrd /boot/initrd.netboot.gz boot}
注:preseed/url=http://192.168.0.1/preseed.txt 为PXE服务端中自动化安装配置文件,一般存放在PXE服务端中/var/www/html下。
d-i debian-installer/locale string zh_CNd-i debian-installer/language string zh_CN:zhd-i debian-installer/country string CNd-i debian-installer/locale string zh_CN.UTF-8d-i localechooser/supported-locales multiselect zh_CN.UTF-8,en_US.UTF-8d-i keyboard-configuration/xkb-keymap select zhd-i netcfg/enable boolean true#d-i netcfg/choose_interface select dhcpd-i netcfg/choose_interface select autod-i netcfg/link_wait_timeout string 20d-i netcfg/dhcp_timeout string 20d-i netcfg/dhcpv6_timeout string 20d-i netcfg/disable_autoconfig boolean falsed-i netcfg/get_hostname string loongsond-i netcfg/get_domain string loongson.cnd-i netcfg/hostname stringd-i netcfg/wireless_wep stringd-i mirror/country string manuald-i mirror/http/hostname string 192.168.0.1d-i mirror/http/directory string /loongnixd-i mirror/http/proxy stringd-i passwd/root-login boolean falsed-i passwd/make-user boolean trued-i passwd/root-password password loongsond-i passwd/root-password-again password loongsond-i passwd/root-password-crypted password $6$0hBQLVlNILNj2tVf$bE8H6cqkYOQQ57Y0VcPt.cCbtm1f8zLzVCO08.TKo9jrwSmLiOqbWMx.GIoo.quYRxkorG37aGbg50Cc6jBCe0d-i passwd/user-fullname string loongsond-i passwd/username string loongsond-i passwd/user-password password loongsond-i passwd/user-password-again password loongsond-i passwd/user-password-crypted password $6$0hBQLVlNILNj2tVf$bE8H6cqkYOQQ57Y0VcPt.cCbtm1f8zLzVCO08.TKo9jrwSmLiOqbWMx.GIoo.quYRxkorG37aGbg50Cc6jBCe0d-i passwd/user-uid string 1001d-i user-setup/allow-password-weak boolean falsed-i user-setup/encrypt-home boolean falsed-i passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashared-i clock-setup/cst boolean trued-i time/zone string Asia/ShangHaid-i clock-setup/ntp boolean trued-i partman-auto/method string regulard-i partman-auto-lvm/guided_size string maxd-i partman-lvm/device_remove_lvm boolean trued-i partman-lvm/confirm boolean trued-i partman-lvm/confirm_nooverwrite boolean trued-i partman/default_filesystem string ext4d-i partman-auto/choose_recipe select multid-i partman-basicfilesystems/choose_label gptd-i partman-partitioning/confirm_write_new_label boolean trued-i partman/choose_partition select finishd-i partman/confirm boolean trued-i partman/confirm_nooverwrite boolean trued-i partman-auto-crypto/erase_disks boolean falsed-i partman/mount_style select uuidd-i apt-setup/services-select select falsetasksel tasksel/first multiselect standard, desktop, mate-desktop, print-serverd-i pkgsel/include string openssh-server vim gnome-system-tools lbrowser brasero synaptic ffmpeg smplayer rhythmbox gnome-system-tools system-config-printer cups grub-efi-loongarch64 mtpaint wps-office locate ed lpr pax font-manager mate-indicator-applet hardinfo selinux-basics system-update-applet qemu less fonts-wqy-zenhei fonts-cesi fcitx-tools fcitx-ui-classic libvirt0 gir1.2-spiceclientgtk-3.0 remmina luckybackup blueman imwheel-gui nethogs arc-theme ayatana-indicator-notifications breeze-cursor-theme mate-applet-brisk-menu fcitx-module-lua fcitx-table-all fcitx-table-bingchan fcitx-table-cangjie fcitx-table-dianbaoma fcitx-table-erbi fcitx-table-wanfeng fcitx-table-ziranma libfcitx-utils0 file-roller fonts-noto-cjk gedit gedit-common gnome-calendar gnome-control-center gnome-control-center-data gnome-packagekit gnome-packagekit-data ayatana-indicator-common libayatana-indicator3-tools libayatana-indicator7 gir1.2-wnck-3.0 loongnix-edu-default-settings gir1.2-mate-panel gir1.2-matepanelapplet-4.0 debian-mate-default-settings mate-session-manager python3-software-properties software-properties-common software-properties-gtk software-properties-kde gir1.2-udisks-2.0 udisks2-bcache udisks2-btrfs udisks2-lvm2 udisks2-vdo udisks2-zram at dpdk libloongson-ipsec-mb thunderbird thunderbird-l10n-zh-cn lightning-l10n-zh-cn electronic-wechat stardict loongsonchat loongsonapplication appinstaller loongsonweather loongnix-src-configd-i grub-installer/only_debian boolean trued-i grub-installer/with_other_os boolean true
1、在含有支持PXE安装的UEFI固件的服务器或工作站,进入EFI界面,当前实例机器摁F2即可进入该界面
2、在EFI界面选择Device Manager --> Network Control --> Pxe Control,将disable变成enable,如下图
系统安装完毕,会有提示是否现在重启机器,重启机器即可