Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/i386/floppies Major overhaul, to enable unprivileged...
details: https://anonhg.NetBSD.org/src/rev/e0be1c68db5e
branches: trunk
changeset: 521688:e0be1c68db5e
user: lukem <lukem%NetBSD.org@localhost>
date: Sun Feb 03 16:22:19 2002 +0000
description:
Major overhaul, to enable unprivileged (cross) building, removing the
requirement to build as root on a system with vnconfig.
Use ${KERNSRCDIR} and ${_SRC_TOP_} where appropriate
Remove now-obsolete:
list2sh.awk runlist.sh bootfloppy-common/list
Bootfloppy-*/Makefile: don't need to set DISKTYPE or BLOCK8K any more
Rename bootfloppy-common/Makefile.inc to common/Makefile.bootfloppy
and fdset-common/Makefile.inc to common/Makefile.fdset
This uses makefs instead of vnconfig and disklabel, thus removing the
need for root privileges to build these floppies..
Add common/Makefile.ramdisk, to simplify ramdisk-*/Makefile.
Uses shared ${_SRC_TOP_}/distrib/common/Makefile.crunch and
${_SRC_TOP_}/distrib/common/Makefile.image to even further simply things.
Migrate ramdisk-*/dot.profile to a shared common/dot.profile, which
detects whether it's an install or rescue profile based on the existance
of /sysinst. Remove /dev generation code as init(8) now does that for us.
Migrate common parts of */list to a shared common/list.ramdisk.
Convert ramdisk-*/list to new format used by distrib/common/parselist.awk
Don't bother running pwd_mkdb now that libhack's getpwent parses
/etc/master.passwd instead of /etc/passwd.
Migrate ramdisk-*/mtree.conf to a shared common/mtree.conf, which is now a
new full-path-style specfile.
Remove ramdisk-*/ramdiskbin.conf as it's now automatically generated
from ramdisk-*/list by parselist.awk.
Migrate ramdisk-*/termcap.mini to a shared common/termcap.mini.
Remove unused ramdisk-{small,tiny}/disktab.preinstall.
Use .for loops in kernel-*/Makefile to simply defining mostly-duplicated
targets.
ramdisk-*/Makefile: convert to using common/Makefile.ramdisk
Remove unused ramdisk-*/dot.hdprofile.
diffstat:
distrib/i386/floppies/Makefile.inc | 6 +-
distrib/i386/floppies/bootfloppy-big/Makefile | 5 +-
distrib/i386/floppies/bootfloppy-common/Makefile.inc | 95 ------
distrib/i386/floppies/bootfloppy-common/list | 9 -
distrib/i386/floppies/bootfloppy-ps2/Makefile | 6 +-
distrib/i386/floppies/bootfloppy-small/Makefile | 6 +-
distrib/i386/floppies/bootfloppy-tiny/Makefile | 6 +-
distrib/i386/floppies/common/Makefile.bootfloppy | 89 ++++++
distrib/i386/floppies/common/Makefile.fdset | 94 ++++++
distrib/i386/floppies/common/Makefile.ramdisk | 37 ++
distrib/i386/floppies/common/dot.profile | 81 +++++
distrib/i386/floppies/common/list.ramdisk | 21 +
distrib/i386/floppies/common/mtree.conf | 38 ++
distrib/i386/floppies/common/termcap.mini | 61 ++++
distrib/i386/floppies/fdset-com/Makefile | 4 +-
distrib/i386/floppies/fdset-common/Makefile.inc | 104 -------
distrib/i386/floppies/fdset-laptop/Makefile | 4 +-
distrib/i386/floppies/fdset/Makefile | 4 +-
distrib/i386/floppies/kernel-ramdisk/Makefile | 87 ++---
distrib/i386/floppies/kernel-rescue/Makefile | 60 ++--
distrib/i386/floppies/list2sh.awk | 55 ---
distrib/i386/floppies/ramdisk-big/Makefile | 91 +------
distrib/i386/floppies/ramdisk-big/dot.hdprofile | 62 ----
distrib/i386/floppies/ramdisk-big/dot.profile | 85 ------
distrib/i386/floppies/ramdisk-big/list | 196 ++++++-------
distrib/i386/floppies/ramdisk-big/mtree.conf | 108 -------
distrib/i386/floppies/ramdisk-big/ramdiskbin.conf | 52 ---
distrib/i386/floppies/ramdisk-big/termcap.mini | 61 ----
distrib/i386/floppies/ramdisk-rescuesmall/Makefile | 88 +-----
distrib/i386/floppies/ramdisk-rescuesmall/dot.profile | 72 -----
distrib/i386/floppies/ramdisk-rescuesmall/list | 161 +++++------
distrib/i386/floppies/ramdisk-rescuesmall/mtree.conf | 94 ------
distrib/i386/floppies/ramdisk-rescuesmall/ramdiskbin.conf | 39 --
distrib/i386/floppies/ramdisk-rescuesmall/termcap.mini | 61 ----
distrib/i386/floppies/ramdisk-rescuetiny/Makefile | 88 +-----
distrib/i386/floppies/ramdisk-rescuetiny/dot.profile | 72 -----
distrib/i386/floppies/ramdisk-rescuetiny/list | 157 ++++------
distrib/i386/floppies/ramdisk-rescuetiny/mtree.conf | 94 ------
distrib/i386/floppies/ramdisk-rescuetiny/ramdiskbin.conf | 41 --
distrib/i386/floppies/ramdisk-rescuetiny/termcap.mini | 61 ----
distrib/i386/floppies/ramdisk-small/Makefile | 89 +------
distrib/i386/floppies/ramdisk-small/disktab.preinstall | 31 --
distrib/i386/floppies/ramdisk-small/dot.hdprofile | 62 ----
distrib/i386/floppies/ramdisk-small/dot.profile | 85 ------
distrib/i386/floppies/ramdisk-small/list | 142 ++++-----
distrib/i386/floppies/ramdisk-small/mtree.conf | 107 -------
distrib/i386/floppies/ramdisk-small/ramdiskbin.conf | 38 --
distrib/i386/floppies/ramdisk-small/termcap.mini | 61 ----
distrib/i386/floppies/ramdisk-tiny/Makefile | 89 +------
distrib/i386/floppies/ramdisk-tiny/disktab.preinstall | 31 --
distrib/i386/floppies/ramdisk-tiny/dot.profile | 73 -----
distrib/i386/floppies/ramdisk-tiny/list | 131 ++++-----
distrib/i386/floppies/ramdisk-tiny/mtree.conf | 94 ------
distrib/i386/floppies/ramdisk-tiny/ramdiskbin.conf | 37 --
distrib/i386/floppies/ramdisk-tiny/termcap.mini | 61 ----
distrib/i386/floppies/rescue-small/Makefile | 6 +-
distrib/i386/floppies/rescue-tiny/Makefile | 6 +-
distrib/i386/floppies/runlist.sh | 13 -
58 files changed, 885 insertions(+), 2826 deletions(-)
diffs (truncated from 4113 to 300 lines):
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/Makefile.inc
--- a/distrib/i386/floppies/Makefile.inc Sun Feb 03 15:56:26 2002 +0000
+++ b/distrib/i386/floppies/Makefile.inc Sun Feb 03 16:22:19 2002 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile.inc,v 1.12 2000/05/29 05:37:06 matt Exp $
+# $NetBSD: Makefile.inc,v 1.13 2002/02/03 16:22:19 lukem Exp $
.include "../../../Makefile.inc"
# REV is revision without dots, as in "12C"
# VER is revision with dots, as in "1.2C"
-REV!=sh ${.CURDIR}/../../../../sys/conf/osrelease.sh -s
-VER!=sh ${.CURDIR}/../../../../sys/conf/osrelease.sh
+REV!=sh ${KERNSRCDIR}/conf/osrelease.sh -s
+VER!=sh ${KERNSRCDIR}/conf/osrelease.sh
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/bootfloppy-big/Makefile
--- a/distrib/i386/floppies/bootfloppy-big/Makefile Sun Feb 03 15:56:26 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-big/Makefile Sun Feb 03 16:22:19 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2002/02/03 14:58:24 lukem Exp $
+# $NetBSD: Makefile,v 1.13 2002/02/03 16:22:20 lukem Exp $
TOP= ${.CURDIR}/..
@@ -23,10 +23,9 @@
# This should place the image in i386-cd.img, which can hopefully
# be used to burn a CD.
-DISKTYPE= floppy288
DISKSIZE= 5760
METAFILE!= printf "USTAR.volsize.%o" ${DISKSIZE}
BLOCK8K= 359
PAD=yes
-.include "${TOP}/bootfloppy-common/Makefile.inc"
+.include "${TOP}/common/Makefile.bootfloppy"
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/bootfloppy-common/Makefile.inc
--- a/distrib/i386/floppies/bootfloppy-common/Makefile.inc Sun Feb 03 15:56:26 2002 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.34 2002/02/03 14:56:00 lukem Exp $
-
-# TOP is assumed to be defined by Makefile including this one.
-
-VND?= vnd0
-VND_DEV= /dev/${VND}a
-VND_RDEV= /dev/r${VND}a
-IMAGE?= boot-xxx.fs
-FSTMP= ustar.tmp
-MDEC= ${DESTDIR}/usr/mdec
-BOOTCODE?= ${MDEC}/biosboot.sym
-#BOOTCODE= ${MDEC}/biosboot_com0.sym # Serial output
-STRIP?= strip
-
-DISKTYPE?= floppy3
-DISKSIZE?= 2880
-BLOCK8K?= 179
-
-CLEANFILES+= netbsd boot ustar.tmp ${METAFILE}
-
-realall: netbsd boot
- if test "${METAFILE}" != ""; then \
- touch ${METAFILE}; \
- fi
- tar cvf ${FSTMP} boot ${METAFILE} netbsd
- @echo
- @echo Making disk number one
- rm -f ${IMAGE}.tmp
- dd if=/dev/zero of=${IMAGE}.tmp count=${DISKSIZE}
- vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE}.tmp
- disklabel -rw ${VND} ${DISKTYPE}
- dd bs=8k seek=1 count=${BLOCK8K} if=${FSTMP} of=${VND_RDEV}
- @echo "installing new bootblocks"
- ${MDEC}/installboot -b 17 -v -f ${BOOTCODE} ${VND_RDEV}
- vnconfig -u ${VND}
- @ls -l ${FSTMP} | (read mode links uid gid size junk; \
- dksize=$$((${DISKSIZE} * 512 - 8 * 1024)); \
- disks=$$(($$size / $$dksize + 1)); \
- if test $$size -gt $$dksize; then \
- bytes=$$(($$size - $$dksize)); \
- echo "Image is $$bytes ($$(($$bytes / 1024))K) too big\
- to fit on one disk."; \
- exit 1; \
- else \
- dd seek=$$(($${size} / 512 + 15)) count=1 \
- if=/dev/zero of=${IMAGE}.tmp; \
- fi; \
- echo; \
- bytes=$$(($$dksize * $$disks - $$size)); \
- if test "${PAD}" = "yes"; then \
- size=$$(($$size + 8 * 1024)); \
- echo "Padding image with $$bytes bytes from $$size"; \
- sectors=$$(($$bytes / 512)); \
- ssize=$$(($$size / 512)); \
- dd if=/dev/zero bs=512 seek=$${ssize} of=${IMAGE}.tmp \
- count=$${sectors}; \
- else \
- echo "There are $$bytes ($$(($$bytes / 1024))K) bytes\
- free on disk $$disks."; \
- fi; \
- )
- mv -f ${IMAGE}.tmp ${IMAGE}
-
-# Let the kernel on the diskette be called "netbsd" although
-# it is compressed. This is because the boot code will search
-# for "netbsd" first, and calling it "netbsd" instead of "netbsd.gz"
-# we avoid scanning all the diskettes before reading the file.
-
-netbsd: ${KERN}
- rm -f netbsd
- cp ${KERN} netbsd
-
-# This is "cheating", just so that we have the available
-# space at the start of the tar file. Installboot will overwrite
-# the start of the bootcode with the tail end of the "real", aligned
-# second-stage boot loader when it is run (which is quite a bit shorter
-# than the entire ${BOOTCODE} file, even when symbols are removed.
-# (the first 15*512 bytes are put into the first 8K filesystem block,
-# around the disklabel)
-
-boot: ${BOOTCODE}
- rm -f boot
- cp ${BOOTCODE} boot
- strip boot
-
-release:
- -mkdir -p ${RELEASEDIR}/installation/floppy
- cp -p ${IMAGE} ${RELEASEDIR}/installation/floppy
-
-clean cleandir distclean:
- /bin/rm -f *.core ${CLEANFILES} ${IMAGE} ${IMAGE}.tmp
-
-.include <bsd.own.mk>
-.include <bsd.obj.mk>
-.include <bsd.subdir.mk>
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/bootfloppy-common/list
--- a/distrib/i386/floppies/bootfloppy-common/list Sun Feb 03 15:56:26 2002 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# $NetBSD: list,v 1.4 2000/05/05 20:13:31 mycroft Exp $
-
-# copy the kernel
-# We copy compressed kernel to "netbsd" rather than "netbsd.gz" for two reasons
-# 1) shaves two seconds off the boot as the bootblocks look for netbsd first.
-# 2) avoids possible moment of confusion when bootblocks
-# print "no such file or directory" error before moving on to netbsd.gz
-
-COPY ${OBJDIR}/netbsd netbsd
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/bootfloppy-ps2/Makefile
--- a/distrib/i386/floppies/bootfloppy-ps2/Makefile Sun Feb 03 15:56:26 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-ps2/Makefile Sun Feb 03 16:22:19 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2001/07/30 21:38:22 jdolecek Exp $
+# $NetBSD: Makefile,v 1.3 2002/02/03 16:22:21 lukem Exp $
TOP= ${.CURDIR}/..
@@ -9,8 +9,6 @@
printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/netbsd.INSTALL_PS2.gz\n" | \
${MAKE} -s -f-
-DISKTYPE= floppy
DISKSIZE= 2880
-BLOCK8K= 179
-.include "${TOP}/bootfloppy-common/Makefile.inc"
+.include "${TOP}/common/Makefile.bootfloppy"
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/bootfloppy-small/Makefile
--- a/distrib/i386/floppies/bootfloppy-small/Makefile Sun Feb 03 15:56:26 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-small/Makefile Sun Feb 03 16:22:19 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2000/09/27 16:04:13 fvdl Exp $
+# $NetBSD: Makefile,v 1.10 2002/02/03 16:22:21 lukem Exp $
TOP= ${.CURDIR}/..
@@ -9,8 +9,6 @@
printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/netbsd.INSTALL_SMALL.gz\n" | \
${MAKE} -s -f-
-DISKTYPE= floppy5
DISKSIZE= 2400
-BLOCK8K= 149
-.include "${TOP}/bootfloppy-common/Makefile.inc"
+.include "${TOP}/common/Makefile.bootfloppy"
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/bootfloppy-tiny/Makefile
--- a/distrib/i386/floppies/bootfloppy-tiny/Makefile Sun Feb 03 15:56:26 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-tiny/Makefile Sun Feb 03 16:22:19 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2000/09/27 16:04:14 fvdl Exp $
+# $NetBSD: Makefile,v 1.7 2002/02/03 16:22:21 lukem Exp $
TOP= ${.CURDIR}/..
@@ -9,8 +9,6 @@
printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/netbsd.INSTALL_TINY.gz\n" | \
${MAKE} -s -f-
-DISKTYPE= floppy5
DISKSIZE= 2400
-BLOCK8K= 149
-.include "${TOP}/bootfloppy-common/Makefile.inc"
+.include "${TOP}/common/Makefile.bootfloppy"
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/common/Makefile.bootfloppy
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/i386/floppies/common/Makefile.bootfloppy Sun Feb 03 16:22:19 2002 +0000
@@ -0,0 +1,89 @@
+# $NetBSD: Makefile.bootfloppy,v 1.1 2002/02/03 16:22:21 lukem Exp $
+
+# TOP is assumed to be defined by Makefile including this one.
+
+IMAGE?= boot-xxx.fs
+FSTMP= ustar.tmp
+MDEC= ${DESTDIR}/usr/mdec
+BOOTCODE?= ${MDEC}/biosboot.sym
+#BOOTCODE= ${MDEC}/biosboot_com0.sym # Serial output
+
+DISKSIZE?= 2880
+
+CLEANFILES+= netbsd boot ustar.tmp ${METAFILE}
+
+realall: netbsd boot
+ if test "${METAFILE}" != ""; then \
+ touch ${METAFILE}; \
+ fi
+ ${PAX} -wvf ${FSTMP} boot ${METAFILE} netbsd
+ @echo
+ @echo Making disk number one
+ rm -rf empty
+ mkdir -m 755 empty
+ ${MAKEFS} -s ${DISKSIZE}b ${IMAGE}.tmp empty
+ dd bs=8k seek=1 count=$$((${DISKSIZE} / 16 - 1)) \
+ if=${FSTMP} of=${IMAGE}.tmp
+ @echo "installing new bootblocks"
+ ${MDEC}/installboot -b 17 -v -f ${BOOTCODE} ${IMAGE}.tmp
+ @ls -l ${FSTMP} | (read mode links uid gid size junk; \
+ dksize=$$((${DISKSIZE} * 512 - 8 * 1024)); \
+ disks=$$(($$size / $$dksize + 1)); \
+ if test $$size -gt $$dksize; then \
+ bytes=$$(($$size - $$dksize)); \
+ echo "Image is $$bytes ($$(($$bytes / 1024))K) too big\
+ to fit on one disk."; \
+ exit 1; \
+ else \
+ dd seek=$$(($${size} / 512 + 15)) count=1 \
+ if=/dev/zero of=${IMAGE}.tmp; \
+ fi; \
+ echo; \
+ bytes=$$(($$dksize * $$disks - $$size)); \
+ if test "${PAD}" = "yes"; then \
+ size=$$(($$size + 8 * 1024)); \
+ echo "Padding image with $$bytes bytes from $$size"; \
+ sectors=$$(($$bytes / 512)); \
+ ssize=$$(($$size / 512)); \
+ dd if=/dev/zero bs=512 seek=$${ssize} of=${IMAGE}.tmp \
+ count=$${sectors}; \
+ else \
+ echo "There are $$bytes ($$(($$bytes / 1024))K) bytes\
+ free on disk $$disks."; \
+ fi; \
+ )
+ mv -f ${IMAGE}.tmp ${IMAGE}
+
+# Let the kernel on the diskette be called "netbsd" although
+# it is compressed. This is because the boot code will search
+# for "netbsd" first, and calling it "netbsd" instead of "netbsd.gz"
+# we avoid scanning all the diskettes before reading the file.
+
+netbsd: ${KERN}
+ rm -f netbsd
+ cp ${KERN} netbsd
+
+# This is "cheating", just so that we have the available
+# space at the start of the tar file. Installboot will overwrite
+# the start of the bootcode with the tail end of the "real", aligned
+# second-stage boot loader when it is run (which is quite a bit shorter
+# than the entire ${BOOTCODE} file, even when symbols are removed.
+# (the first 15*512 bytes are put into the first 8K filesystem block,
+# around the disklabel)
+
+boot: ${BOOTCODE}
+ rm -f boot
+ cp ${BOOTCODE} boot
+ ${STRIP} boot
+
+release:
+ -mkdir -p ${RELEASEDIR}/installation/floppy
+ cp -p ${IMAGE} ${RELEASEDIR}/installation/floppy
+
+clean cleandir distclean:
+ rm -f *.core ${CLEANFILES} ${IMAGE} ${IMAGE}.tmp
+ rm -rf empty
+
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.subdir.mk>
diff -r 50b3e4baf8f7 -r e0be1c68db5e distrib/i386/floppies/common/Makefile.fdset
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
Home |
Main Index |
Thread Index |
Old Index