安装方式


1. DVD安装

如果您有DVD刻录机,可以选择从 Loongnix 镜像站点下载Loongnix系统镜像,然后使用刻录工具刻录镜像(推荐Loongnix自带刻录工具brasero)。

2. U盘安装

建议使用大于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

3. 网络安装

可以选择从 Loongnix 镜像站点 下载Loongnix系统网络安装镜像进行网络安装。

4. Loongnix PXE搭建手册

4.1. PXE简介

PXE全称是Pre-boot Execution Environment,即预启动执行环境,是工作在基于Client/Server的网络模式下,PXE支持客户机通过网络从远端服务器下载启动镜像,并由此通过网络引导启动并安装操作系统。目前只支持在UEFI、昆仑中固件上使用PXE安装,同时UEFI固件还要支持从网卡启动,同时网卡还必须要支持PXE功能,安装网络环境中至少还要有一台服务器,需要在服务器上部署DHCP服务、TFTP服务和HTTP/NFS服务。

4.2. PXE环境搭建

搭建dhcp服务

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节介绍。

搭建tftp服务

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文件),或者设置为独立的守护程序。这可以在安装软件包的时候选择,也可以用重新配置软件包方式修改,当前方法为后者:使用重新配置软件方法。

搭建http服务

1、安装http服务

apt-get install -y apache2

2、搭建apt本地源

通过挂载镜像的方式创建本地源。

mount  Loongnix-20.3.netinst.mate.loongarch64.iso   /var/www/html

创建并配置PXE启动文件

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/html
cp  /var/www/html/boot  /srv/tftp/  -a

/srv/tftp目录结构

  • 下列是/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=5

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video
}

load_video
insmod gzio
insmod part_gpt
insmod ext2

search --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下。

preseed文件示例

d-i debian-installer/locale string zh_CN

d-i debian-installer/language string zh_CN:zh
d-i debian-installer/country string CN
d-i debian-installer/locale string zh_CN.UTF-8
d-i localechooser/supported-locales multiselect zh_CN.UTF-8,en_US.UTF-8

d-i keyboard-configuration/xkb-keymap select zh

d-i netcfg/enable boolean true

#d-i netcfg/choose_interface select dhcp

d-i netcfg/choose_interface select auto

d-i netcfg/link_wait_timeout string 20

d-i netcfg/dhcp_timeout string 20
d-i netcfg/dhcpv6_timeout string 20

d-i netcfg/disable_autoconfig boolean false


d-i netcfg/get_hostname string loongson
d-i netcfg/get_domain string loongson.cn

d-i netcfg/hostname string

d-i netcfg/wireless_wep string

d-i mirror/country string manual
d-i mirror/http/hostname string 192.168.0.1
d-i mirror/http/directory string /loongnix
d-i mirror/http/proxy string

d-i passwd/root-login boolean false
d-i passwd/make-user boolean true

d-i passwd/root-password password loongson
d-i passwd/root-password-again password loongson
d-i passwd/root-password-crypted password $6$0hBQLVlNILNj2tVf$bE8H6cqkYOQQ57Y0VcPt.cCbtm1f8zLzVCO08.TKo9jrwSmLiOqbWMx.GIoo.quYRxkorG37aGbg50Cc6jBCe0

d-i passwd/user-fullname string loongson
d-i passwd/username string loongson
d-i passwd/user-password password loongson
d-i passwd/user-password-again password loongson
d-i passwd/user-password-crypted password $6$0hBQLVlNILNj2tVf$bE8H6cqkYOQQ57Y0VcPt.cCbtm1f8zLzVCO08.TKo9jrwSmLiOqbWMx.GIoo.quYRxkorG37aGbg50Cc6jBCe0
d-i passwd/user-uid string 1001

d-i user-setup/allow-password-weak  boolean false
d-i user-setup/encrypt-home boolean false

d-i passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashare

d-i clock-setup/cst boolean true

d-i time/zone string Asia/ShangHai

d-i clock-setup/ntp boolean true

d-i partman-auto/method string regular

d-i partman-auto-lvm/guided_size string max

d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman/default_filesystem string ext4

d-i partman-auto/choose_recipe select multi

d-i partman-basicfilesystems/choose_label gpt

d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-auto-crypto/erase_disks boolean false
d-i partman/mount_style select uuid
d-i apt-setup/services-select select false
tasksel tasksel/first multiselect standard, desktop, mate-desktop, print-server
d-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-config
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

4.3. PXE安装步骤

EFI中配置PXE启动

1、在含有支持PXE安装的UEFI固件的服务器或工作站,进入EFI界面,当前示例机器按F2即可进入该界面 size:800,1000

2、在EFI界面选择Device Manager --> Network Control --> Pxe Control,将disable变成enable,如下图 size:800,1000 size:800,1000

3、进入grub界面,选择PXE安装 size:800,1000

PXE镜像正在安装

size:800,1000

PXE安装结束

系统安装完毕,会有提示是否现在重启机器,重启机器即可。

©龙芯开源社区 all right reserved,powered by Gitbook文档更新时间: 2024-11-08 10:27:22

results matching ""

    No results matching ""

    results matching ""

      No results matching ""