Commit 31ca1ba9 authored by Steve Kemp's avatar Steve Kemp

Added common scripts to move common code into.

parent 1e0f00a3
......@@ -1206,14 +1206,16 @@ sub postInstallationCustomization
# common files.
#
my @scripts;
push( @scripts, "/usr/lib/rinse/" . lc ( $distribution ) );
push( @scripts, "/usr/lib/rinse/common" );
push( @scripts, "/usr/lib/rinse/" . lc ( $distribution ) );
#
# For each one
#
foreach my $script ( @scripts )
{
$CONFIG{'verbose'} && print "Dir: $script\n";
foreach my $file ( sort( glob( $script . "/*" ) ) )
{
$CONFIG{ 'verbose' } && print "-script $file\n";
......
#!/bin/sh
#
# Ensure the chroot has an /etc/resolv.conf file.
#
# Steve
# --
#
# Get the root of the chroot.
#
prefix=$1
#
# Ensure it exists.
#
if [ ! -d "${prefix}" ]; then
echo "Serious error - the named directory doesn't exist."
exit
fi
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#!/bin/sh
#
# Ensure the chroot has /proc + /sys mounted.
#
# Steve
# --
#
# Get the root of the chroot.
#
prefix=$1
#
# Ensure it exists.
#
if [ ! -d "${prefix}" ]; then
echo "Serious error - the named directory doesn't exist."
exit
fi
#
# Mount /proc + /sys
#
for i in /proc /sys; do
echo " Mounting $i"
if [ ! -d "${prefix}/$i" ]; then
mkdir -p "${prefix}/$i"
fi
#
# Bind-mount
#
mount -o bind $i ${prefix}/${i}
done
\ No newline at end of file
#!/bin/sh
#
# Ensure the chroot has /dev/zero
#
# Steve
# --
#
# Get the root of the chroot.
#
prefix=$1
#
# Ensure it exists.
#
if [ ! -d "${prefix}" ]; then
echo "Serious error - the named directory doesn't exist."
exit
fi
#
# Ensure we have /dev
#
if [ ! -d "${prefix}/dev" ]; then
mkdir "${prefix}/dev"
fi
#
# Create the node
#
echo " Creating devices in /dev"
if [ ! -e "${prefix}/dev/zero" ]; then
mknod -m 666 "${prefix}/dev/zero" c 1 5
fi
......@@ -12,33 +12,13 @@ fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping yum"
chroot ${prefix} /usr/bin/yum -y install yum passwd 2>/dev/null
chroot ${prefix} /usr/bin/yum -y install vim-minimal dhclient 2>/dev/null
#
# 4.5 make 'passwd' work.
# make 'passwd' work.
#
echo " Authfix"
chroot ${prefix} /usr/bin/yum -y install authconfig
......@@ -46,11 +26,12 @@ chroot ${prefix} /usr/bin/authconfig --enableshadow --update
#
# 5. Clean up
# Clean up
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -10,18 +10,10 @@ if [ ! -d "${prefix}" ]; then
exit
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 3.5 BUGFIX:
# BUGFIX:
#
echo "BUGFIX"
mkdir -p ${prefix}/usr/lib/python2.4/site-packages/urlgrabber.skx
for i in ${prefix}/usr/lib/python2.4/site-packages/urlgrabber/keepalive.*; do
......@@ -29,21 +21,15 @@ for i in ${prefix}/usr/lib/python2.4/site-packages/urlgrabber/keepalive.*; do
done
#
# 4. Run "yum install yum".
# Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping yum"
chroot ${prefix} /usr/bin/yum -y install yum 2>/dev/null
chroot ${prefix} /usr/bin/yum -y install vim-minimal 2>/dev/null
chroot ${prefix} /usr/bin/yum -y install dhclient 2>/dev/null
#
# 4.5 make 'passwd' work.
# make 'passwd' work.
#
echo " Authfix"
chroot ${prefix} /usr/bin/yum -y install authconfig
......@@ -55,6 +41,7 @@ chroot ${prefix} /usr/bin/authconfig --enableshadow --update
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -13,18 +13,6 @@ if [ ! -d "${prefix}" ]; then
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -76,12 +64,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Priming the yum cache"
if [ ! -d "${prefix}/var/cache/yum/core/packages/" ]; then
mkdir -p ${prefix}/var/cache/yum/core/packages
......@@ -100,8 +82,8 @@ chroot ${prefix} /usr/bin/yum -y install dhclient 2>/dev/null
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -12,19 +12,6 @@ if [ ! -d "${prefix}" ]; then
exit
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -79,12 +66,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping yum"
chroot ${prefix} /sbin/ldconfig
chroot ${prefix} /usr/bin/yum -y install yum 2>/dev/null
......
......@@ -14,17 +14,6 @@ fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -79,12 +68,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping yum"
chroot ${prefix} /sbin/ldconfig
chroot ${prefix} /usr/bin/yum -y install yum 2>/dev/null
......@@ -98,6 +81,7 @@ chroot ${prefix} /usr/bin/yum -y install dhclient 2>/dev/null
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -14,17 +14,6 @@ fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -79,12 +68,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping yum"
chroot ${prefix} /sbin/ldconfig
chroot ${prefix} /usr/bin/yum -y install yum 2>/dev/null
......@@ -97,8 +80,8 @@ chroot ${prefix} /usr/bin/yum -y install dhclient 2>/dev/null
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -13,18 +13,6 @@ if [ ! -d "${prefix}" ]; then
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -79,12 +67,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping yum"
chroot ${prefix} /sbin/ldconfig
chroot ${prefix} /usr/bin/yum -y install yum 2>/dev/null
......@@ -97,8 +79,8 @@ chroot ${prefix} /usr/bin/yum -y install dhclient 2>/dev/null
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -13,18 +13,6 @@ if [ ! -d "${prefix}" ]; then
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -79,12 +67,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Priming the yum cache"
if [ ! -d "${prefix}/var/cache/yum/core/packages/" ]; then
mkdir -p ${prefix}/var/cache/yum/core/packages
......@@ -103,8 +85,8 @@ chroot ${prefix} /usr/bin/yum -y install dhclient 2>/dev/null
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -13,18 +13,6 @@ if [ ! -d "${prefix}" ]; then
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -76,12 +64,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Priming the yum cache"
if [ ! -d "${prefix}/var/cache/yum/core/packages/" ]; then
mkdir -p ${prefix}/var/cache/yum/core/packages
......@@ -100,8 +82,8 @@ chroot ${prefix} /usr/bin/yum -y install dhclient 2>/dev/null
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -13,24 +13,6 @@ if [ ! -d "${prefix}" ]; then
fi
# There's no pre-existing /dev/zero nor is there one from the packages that are already unpacked.
echo " Creating devices in /dev"
if ! [ -e "${prefix}/dev/zero" ]; then
mknod -m 666 "${prefix}/dev/zero" c 1 5
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the yum directory, so that
# yum doesn't need to make them again.
......@@ -85,12 +67,6 @@ EOF
#
# 4. Run "yum install yum".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Priming the yum cache"
if [ ! -d "${prefix}/var/cache/yum/core/packages/" ]; then
mkdir -p ${prefix}/var/cache/yum/core/packages
......@@ -110,8 +86,8 @@ chroot ${prefix} /usr/bin/yum -y update 2>/dev/null
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/yum clean all
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -10,23 +10,6 @@ if [ ! -d "${prefix}" ]; then
exit
fi
# There's no pre-existing /dev/zero nor is there one from the packages that are already unpacked.
echo " Creating devices in /dev"
if ! [ -e "${prefix}/dev/zero" ]; then
mknod -m 666 "${prefix}/dev/zero" c 1 5
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the zypper directory, so that
# zypper doesn't need to fetch them again.
......@@ -62,12 +45,6 @@ EOF
#
# 4. Run "zypper install zypper".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
# FIXME - Figure out a better way to bootstrap/prime zypper so it doesn't take so long
echo " Bootstrapping zypper - this will take some time!"
chroot ${prefix} /sbin/ldconfig
......@@ -83,8 +60,8 @@ chroot ${prefix} /bin/sh -c "/usr/bin/yes | /usr/bin/zypper update"
#
echo " Cleaning up"
rm -f ${prefix}/var/cache/zypp/packages/opensuse/suse/${arch}/*.rpm
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -10,22 +10,6 @@ if [ ! -d "${prefix}" ]; then
exit
fi
# There's no pre-existing /dev/zero nor is there one from the packages that are already unpacked.
echo " Creating devices in /dev"
if ! [ -e "${prefix}/dev/zero" ]; then
mknod -m 666 "${prefix}/dev/zero" c 1 5
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the zypper directory, so that
......@@ -62,12 +46,6 @@ EOF
#
# 4. Run "zypper install zypper".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping zypper"
chroot ${prefix} /sbin/ldconfig
chroot ${prefix} /usr/bin/zypper -n --no-gpg-checks install zypper 2>/dev/null
......@@ -81,8 +59,8 @@ chroot ${prefix} /usr/bin/zypper -n --no-gpg-checks update 2>/dev/n
#
echo " Cleaning up"
rm -f ${prefix}/var/cache/zypp/packages/opensuse/suse/${arch}/*.rpm
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -10,23 +10,6 @@ if [ ! -d "${prefix}" ]; then
exit
fi
# There's no pre-existing /dev/zero nor is there one from the packages that are already unpacked.
echo " Creating devices in /dev"
if ! [ -e "${prefix}/dev/zero" ]; then
mknod -m 666 "${prefix}/dev/zero" c 1 5
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the zypper directory, so that
# zypper doesn't need to fetch them again.
......@@ -62,12 +45,6 @@ EOF
#
# 4. Run "zypper install zypper".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping zypper"
chroot ${prefix} /sbin/ldconfig
chroot ${prefix} /usr/bin/zypper -n --no-gpg-checks install zypper 2>/dev/null
......@@ -81,8 +58,8 @@ chroot ${prefix} /usr/bin/zypper -n --no-gpg-checks update 2>/dev/n
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/zypper clean
umount ${prefix}/proc
umount ${prefix}/sys
#
......
......@@ -10,24 +10,6 @@ if [ ! -d "${prefix}" ]; then
exit
fi
# There's no pre-existing /dev/zero nor is there one from the packages that are already unpacked.
echo " Creating devices in /dev"
if ! [ -e "${prefix}/dev/zero" ]; then
mknod -m 666 "${prefix}/dev/zero" c 1 5
fi
#
# 1. Make sure there is a resolv.conf file present, such that
# DNS lookups succeed.
#
echo " Creating resolv.conf"
if [ ! -d "${prefix}/etc/" ]; then
mkdir -p "${prefix}/etc/"
fi
cp /etc/resolv.conf "${prefix}/etc/"
#
# 2. Copy the cached .RPM files into the zypper directory, so that
# zypper doesn't need to fetch them again.
......@@ -63,12 +45,6 @@ EOF
#
# 4. Run "zypper install zypper".
#
echo " Mounting /proc"
if [ ! -d "${prefix}/proc" ]; then
mkdir -p "${prefix}/proc"
fi
mount -o bind /proc ${prefix}/proc
echo " Bootstrapping zypper"
chroot ${prefix} /sbin/ldconfig
chroot ${prefix} /usr/bin/zypper -n --no-gpg-checks install zypper 2>/dev/null
......@@ -82,8 +58,8 @@ chroot ${prefix} /usr/bin/zypper -n --no-gpg-checks update 2>/dev/n
#
echo " Cleaning up"
chroot ${prefix} /usr/bin/zypper clean
umount ${prefix}/proc
umount ${prefix}/sys
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment