ello,大家好啊!**在个性化和定制化日益成为趋势的今天,操作系统的定制化安装也变得越来越重要。特别是对于企业用户来说,能够根据不同的硬件配置和需求,安装定制化的操作系统,无疑能大大提高工作效率和用户体验。今天,我要给大家介绍的是如何制作麒麟(Kylin) OEM镜像,并且根据终端品牌与BIOS信息安装不同的内容。
为什么要制作麒麟OEM镜像?
制作OEM镜像的主要目的是为了在安装操作系统时,能够根据不同的硬件或用户需求自动执行特定的设置或安装特定的软件。这在大规模部署时尤为重要,比如在不同型号的电脑上安装预定的驱动程序,或者为特定的用户群体安装特定的软件包。通过制作定制化的麒麟OEM镜像,企业和组织可以大大简化操作系统的部署过程,并确保每台机器都能获得最适合其硬件和用途的配置和软件。这不仅提高了效率,也优化了用户体验。希望这篇文章能帮助到需要进行大规模系统部署的朋友们。如果你有任何问题或者更多的经验分享,请在评论区留言,我们一起讨论。
如果你觉得这篇文章有用,别忘了分享转发,点个关注和在看哦!让我们一起探索和学习更多关于Linux系统定制化的知识!
1、查看镜像制作使用的操作系统信息
root@pdsyw-pc:~# uname -a
Linux pdsyw-pc 5.4.18-85-generic #74-KYLINOS SMP Fri Mar 24 11:20:19 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
root@pdsyw-pc:~#
root@pdsyw-pc:~# cat /etc/os-release
NAME="Kylin"
VERSION="银河麒麟桌面操作系统V10 (SP1)"
VERSION_US="Kylin Linux Desktop V10 (SP1)"
ID=kylin
ID_LIKE=debian
PRETTY_NAME="Kylin V10 SP1"
VERSION_ID="v10"
HOME_URL="http://www.kylinos.cn/"
SUPPORT_URL="http://www.kylinos.cn/support/technology.html"
BUG_REPORT_URL="http://www.kylinos.cn/"
PRIVACY_POLICY_URL="http://www.kylinos.cn"
VERSION_CODENAME=kylin
UBUNTU_CODENAME=kylin
PROJECT_CODENAME=V10SP1
KYLIN_RELEASE_ID="2303"
root@pdsyw-pc:~#
2、创建目录并挂载镜像
root@pdsyw-pc:/data# mkdir x86-2303
root@pdsyw-pc:/data#
root@pdsyw-pc:/data# mount /home/pdsyw/Kylin-Desktop-V10-SP1-General-Release-2303-X86_64.iso /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
root@pdsyw-pc:/data#
root@pdsyw-pc:/data# cp -ra /mnt/. x86-2303/
root@pdsyw-pc:/data# cd x86-2303/
root@pdsyw-pc:/data/x86-2303#
3、挂载后的镜像内容
root@pdsyw-pc:/data/x86-2303# ll
总用量 216
dr-xr-xr-x 10 root root 4096 4月 27 2023 ./
drwxrwxrwt 7 root root 4096 11月 28 16:40 ../
dr-xr-xr-x 5 root root 4096 4月 27 2023 apps-third/
-r--r--r-- 1 root root 27 3月 4 2020 AUTORUN.INF
dr-xr-xr-x 3 root root 4096 2月 21 2020 boot/
dr-xr-xr-x 2 root root 4096 4月 27 2023 casper/
dr-xr-xr-x 2 root root 4096 4月 27 2023 .disk/
dr-xr-xr-x 3 root root 4096 4月 27 2023 dists/
dr-xr-xr-x 3 root root 4096 4月 27 2023 EFI/
dr-xr-xr-x 2 root root 4096 4月 27 2023 isolinux/
-r--r--r-- 1 root root 262 4月 27 2023 .kyinfo
-r--r--r-- 1 root root 4365 4月 27 2023 ky-installer.cfg
-r--r--r-- 1 root root 67646 3月 4 2020 kylin.ico
-r--r--r-- 1 root root 1846 3月 23 2023 .kylin-post-actions
-r--r--r-- 1 root root 331 4月 28 2020 .kylin-post-actions-nochroot
-r--r--r-- 1 root root 464 4月 27 2023 LICENSE
-r--r--r-- 1 root root 28912 4月 27 2023 md5sum.txt
dr-xr-xr-x 6 root root 4096 4月 27 2023 pool/
-r--r--r-- 1 root root 42171 4月 27 2023 SHA256SUMS
-r--r--r-- 1 root root 3766 4月 27 2023 TRANS.TBL
root@pdsyw-pc:/data/x86-2303#
4、创建software目录,拷贝360浏览器安装包到software目录下
root@pdsyw-pc:/data/x86-2303# mkdir software
root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303# cd software/
root@pdsyw-pc:/data/x86-2303/software#
root@pdsyw-pc:/data/x86-2303/software# cp /home/pdsyw/browser360-cn-stable_13.3.1010.176-1_amd64.deb ./
root@pdsyw-pc:/data/x86-2303/software#
root@pdsyw-pc:/data/x86-2303/software# ll
总用量 126212
drwxr-xr-x 2 root root 4096 11月 28 16:43 ./
dr-xr-xr-x 11 root root 4096 11月 28 16:43 ../
-rw-r--r-- 1 root root 129230572 11月 28 16:43 browser360-cn-stable_13.3.1010.176-1_amd64.deb
root@pdsyw-pc:/data/x86-2303/software#
root@pdsyw-pc:/data/x86-2303/software# cd ..
root@pdsyw-pc:/data/x86-2303# ll -d
dr-xr-xr-x 11 root root 4096 11月 28 16:43 ./
root@pdsyw-pc:/data/x86-2303#
5、编辑.kylin-post-actions
root@pdsyw-pc:/data/x86-2303# vi .kylin-post-actions
root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303# head -17 .kylin-post-actions
#!/bin/bash
#获取当前安装的终端bios版本
now_bios=$(dmidecode -t bios | grep -i version | awk -F': ' '{print $2}')
#获取当前安装的终端品牌
now_product=$(dmidecode -t system | grep -i "Product Name" | awk -F': ' '{print $2}')
#如果当前安装的终端bios版本为XNC30_BIOS_1.0.4,则安装360浏览器
if [ "$now_bios" == "XNC30_BIOS_1.0.4" ] ; then
cp -ra /cdrom/software /opt/
dpkg -i /opt/software/*.deb
rm -rf /opt/software
fi
#如果当前安装的终端品牌为XNC30,则在/etc/下新建一个 pdsyw.txt文件
if [ "$now_product" == "XNC30" ] ; then
echo "hello pdsyw" >> pdsyw.txt
fi
root@pdsyw-pc:/data/x86-2303#
6、编辑boot/grub/grub.cfg
root@pdsyw-pc:/data/x86-2303# vi boot/grub/grub.cfg
root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303# cat boot/grub/grub.cfg
set default=0
set timeout=3
set is_preload=false
set color_normal=white/black
set color_highlight=black/light-gray
if loadfont /boot/grub/unicode.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
menuentry "Install Kylin-Desktop V10-SP1 PDSYW" {
linux /casper/vmlinuz boot=casper fsck.mode=skip only-ubiquity locale=zh_CN quiet splash audit=0 security= automatic
initrd /casper/initrd.lz
}
root@pdsyw-pc:/data/x86-2303#
7、编辑ky-installer.cfg
root@pdsyw-pc:/data/x86-2303# vi ky-installer.cfg
root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303# grep pdsyw ky-installer.cfg
username=pdsyw
root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303# grep devpath ky-installer.cfg
devpath=root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303#
8、删除MD5文件
root@pdsyw-pc:/data/x86-2303# rm -rf md5sum.txt
root@pdsyw-pc:/data/x86-2303#
root@pdsyw-pc:/data/x86-2303# find -type f -print0 | xargs -0 md5sum|grep -v isolinux/boot.cat | tee md5sum.txt
709619bcb22485ea2eed0f3cc20fa1d1 ./software/browser360-cn-stable_13.3.1010.176-1_amd64.deb
cad5727805cbf17be8496b336350b6ff ./.kylin-post-actions-nochroot
ee392b6bb4fb588eea67b8f56ec12493 ./kylin.ico
3e471fc6fddb0c8c692c9cf28f2ec10e ./.kylin-post-actions
fd80cb169256046d1dccdfbf7e2b31b4 ./.kyinfo
928085058e39492e936704b14227deb1 ./TRANS.TBL
d4849af0a290c97b0849525e1fb37984 ./SHA256SUMS
2e7295668308946336efceb87e3ef8e2 ./dists/v101/multiverse/binary-amd64/Packages.gz
36ebef708dfacb09a9d2a85ff16313ae ./dists/v101/multiverse/binary-amd64/Packages
284763858c7aebbbbf21c4d960ca18f0 ./dists/v101/multiverse/binary-amd64/TRANS.TBL
e83631558690df5a45770782ed732e82 ./dists/v101/multiverse/binary-i386/Packages.gz
9、生成镜像
root@pdsyw-pc:/data/x86-2303# genisoimage -e boot/grub/efi.img -no-emul-boot -T -allow-limited-size -J -R -c boot.catalog -hide boot.catalog -V "Kylin-Desktop-V10-SP1" -o /opt/Kylin-Desktop-V10-SP1-PDSYW-X86_64.iso .
I: -input-charset not specified, using utf-8 (detected in locale settings)
[test] here add dot & dot
Using _KYLI000.;1 for /.kylin-post-actions (.kylin-post-actions-nochroot)
Using PART_000.MOD;1 for ./boot/grub/x86_64-efi/part_sunpc.mod (part_sun.mod)
Using SEARC000.MOD;1 for ./boot/grub/x86_64-efi/search_fs_file.mod (search_fs_uuid.mod)
Using MDRAI000.MOD;1 for ./boot/grub/x86_64-efi/mdraid09_be.mod (mdraid09.mod)
Using XNU_U000.MOD;1 for ./boot/grub/x86_64-efi/xnu_uuid_test.mod (xnu_uuid.mod)
Using PASSW000.MOD;1 for ./boot/grub/x86_64-efi/password.mod (password_pbkdf2.mod)
Using GCRY_000.MOD;1 for ./boot/grub/x86_64-efi/gcry_sha512.mod (gcry_sha1.mod)
Using USBSE000.MOD;1 for ./boot/grub/x86_64-efi/usbserial_usbdebug.mod (usbserial_ftdi.mod)
Using VIDEO000.MOD;1 for ./boot/grub/x86_64-efi/videotest.mod (videotest_checksum.mod)
Using GCRY_001.MOD;1 for ./boot/grub/x86_64-efi/gcry_sha1.mod (gcry_sha256.mod)
Using USBSE001.MOD;1 for ./boot/grub/x86_64-efi/usbserial_ftdi.mod (usbserial_common.mod)
Using MULTI000.MOD;1 for ./boot/grub/x86_64-efi/multiboot.mod (multiboot2.mod)
Using GFXTE000.MOD;1 for ./boot/grub/x86_64-efi/gfxterm_background.mod (gfxterm_menu.mod)
10、下载镜像
roc@ROC ~ % scp pdsyw@10.211.55.57:/opt/Kylin-Desktop-V10-SP1-PDSYW-X86_64.iso ./Desktop/
pdsyw@10.211.55.57's password:
Permission denied, please try again.
pdsyw@10.211.55.57's password:
Kylin-Desktop-V10-SP1-PDSYW-X86_64.iso 100% 3944MB 155.1MB/s 00:25
11.1、在东海终端上安装系统后有360浏览器
11.2、查看BIOS信息
pdsyw@sa-QiTianM425-N000:~/桌面$ sudo dmidecode -t bios
输入密码
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.1 present.
Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
Vendor: Byosoft
Version: XNC30_BIOS_1.0.4
Release Date: 10/27/2021
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 8192 kB
Characteristics:
PCI is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed
EDD is supported
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
ACPI is supported
USB legacy is supported
BIOS boot specification is supported
Targeted content distribution is supported
UEFI is supported
BIOS Revision: 0.0
Firmware Revision: 1.3
Handle 0x0022, DMI type 13, 22 bytes
BIOS Language Information
Language Description Format: Long
Installable Languages: 2
en|US|iso8859-1
zh|CN|unicode
Currently Installed Language: zh|CN|unicode
pdsyw@sa-QiTianM425-N000:~/桌面$
11.3、查看system信息
pdsyw@sa-QiTianM425-N000:~/桌面$ sudo dmidecode -t system
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.1 present.
Handle 0x0001, DMI type 1, 27 bytes
System Information
Manufacturer: UDH
Product Name: XNC30
Version: TBD
Serial Number: 109XNC30A22C260140
UUID: 07140222-5058-ec11-819e-998a92df1c61
Wake-up Type: Power Switch
SKU Number: ED0
Family: ZXE
Handle 0x0010, DMI type 12, 5 bytes
System Configuration Options
Option 1: System Option String
Handle 0x0011, DMI type 23, 13 bytes
System Reset
Status: Disabled
Watchdog Timer: Not Present
Handle 0x0012, DMI type 32, 11 bytes
System Boot Information
Status: No errors detected
pdsyw@sa-QiTianM425-N000:~/桌面$
12.1、在VMware虚拟机中安装系统没有360浏览器
12.2、查看BIOS信息
pdsyw@sa-QiTianM425-N000:~/桌面$ sudo dmidecode -t bios
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
Vendor: VMware, Inc.
Version: VMW201.00V.20904234.B64.2212051119
Release Date: 12/05/2022
ROM Size: 2048 kB
Characteristics:
ISA is supported
PCI is supported
PNP is supported
BIOS is upgradeable
ACPI is supported
Targeted content distribution is supported
UEFI is supported
pdsyw@sa-QiTianM425-N000:~/桌面$
12.3、查看system信息
pdsyw@sa-QiTianM425-N000:~/桌面$ sudo dmidecode -t system
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
Handle 0x0001, DMI type 1, 27 bytes
System Information
Manufacturer: VMware, Inc.
Product Name: VMware20,1
Version: None
Serial Number: VMware-56 4d e1 1f bd ec 7e 0c-35 6d 5f f9 76 68 80 94
UUID: 1fe14d56-ecbd-0c7e-356d-5ff976688094
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: Not Specified
Handle 0x0122, DMI type 23, 13 bytes
System Reset
Status: Enabled
Watchdog Timer: Present
Boot Option: Do Not Reboot
Boot Option On Limit: Do Not Reboot
Reset Count: Unknown
Reset Limit: Unknown
Timer Interval: Unknown
Timeout: Unknown
Handle 0x0125, DMI type 32, 11 bytes
System Boot Information
Status: No errors detected
pdsyw@sa-QiTianM425-N000:~/桌面$