From 27fed5d1a17e1cb64e31326acbf8913453a93bac Mon Sep 17 00:00:00 2001 From: Peng Zhihui Date: Fri, 16 May 2014 14:51:36 +0800 Subject: [PATCH] deleted useless script : operation/finish_install.py add no raid install : just move scripts/local-top/mdadm from initrd this will support Lenovo RD440 machine deleted: operation/finish_install.py new file: operation/finish_install/97update_initrd_noraid.sh modified: text/get_instmode.sh --- operation/finish_install.py | 26 ------------------- .../finish_install/97update_initrd_noraid.sh | 12 +++++++++ text/get_instmode.sh | 2 +- 3 files changed, 13 insertions(+), 27 deletions(-) delete mode 100755 operation/finish_install.py create mode 100755 operation/finish_install/97update_initrd_noraid.sh diff --git a/operation/finish_install.py b/operation/finish_install.py deleted file mode 100755 index be01aa9..0000000 --- a/operation/finish_install.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python - -# run finish_install scripts -# - -import os,sys -sys.path.append('../interface') -import ri_data - -# get data from install.xml -ri_data.init_from_xml() -username = ri_data.StateGrid.username -homedir = ri_data.StateGrid.home_dir -shell = ri_data.StateGrid.shell - -# run state grid custom scripts -f = open('/proc/cmdline', 'r') -cmdline = f.readline() -f.close() -instmode = cmdline.split(' ')[0].split('=')[1] -if instmode == 'StateGrid': - os.system("chroot /mnt /opt/finish_install/StateGrid/setup.sh %s %s %s" %(username, homedir, shell)) - -# run post_add scripts -os.system("chroot /mnt /opt/finish_install/99finish_install.sh") - diff --git a/operation/finish_install/97update_initrd_noraid.sh b/operation/finish_install/97update_initrd_noraid.sh new file mode 100755 index 0000000..24ad0fa --- /dev/null +++ b/operation/finish_install/97update_initrd_noraid.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +instmode=`cat /proc/cmdline | sed 's/.*instmode=\([^ ]*\).*/\1/'` +if [ instmode == 'NoRaid' ];then + mkdir -p /mnt/boot/t + cd /mnt/boot/t + zcat /mnt/boot/initrd.img-2.6.32.41-Rocky4.2-x86_64 |cpio -di + rm scripts/local-top/mdadm + find . |cpio -H newc -o |gzip -9 > /mnt/boot/initrd.img-2.6.32.41-Rocky4.2-x86_64 + cd - + rm -rf /mnt/boot/t +fi diff --git a/text/get_instmode.sh b/text/get_instmode.sh index d0f2fcc..0cce2e3 100755 --- a/text/get_instmode.sh +++ b/text/get_instmode.sh @@ -11,7 +11,7 @@ select_inst_mode(){ [ -z $instmode ] && instmode=`cat /proc/cmdline | sed 's/.*instmode=\([^ ]*\).*/\1/'` -if [ "$instmode" = "HdInstall" -o "$instmode" = "NetInstall" ];then +if [ "$instmode" = "HdInstall" -o "$instmode" = "NetInstall" -o "$instmode" = "NoRaid" ];then select_inst_mode fi