From e7ef3d5b168d1a3644600df16b029a91cc37fb08 Mon Sep 17 00:00:00 2001 From: "Xu, Shunxuan" Date: Tue, 6 Nov 2018 11:21:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A040=E5=AE=89=E8=A3=85=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=8F=8A=E6=94=AF=E6=8C=81700=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E7=9A=84dmraid=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit modified: main/begin-install modified: operation/finish_install/98state_grid_custom.py new file: operation/finish_install/exec_install_40.sh modified: operation/functions new file: xml/install-40-d5000.xml Signed-off-by: Xu, Shunxuan --- main/begin-install | 8 +- .../finish_install/98state_grid_custom.py | 1 + operation/finish_install/exec_install_40.sh | 18 + operation/functions | 4 +- xml/install-40-d5000.xml | 511 ++++++++++++++++++ 5 files changed, 539 insertions(+), 3 deletions(-) create mode 100755 operation/finish_install/exec_install_40.sh create mode 100644 xml/install-40-d5000.xml diff --git a/main/begin-install b/main/begin-install index c778bda..1e5823a 100755 --- a/main/begin-install +++ b/main/begin-install @@ -12,6 +12,7 @@ work_as_net_inst_server(){ activate_dmraid(){ modprobe dm_mod + /usr/sbin/dmsetup remove_all dmraid -p -ay for i in $(dmraid -s -c);do kpartx -a /dev/mapper/$i @@ -19,6 +20,7 @@ activate_dmraid(){ } dmraid=`cat /proc/cmdline | sed 's/.*dmraid=\([^ ]*\).*/\1/'` +os=`cat /proc/cmdline | sed 's/.*os=\([^ ]*\).*/\1/'` if [ "$(echo $dmraid |tr '[A-Z]' '[a-z]')" = "true" ];then activate_dmraid @@ -40,7 +42,11 @@ if [ $instmode = 'Auto' ];then cp /usr/lib/new_install/xml/install.xml /var/install/install.xml elif [ $instmode = 'StateGrid' ];then mkdir -pv /var/install/ - cp /usr/lib/new_install/xml/install-d5000.xml /var/install/install.xml + if [ $os = '40' ];then + cp /usr/lib/new_install/xml/install-40-d5000.xml /var/install/install.xml + else + cp /usr/lib/new_install/xml/install-d5000.xml /var/install/install.xml + fi fi case $instmode in diff --git a/operation/finish_install/98state_grid_custom.py b/operation/finish_install/98state_grid_custom.py index 4c826d9..e45ec7e 100755 --- a/operation/finish_install/98state_grid_custom.py +++ b/operation/finish_install/98state_grid_custom.py @@ -27,6 +27,7 @@ except: instmode = 'Text' if instmode == 'StateGrid': os.system("cp -r /usr/lib/StateGrid /mnt/opt/") + os.system("source /usr/lib/new_install/operation/finish_install/exec_install_40.sh") os.system("chroot /mnt /opt/StateGrid/setup.sh %s %s %s" %(username, homedir, shell)) os.system("rm -rf /mnt/opt/StateGrid") diff --git a/operation/finish_install/exec_install_40.sh b/operation/finish_install/exec_install_40.sh new file mode 100755 index 0000000..e502fc6 --- /dev/null +++ b/operation/finish_install/exec_install_40.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +os=`cat /proc/cmdline | sed 's/.*os=\([^ ]*\).*/\1/'` +if [ $os == "40" ];then + # 40 don't set bonding + sed 's/^\.\/set_bonding/\#\.\/set_bonding/g' /mnt/opt/StateGrid/setup.sh > /mnt/opt/StateGrid/setup.sh.bak + mv /mnt/opt/StateGrid/setup.sh.bak /mnt/opt/StateGrid/setup.sh + chmod +x /mnt/opt/StateGrid/setup.sh + # change desktop pic + echo "cp /opt/StateGrid/install_shell/kdesktoprc \$USER_HOME/.kde/share/config/" >> /mnt/opt/StateGrid/install_shell/create_users.sh + echo "cp /opt/StateGrid/install_shell/kdesktoprc \$HOME/.kde/share/config/" >> /mnt/opt/StateGrid/install_shell/create_users.sh + echo "cp /opt/StateGrid/install_shell/kdesktoprc /etc/skel/.kde/share/config/" >> /mnt/opt/StateGrid/install_shell/create_users.sh + echo "chown sys:sys /etc/skel/.kde/share/config/kdesktoprc" >> /mnt/opt/StateGrid/install_shell/create_users.sh + echo "chown \$USER_NAME:\$USER_NAME \$USER_NAME/.kde/share/config" >> /mnt/opt/StateGrid/install_shell/create_users.sh + # change issue + sed 's/6\.0\.42\.41/4\.2\.40/g' /mnt/etc/issue > /mnt/etc/issue.bak + mv /mnt/etc/issue.bak /mnt/etc/issue +fi diff --git a/operation/functions b/operation/functions index 1840c7c..33fbb7f 100644 --- a/operation/functions +++ b/operation/functions @@ -119,7 +119,7 @@ reumount () update_udev() { killall udevd - start_udev + start_udev 1>/dev/null 2>/dev/null } # @@ -144,7 +144,7 @@ get_disk_sym () update_udev # scsci's by-id may be have multi-links, we get first link # update hard disk informations. - devname=$(udevinfo -q symlink -p $path|tr " " "\n"|grep "$type"|head -n 1) + devname=$(udevadm info -q symlink -p $path|tr " " "\n"|grep "$type"|head -n 1) echo "$devname" diff --git a/xml/install-40-d5000.xml b/xml/install-40-d5000.xml new file mode 100644 index 0000000..a740174 --- /dev/null +++ b/xml/install-40-d5000.xml @@ -0,0 +1,511 @@ + + + 0123456789 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +