abort on errors (eg disk full)
This commit is contained in:
parent
61f9c5048f
commit
a53cf4388d
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
IMG=$1
|
IMG=$1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
if ! [ $# -eq 1 ]; then
|
if ! [ $# -eq 1 ]; then
|
||||||
echo "usage $0 <img_file_name>"
|
echo "usage $0 <img_file_name>"
|
||||||
exit 1
|
exit 1
|
||||||
@ -16,7 +18,12 @@ ls -als $IMG
|
|||||||
mount -o loop $IMG mnt || exit 1
|
mount -o loop $IMG mnt || exit 1
|
||||||
INSTALLDIR=`pwd`/mnt/
|
INSTALLDIR=`pwd`/mnt/
|
||||||
yum -c $PWD/yum.conf clean packages --installroot=$INSTALLDIR
|
yum -c $PWD/yum.conf clean packages --installroot=$INSTALLDIR
|
||||||
dd if=/dev/zero of=mnt/fillme bs=1M
|
|
||||||
|
# Make sure that rpm database has right format (for rpm version in template, not host)
|
||||||
|
echo "--> Rebuilding rpm database..."
|
||||||
|
chroot `pwd`/mnt /bin/rpm --rebuilddb
|
||||||
|
|
||||||
|
dd if=/dev/zero of=mnt/fillme bs=1M || true
|
||||||
sync
|
sync
|
||||||
rm mnt/fillme
|
rm mnt/fillme
|
||||||
umount mnt
|
umount mnt
|
||||||
|
Loading…
Reference in New Issue
Block a user