Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions mksuite.centos
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# NB: you have to be root to run this.
# This uses a Red Hat equivalent of debootstrap, see
# https://github.com/dozzie/yumbootstrap

set -eu

SUITE=centos-6
PUBLISH=/srv/http/noah-blob/ubuntu.tar.gz

# install to chroot env
TARGET=~/$SUITE
rm -rf $TARGET
mkdir $TARGET
/usr/local/sbin/yumbootstrap --verbose \
--group=Core \
$SUITE $TARGET

# fixup
mkdir $TARGET/Users $TARGET/Volumes
chmod u+w $TARGET/proc
mkdir $TARGET/proc/self/
sh -c "echo 'none / hfsplus' > $TARGET/proc/self/mounts"
chmod u-w $TARGET/proc
ln -fs ../proc/self/mounts $TARGET/etc/mtab

# compress
ARCHIVE=$(mktemp --suffix .tar.gz)
echo Archive: $ARCHIVE
tar cfvz $ARCHIVE -C `dirname $TARGET` `basename $TARGET`
mv $ARCHIVE $PUBLISH
chown root:root $PUBLISH
chmod 644 $PUBLISH
rm -rf $TARGET