source: drbl-virt/sbin/drbl_xen_patch.sh @ 173

Last change on this file since 173 was 173, checked in by rock, 14 years ago

Add: patch /opt/drbl/sbin/generate-pxe-menu

  • Property svn:executable set to *
File size: 2.6 KB
RevLine 
[161]1#!/bin/bash
2# Program:
3#   Path DRBL evironment to support Xen/KVM
4# Author:
5#   Jazz, Rock {jazz, rock}@nchc.org.tw
6# Version:
7#    1.0
8# History:                                                                                         
9#   2010/07/20  Rock    First release (1.0)
10
11# [Source]
[171]12source functions_drbl_virt
13source /opt/drbl-virt/conf/drbl-virt.conf
[161]14
15# [Main]
16
[171]17# = 1. Patch DRBL xen env for client =
18# == Shutdown all drbl client ==
19echo "Please check all client are shutdown !!!"
20read -p "Push 'Enter' to continue......"
[161]21
[171]22# == Change xen kernel for drbl client ==
23check_xen_nu
24Xen_Kernel=$(echo $Xen_Kernel | sed 's/^vmlinuz-//g' )
25echo "/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel"
26#/opt/drbl/sbin/drblsrv-offline -s $Xen_Kernel
27echo ""
[161]28
[171]29# == Re-delpoy drbl client ==
30echo "Re-delpoy drbl client"
31echo "/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf"
32#/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf
33echo ""
34
35# == Copy xen image to /tftpboot/nbi_img/ ==
36echo "copy Xen image & Kernel to /tftpboot/nbi_img/"
[172]37#cp /boot/*xen* /tftpboot/nbi_img/
38#cp /boot/vmlinuz-${Xen_Kernel} /tftpboot/nbi_img/
39#cp /boot/initrd.img-${Xen_Kernel} /tftpboot/nbi_img/
40#cp /boot/config-${Xen_Kernel} /tftpboot/nbi_img/
[171]41echo ""
42
43# == Modify PXE booting menu ==
[173]44# backup generate-pxe-menu
[172]45#cp /tftpboot/nbi_img/pxelinux.cfg/default /tftpboot/nbi_img/pxelinux.cfg/default.drbl-virt_bak
[173]46#cp /opt/drbl/sbin/generate-pxe-menu /opt/drbl/sbin/generate-pxe-menu.drbl_virt_bak
47generate_PXE_menu="/opt/drbl/sbin/generate-pxe-menu"
48declare -i modify_line=$(cat -n $generate_PXE_menu | grep 'label drbl' | awk 'NR==1 {print $1}')
49# modify menu
50sed -i "${modify_line}i\label drbl-virt" $generate_PXE_menu
51modify_line=$modify_line+1
52sed -i "${modify_line}i\  MENU DEFAULT" $generate_PXE_menu
53modify_line=$modify_line+1
54sed -i "${modify_line}i\  MENU LABEL DRBL-Virtualization ($Xen, $Xen_Kernel)" $generate_PXE_menu
55modify_line=$modify_line+1
56sed -i "${modify_line}i\  kernel mboot.c32" $generate_PXE_menu
57modify_line=$modify_line+1
58sed -i "${modify_line}i\  append $Xen --- vmlinuz-pxe --- initrd-pxe.img devfs=nomount drblthincli=off selinux=0 nomodeset" $generate_PXE_menu
59modify_line=$modify_line+1
60sed -i "${modify_line}i\  TEXT HELP" $generate_PXE_menu
61modify_line=$modify_line+1
62sed -i "${modify_line}i\  ENDTEXT" $generate_PXE_menu
63modify_line=$modify_line+1
64sed -i "${modify_line}i\ " $generate_PXE_menu
[171]65
66
67# = 2. Patch DRBL initrd to support bridge =
68# == Patch /usr/bin/mkpxeinitrd-net (1)modules (2)xen network scripts ==
69
[173]70
[171]71# == Copy xen netwrok scripts ==
72
73# == run xen network scripts (/usr/lib/mkpxeinitrd-net/initrd-skel/linuxrc-or-init) ==
74
75
76
Note: See TracBrowser for help on using the repository browser.