Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cloudera-os-build' into cloudera…
Browse files Browse the repository at this point in the history
…-os-build
  • Loading branch information
Jenkins committed Mar 23, 2012
2 parents cec8cfc + 7fa3df5 commit 02462c3
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 33 deletions.
7 changes: 4 additions & 3 deletions build_sledgehammer.sh
Expand Up @@ -145,12 +145,13 @@ in_chroot mkdir -p /mnt/cache
sudo mount --bind "$SLEDGEHAMMER_CHROOT_CACHE" "$CHROOT/$CHROOT_PKGDIR"
sudo mount --bind "$SLEDGEHAMMER_LIVECD_CACHE" "$CHROOT/mnt/cache"
setup_sledgehammer_chroot
chroot_install livecd-tools tar
in_chroot touch /mnt/make_sledgehammer
in_chroot chmod 777 /mnt/make_sledgehammer
echo '#!/bin/bash' >>/mnt/make_sledgehammer
echo '#!/bin/bash' >>"$CHROOT/mnt/make_sledgehammer"
if [[ $USE_PROXY = "1" ]]; then
printf "\nno_proxy=%q\nhttp_proxy=%q\nexport no_proxy http_proxy\n" \
printf "\nexport no_proxy=%q http_proxy=%q\n" \
"$no_proxy" "$http_proxy" >> "$CHROOT/mnt/make_sledgehammer"
printf "\nexport NO_PROXY=%q HTTP_PROXY=%q\n" \
"$no_proxy" "$http_proxy" >> "$CHROOT/mnt/make_sledgehammer"
fi
cat >> "$CHROOT/mnt/make_sledgehammer" <<EOF
Expand Down
45 changes: 45 additions & 0 deletions centos-5.7-extra/build_sledgehammer_lib.sh
@@ -0,0 +1,45 @@
#!/bin/bash

# This file contains lobrary routines needed to build Sledgehammer on Centos 5.7

EXTRA_REPOS=('http://mirror.centos.org/centos/5/os/$basearch' \
'http://mirror.centos.org/centos/5/updates/$basearch' \
'http://mirror.centos.org/centos/5/extras/$basearch' \
'http://mirror.pnl.gov/epel/5/$basearch' \
'http://www.nanotechnologies.qc.ca/propos/linux/centos-live/$basearch/live' \
'http://rbel.frameos.org/stable/el5/$basearch')

setup_sledgehammer_chroot() {
local repo rnum
sudo rm -f "$CHROOT/etc/yum.repos.d/"*
rnum=0
for repo in "${EXTRA_REPOS[@]}"; do
add_repos "bare r${rnum} 10 $repo"
rnum=$((rnum + 1))
done
# Make sure yum does not throw away our caches for any reason.
in_chroot /bin/sed -i -e '/keepcache/ s/0/1/' /etc/yum.conf
in_chroot sh -c "echo 'exclude = *.i386' >>/etc/yum.conf"
# fourth, have yum bootstrap everything else into usefulness
in_chroot mkdir -p "/usr/lib/python2.4/site-packages/urlgrabber.broke"
for f in "$CHROOT/usr/lib/python2.4/site-packages/urlgrabber/keepalive"*; do
in_chroot mv "${f#$CHROOT}" \
"/usr/lib/python2.4/site-packages/urlgrabber.broke/"
done
chroot_install livecd-tools rhpl kudzu
# Force livecd-creator to use ext2 instead of ext3.
in_chroot /bin/sed -i -e '/self.__fstype/ s/ext3/ext2/' \
/usr/lib/python2.4/site-packages/imgcreate/creator.py

in_chroot /bin/mv "/sbin/mksquashfs" "/sbin/mksquashfs.orig"
in_chroot touch /sbin/mksquashfs
in_chroot chmod 777 /sbin/mksquashfs
cat > "$CHROOT/sbin/mksquashfs" <<"EOF"
#!/bin/bash
# nuke any -no-progress arg, leave the rest unchanged.
/sbin/mksquashfs.orig "${@//-no-progress/}" </dev/null 2>/dev/null >/dev/nul
EOF
in_chroot /bin/chmod 777 /sbin/mksquashfs
in_chroot /bin/chmod 777 /sbin/mksquashfs.orig
}
129 changes: 129 additions & 0 deletions centos-5.7-extra/sledgehammer.ks
@@ -0,0 +1,129 @@
lang en_US.UTF-8
keyboard us
timezone US/Eastern
auth --useshadow --enablemd5
selinux --disabled
firewall --disabled

repo --name=a-base --baseurl=http://mirror.centos.org/centos/5/os/$basearch
repo --name=a-updates --baseurl=http://mirror.centos.org/centos/5/updates/$basearch
repo --name=a-extras --baseurl=http://mirror.centos.org/centos/5/extras/$basearch
repo --name=a-epel --baseurl=http://mirror.pnl.gov/epel/5/$basearch
repo --name=a-live --baseurl=http://www.nanotechnologies.qc.ca/propos/linux/centos-live/$basearch/live
repo --name=a-rbel --baseurl=http://rbel.frameos.org/stable/el5/$basearch

%packages
bash
kernel
syslinux
passwd
policycoreutils
chkconfig
authconfig
rootfiles
comps-extras
xkeyboard-config
dhclient
tcpdump
vim-enhanced
openssh-clients
openssh-server
OpenIPMI-tools
OpenIPMI
portmap
nfs-utils
procmail
wget
lshw
dmidecode
glibc.i686
libxml2
libxml2-devel
zlib
zlib-devel
libxslt
libxml2.i386
compat-libstdc++-33.i386
pciutils
ntp
which
rpm
coreutils
tar
gzip
mktemp
libsysfs.x86_64
libsysfs.i386
yum
curl
ruby
ruby-libs.x86_64
ruby-devel.x86_64
ruby-ri
ruby-rdoc
rubygems
rubygem-chef
rubygem-ohai
git
gcc
gcc-c++
automake
autoconf
make
perl-XML-Twig
parted

%post

yum -y remove '*.i?86'

########################################################################
# Create a sub-script so the output can be captured
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
########################################################################
cat > /root/post-install << EOF_post
#!/bin/bash

echo ###################################################################
echo ## Creating the centos-live init script
echo ###################################################################

cat > /etc/rc.d/init.d/openstack-start-up << EOF_initscript
#!/bin/bash
#
# live: Init script for live image
#
# chkconfig: 345 72 28
# description: Init script for live image.


EOF_initscript

/sbin/chkconfig --add openstack-start-up

EOF_post

/bin/bash -x /root/post-install 2>&1 | tee /root/post-install.log


%post --nochroot

########################################################################
# Create a sub-script so the output can be captured
# Must change "$" to "\$" and "`" to "\`" to avoid shell quoting
########################################################################
cat > /root/postnochroot-install << EOF_postnochroot
#!/bin/bash

cp *.gem $INSTALL_ROOT/root

cp start-up.sh $INSTALL_ROOT/etc/rc.d/init.d/openstack-start-up
chmod +x $INSTALL_ROOT/etc/rc.d/init.d/openstack-start-up
cp sshd_config $INSTALL_ROOT/etc/ssh/sshd_config

cp dhclient.conf $INSTALL_ROOT/etc

EOF_postnochroot

/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log

1 change: 1 addition & 0 deletions centos-6.2-extra/build_sledgehammer_lib.sh
Expand Up @@ -21,4 +21,5 @@ setup_sledgehammer_chroot() {
in_chroot /bin/sed -i -e '/keepcache/ s/0/1/' /etc/yum.conf
in_chroot sh -c "echo 'exclude = *.i386' >>/etc/yum.conf"
# fourth, have yum bootstrap everything else into usefulness
chroot_install livecd-tools tar
}

0 comments on commit 02462c3

Please sign in to comment.