From b99600a8761b5fb92bef9c1042975b79e56cf79b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 17 Jun 2011 15:47:37 +0000 Subject: [PATCH] Dracut scripts to assemble a rudimentary base nbroot out of CentOS6 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9844 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot2/check | 3 +++ xCAT-nbroot2/install | 10 ++++++++++ xCAT-nbroot2/installkernel | 4 ++++ xCAT-nbroot2/xcat-cmdline.sh | 14 ++++++++++++++ xCAT-nbroot2/xcatroot | 8 ++++++++ 5 files changed, 39 insertions(+) create mode 100755 xCAT-nbroot2/check create mode 100755 xCAT-nbroot2/install create mode 100755 xCAT-nbroot2/installkernel create mode 100755 xCAT-nbroot2/xcat-cmdline.sh create mode 100755 xCAT-nbroot2/xcatroot diff --git a/xCAT-nbroot2/check b/xCAT-nbroot2/check new file mode 100755 index 000000000..d075f1a42 --- /dev/null +++ b/xCAT-nbroot2/check @@ -0,0 +1,3 @@ +#!/bin/sh +[ "$1" = "-d" ] && echo network +exit 0 diff --git a/xCAT-nbroot2/install b/xCAT-nbroot2/install new file mode 100755 index 000000000..63e703adf --- /dev/null +++ b/xCAT-nbroot2/install @@ -0,0 +1,10 @@ +#!/bin/sh +echo $drivers +dracut_install wget openssl tar ipmitool cpio gzip dash modprobe touch echo cut wc +dracut_install grep ip hostname awk egrep grep dirname expr +dracut_install mount.nfs sshd vi reboot lspci parted libvirtd /usr/share/libvirt/cpu_map.xml mkfs mkfs.ext4 mkfs.btrfs +dracut_install mkswap df brctl vconfig ifenslave ssh-keygen /usr/libexec/qemu-kvm scp clear +inst "$moddir/xcatroot" "/sbin/xcatroot" +inst "/root/.ssh/id_rsa.pub" "/.ssh/authorized_keys" +inst "/lib/terminfo/l/linux" "/lib/terminfo/l/linux" +inst_hook cmdline 10 "$moddir/xcat-cmdline.sh" diff --git a/xCAT-nbroot2/installkernel b/xCAT-nbroot2/installkernel new file mode 100755 index 000000000..0433e9e14 --- /dev/null +++ b/xCAT-nbroot2/installkernel @@ -0,0 +1,4 @@ +#!/bin/bash +instmods nfs sunrpc +instmods e1000 e1000e virtio_net igb ines mlx4_en cxgb3 cxgb4 bnx2 bnx2x bna ixgb qlge mpt2sas ata_piix megaraid_sas virtio_blk ahci ibmaem xhci-hcd sd_mod pmcraid be2net ext3 ext4 btrfs reiserfs usb_storage scsi_wait_scan kvm kvm-intel kvm-amd +instmods macvlan macvtap 8021q bridge bonding diff --git a/xCAT-nbroot2/xcat-cmdline.sh b/xCAT-nbroot2/xcat-cmdline.sh new file mode 100755 index 000000000..3f4b5a9ec --- /dev/null +++ b/xCAT-nbroot2/xcat-cmdline.sh @@ -0,0 +1,14 @@ +root=1 +rootok=1 +netroot=xcat +clear +echo "Wating for network to become available..." +echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh +#/bin/dash +mkdir -p /etc/ssh +mkdir -p /var/empty/sshd +echo sshd:x:30:30:SSH User:/var/empty/sshd:/sbin/nologin >> /etc/passwd +ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C '' -N '' +ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -C '' -N '' +echo 'Protocol 2' >> /etc/ssh/sshd_config +/usr/sbin/sshd diff --git a/xCAT-nbroot2/xcatroot b/xCAT-nbroot2/xcatroot new file mode 100755 index 000000000..b510baabb --- /dev/null +++ b/xCAT-nbroot2/xcatroot @@ -0,0 +1,8 @@ +#!/bin/sh +echo "Starting xCAT mini-environment" +NEWROOT=$3 +XCATMASTER=$XCAT +while : +do + /bin/dash +done