Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in docs/UPDATING. ack/aout-format images can't be built any more, and booting clang/ELF-format ones is a little different. Updating to the new boot monitor is recommended. Changes in this commit: . drop boot monitor -> allowing dropping ack support . facility to copy ELF boot files to /boot so that old boot monitor can still boot fairly easily, see UPDATING . no more ack-format libraries -> single-case libraries . some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases . drop several ack toolchain commands, but not all support commands (e.g. aal is gone but acksize is not yet). . a few libc files moved to netbsd libc dir . new /bin/date as minix date used code in libc/ . test compile fix . harmonize includes . /usr/lib is no longer special: without ack, /usr/lib plays no kind of special bootstrapping role any more and bootstrapping is done exclusively through packages, so releases depend even less on the state of the machine making them now. . rename nbsd_lib* to lib* . reduce mtree
This commit is contained in:
@@ -33,7 +33,6 @@ usage:
|
||||
@echo "Usage:" >&2
|
||||
@echo " make includes # Install include files" >&2
|
||||
@echo " make depend # Generate dependency files" >&2
|
||||
@echo " make libraries # Make system libraries" >&2
|
||||
@echo " make services # Compile and install all services" >&2
|
||||
@echo " make image # Make needed services and create boot image" >&2
|
||||
@echo " make install # Make image, and install to hard disk" >&2
|
||||
@@ -51,25 +50,10 @@ usage:
|
||||
|
||||
all: services image
|
||||
|
||||
# Pad the kernel text only if ACK compiler is used. padtext does not work for
|
||||
# gnu-like compilers as they generate common I&D and a linker script can do the
|
||||
# same in a nicer way
|
||||
.if ${COMPILER_TYPE} == "gnu"
|
||||
PAD_KERNEL_TEXT := cp ../kernel/kernel kernel
|
||||
.else
|
||||
PAD_KERNEL_TEXT := padtext ../kernel/kernel kernel
|
||||
.endif
|
||||
|
||||
.if ${OBJECT_FMT} == "ELF"
|
||||
image: includes services
|
||||
${PAD_KERNEL_TEXT}
|
||||
cp ../kernel/kernel kernel
|
||||
mkimage $(PROGRAMS)
|
||||
strip -s ${KERNEL} ${PROGRAMS}
|
||||
.else
|
||||
image: includes services
|
||||
${PAD_KERNEL_TEXT}
|
||||
installboot_minix -image $@ $(KERNEL) $(PROGRAMS)
|
||||
.endif
|
||||
|
||||
# rebuild the program or system libraries
|
||||
includes:
|
||||
@@ -86,25 +70,16 @@ services: includes kernel servers .WAIT drivers
|
||||
kernel: includes
|
||||
$(MAKE) -C ../kernel
|
||||
|
||||
.if ${COMPILER_TYPE} == "gnu"
|
||||
servers: includes
|
||||
$(MAKE) -C ../servers all install
|
||||
.else
|
||||
servers: includes
|
||||
$(MAKE) -C ../servers all
|
||||
.endif
|
||||
|
||||
drivers: includes servers
|
||||
$(MAKE) -C ../drivers all install
|
||||
|
||||
libraries: includes
|
||||
cd ../lib && sh ack_build.sh clean obj depend all install
|
||||
|
||||
# make bootable and place system images
|
||||
bootable:
|
||||
exec su root mkboot bootable
|
||||
|
||||
.if ${OBJECT_FMT} == "ELF"
|
||||
hdboot: image
|
||||
rm -rf /boot/minix/.temp/
|
||||
mkdir -p /boot/minix/.temp
|
||||
@@ -113,15 +88,13 @@ hdboot: image
|
||||
do \
|
||||
let n=n+1 >/dev/null; \
|
||||
[ "$$n" -ge 10 ] && prefix="mod" || prefix="mod0"; \
|
||||
cp $$i /boot/minix/.temp/$${prefix}$${n}_`basename $$i`;\
|
||||
newname="/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
|
||||
cp $$i $$newname; \
|
||||
[ -d /boot/image ] && ln -f $$newname /boot/`basename $$i` || true ; \
|
||||
done
|
||||
cp kernel /boot/minix/.temp/
|
||||
[ -d /boot/image ] && ln -f /boot/minix/.temp/kernel /boot/kernel || true
|
||||
exec sh mkboot $@ minix
|
||||
.else
|
||||
hdboot: image
|
||||
exec sh mkboot $@ image
|
||||
@sync
|
||||
.endif
|
||||
|
||||
fdboot: image
|
||||
exec su root mkboot $@
|
||||
|
||||
@@ -12,15 +12,12 @@ make world
|
||||
|
||||
cd tools
|
||||
rm revision
|
||||
rm /boot/image/*
|
||||
make install
|
||||
cp /boot/image/* /boot/image_big # Make big image accessible by this name
|
||||
cp ../boot/boot/boot /boot/boot
|
||||
|
||||
CC=clang make cleandepend clean depend image
|
||||
make cleandepend clean depend image
|
||||
rm revision
|
||||
rm -rf /boot/minix/* # on old systems might not be present
|
||||
CC=clang make install
|
||||
make install
|
||||
cp ../sys/arch/i386/stand/boot/biosboot/boot_monitor /
|
||||
cp -rf /boot/minix/* /boot/minix_default
|
||||
|
||||
@@ -30,4 +27,3 @@ if [ $MAKEMAP -ne 0 ]; then
|
||||
fi
|
||||
make clean
|
||||
make cleandepend
|
||||
find . -name 'obj-*' -type d|xargs rm -rf
|
||||
|
||||
61
tools/mkboot
61
tools/mkboot
@@ -76,13 +76,6 @@ bootable | hdboot)
|
||||
esac
|
||||
|
||||
case $action in
|
||||
bootable)
|
||||
# Install the boot monitor on the root device and make it bootable.
|
||||
install -cs -m 644 $mdec/boot $rootdir/boot/boot || exit
|
||||
sync
|
||||
installboot_minix -device $root $mdec/bootblock /boot/boot || exit
|
||||
test $realroot != $root && umount $root
|
||||
;;
|
||||
hdboot)
|
||||
# Install a new image on the root device.
|
||||
if [ -e $rootdir/boot/$hdboot_t -a ! -d $rootdir/boot/$hdboot_t ]
|
||||
@@ -136,14 +129,6 @@ hdboot)
|
||||
mv /boot/minix/.temp /boot/minix/"$target"
|
||||
rm -f /boot/minix_latest
|
||||
ln -s /boot/minix/"$target" /boot/minix_latest
|
||||
|
||||
# XXX for compatibility with old boot
|
||||
ln -f /boot/minix_latest/kernel /boot/kernel
|
||||
for i in /boot/minix_latest/mod*
|
||||
do
|
||||
lname=`basename $i | sed 's/.*_//'`
|
||||
ln -f "$i" "/boot/$lname"
|
||||
done
|
||||
else
|
||||
# Install the new image.
|
||||
echo "install $hdboot_t $root:/boot/$hdboot_t/$target"
|
||||
@@ -159,52 +144,6 @@ hdboot)
|
||||
test $realroot != $root && umount $root
|
||||
echo "Done."
|
||||
;;
|
||||
fdboot)
|
||||
# fdboot: Make a boot floppy.
|
||||
|
||||
if [ -z "$dev" ]
|
||||
then
|
||||
echo -n \
|
||||
"Finish the name of the floppy device to write (by default 'fd0'): /dev/";
|
||||
read dev
|
||||
case "$dev" in
|
||||
'') dev=/dev/fd0
|
||||
;;
|
||||
/dev/*)
|
||||
;;
|
||||
*) dev=/dev/$dev
|
||||
esac
|
||||
fi
|
||||
|
||||
# Make a file system.
|
||||
umount $dev 2>/dev/null
|
||||
if mkfs -B 1024 -i 512 $dev
|
||||
then :
|
||||
else
|
||||
echo "mkfs of $dev failed."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# Install /dev, /boot/boot and /boot/image.
|
||||
mount $dev /mnt || exit
|
||||
mkdir -p /mnt/boot/image || exit
|
||||
cpdir /dev /mnt/dev || exit
|
||||
cp -p $mdec/boot /mnt/boot/boot || exit
|
||||
cp -p image /mnt/boot/image/ || exit
|
||||
umount $dev || exit
|
||||
|
||||
# Make bootable and copy the boot parameters.
|
||||
installboot_minix -d $dev $mdec/bootblock /boot/boot || exit
|
||||
pfile=fdbootparams
|
||||
if [ -f $pfile ]
|
||||
then echo "Using floppy boot parameters from file $pfile."
|
||||
edparams $dev "`cat $pfile`" || exit
|
||||
else echo "Copying floppy boot parameters from $root."
|
||||
dd if=$root of=$dev skip=1 seek=1 count=1 conv=silent || exit
|
||||
fi
|
||||
edparams $dev 'main(){delay 2000;boot}; save' || exit
|
||||
echo "Test kernel installed on $dev"
|
||||
;;
|
||||
esac
|
||||
sync
|
||||
exit 0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
bin/date src/bin/date
|
||||
common/lib/libprop src/common/lib/libprop
|
||||
nbsd_include/ufs src/sys/ufs
|
||||
include/ufs src/sys/ufs
|
||||
sbin/newfs_ext2fs src/sbin/newfs_ext2fs
|
||||
sbin/fsck_ext2fs src/sbin/fsck_ext2fs
|
||||
lib/libprop src/lib/libprop
|
||||
@@ -7,15 +8,15 @@ common/include/arch/x86 src/sys/arch/x86/include
|
||||
common/include/arch/i386 src/sys/arch/i386/include
|
||||
common/include src/common/include
|
||||
common/lib/libc src/common/lib/libc
|
||||
lib/nbsd_libc src/lib/libc
|
||||
lib/nbsd_libm src/lib/libm
|
||||
lib/libc src/lib/libc
|
||||
lib/libm src/lib/libm
|
||||
lib/libcrypt src/lib/libcrypt
|
||||
lib/libterminfo src/lib/libterminfo
|
||||
lib/libcurses src/lib/libcurses
|
||||
lib/libutil src/lib/libutil
|
||||
common/lib/libutil src/common/lib/libutil
|
||||
lib/libbz2 src/lib/libbz2
|
||||
nbsd_include src/include
|
||||
include src/include
|
||||
bin/mkdir src/bin/mkdir
|
||||
bin/rm src/bin/rm
|
||||
bin/rmdir src/bin/rmdir
|
||||
|
||||
@@ -185,20 +185,15 @@ mkdir -p $RELEASEPACKAGE
|
||||
|
||||
echo " * Transfering bootstrap dirs to $RELEASEDIR"
|
||||
cp -p /bin/* /usr/bin/* /usr/sbin/* /sbin/* $RELEASEDIR/$XBIN
|
||||
cp -rp /usr/lib $RELEASEDIR/usr
|
||||
cp -rp /bin/sh /bin/echo /bin/install /bin/rm \
|
||||
/bin/date /bin/ls $RELEASEDIR/bin
|
||||
cp -rp /usr/bin/make /usr/bin/yacc /usr/bin/lex /usr/bin/asmconv \
|
||||
cp -rp /usr/bin/make /usr/bin/yacc /usr/bin/lex \
|
||||
/usr/bin/grep /usr/bin/egrep /usr/bin/awk /usr/bin/sed $RELEASEDIR/usr/bin
|
||||
|
||||
CONFIGHEADER=$RELEASEDIR/usr/src/common/include/minix/sys_config.h
|
||||
CONFIGHEADER=$RELEASEDIR/usr/src/include/minix/sys_config.h
|
||||
|
||||
copy_local_packages
|
||||
|
||||
# Make sure compilers and libraries are root-owned
|
||||
chown -R root $RELEASEDIR/usr/lib
|
||||
chmod -R u+w $RELEASEDIR/usr/lib
|
||||
|
||||
if [ "$COPY" -ne 1 ]
|
||||
then
|
||||
echo "Retrieving latest minix repo from $REPO."
|
||||
@@ -235,16 +230,6 @@ else
|
||||
IMG=${IMG_BASE}_copy.iso
|
||||
fi
|
||||
|
||||
echo " * Fixups for owners and modes of dirs and files"
|
||||
chown -R root $RELEASEDIR/usr/$SRC
|
||||
chmod -R u+w $RELEASEDIR/usr/$SRC
|
||||
find $RELEASEDIR/usr/$SRC -type d | xargs chmod 755
|
||||
find $RELEASEDIR/usr/$SRC -type f | xargs chmod 644
|
||||
find $RELEASEDIR/usr/$SRC -name configure | xargs chmod 755
|
||||
find $RELEASEDIR/usr/$SRC/commands -name build | xargs chmod 755
|
||||
# Bug tracking system not for on cd
|
||||
rm -rf $RELEASEDIR/usr/$SRC/doc/bugs
|
||||
|
||||
# Make sure the CD knows it's a CD, unless it's not
|
||||
if [ "$USB" -eq 0 ]
|
||||
then date >$RELEASEDIR/CD
|
||||
@@ -279,6 +264,9 @@ rm -rf $RELEASEDIR/$XBIN
|
||||
chown -R root $RELEASEDIR/usr/src*
|
||||
cp issue.install $RELEASEDIR/etc/issue
|
||||
|
||||
echo " * Resetting timestamps"
|
||||
find $RELEASEDIR | xargs touch
|
||||
|
||||
echo $version_pretty, SVN revision $REVISION, generated `date` >$RELEASEDIR/etc/version
|
||||
rm -rf $RELEASEDIR/tmp/*
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
# Author: Kees J. Bot
|
||||
|
||||
echo "
|
||||
#include \"../common/include/minix/config.h\"
|
||||
#include \"../include/minix/config.h\"
|
||||
$*
|
||||
" >/tmp/tell.$$
|
||||
exec </tmp/tell.$$
|
||||
rm /tmp/tell.$$
|
||||
|
||||
exec cc -P -E -
|
||||
exec clang -P -E -
|
||||
|
||||
Reference in New Issue
Block a user