makedist.sh,functions.inc.sh: sync with current production server

This commit is contained in:
Silvan 2023-07-30 11:04:04 +02:00
parent 910cd4cc53
commit e887892a40
3 changed files with 14 additions and 8 deletions

View File

@ -377,7 +377,6 @@ for i in `seq 0 $ALLMEDIASLAST`; do
echo "Releasing $PRODUCT_NAME media (${PLATFORM}/${SUBPLATFORM} $RELEASETAG)" echo "Releasing $PRODUCT_NAME media (${PLATFORM}/${SUBPLATFORM} $RELEASETAG)"
SIMULATE=1 SIMULATE=1
elif [ "$WEEKDAY" = "${MEDIA_WEEKDAY[i]}" -o \ elif [ "$WEEKDAY" = "${MEDIA_WEEKDAY[i]}" -o \
"${MEDIA_WEEKDAY[i]}" = "ANY" -o \
"$FORCEBUILD" = "$PRODUCT_NAME" ]; then "$FORCEBUILD" = "$PRODUCT_NAME" ]; then
echo "Building $PRODUCT_NAME media" echo "Building $PRODUCT_NAME media"
unset SIMULATE unset SIMULATE

View File

@ -1,6 +1,6 @@
# Functions used by makedist scripts # Functions used by makedist scripts
# #
# Copyright (c) 2004-2020 by Silvan Calarco (silvan.calarco@mambasoft.it) # Copyright (c) 2004-2023 by Silvan Calarco (silvan.calarco@mambasoft.it)
# Copyright (c) 2004-2005 by Davide Madrisan (davide.madrisan@gmail.com) # Copyright (c) 2004-2005 by Davide Madrisan (davide.madrisan@gmail.com)
# #
@ -125,6 +125,7 @@ function initialize_root_dir() {
# / to /usr symlinks # / to /usr symlinks
mkdir -p $MOUNTDIR/usr/{bin,sbin,lib} mkdir -p $MOUNTDIR/usr/{bin,sbin,lib}
#ln -s bin $MOUNTDIR/usr/sbin
ln -s usr/bin $MOUNTDIR/bin ln -s usr/bin $MOUNTDIR/bin
ln -s usr/sbin $MOUNTDIR/sbin ln -s usr/sbin $MOUNTDIR/sbin
ln -s usr/lib $MOUNTDIR/lib ln -s usr/lib $MOUNTDIR/lib
@ -137,7 +138,7 @@ function initialize_root_dir() {
#[ $MEDIA = "raw" ] && create_raw_filesystem $LOCALSTATEDIR/$MEDIA_NAME $MEDIA_SIZE 1024k $ROOTFS #[ $MEDIA = "raw" ] && create_raw_filesystem $LOCALSTATEDIR/$MEDIA_NAME $MEDIA_SIZE 1024k $ROOTFS
[ $MEDIA = "raw" ] && create_raw_disk_image $MEDIA_SIZE 1024k [ $MEDIA = "raw" ] && create_raw_disk_image $MEDIA_SIZE 1024k
trap "[ $LOOPDEV ] && losetup -d $LOOPDEV; chroot $MOUNTDIR /usr/bin/gpgconf --kill gpg-agent 2>/dev/null; sleep 10; [ -e $MOUNTDIR/proc/version ] && umount $MOUNTDIR/proc; [ -e $MOUNTDIR/dev/null ] && umount $MOUNTDIR/dev; [ -e $MOUNTDIR/run/systemd ] && umount $MOUNTDIR/run; [ -e $MOUNTDIR/sys/kernel ] && umount $MOUNTDIR/sys; [ \"$MOUNTDIR_TMPFS\" ] && umount $MOUNTDIR_TMPFS" 0 HUP INT QUIT ABRT KILL TERM trap "[ $LOOPDEV ] && losetup -d $LOOPDEV; killall -9 gpg-agent; [ -e $MOUNTDIR/proc/version ] && umount $MOUNTDIR/proc; [ -e $MOUNTDIR/dev/null ] && umount $MOUNTDIR/dev; [ -e $MOUNTDIR/run/systemd ] && umount $MOUNTDIR/run; [ -e $MOUNTDIR/sys/kernel ] && umount $MOUNTDIR/sys; [ \"$MOUNTDIR_TMPFS\" ] && umount $MOUNTDIR_TMPFS" 0 HUP INT QUIT ABRT KILL TERM
} }
function create_rpm_database() { function create_rpm_database() {
@ -172,7 +173,10 @@ $RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --initdb" > ${LOCALSTATEDIR}/${BUILDSCR
mkdir -p $MOUNTDIR/var/lib/rpm mkdir -p $MOUNTDIR/var/lib/rpm
$RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --initdb || $RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --initdb ||
{ echo "$makedist_me: unable to initialize the RPM database" >&2 { echo "$makedist_me: unable to initialize the RPM database" >&2
{ (exit 1); exit 1; }; } echo "$makedist_me: command was: $RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --initdb" >&2
echo "$makedist_me: sleeping 600 seconds"
sleep 600
{ (exit 1); exit 1; }; }
[ -e "$RPM_GPG_KEY" ] && { [ -e "$RPM_GPG_KEY" ] && {
$RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --import $RPM_GPG_KEY $RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --import $RPM_GPG_KEY
echo "$RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --import $RPM_GPG_KEY" >> ${LOCALSTATEDIR}/${BUILDSCRIPT_NAME} echo "$RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --import $RPM_GPG_KEY" >> ${LOCALSTATEDIR}/${BUILDSCRIPT_NAME}
@ -180,10 +184,13 @@ $RPM_CHROOT_PREFIX $RPM $RPM_ROOT_APPEND --initdb" > ${LOCALSTATEDIR}/${BUILDSCR
} }
function clean_rpm_database() { function clean_rpm_database() {
echo "Cleaning rpm database" #echo "Cleaning rpm database"
[ "$MOUNTDIR" != "" -a "$MOUNTDIR" != "/" ] && rm -rf $MOUNTDIR/var/lib/rpm/__db.* #[ "$MOUNTDIR" != "" -a "$MOUNTDIR" != "/" ] && rm -rf $MOUNTDIR/var/lib/rpm/__db.*
echo "Killing any gpg-agent..."
# Kill any gpg-agent daemon spawned daemon preventing umount # Kill any gpg-agent daemon spawned daemon preventing umount
chroot $MOUNTDIR /usr/bin/gpgconf --kill gpg-agent || : killall -9 gpg-agent
rm -rf $MOUNTDIR/root/.gnupg
#chroot $MOUNTDIR /usr/bin/gpgconf --kill gpg-agent || :
} }
function erase_rpm_database() { function erase_rpm_database() {

View File

@ -119,7 +119,7 @@ TARGETDIR=$TARGETSDIR/$MAKEDIST_TARGET
MOUNTDIR=$LOCALSTATEDIR/root.tmp MOUNTDIR=$LOCALSTATEDIR/root.tmp
# Auxiliary mountdir # Auxiliary mountdir
MOUNTDIR2=$LOCALSTATEDIR/root2.tmp MOUNTDIR2=$LOCALSTATEDIR/root2.tmp
MOUNTDIR_TMPFS_SIZE=10G MOUNTDIR_TMPFS_SIZE=16G
[ -d $MOUNTDIR ] && rm -rf $MOUNTDIR [ -d $MOUNTDIR ] && rm -rf $MOUNTDIR
mkdir -p $MOUNTDIR mkdir -p $MOUNTDIR