releasetools: make replace
. add shellscript (placeprograms.sh) that takes all the already-built boot-time programs, gives them the proper names (modules must be in the right order when sorted alphabetically), and puts them in the right dir, stripped and compressed, just like what was done by the Makefile; . add 'replace' target that just invokes this script so that the minix_latest boot directory is replaced by those executables, for a really quick update Change-Id: I35ecab33b4f7263d7114fc9efd198a0779fdc37b
This commit is contained in:
parent
717425320f
commit
568a958d72
|
|
@ -83,29 +83,25 @@ bootable:
|
|||
|
||||
hdboot install: services .WAIT do-hdboot
|
||||
|
||||
TEMPDIR=${DESTDIR}/boot/minix/.temp/
|
||||
|
||||
do-hdboot:
|
||||
@rm -rf ${DESTDIR}/boot/minix/.temp/
|
||||
${INSTALL_DIR} ${DESTDIR}/boot/minix/.temp
|
||||
# mod_0 is used to make alphabetical order equal to the boot order
|
||||
@n=0; \
|
||||
for i in ${PROGRAMS}; \
|
||||
do \
|
||||
n=`expr $$n + 1`; \
|
||||
[ "$$n" -ge 10 ] && prefix="mod" || prefix="mod0"; \
|
||||
newname="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
|
||||
${INSTALL} $$i $$newname; \
|
||||
done
|
||||
@cp ${PROGROOT}/kernel/kernel ${DESTDIR}/boot/minix/.temp/
|
||||
@rm -rf ${TEMPDIR}
|
||||
${INSTALL_DIR} ${TEMPDIR}
|
||||
${HOST_SH} placeprograms.sh ${TEMPDIR} "${INSTALL}" \
|
||||
"${STRIP} -s" ${PROGRAMS} ${KERNEL}
|
||||
@if [ "${MKINSTALLBOOT:Uno}" != "no" ] ; then \
|
||||
${STRIP} -s ${DESTDIR}/boot/minix/.temp/* ; \
|
||||
gzip ${DESTDIR}/boot/minix/.temp/mod* ; \
|
||||
${HOST_SH} mkboot hdboot ${DESTDIR}; \
|
||||
${HOST_SH} ../commands/update_bootcfg/update_bootcfg.sh;\
|
||||
else \
|
||||
${INSTALL_DIR} ${DESTDIR}/multiboot; \
|
||||
${INSTALL} ${DESTDIR}/boot/minix/.temp/* ${DESTDIR}/multiboot; \
|
||||
${INSTALL} ${TEMPDIR}/* ${DESTDIR}/multiboot; \
|
||||
fi
|
||||
|
||||
replace:
|
||||
${HOST_SH} placeprograms.sh ${DESTDIR}/boot/minix_latest/./ "${INSTALL}" \
|
||||
"${STRIP} -s" ${PROGRAMS} ${KERNEL}
|
||||
|
||||
# download and update NetBSD reference sources.
|
||||
nbsd_fetch:
|
||||
export CVS_RSH=ssh; \
|
||||
|
|
|
|||
57
releasetools/placeprograms.sh
Normal file
57
releasetools/placeprograms.sh
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Script to collect boot-time programs, install them in the given
|
||||
# dir (to boot from), and
|
||||
# for the modules:
|
||||
# . give them filenames so that the sorted names is the boot order,
|
||||
# and gzip them there
|
||||
# for the kernel:
|
||||
# . just copy it
|
||||
|
||||
if [ $# -lt 4 ]
|
||||
then echo "Usage: $0 <installdir> <installcmd> <stripcmd> <programlist ...>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
installdir="$1"
|
||||
|
||||
if [ ! -d "$installdir" ]
|
||||
then echo "$0: expecting directory as first argument, $installdir"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shift
|
||||
|
||||
installcmd="$1"
|
||||
shift
|
||||
|
||||
stripcmd="$1"
|
||||
shift
|
||||
|
||||
rm $installdir/*.gz
|
||||
|
||||
echo "install cmd: $installcmd"
|
||||
|
||||
n=0
|
||||
|
||||
while [ $# -gt 0 ]
|
||||
do n="`expr $n + 1`"
|
||||
if [ $n -ge 10 ]
|
||||
then prefix=mod
|
||||
else prefix=mod0
|
||||
fi
|
||||
file="$1"
|
||||
if [ ! -f $file ]
|
||||
then echo "$0: expecting filenames, $file"
|
||||
exit 1
|
||||
fi
|
||||
basename="`basename $file`"
|
||||
if [ $basename != kernel ]
|
||||
then basename="${prefix}${n}_$basename"
|
||||
fi
|
||||
$installcmd $file $installdir/$basename
|
||||
$stripcmd $installdir/$basename
|
||||
shift
|
||||
done
|
||||
|
||||
gzip $installdir/mod*
|
||||
Loading…
Reference in New Issue
Block a user