欢迎大家访问我的网站!

临时

思博2021-09-26 21:18:47548统信UOS教程

Windows定制版安装镜像很多人都会做,但是Linux定制版安装镜像则未必了。作为一个统信UOS/Deepin的用户,如果你想要一个已经预装好多种软件的安装镜像,该如何做呢?下面我将通过一个简易的例子,来说明如何定制统信UOS/Deepin安装镜像。

1、为UOS/Deepin原版安装镜像和要制作的新镜像创建挂载目录。打开终端,输入:

sudo mkdir -p /mnt/uos20old /mnt/uos20new

2、挂载原版安装镜像。

sudo mount ~/Downloads/uniontechos-desktop-home-1030-amd64.iso /mnt/uos20old/

3、同步镜像。

sudo rsync -av /mnt/uos20old/ /mnt/uos20new/sudo sync

4、为新镜像准备oem目录以放置要集成安装的deb软件包。

sudo mkdir -p /mnt/uos20new/oem/deb

5、将要集成安装的软件包复制到上面的目录中(集成安装内核的deb软件包也是没有问题的,这里有新的内核deb软件包,稍微动下脑筋就知道下载地址啦 )。

sudo cp xxx.deb /mnt/uos20new/oem/deb/

6、安装必备的光盘镜像制作工具xorriso。

sudo apt updatesudo apt install xorriso

7、编写安装镜像制作脚本build-iso.sh,这里用的是nano命令行编辑器。

sudo nano /mnt/build-iso.sh

build-iso.sh的内容如下(命令行参数研究一下就明白了):

#!/bin/bashxorriso -as mkisofs -D -r -V "UOS 20" \-cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat \-no-emul-boot -boot-load-size 4 -boot-info-table \-eltorito-alt-boot --efi-boot boot/efi.img \-input-charset utf-8 \-o uos-20-home-amd64.iso uos20new

8、执行build-iso.sh脚本,制作UOS/Deepin安装镜像。

cd /mntsudo chmod +x build-iso.shsudo ./build-iso.sh

以下生成ARM架构的ISO

sudo xorriso -as mkisofs -r -o debian-test.iso -J -joliet-long -e boot/grub/efi.img -no-emul-boot uos20new

注意uos20new虚拟光驱的路径

下面安需要设置

uos20new/oem/hooks/in_chroot中的01_machine_id

1:安装后直接接入开发者模式

#!/bin/bash


[ -d /var/lib/deepin/developer-mode ] || mkdir -pv /var/lib/deepin/developer-mode


echo -n -E 1 > /var/lib/deepin/developer-mode/enabled


2:安装后发送定制软件到桌面

#发送桌面快捷方式

DESK_APPS_ARR=('deepin-manual' 'uos-browser')

for DESK_APP_ITEM in ${DESK_APPS_ARR[@]}; do

if [ -f /usr/share/applications/${DESK_APP_ITEM}.desktop ]; then

install -v -Dm644 /usr/share/applications/${DESK_APP_ITEM}.desktop/etc/skel/Desktop/

fi

done


常用图标

wwlocal.desktop

com.pantum.pantum.scanapp.desktop

com.qianxin.qaxsafe.desktop

360sd_usrstart.desktop

wps-office-wpp.desktop

wps-office-pdf.desktop

wps-office-et.desktop

cn.suwell.reader.desktop

com.qq.weixin.deepin.desktop



3:修改hosts脚本

简单版

echo "19.15.0.77  xtbgsafe.gdzwfw.gov.cn" >> /etc/hosts

echo "19.15.0.77  xtbg.gdzwfw.gov.cn" >> /etc/hosts


复杂版

# insert/update hosts entry

ip_address="19.15.0.77"

host_name="xtbgsafe.gdzwfw.gov.cn"

ip_address2="19.15.0.77"

host_name2="xtbg.gdzwfw.gov.cn"

# find existing instances in the host file and save the line numbers

matches_in_hosts="$(grep -n $host_name & $host_name /etc/hosts | cut -f1 -d:)"

host_entry="${ip_address} ${host_name} "

host_entry2="${ip_address2} ${host_name2}"

echo "Please enter your password if requested."


if [ ! -z "$matches_in_hosts" ]

then

    echo "Updating existing hosts entry."

    # iterate over the line numbers on which matches were found

    while read -r line_number; do

        # replace the text of each line with the desired host entry

        sudo sed -i '' "${line_number}s/.*/${host_entry} & ${host_entry2} /" /etc/hosts

    done <<< "$matches_in_hosts"

else

    echo "Adding new hosts entry."

    echo "$host_entry" | sudo tee -a /etc/hosts > /dev/null

fi


转载声明:本站发布文章及版权归原作者所有,转载本站文章请注明文章来源!

本文链接:http://lxkj.vip/?id=53

网友评论