From eacff4bab45981f4adc1a73a28a7832c672bf66a Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Fri, 16 Jan 2015 10:38:37 +0100 Subject: [PATCH] MT#10805 add carrier support in templates Change-Id: I3361ad68d3ed262c7f8171c020c8cf1a8917d0c1 --- .gitignore | 2 ++ build_templates.sh | 17 +++++++++-- grub.cfg_carrier | 13 ++++++++ isolinux.cfg_carrier | 27 +++++++++++++++++ releases | 45 +++++++++++++++------------- templates/boot/grub/grub.cfg | 26 +++++----------- templates/boot/isolinux/isolinux.cfg | 43 ++++++-------------------- 7 files changed, 96 insertions(+), 77 deletions(-) create mode 100644 .gitignore create mode 100644 grub.cfg_carrier create mode 100644 isolinux.cfg_carrier diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fea27c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +sipwise_*.cfg diff --git a/build_templates.sh b/build_templates.sh index 6cca9a8..e29e68a 100755 --- a/build_templates.sh +++ b/build_templates.sh @@ -8,7 +8,8 @@ GRUB="${BOOT}/grub/grub.cfg" ISO="${BOOT}/isolinux" RELEASES=($(grep -v '#' ${BASE}/releases | cut -d, -f1 )) DISTS=($(grep -v '#' ${BASE}/releases |cut -d, -f2 )) -INFO=($(grep -v '#' ${BASE}/releases |cut -d, -f3 )) +CARRIER=($(grep -v '#' ${BASE}/releases |cut -d, -f3 )) +INFO=($(grep -v '#' ${BASE}/releases |cut -d, -f4 )) MR="${MR:-no}" PUBLIC="${PUBLIC:-no}" @@ -37,21 +38,31 @@ for index in ${!RELEASES[*]}; do echo "*** [SKIP] isolinux template for RELEASE:${RELEASES[$index]} DIST:${DISTS[$index]} ***" fi else - echo "*** grub template for RELEASE:${RELEASES[$index]} DIST:${DISTS[$index]} ***" + echo "*** grub template for RELEASE:${RELEASES[$index]} DIST:${DISTS[$index]} CARRIER:${CARRIER[$index]} ***" sed -e "s_##VERSION##_${RELEASES[$index]}_g" \ -e "s_##DIST##_${DISTS[$index]}_g" \ ${BASE}/grub.cfg_ce >> ${BOOT}/grub/sipwise_ce.cfg sed -e "s_##VERSION##_${RELEASES[$index]}_g" \ -e "s_##DIST##_${DISTS[$index]}_g" \ ${BASE}/grub.cfg_pro >> ${BOOT}/grub/sipwise_pro.cfg + if [ "${CARRIER[$index]}" == "yes" ]; then + sed -e "s_##VERSION##_${RELEASES[$index]}_g" \ + -e "s_##DIST##_${DISTS[$index]}_g" \ + ${BASE}/grub.cfg_carrier >> ${BOOT}/grub/sipwise_carrier.cfg + fi - echo "*** isolinux template for RELEASE:${RELEASES[$index]} DIST:${DISTS[$index]} ***" + echo "*** isolinux template for RELEASE:${RELEASES[$index]} DIST:${DISTS[$index]} CARRIER:${CARRIER[$index]} ***" sed -e "s_##VERSION##_${RELEASES[$index]}_g" \ -e "s_##DIST##_${DISTS[$index]}_g" ${BASE}/isolinux.cfg_ce \ >> ${BOOT}/isolinux/sipwise_ce.cfg sed -e "s_##VERSION##_${RELEASES[$index]}_g" \ -e "s_##DIST##_${DISTS[$index]}_g" ${BASE}/isolinux.cfg_pro \ >> ${BOOT}/isolinux/sipwise_pro.cfg + if [ "${CARRIER[$index]}" == "yes" ]; then + sed -e "s_##VERSION##_${RELEASES[$index]}_g" \ + -e "s_##DIST##_${DISTS[$index]}_g" ${BASE}/isolinux.cfg_carrier \ + >> ${BOOT}/isolinux/sipwise_carrier.cfg + fi fi fi done diff --git a/grub.cfg_carrier b/grub.cfg_carrier new file mode 100644 index 0000000..b15bb9a --- /dev/null +++ b/grub.cfg_carrier @@ -0,0 +1,13 @@ +menuentry "sip:Carrier mgmt (web01a) DHCP / ##VERSION## release" { + echo 'Loading kernel...' + linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=##DIST## netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcpnoupload ngcpnw.dhcp ngcpvers=##VERSION## ngcpcrole=mgmt ngcpnonwrecfg ngcphostname=web01a + echo 'Loading initrd...' + initrd /boot/%SHORT_NAME%/initrd.img +} + +menuentry "sip:Carrier mgmt (web01a) / ##VERSION## release" { + echo 'Loading kernel...' + linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=##DIST## netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcpnoupload ngcpnonwrecfg ngcpvers=##VERSION## dns=92.42.136.30 ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off ngcpcrole=mgmt ngcphostname=web01a + echo 'Loading initrd...' + initrd /boot/%SHORT_NAME%/initrd.img +} diff --git a/isolinux.cfg_carrier b/isolinux.cfg_carrier new file mode 100644 index 0000000..ce7b4e3 --- /dev/null +++ b/isolinux.cfg_carrier @@ -0,0 +1,27 @@ +label carrier##VERSION## + menu label sip:Carrier mgmt/web01a DHCP / ##VERSION## + kernel /boot/%SHORT_NAME%/vmlinuz + append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=##DIST## netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcpnw.dhcp ngcpnonwrecfg ngcpvers=##VERSION## ngcpcrole=mgmt ngcphostname=web01a + + text help + Install sip:Carrier version ##VERSION##. + Install web01a node of Carrier setup. + Other nodes will be installed from web01a. + + Retrieve network configuration via DHCP. + endtext + + +label carriernw##VERSION## + menu label sip:Carrier mgmt/web01a / ##VERSION## + kernel /boot/%SHORT_NAME%/vmlinuz + append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=##DIST## netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcpnoupload ngcpvers=##VERSION## dns=92.42.136.30 ngcpnonwrecfg ngcpcrole=mgmt ngcphostname=web01a ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off + + text help + Install sip:Carrier version ##VERSION##. + Install web01a node of Carrier setup. + Other nodes will be installed from web01a. + + Static network configuration. + endtext + diff --git a/releases b/releases index 4cc9ffa..58a798b 100644 --- a/releases +++ b/releases @@ -1,23 +1,26 @@ # list of releases # no spaces please!! -mr3.6,wheezy,. -mr3.6.2,wheezy,LATEST -mr3.6.1,wheezy,. -mr3.5,wheezy,. -mr3.5.1,wheezy,. -mr3.4,wheezy,. -mr3.4.2,wheezy,. -mr3.4.1,wheezy,. -mr3.3,wheezy,. -mr3.3.2,wheezy,. -mr3.3.1,wheezy,. -mr3.2.2,wheezy,. -mr3.2.1,wheezy,. -mr3.2,wheezy,. -3.1,wheezy,. -3.0,wheezy,. -2.8,squeeze,LTS -2.7,squeeze,. -2.6,squeeze,. -2.5,squeeze,. -2.4,squeeze,. +#version,distribution,carrier,info +# carrier [yes|no] +# info [.|LTS|LATEST] +mr3.6,wheezy,yes,. +mr3.6.2,wheezy,yes,LATEST +mr3.6.1,wheezy,yes,. +mr3.5,wheezy,no,. +mr3.5.1,wheezy,no,. +mr3.4,wheezy,no,. +mr3.4.2,wheezy,no,. +mr3.4.1,wheezy,no,. +mr3.3,wheezy,no,. +mr3.3.2,wheezy,no,. +mr3.3.1,wheezy,no,. +mr3.2.2,wheezy,no,. +mr3.2.1,wheezy,no,. +mr3.2,wheezy,no,. +3.1,wheezy,no,. +3.0,wheezy,no,. +2.8,squeeze,no,LTS +2.7,squeeze,no,. +2.6,squeeze,no,. +2.5,squeeze,no,. +2.4,squeeze,no,. diff --git a/templates/boot/grub/grub.cfg b/templates/boot/grub/grub.cfg index 342514a..61e4479 100644 --- a/templates/boot/grub/grub.cfg +++ b/templates/boot/grub/grub.cfg @@ -153,36 +153,24 @@ source /boot/grub/sipwise_pro.cfg } # Specific sip:providerPRO releases -## begin of Carrier 3.x menu {{{ -submenu "Specific sip:Carrier 3.x releases ... ->" --class=submenu { +## begin of Carrier menu {{{ +submenu "Specific sip:Carrier releases ... ->" --class=submenu { -menuentry "sip:Carrier 3.x PXE mgmt (web01a) DHCP / trunk" { +menuentry "sip:Carrier mgmt (web01a) DHCP / trunk" { echo 'Loading kernel...' - linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcptrunk ngcpnoupload ngcpnw.dhcp ngcpcrole=mgmt ngcpnonwrecfg ngcphostname=web01a + linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcpnoupload ngcpnw.dhcp ngcptrunk ngcpcrole=mgmt ngcpnonwrecfg ngcphostname=web01a echo 'Loading initrd...' initrd /boot/%SHORT_NAME%/initrd.img } -menuentry "sip:Carrier 3.x PXE mgmt (web01a) / trunk" { +menuentry "sip:Carrier mgmt (web01a) / trunk" { echo 'Loading kernel...' - linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp2 ngcptrunk ngcpnoupload ngcpcrole=mgmt ngcphostname=web01b ngcpnonwrecfg dns=92.42.136.30 ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off + linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcpnoupload ngcpnonwrecfg dns=92.42.136.30 ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off ngcptrunk ngcpcrole=mgmt ngcphostname=web01a echo 'Loading initrd...' initrd /boot/%SHORT_NAME%/initrd.img } -menuentry "sip:Carrier 3.x mgmt/db/proxy/lb DHCP / mr3.6.1" { - echo 'Loading kernel...' - linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpvers=mr3.6.1 ngcpnoupload ngcpnw.dhcp ngcpnonwrecfg ngcphostname=web01a_FIXME ngcpcrole=mgmt_FIXME ngcpsp1_FIXME - echo 'Loading initrd...' - initrd /boot/%SHORT_NAME%/initrd.img -} - -menuentry "sip:Carrier 3.x mgmt/db/proxy/lb / mr3.6.1" { - echo 'Loading kernel...' - linux /boot/%SHORT_NAME%/vmlinuz live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpvers=mr3.6.1 ngcpnoupload ngcpnw.dhcp ngcpnonwrecfg ngcphostname=web01a_FIXME ngcpcrole=mgmt_FIXME ngcpsp1_FIXME dns=92.42.136.30 ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off - echo 'Loading initrd...' - initrd /boot/%SHORT_NAME%/initrd.img -} +source /boot/grub/sipwise_carrier.cfg } # Specific sip:providerCarrier 3.x releases diff --git a/templates/boot/isolinux/isolinux.cfg b/templates/boot/isolinux/isolinux.cfg index d5f5c5f..e9c2ce1 100644 --- a/templates/boot/isolinux/isolinux.cfg +++ b/templates/boot/isolinux/isolinux.cfg @@ -358,13 +358,13 @@ menu exit menu separator label carrierweb01atrunkdhcp - menu label sip:Carrier 3.x PXE mgmt/web01a DHCP / trunk + menu label sip:Carrier mgmt/web01a DHCP / trunk kernel /boot/%SHORT_NAME%/vmlinuz - append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcptrunk ngcpnw.dhcp ngcpcrole=mgmt ngcphostname=web01a ngcpnonwrecfg + append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcptrunk ngcpnw.dhcp ngcpnonwrecfg ngcpcrole=mgmt ngcphostname=web01a text help - Install sip:Carrier 3.x edition (trunk). - Install web01a node of Carrier 3.x setup. + Install sip:Carrier edition (trunk). + Install web01a node of Carrier setup. Other nodes will be installed from web01a. Retrieve network configuration via DHCP. @@ -372,45 +372,20 @@ label carrierweb01atrunkdhcp label carrierweb01atrunkstatic - menu label sip:Carrier 3.x PXE mgmt/web01a / trunk + menu label sip:Carrier mgmt/web01a / trunk kernel /boot/%SHORT_NAME%/vmlinuz - append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp2 ngcptrunk ngcpnoupload ngcpcrole=mgmt ngcphostname=web01b ngcpnonwrecfg dns=92.42.136.30 ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off + append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpsp1 ngcptrunk ngcpnoupload ngcpnonwrecfg dns=92.42.136.30 ngcpcrole=mgmt ngcphostname=web01a ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off text help - Install sip:Carrier 3.x edition (trunk). - Install web01a node of Carrier 3.x setup. + Install sip:Carrier edition (trunk). + Install web01a node of Carrier setup. Other nodes will be installed from web01a. Static network configuration. endtext -label carrieranymr361dhcp - menu label sip:Carrier 3.x mgmt/db/proxy/lb DHCP / mr3.6.1 - kernel /boot/%SHORT_NAME%/vmlinuz - append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpvers=mr3.6.1 ngcpnoupload ngcpnw.dhcp ngcpnonwrecfg ngcphostname=web01a_FIXME ngcpcrole=mgmt_FIXME ngcpsp1_FIXME - - text help - Install sip:Carrier 3.x edition (mr3.6.1). - Install any node of Carrier 3.x setup. - Please configure boot options manually! - - Retrieve network configuration via DHCP. - endtext - - -label carrieranymr361static - menu label sip:Carrier 3.x mgmt/db/proxy/lb / mr3.6.1 - kernel /boot/%SHORT_NAME%/vmlinuz - append initrd=/boot/%SHORT_NAME%/initrd.img live-media-path=/live/%GRML_NAME%/ boot=live bootid=%BOOTID% apm=power-off vga=791 quiet nomce ngcppro ssh=sipwise debianrelease=wheezy netscript=http://deb.sipwise.com/kantan/deployment.sh ngcpvers=mr3.6.1 ngcpnoupload ngcpnw.dhcp ngcpnonwrecfg ngcphostname=web01a_FIXME ngcpcrole=mgmt_FIXME ngcpsp1_FIXME dns=92.42.136.30 ip=10.15.20.101::10.15.20.1:255.255.255.0:sp1:eth0:off - - text help - Install sip:Carrier 3.x edition (mr3.6.1). - Install any node of Carrier 3.x setup. - Please configure boot options manually! - - Static network configuration. - endtext +include sipwise_carrier.cfg # back to main menu label quit