From b0814fec4ea324888e28bb016b3a50b43fc1ac6c Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 23 Nov 2012 20:35:59 +0000 Subject: [PATCH] Fix release.sh to work with NetBSD Build system. Also fix a potential issue where host tools would be compiled dynamically under MINIX. This also updates proto.common.dynamic to use the new placement of the dynamic libraries (/usr/lib) --- Makefile | 2 +- drivers/ramdisk/proto.common.dynamic | 10 +++++----- releasetools/Makefile | 4 ++-- releasetools/chrootmake.sh | 17 ----------------- releasetools/mkboot | 23 ++++++++++++++--------- releasetools/release.sh | 23 +++++++++++++++++------ share/mk/bsd.sys.mk | 1 + 7 files changed, 40 insertions(+), 40 deletions(-) delete mode 100755 releasetools/chrootmake.sh diff --git a/Makefile b/Makefile index 7c2ce1ef1..78fe82535 100644 --- a/Makefile +++ b/Makefile @@ -312,7 +312,7 @@ distribution buildworld: .PHONY .MAKE .if defined(__MINIX) ${MAKEDIRTARGET} releasetools do-hdboot .endif # defined(__MINIX) -.if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/" +.if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/" && ${CHECKFLIST:Uyes} == "yes" ${MAKEDIRTARGET} . postinstall-fix-obsolete ${MAKEDIRTARGET} distrib/sets checkflist .endif diff --git a/drivers/ramdisk/proto.common.dynamic b/drivers/ramdisk/proto.common.dynamic index 302c6d02f..03b137e0b 100644 --- a/drivers/ramdisk/proto.common.dynamic +++ b/drivers/ramdisk/proto.common.dynamic @@ -1,11 +1,11 @@ libexec d--755 0 0 - ld.elf_so ---755 0 0 /libexec/ld.elf_so + ld.elf_so ---755 0 0 /usr/libexec/ld.elf_so $ usr d--755 0 0 lib d--755 0 0 - libc.so.0 ---755 0 0 /lib/libc.so.0 - libminlib.so.0 ---755 0 0 /lib/libminlib.so.0 - libcompat_minix.so.0 ---755 0 0 /lib/libcompat_minix.so.0 - libterminfo.so.0 ---755 0 0 /lib/libterminfo.so.0 + libc.so.0 ---755 0 0 /usr/lib/libc.so.0 + libminlib.so.0 ---755 0 0 /usr/lib/libminlib.so.0 + libcompat_minix.so.0 ---755 0 0 /usr/lib/libcompat_minix.so.0 + libterminfo.so.0 ---755 0 0 /usr/lib/libterminfo.so.0 $ $ diff --git a/releasetools/Makefile b/releasetools/Makefile index 70fb58b3a..5d90d2714 100644 --- a/releasetools/Makefile +++ b/releasetools/Makefile @@ -78,7 +78,7 @@ drivers: includes servers # make bootable and place system images bootable: - exec su root mkboot bootable + exec su root mkboot bootable ${DESTDIR} hdboot: services .WAIT do-hdboot @@ -98,7 +98,7 @@ do-hdboot: @if [ "${MKINSTALLBOOT:Uno}" != "no" ] ; then \ ${STRIP} -s ${DESTDIR}/boot/minix/.temp/* ; \ gzip ${DESTDIR}/boot/minix/.temp/mod* ; \ - ${HOST_SH} mkboot hdboot; \ + ${HOST_SH} mkboot hdboot ${DESTDIR}; \ ${HOST_SH} ../commands/update_bootcfg/update_bootcfg.sh;\ else \ ${INSTALL_DIR} ${DESTDIR}/multiboot; \ diff --git a/releasetools/chrootmake.sh b/releasetools/chrootmake.sh deleted file mode 100755 index 444d33f5d..000000000 --- a/releasetools/chrootmake.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -set -e -export SHELL=/bin/sh -cd /usr/src - -if [ $# -gt 0 ] -then make $@ - exit $? -fi -make world -cp /usr/mdec/boot_monitor / -cp /boot/minix_latest/* /boot/minix_default/ - -if [ $MAKEMAP -ne 0 ]; then - find . -type f -perm 755 | xargs nm -n 2> /dev/null > symbols.txt -fi -make clean cleandepend diff --git a/releasetools/mkboot b/releasetools/mkboot index 4ae3299f0..ec72b3787 100755 --- a/releasetools/mkboot +++ b/releasetools/mkboot @@ -4,7 +4,7 @@ # Author: Kees J. Bot usage() { - echo "Usage: $0 [bootable | hdboot]" >&2 + echo "Usage: $0 [bootable | hdboot] [DESTDIR]" >&2 exit 1 } @@ -28,11 +28,16 @@ rotate_oldest() { trap 'e=$?; rm -f /tmp/mkb.$$; exit $e' 0 2 mdec=/usr/mdec # bootstraps - +# If no DESTDIR specified, then act on / or on the current chroot +DESTDIR= # Check arguments. case "$#:$1" in 1:bootable | 1:hdboot ) - action=$1 dev=$2 size=$3 + # LSC Broken, if $# == 1, then $2,$3 are not set... + action=$1 + ;; +2:bootable | 2:hdboot ) + action=$1 DESTDIR=$2 ;; *) usage esac @@ -100,15 +105,15 @@ hdboot) target="${version}${rrevision}${gitrev}" - rotate_oldest "$rootdir/boot/minix" + rotate_oldest "$DESTDIR/boot/minix" # rotate system processes. We assume latest ones are in # /boot/modules/.temp and we maintain /boot/modules/ by ourselves. - [ -d /boot/minix/.temp ] || exit 1 - rm -rf /boot/minix/"$target"/ - mv /boot/minix/.temp /boot/minix/"$target" - rm -f /boot/minix_latest - ln -s minix/"$target" /boot/minix_latest + [ -d $DESTDIR/boot/minix/.temp ] || exit 1 + rm -rf $DESTDIR/boot/minix/"$target"/ + mv $DESTDIR/boot/minix/.temp $DESTDIR/boot/minix/"$target" + rm -f $DESTDIR/boot/minix_latest + ln -s minix/"$target" $DESTDIR/boot/minix_latest # Save the revision number. test "$revision" != "$oldrev" && echo $revision >revision diff --git a/releasetools/release.sh b/releasetools/release.sh index cbe1fcbb2..526b940ba 100755 --- a/releasetools/release.sh +++ b/releasetools/release.sh @@ -55,7 +55,7 @@ set -- $* $RELOPTS # SVN trunk repo TRUNK=https://gforge.cs.vu.nl/svn/minix/trunk -RELEASEDIR=/usr/r-staging +export RELEASEDIR=/usr/r-staging RELEASEMNTDIR=/usr/r RELEASEPACKAGE=${RELEASEDIR}/usr/install/packages @@ -241,7 +241,7 @@ then fi else echo "Copying contents from current src dir." - ( cd .. && make depend && make clean ) + ( cd .. && make cleandir ) srcdir=/usr/$SRC ( cd $srcdir && tar --exclude .svn -cf - . ) | ( cd $RELEASEDIR/usr && mkdir $SRC && cd $SRC && tar xf - ) REVTAG=copy @@ -261,12 +261,10 @@ chmod 755 $RELEASEDIR/usr/share/mk cp $RELEASEDIR/usr/src/share/mk/* $RELEASEDIR/usr/share/mk/ chown -R root $RELEASEDIR/usr/share/mk rm -f $RELEASEDIR/usr/$SRC/releasetools/revision -cp chrootmake.sh $RELEASEDIR/usr/$SRC/releasetools/chrootmake.sh mkdir -p $RELEASEDIR/etc cp $RELEASEDIR/usr/src/etc/group $RELEASEDIR/etc echo " * Make hierarchy" -sh -c "$LD_LIB chroot $RELEASEDIR sh -c \"$BUILDENV sh -x /usr/$SRC/releasetools/chrootmake.sh etcfiles\"" || exit 1 for p in $PREINSTALLED_PACKAGES do echo " * Pre-installing: $p from $PKG_ADD_URL" @@ -279,8 +277,21 @@ fi echo " * Resetting timestamps" find $RELEASEDIR | xargs touch -echo " * Chroot build" -sh -c "$LD_LIB MAKEMAP=$MAKEMAP chroot $RELEASEDIR sh -c \"$BUILDENV sh -x /usr/$SRC/releasetools/chrootmake.sh\"" || exit 1 +echo " * Build" + +cd $RELEASEDIR/usr/src +make distribution DESTDIR=$RELEASEDIR CHECKFLIST=no +make -C releasetools do-hdboot DESTDIR=$RELEASEDIR MKINSTALLBOOT=yes +cp $RELEASEDIR/usr/mdec/boot_monitor $RELEASEDIR +cp $RELEASEDIR/boot/minix_latest/* $RELEASEDIR/boot/minix_default/ + +if [ $MAKEMAP -ne 0 ]; then + find . -type f -perm 755 | xargs nm -n 2> /dev/null > symbols.txt +fi +make cleandir + +cd - + echo " * Chroot build done" echo " * Removing bootstrap files" rm -rf $RELEASEDIR/$XBIN diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index e0be36948..523de92b3 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -7,6 +7,7 @@ _BSD_SYS_MK_=1 .if ${HOST_OSTYPE:C/\-.*//:U} == "Minix" HOST_CPP?= /usr/lib/cpp +HOST_LDFLAGS?= -static .endif .if ${MKREPRO:Uno} == "yes" -- 2.44.0