#!/bin/bash

###########################################################################
# 
# Baracus build and boot management framework
# 
# Copyright (C) 2010 Novell, Inc, 404 Wyman Street, Waltham, MA 02451, USA.
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Artistic License 2.0, as published
# by the Perl Foundation, or the GNU General Public License 2.0
# as published by the Free Software Foundation; your choice.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Both the Artistic
# Licesnse and the GPL License referenced have clauses with more details.
# 
# You should have received a copy of the licenses mentioned
# along with this program; if not, write to:
# 
# FSF, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110, USA.
# The Perl Foundation, 6832 Mulderstraat, Grand Ledge, MI 48837, USA.
#
###########################################################################

baconfig detail hardware default --all &> /dev/null || \
baconfig add hardware --name default \
--description="/dev/sda drive" \
--bootargs="acpi=off selinux=0 apm=off" \
--rootdisk=/dev/sda \
--rootpart=/dev/sda \
--cert "sles-11.1-x86_64 sles-11.1-x86 sles-10.3-x86_64 sles-10.3-x86"

baconfig detail hardware default-iscsi --all &> /dev/null || \
baconfig add hardware --name default-iscsi \
--description="bootargs +withiscsi +netsetup" \
--bootargs="acpi=on selinux=0 apm=off WithISCSI=1 netsetup=1" \
--rootdisk=/dev/sda \
--rootpart=/dev/sda

baconfig detail hardware default-hda --all &> /dev/null || \
baconfig add hardware --name default-hda \
--description="/dev/hda drive" \
--bootargs="acpi=on selinux=0 apm=off" \
--rootdisk=/dev/hda \
--rootpart=/dev/hda

baconfig detail hardware default-vda --all &> /dev/null || \
baconfig add hardware --name default-vda \
--description="/dev/vda drive" \
--bootargs="acpi=on selinux=0 apm=off insmod=virtio_pci insmod=virtio_blk" \
--rootdisk=/dev/vda \
--rootpart=/dev/vda

baconfig detail hardware default-xvda --all &> /dev/null || \
baconfig add hardware --name default-xvda \
--description="/dev/xvda drive for suse / xen" \
--bootargs="acpi=on selinux=0 apm=off insmod=xenblk,xennet" \
--rootdisk=/dev/xvda \
--rootpart=/dev/xvda \
--cert "sles-11.1-x86_64_xen sles-11.1-x86_xen"

baconfig detail hardware default-nfs --all &> /dev/null || \
baconfig add hardware --name default-nfs \
--description="NFS root" \
--bootargs="acpi=on selinux=0 apm=off insmod=nfs ip=dhcp" \
--rootdisk=/dev/nfs \
--rootpart=/dev/nfs \
--cert "sles-11.1-x86_64 sles-11.1-x86"

baconfig detail hardware default-hp --all &> /dev/null || \
baconfig add hardware --name default-hp \
--description="/dev/cciss smart array" \
--bootargs="acpi=on selinux=0 apm=off" \
--rootdisk=/dev/cciss/c0d0 \
--rootpart=/dev/cciss/c0d0p \
--cert "sles-11.1-x86_64 sles-11.1-x86 sles-10.3-x86_64 sles-10.3-x86"

baconfig detail hardware default-rhel --all &> /dev/null || \
baconfig add hardware --name default-rhel \
--description="hda drive (no /dev)" \
--bootargs="acpi=on selinux=0 apm=off" \
--rootdisk=hda \
--rootpart=hda \
--cert "rhel-5.5-x86_64 rhel-5.5-x86 rhel-5.4-x86_64 rhel-5.4-x86"

baconfig detail hardware default-rhel-hp --all &> /dev/null || \
baconfig add hardware --name default-rhel-hp \
--description="cciss array (no /dev)" \
--bootargs="acpi=on selinux=0 apm=off" \
--rootdisk=cciss/c0d0 \
--rootpart=cciss/c0d0p \
--cert "rhel-5.5-x86_64 rhel-5.5-x86 rhel-5.4-x86_64 rhel-5.4-x86"

baconfig detail hardware default-ubuntu --all &> /dev/null || \
baconfig add hardware --name default-ubuntu \
--description="ubuntu bootargs" \
--rootdisk=/dev/hda \
--rootpart=/dev/hda \
--cert "ubuntu-10.4-x86_64 ubuntu-10.4-x86 ubuntu_desktop-10.4-x86_64 ubuntu_desktop-10.4-x86 ubuntu-9.10-x86_64 ubuntu-9.10-x86"

baconfig detail hardware ubuntu-virtio --all &> /dev/null || \
baconfig add hardware --name ubuntu-virtio \
--description="/dev/vda +ubuntu bootargs" \
--rootdisk=/dev/vda \
--rootpart=/dev/vda \
--cert "ubuntu-10.4-x86_64 ubuntu-10.4-x86 ubuntu_desktop-10.4-x86_64 ubuntu_desktop-10.4-x86 ubuntu-9.10-x86_64 ubuntu-9.10-x86"

baconfig detail hardware default-dasda --all &> /dev/null || \
baconfig add hardware --name default-dasda \
--description="/dev/dasda drive (s390/s390x)" \
--bootargs="selinux=0 TERM=dumb" \
--rootdisk=/dev/dasda \
--rootpart=/dev/dasda \
--cert "sles-11.1-s390x sles-11.1-s390 sles-10.3-s390x sles-10.3-s390"

baconfig detail hardware default-xenserver --all &> /dev/null || \
baconfig add hardware --name default-xenserver \
--description="XenServer install bootargs" \
--bootargs="dom0_mem=752M console=vga --- /boot/vmlinuz console=tty0 --- /install.img" \
--rootdisk=/dev/sda \
--rootpart=/dev/sda \
--cert "xenserver-5.6.0-x86"
