]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix release.sh to work with NetBSD Build system.
authorLionel Sambuc <lionel@minix3.org>
Fri, 23 Nov 2012 20:35:59 +0000 (20:35 +0000)
committerLionel Sambuc <lionel@minix3.org>
Mon, 26 Nov 2012 09:46:19 +0000 (10:46 +0100)
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
drivers/ramdisk/proto.common.dynamic
releasetools/Makefile
releasetools/chrootmake.sh [deleted file]
releasetools/mkboot
releasetools/release.sh
share/mk/bsd.sys.mk

index 7c2ce1ef17fa0d823318fa67938fd565818fb803..78fe825352bddacbff714d36f23d64eb49674cb9 100644 (file)
--- 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
index 302c6d02ff9053640212dd89e0722ddd349b41db..03b137e0b6c6274dc000076edfb52467dfc6b383 100644 (file)
@@ -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
                $
        $
index 70fb58b3acae30ca5b4dafcecc822e096fd9bf5c..5d90d2714c0507bc95248426e4d6793a144a2a38 100644 (file)
@@ -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 (executable)
index 444d33f..0000000
+++ /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
index 4ae3299f0d093e5f44909db6ff9ac23a3f6a2453..ec72b3787586a529c99c3288c6622c22e78509d5 100755 (executable)
@@ -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
index cbe1fcbb26781979613314cb613b593719a72cd4..526b940baf0880d43ca96ffd2bce179430c44082 100755 (executable)
@@ -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
index e0be36948e50e92bd455c6884df6f6e2d4ba603a..523de92b3b5875143d7265f0492fc90c9a0cc626 100644 (file)
@@ -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"