Initial commit
This commit is contained in:
23
buildtools/TODO.txt
Normal file
23
buildtools/TODO.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
TODO list for RescueBRU-7.1.1
|
||||
|
||||
feature: save config of backup in a backup.conf file to include devices.
|
||||
Check for this file when doing a new backup. Offer to use existing
|
||||
config.
|
||||
|
||||
feature: replace spaces with underscores in new image name.
|
||||
|
||||
bug: on restore, the "original drive was" and "current drive is" info
|
||||
messages may be blank due to inconsistency in how smartctl
|
||||
displays the drive model. the code looks for "Device Model" and
|
||||
sometimes smartctl just outputs "Device"
|
||||
|
||||
bug: when getting a list of images in imageselect() sometime a busy
|
||||
server can make the client appear to lock up. Need a "please wait.."
|
||||
message so user doesn't panic.
|
||||
|
||||
bug: server may appear to lock up when using several functions. Need a
|
||||
"please wait..." message for anything that might have to load data
|
||||
from the CD.
|
||||
|
||||
bug: settings selections submenus don't preselect the current setting as
|
||||
the default-item in the dialog.
|
||||
103
buildtools/buildrescuebru
Normal file
103
buildtools/buildrescuebru
Normal file
@@ -0,0 +1,103 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -e buildtools.conf ]; then
|
||||
cp buildtools.conf.delivered buildtools.conf
|
||||
fi
|
||||
source buildtools.conf
|
||||
|
||||
function buildclient() {
|
||||
echo "buildrescuebru: building client iso image..."
|
||||
cp /mnt/custom/customcd/isoroot/isolinux/isolinux.cfg.client /mnt/custom/customcd/isoroot/isolinux/isolinux.cfg
|
||||
cp /mnt/custom/customcd/isoroot/boot/grub/grub-522.cfg.client /mnt/custom/customcd/isoroot/boot/grub/grub-522.cfg
|
||||
dobuild "client"
|
||||
}
|
||||
|
||||
function buildserver() {
|
||||
echo "buildrescuebru: building server iso image..."
|
||||
cp /mnt/custom/customcd/isoroot/isolinux/isolinux.cfg.server /mnt/custom/customcd/isoroot/isolinux/isolinux.cfg
|
||||
cp /mnt/custom/customcd/isoroot/boot/grub/grub-522.cfg.server /mnt/custom/customcd/isoroot/boot/grub/grub-522.cfg
|
||||
dobuild "server"
|
||||
}
|
||||
|
||||
function dobuild() {
|
||||
echo "buildrescuebru: creating squashfs for $1..."
|
||||
/usr/sbin/sysresccd-custom squashfs
|
||||
echo "buildrescuebru: removing stale sysresccd files from isofile directory..."
|
||||
rm -fv /mnt/custom/customcd/isofile/sysresccd*
|
||||
echo "buildrescuebru: generating new iso/md5 for $volname-$1..."
|
||||
/usr/sbin/sysresccd-custom isogen $volname-$1
|
||||
echo "buildrescuebru: moving sysresccd iso/md5 files to volume name files in xfer directory..."
|
||||
origiso=`ls /mnt/custom/customcd/isofile/sysresccd-*.iso`
|
||||
origmd5=`ls /mnt/custom/customcd/isofile/sysresccd-*.md5`
|
||||
mv -v $origiso /mnt/custom/isoxfer/$volname-$1.iso
|
||||
mv -v $origmd5 /mnt/custom/isoxfer/$volname-$1.md5
|
||||
}
|
||||
|
||||
# ------
|
||||
|
||||
echo -n "Is this a development system or a build machine? [d/b] : "
|
||||
read systype
|
||||
echo -n "Will this be a client CD or server CD or both or no CD? [c/s/b/n] : "
|
||||
read buildtype
|
||||
if [ "$buildtype" != "n" ]; then
|
||||
echo -n "Enter CD volume name : "
|
||||
read volname
|
||||
fi
|
||||
echo -n "Would you like to extract a new customcd? [y/n] : "
|
||||
read ext
|
||||
echo -n "Do you need to chroot into the customcd filesystem? [y/n] : "
|
||||
read chrt
|
||||
if [ "$ext" = "y" ]; then
|
||||
echo "Moving existing customcd to customcd-`date +%Y%m%d%H%M%S`..."
|
||||
mv /mnt/custom/customcd /mnt/custom/customcd-`date +%Y%m%d%H%M%S`
|
||||
echo "Extracting new customcd..."
|
||||
/usr/sbin/sysresccd-custom extract
|
||||
fi
|
||||
if [ "$buildtype" != "n" ]; then
|
||||
mkdir -p /mnt/custom/isoxfer
|
||||
rm -f /mnt/custom/isoxfer/*
|
||||
fi
|
||||
/mnt/custom/buildtools/get_distributables $systype
|
||||
if [ "$REL_TYPE" = "p" ]; then
|
||||
/mnt/custom/buildtools/get_documentation $systype
|
||||
fi
|
||||
/mnt/custom/buildtools/fixpermissions
|
||||
/mnt/custom/buildtools/setsymlinks
|
||||
if [ "$chrt" = "y" ]; then
|
||||
/mnt/custom/buildtools/customchroot
|
||||
fi
|
||||
mkdir -p /mnt/custom/customcd/isoroot/rescuebru-src
|
||||
rm -rf /mnt/custom/customcd/isoroot/rescuebru-src/*
|
||||
cp -R /mnt/custom/rescuebru-src/* /mnt/custom/customcd/isoroot/rescuebru-src
|
||||
|
||||
mkdir -p /mnt/custom/customcd/isoroot/buildtools
|
||||
rm -rf /mnt/custom/customcd/isoroot/buildtools/*
|
||||
cp -R /mnt/custom/buildtools/* /mnt/custom/customcd/isoroot/buildtools
|
||||
case $buildtype in
|
||||
"c" )
|
||||
buildclient
|
||||
;;
|
||||
|
||||
"s" )
|
||||
buildserver
|
||||
;;
|
||||
|
||||
"b" )
|
||||
buildclient
|
||||
buildserver
|
||||
;;
|
||||
"n" )
|
||||
echo "This was a file update only. Not building a new iso."
|
||||
;;
|
||||
esac
|
||||
if [ "$buildtype" != "n" ]; then
|
||||
if [ "$systype" = "b" ]; then
|
||||
echo "buildrescuebru: transferring iso/md5 files back to development system..."
|
||||
/mnt/custom/buildtools/putiso
|
||||
else
|
||||
echo "iso/md5 file generation complete. Files are in /mnt/custom/isoxfer"
|
||||
fi
|
||||
else
|
||||
echo "File update complete."
|
||||
fi
|
||||
|
||||
16
buildtools/buildtools.conf.delivered
Normal file
16
buildtools/buildtools.conf.delivered
Normal file
@@ -0,0 +1,16 @@
|
||||
# buildtools.conf.delivered
|
||||
|
||||
# type of release, c=clean or p=proprietary
|
||||
REL_TYPE="c"
|
||||
|
||||
# path of source files if we are build machine
|
||||
BUILD_SRC_PATH="rwright@bomarc:/home/rwright/latest-rbru/"
|
||||
|
||||
# path of source files if we are a development machine
|
||||
DEV_SRC_PATH="/mnt/custom/rescuebru-src/"
|
||||
|
||||
# path of proprietary documentation files if we are build machine
|
||||
BUILD_DOC_PATH="rwright@bomarc:/home/rwright/RescueBRU/latest-docs/"
|
||||
|
||||
# path on remote development machine where new isos will be put
|
||||
ISO_DEST_PATH="rwright@bomarc:/home/rwright/RescueBRU/rescuebru-isos/"
|
||||
14
buildtools/customchroot
Normal file
14
buildtools/customchroot
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# customchroot - Modify a stock SystemRescueCD
|
||||
|
||||
# Set up the chroot environment
|
||||
for vfs in proc dev sys; do
|
||||
mkdir -p /mnt/custom/customcd/files/$vfs
|
||||
mount -o bind /$vfs /mnt/custom/customcd/files/$vfs
|
||||
done
|
||||
echo "Entering chroot environment. Type exit to leave."
|
||||
chroot /mnt/custom/customcd/files /bin/bash
|
||||
for vfs in proc dev sys; do
|
||||
umount /mnt/custom/customcd/files/$vfs
|
||||
done
|
||||
|
||||
47
buildtools/fixpermissions
Normal file
47
buildtools/fixpermissions
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
executables="\
|
||||
/root/rescuebru/rbruserver.sh \
|
||||
/root/rescuebru/rescuebru.sh \
|
||||
/root/rescuebru/xrbruserver.sh \
|
||||
/root/rescuebru/xrescuebru.sh \
|
||||
/root/rescuebru/clone.sh \
|
||||
/root/rescuebru/blank.sh \
|
||||
/root/rescuebru/faultmonitor.sh \
|
||||
/root/rescuebru/showcapacitywindow.sh \
|
||||
/root/rescuebru/showfaultwindow.sh \
|
||||
/root/rescuebru/showstatuswindow.sh \
|
||||
/root/rescuebru/updatecapacity.sh \
|
||||
/root/rescuebru/updatestatus.sh \
|
||||
/root/autorun1 \
|
||||
/root/autorun2 \
|
||||
/root/autorun3 \
|
||||
/root/autorun4 \
|
||||
/root/srcdtips \
|
||||
/etc/init.d/pxebootsrv \
|
||||
/etc/init.d/sysresccd \
|
||||
/etc/init.d/dostartx \
|
||||
/etc/init.d/dhcpd \
|
||||
/bin/bashlogin \
|
||||
"
|
||||
|
||||
tools="\
|
||||
buildrescuebru \
|
||||
fixpermissions \
|
||||
get_distributables \
|
||||
get_documentation \
|
||||
putiso \
|
||||
setsymlinks \
|
||||
customchroot \
|
||||
updatedevsystem \
|
||||
updatelocalsrc \
|
||||
"
|
||||
|
||||
for x in $executables; do
|
||||
echo "Setting executable bit on $x"
|
||||
chmod +x /mnt/custom/customcd/files$x
|
||||
done
|
||||
for y in $tools; do
|
||||
echo "Setting executable bit on $y"
|
||||
chmod +x /mnt/custom/buildtools/$y
|
||||
done
|
||||
|
||||
40
buildtools/get_distributables
Normal file
40
buildtools/get_distributables
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Getting distributables..."
|
||||
|
||||
if [ ! -e buildtools.conf ]; then
|
||||
cp buildtools.conf.delivered buildtools.conf
|
||||
fi
|
||||
source buildtools.conf
|
||||
|
||||
if [ "$1" = "b" ]; then
|
||||
srcpath=$BUILD_SRC_PATH
|
||||
elif [ "$1" = "d" ]; then
|
||||
srcpath=$DEV_SRC_PATH
|
||||
else
|
||||
echo "Unknown system type parameter."
|
||||
echo "Must be b for build machine or d for dev system."
|
||||
exit 1
|
||||
fi
|
||||
rm -rf /mnt/custom/customcd/files/root/rescuebru/*
|
||||
rm -rf /root/rescuebru/*
|
||||
sleep 2
|
||||
if [ "$1" = "b" ]; then
|
||||
ntpdate 0.pool.ntp.org
|
||||
fi
|
||||
rm -rf /mnt/custom/customcd/isoroot/RescueBRU_Documentation/*
|
||||
rsync -rlptDvz --exclude=*.iso --exclude=*.md5 $srcpath /mnt/custom/
|
||||
find /mnt/custom/customcd/isoroot/RescueBRU_Documentation/ -type f ! -name '*.pdf' ! -name '*.xls' -delete
|
||||
mkdir -p /mnt/custom/rescuebru-src
|
||||
rsync -rlptDvz --del --exclude=*.iso --exclude=*.md5 $srcpath /mnt/custom/rescuebru-src/
|
||||
cp -Rv /mnt/custom/rescuebru-src /mnt/custom/customcd/isoroot
|
||||
if [ ! -d "/root/rescuebru" ]; then
|
||||
mkdir /root/rescuebru
|
||||
fi
|
||||
chmod +x /mnt/custom/buildtools/*
|
||||
chmod -x /mnt/custom/buildtools/*.conf /mnt/custom/buildtools/*.conf.delivered
|
||||
cp -R /mnt/custom/customcd/files/root/rescuebru/* /root/rescuebru
|
||||
|
||||
rm -f /mnt/custom/customcd/files/root/.bash_history
|
||||
rm -rf /mnt/custom/customcd/files/root/.config/geany
|
||||
|
||||
23
buildtools/get_documentation
Normal file
23
buildtools/get_documentation
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Getting proprietary documentation..."
|
||||
|
||||
if [ ! -e buildtools.conf ]; then
|
||||
cp buildtools.conf.delivered buildtools.conf
|
||||
fi
|
||||
source buildtools.conf
|
||||
|
||||
if [ "$1" = "b" ]; then
|
||||
docpath=$BUILD_DOC_PATH
|
||||
mkdir -p /mnt/custom/customcd/isoroot/RescueBRU_Documentation
|
||||
rsync -rlptDvz $docpath/RescueBRU_Documentation /mnt/custom/customcd/isoroot/
|
||||
find /mnt/custom/customcd/isoroot/RescueBRU_Documentation/ -type f ! -name '*.pdf' ! -name '*.xls' -delete
|
||||
elif [ "$1" = "d" ]; then
|
||||
echo "This is a development machine, so leaving documentation as-is."
|
||||
else
|
||||
echo "Unknown system type parameter."
|
||||
echo "Must be b for build machine or d for dev system."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f /mnt/custom/customcd/files/root/.bash_history
|
||||
8
buildtools/putiso
Normal file
8
buildtools/putiso
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
if [ ! -e buildtools.conf ]; then
|
||||
cp buildtools.conf.delivered buildtools.conf
|
||||
fi
|
||||
source buildtools.conf
|
||||
|
||||
isopath=$ISO_DEST_PATH
|
||||
rsync -avz /mnt/custom/isoxfer/ $isopath
|
||||
9
buildtools/setsymlinks
Normal file
9
buildtools/setsymlinks
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
rm -f /mnt/custom/customcd/files/root/rescuebru/rescuebru \
|
||||
/mnt/custom/customcd/files/root/rescuebru/rbruserver \
|
||||
/mnt/custom/customcd/files/root/rescuebru/clone \
|
||||
/mnt/custom/customcd/files/root/rescuebru/blank
|
||||
ln -s /root/rescuebru/rescuebru.sh /mnt/custom/customcd/files/root/rescuebru/rescuebru
|
||||
ln -s /root/rescuebru/rbruserver.sh /mnt/custom/customcd/files/root/rescuebru/rbruserver
|
||||
ln -s /root/rescuebru/clone.sh /mnt/custom/customcd/files/root/rescuebru/clone
|
||||
ln -s /root/rescuebru/blank.sh /mnt/custom/customcd/files/root/rescuebru/blank
|
||||
10
buildtools/updatedevsystem
Normal file
10
buildtools/updatedevsystem
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# updatedevsystem - Push latest src files back to the normal development system
|
||||
if [ ! -e buildtools.conf ]; then
|
||||
cp buildtools.conf.delivered buildtools.conf
|
||||
fi
|
||||
source buildtools.conf
|
||||
|
||||
devsystem=$BUILD_SRC_PATH
|
||||
srcpath=$DEV_SRC_PATH
|
||||
rsync -avz --exclude 'buildtools.conf' $srcpath $devsystem
|
||||
10
buildtools/updatelocalsrc
Normal file
10
buildtools/updatelocalsrc
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# updatelocalsrc - Get latest src files from normal development system
|
||||
if [ ! -e buildtools.conf ]; then
|
||||
cp buildtools.conf.delivered buildtools.conf
|
||||
fi
|
||||
source buildtools.conf
|
||||
|
||||
devsystem=$BUILD_SRC_PATH
|
||||
srcpath=$DEV_SRC_PATH
|
||||
rsync -avz --del --exclude 'buildtools.conf' $devsystem $srcpath
|
||||
Reference in New Issue
Block a user