Sun Jan 22 03:53:33 2012 UTC ()
Add "live-image" and "install-image" target support to build.sh.
"live-image" target builds pre-installed disk images that can be used on
emulators or boot from USB memory sticks to try NetBSD without installation.
Currently amd64, i386, pmax, sparc, sparc64, sun2, sun3, and vax
(which have working emulators and don't require extra tools like preparing
msdosfs or partitioning MD label structures) support this target.
"install-image" target builds an bootable installation disk image that can
be used as an install CD but burned into USB memory sticks etc.
Current only amd64 and i386 (which would support USB boot) have this target.
For more details (and known issue) see following posts on netbsd-bugs@:
http://mail-index.NetBSD.org/netbsd-bugs/2011/08/06/msg023639.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/09/23/msg024207.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/07/msg025166.html
http://mail-index.NetBSD.org/netbsd-bugs/2011/12/08/msg025178.html
No particular comments about implementation, and
"go ahead" comments from mrg@, riz@ and christos@.
Closes PR toolchain/45153 and PR misc/45155.
(tsutsui)
diff -r1.96 -r1.97 src/BUILDING
diff -r1.289 -r1.290 src/Makefile
diff -r1.252 -r1.253 src/build.sh
diff -r1.17 -r1.18 src/distrib/Makefile
diff -r1.9 -r1.10 src/distrib/Makefile.inc
diff -r1.5 -r1.6 src/distrib/amd64/Makefile
diff -r0 -r1.1 src/distrib/amd64/installimage/Makefile
diff -r0 -r1.1 src/distrib/amd64/installimage/boot.cfg.in
diff -r0 -r1.1 src/distrib/amd64/installimage/etc.rc
diff -r0 -r1.1 src/distrib/amd64/installimage/etc.ttys
diff -r0 -r1.1 src/distrib/amd64/installimage/install.sh
diff -r0 -r1.1 src/distrib/amd64/installimage/spec.inst
diff -r0 -r1.1 src/distrib/amd64/liveimage/Makefile
diff -r0 -r1.1 src/distrib/amd64/liveimage/Makefile.liveimage
diff -r0 -r1.1 src/distrib/amd64/liveimage/emuimage/Makefile
diff -r0 -r1.1 src/distrib/amd64/liveimage/usbimage/Makefile
diff -r1.18 -r1.19 src/distrib/common/Makefile.bootcd
diff -r0 -r1.1 src/distrib/common/bootimage/Makefile.bootimage
diff -r0 -r1.1 src/distrib/common/bootimage/Makefile.installimage
diff -r0 -r1.1 src/distrib/common/bootimage/Makefile.liveimage
diff -r0 -r1.1 src/distrib/common/bootimage/diskproto.in
diff -r0 -r1.1 src/distrib/common/bootimage/diskproto.mbr.in
diff -r0 -r1.1 src/distrib/common/bootimage/diskproto.noswap.in
diff -r0 -r1.1 src/distrib/common/bootimage/diskproto.noswap.mbr.in
diff -r0 -r1.1 src/distrib/common/bootimage/fstab.in
diff -r0 -r1.1 src/distrib/common/bootimage/fstab.install.in
diff -r0 -r1.1 src/distrib/common/bootimage/spec.in
diff -r1.8 -r1.9 src/distrib/i386/Makefile
diff -r0 -r1.1 src/distrib/i386/installimage/Makefile
diff -r0 -r1.1 src/distrib/i386/installimage/boot.cfg.in
diff -r0 -r1.1 src/distrib/i386/installimage/etc.rc
diff -r0 -r1.1 src/distrib/i386/installimage/etc.ttys
diff -r0 -r1.1 src/distrib/i386/installimage/install.sh
diff -r0 -r1.1 src/distrib/i386/installimage/spec.inst
diff -r0 -r1.1 src/distrib/i386/liveimage/Makefile
diff -r0 -r1.1 src/distrib/i386/liveimage/Makefile.liveimage
diff -r0 -r1.1 src/distrib/i386/liveimage/emuimage/Makefile
diff -r0 -r1.1 src/distrib/i386/liveimage/usbimage/Makefile
diff -r1.4 -r1.5 src/distrib/pmax/Makefile
diff -r0 -r1.1 src/distrib/pmax/liveimage/Makefile
diff -r0 -r1.1 src/distrib/pmax/liveimage/emuimage/Makefile
diff -r1.7 -r1.8 src/distrib/sparc/Makefile
diff -r0 -r1.1 src/distrib/sparc/liveimage/Makefile
diff -r0 -r1.1 src/distrib/sparc/liveimage/emuimage/Makefile
diff -r1.7 -r1.8 src/distrib/sparc64/Makefile
diff -r0 -r1.1 src/distrib/sparc64/liveimage/Makefile
diff -r0 -r1.1 src/distrib/sparc64/liveimage/emuimage/Makefile
diff -r1.9 -r1.10 src/distrib/sun2/Makefile
diff -r0 -r1.1 src/distrib/sun2/liveimage/Makefile
diff -r0 -r1.1 src/distrib/sun2/liveimage/emuimage/Makefile
diff -r1.10 -r1.11 src/distrib/sun3/Makefile
diff -r0 -r1.1 src/distrib/sun3/liveimage/Makefile
diff -r0 -r1.1 src/distrib/sun3/liveimage/emuimage/Makefile
diff -r1.18 -r1.19 src/distrib/vax/Makefile
diff -r0 -r1.1 src/distrib/vax/liveimage/Makefile
diff -r0 -r1.1 src/distrib/vax/liveimage/emuimage/Makefile
diff -r1.395 -r1.396 src/etc/Makefile
--- src/BUILDING 2011/09/09 18:48:34 1.96
+++ src/BUILDING 2012/01/22 03:53:32 1.97
| @@ -617,26 +617,61 @@ BUILDING | | | @@ -617,26 +617,61 @@ BUILDING |
617 | | | 617 | |
618 | Note that other, smaller, CD-ROM images may be created in | | 618 | Note that other, smaller, CD-ROM images may be created in |
619 | the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- | | 619 | the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- |
620 | tory by ``make release''. These smaller images usually | | 620 | tory by ``make release''. These smaller images usually |
621 | contain the same tools as the larger images in | | 621 | contain the same tools as the larger images in |
622 | RELEASEDIR/iso, but do not contain additional content such | | 622 | RELEASEDIR/iso, but do not contain additional content such |
623 | as the distribution sets. | | 623 | as the distribution sets. |
624 | | | 624 | |
625 | Note that the mac68k port still uses an older method of | | 625 | Note that the mac68k port still uses an older method of |
626 | creating CD-ROM images. This requires the mkisofs(1) util- | | 626 | creating CD-ROM images. This requires the mkisofs(1) util- |
627 | ity, which is not part of NetBSD, but which can be | | 627 | ity, which is not part of NetBSD, but which can be |
628 | installed from pkgsrc/sysutils/cdrtools. | | 628 | installed from pkgsrc/sysutils/cdrtools. |
629 | | | 629 | |
| | | 630 | install-image Create a bootable NetBSD installation disk image in the |
| | | 631 | RELEASEDIR/RELEASEMACHINEDIR/installation/installimage |
| | | 632 | directory. The bootable installation disk image is |
| | | 633 | suitable to USB flash memory sticks etc. for machines which |
| | | 634 | may support boot from such USB devices. File system in the |
| | | 635 | bootable disk image will have a layout as described in |
| | | 636 | release(7). |
| | | 637 | |
| | | 638 | The installation image is bootable, and will automatically |
| | | 639 | run the sysinst(8) menu-based installation program, which |
| | | 640 | can be used to install or upgrade a NetBSD system. |
| | | 641 | Bootable installation images also contain tools that may be |
| | | 642 | useful in repairing a damaged NetBSD installation. |
| | | 643 | |
| | | 644 | Before ``make install-image'' is attempted, RELEASEDIR must |
| | | 645 | be populated by ``make release'' or equivalent and |
| | | 646 | RELEASEDIR binaries must be built with ``MKUNPRIVED=yes'' |
| | | 647 | to refer permission information from specfiles. |
| | | 648 | |
| | | 649 | live-image Create NetBSD live images in the |
| | | 650 | RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage |
| | | 651 | directory. The live image contains all necessary files |
| | | 652 | to boot NetBSD upto multi user mode, including all files |
| | | 653 | which should be extracted during installation, NetBSD |
| | | 654 | disklabel, and bootloaders etc. |
| | | 655 | |
| | | 656 | The live image is suitable for misc emulators like QEMU, |
| | | 657 | and also usuful to try NetBSD on real machines with USB |
| | | 658 | flash memory sticks without installation. |
| | | 659 | |
| | | 660 | Before ``make live-image'' is attempted, RELEASEDIR must be |
| | | 661 | populated by ``make release'' or equivalent and RELEASEDIR |
| | | 662 | binaries must be built with ``MKUNPRIVED=yes'' to refer |
| | | 663 | permission information from specfiles. |
| | | 664 | |
630 | regression-tests | | 665 | regression-tests |
631 | Can only be run after building the regression tests in the | | 666 | Can only be run after building the regression tests in the |
632 | directory ``regress''. Runs those compiled regression | | 667 | directory ``regress''. Runs those compiled regression |
633 | tests on the local host. Note that most tests are now man- | | 668 | tests on the local host. Note that most tests are now man- |
634 | aged instead using atf(7); this target should probably run | | 669 | aged instead using atf(7); this target should probably run |
635 | those as well but currently does not. | | 670 | those as well but currently does not. |
636 | | | 671 | |
637 | The "build.sh" script | | 672 | The "build.sh" script |
638 | This script file is a shell script designed to build the entire NetBSD | | 673 | This script file is a shell script designed to build the entire NetBSD |
639 | system on any host with a suitable modern shell and some common utili- | | 674 | system on any host with a suitable modern shell and some common utili- |
640 | ties. The required shell features are described under the HOST_SH vari- | | 675 | ties. The required shell features are described under the HOST_SH vari- |
641 | able. | | 676 | able. |
642 | | | 677 | |
| @@ -728,26 +763,30 @@ BUILDING | | | @@ -728,26 +763,30 @@ BUILDING |
728 | mined from the ``config'' directives in kconf. | | 763 | mined from the ``config'' directives in kconf. |
729 | | | 764 | |
730 | sets Perform ``make sets''. | | 765 | sets Perform ``make sets''. |
731 | | | 766 | |
732 | sourcesets Perform ``make sourcesets''. | | 767 | sourcesets Perform ``make sourcesets''. |
733 | | | 768 | |
734 | syspkgs Perform ``make syspkgs''. | | 769 | syspkgs Perform ``make syspkgs''. |
735 | | | 770 | |
736 | iso-image Perform ``make iso-image''. | | 771 | iso-image Perform ``make iso-image''. |
737 | | | 772 | |
738 | iso-image-source | | 773 | iso-image-source |
739 | Perform ``make iso-image-source''. | | 774 | Perform ``make iso-image-source''. |
740 | | | 775 | |
| | | 776 | install-image Perform ``make install-image''. |
| | | 777 | |
| | | 778 | live-image Perform ``make live-image''. |
| | | 779 | |
741 | The following command line options alter the behaviour of the build.sh | | 780 | The following command line options alter the behaviour of the build.sh |
742 | operations described above: | | 781 | operations described above: |
743 | | | 782 | |
744 | -a arch Set the value of MACHINE_ARCH to arch. | | 783 | -a arch Set the value of MACHINE_ARCH to arch. |
745 | | | 784 | |
746 | -B buildid | | 785 | -B buildid |
747 | Set the value of BUILDID to buildid. This will also append the | | 786 | Set the value of BUILDID to buildid. This will also append the |
748 | build identifier to the name of the ``make'' wrapper script so | | 787 | build identifier to the name of the ``make'' wrapper script so |
749 | that the resulting name is of the form | | 788 | that the resulting name is of the form |
750 | ``nbmake-MACHINE-BUILDID''. | | 789 | ``nbmake-MACHINE-BUILDID''. |
751 | | | 790 | |
752 | -C cdextras | | 791 | -C cdextras |
753 | Append cdextras to the CDEXTRA variable, which is a space-sepa- | | 792 | Append cdextras to the CDEXTRA variable, which is a space-sepa- |
--- src/Makefile 2011/09/09 14:23:37 1.289
+++ src/Makefile 2012/01/22 03:53:32 1.290
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile,v 1.289 2011/09/09 14:23:37 apb Exp $ | | 1 | # $NetBSD: Makefile,v 1.290 2012/01/22 03:53:32 tsutsui Exp $ |
2 | | | 2 | |
3 | # | | 3 | # |
4 | # This is the top-level makefile for building NetBSD. For an outline of | | 4 | # This is the top-level makefile for building NetBSD. For an outline of |
5 | # how to build a snapshot or release, as well as other release engineering | | 5 | # how to build a snapshot or release, as well as other release engineering |
6 | # information, see http://www.NetBSD.org/developers/releng/index.html | | 6 | # information, see http://www.NetBSD.org/developers/releng/index.html |
7 | # | | 7 | # |
8 | # Not everything you can set or do is documented in this makefile. In | | 8 | # Not everything you can set or do is documented in this makefile. In |
9 | # particular, you should review the files in /usr/share/mk (especially | | 9 | # particular, you should review the files in /usr/share/mk (especially |
10 | # bsd.README) for general information on building programs and writing | | 10 | # bsd.README) for general information on building programs and writing |
11 | # Makefiles within this structure, and see the comments in src/etc/Makefile | | 11 | # Makefiles within this structure, and see the comments in src/etc/Makefile |
12 | # for further information on installation and release set options. | | 12 | # for further information on installation and release set options. |
13 | # | | 13 | # |
14 | # Variables listed below can be set on the make command line (highest | | 14 | # Variables listed below can be set on the make command line (highest |
| @@ -61,26 +61,36 @@ | | | @@ -61,26 +61,36 @@ |
61 | # sourcesets: | | 61 | # sourcesets: |
62 | # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR} | | 62 | # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR} |
63 | # syspkgs: | | 63 | # syspkgs: |
64 | # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs | | 64 | # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs |
65 | # from ${DESTDIR} | | 65 | # from ${DESTDIR} |
66 | # iso-image: | | 66 | # iso-image: |
67 | # Create CD-ROM image in RELEASEDIR/iso. | | 67 | # Create CD-ROM image in RELEASEDIR/iso. |
68 | # RELEASEDIR must already have been populated by `make release' | | 68 | # RELEASEDIR must already have been populated by `make release' |
69 | # or equivalent. | | 69 | # or equivalent. |
70 | # iso-image-source: | | 70 | # iso-image-source: |
71 | # Create CD-ROM image with source in RELEASEDIR/iso. | | 71 | # Create CD-ROM image with source in RELEASEDIR/iso. |
72 | # RELEASEDIR must already have been populated by | | 72 | # RELEASEDIR must already have been populated by |
73 | # `make release sourcesets' or equivalent. | | 73 | # `make release sourcesets' or equivalent. |
| | | 74 | # live-image: |
| | | 75 | # Create bootable live image for emulators or USB stick etc. |
| | | 76 | # in RELEASEDIR/liveimage. |
| | | 77 | # RELEASEDIR must already have been populated by `make release' |
| | | 78 | # or equivalent. |
| | | 79 | # install-image: |
| | | 80 | # Create bootable installation image for USB stick etc. |
| | | 81 | # in RELEASEDIR/installimage. |
| | | 82 | # RELEASEDIR must already have been populated by `make release' |
| | | 83 | # or equivalent. |
74 | # | | 84 | # |
75 | # Targets invoked by `make build,' in order: | | 85 | # Targets invoked by `make build,' in order: |
76 | # cleandir: cleans the tree. | | 86 | # cleandir: cleans the tree. |
77 | # do-top-obj: creates the top level object directory. | | 87 | # do-top-obj: creates the top level object directory. |
78 | # do-tools-obj: creates object directories for the host toolchain. | | 88 | # do-tools-obj: creates object directories for the host toolchain. |
79 | # do-tools: builds host toolchain. | | 89 | # do-tools: builds host toolchain. |
80 | # obj: creates object directories. | | 90 | # obj: creates object directories. |
81 | # do-distrib-dirs: creates the distribution directories. | | 91 | # do-distrib-dirs: creates the distribution directories. |
82 | # includes: installs include files. | | 92 | # includes: installs include files. |
83 | # do-tools-compat: builds the "libnbcompat" library; needed for some | | 93 | # do-tools-compat: builds the "libnbcompat" library; needed for some |
84 | # random host tool programs in the source tree. | | 94 | # random host tool programs in the source tree. |
85 | # do-lib-csu: builds and installs prerequisites from lib/csu. | | 95 | # do-lib-csu: builds and installs prerequisites from lib/csu. |
86 | # do-libgcc: builds and installs prerequisites from | | 96 | # do-libgcc: builds and installs prerequisites from |
| @@ -392,26 +402,44 @@ release snapshot: .PHONY .MAKE | | | @@ -392,26 +402,44 @@ release snapshot: .PHONY .MAKE |
392 | iso-image: .PHONY | | 402 | iso-image: .PHONY |
393 | ${MAKEDIRTARGET} distrib iso_image | | 403 | ${MAKEDIRTARGET} distrib iso_image |
394 | ${MAKEDIRTARGET} etc iso-image | | 404 | ${MAKEDIRTARGET} etc iso-image |
395 | @echo "make ${.TARGET} started at: ${START_TIME}" | | 405 | @echo "make ${.TARGET} started at: ${START_TIME}" |
396 | @printf "make ${.TARGET} finished at: " && date | | 406 | @printf "make ${.TARGET} finished at: " && date |
397 | | | 407 | |
398 | iso-image-source: .PHONY | | 408 | iso-image-source: .PHONY |
399 | ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true | | 409 | ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true |
400 | ${MAKEDIRTARGET} etc iso-image | | 410 | ${MAKEDIRTARGET} etc iso-image |
401 | @echo "make ${.TARGET} started at: ${START_TIME}" | | 411 | @echo "make ${.TARGET} started at: ${START_TIME}" |
402 | @printf "make ${.TARGET} finished at: " && date | | 412 | @printf "make ${.TARGET} finished at: " && date |
403 | | | 413 | |
404 | # | | 414 | # |
| | | 415 | # Create bootable live images. |
| | | 416 | # |
| | | 417 | |
| | | 418 | live-image: .PHONY |
| | | 419 | ${MAKEDIRTARGET} etc live-image |
| | | 420 | @echo "make ${.TARGET} started at: ${START_TIME}" |
| | | 421 | @printf "make ${.TARGET} finished at: " && date |
| | | 422 | |
| | | 423 | # |
| | | 424 | # Create bootable installation images. |
| | | 425 | # |
| | | 426 | |
| | | 427 | install-image: .PHONY |
| | | 428 | ${MAKEDIRTARGET} etc install-image |
| | | 429 | @echo "make ${.TARGET} started at: ${START_TIME}" |
| | | 430 | @printf "make ${.TARGET} finished at: " && date |
| | | 431 | |
| | | 432 | # |
405 | # Special components of the "make build" process. | | 433 | # Special components of the "make build" process. |
406 | # | | 434 | # |
407 | | | 435 | |
408 | check-tools: .PHONY | | 436 | check-tools: .PHONY |
409 | .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN) | | 437 | .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN) |
410 | @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.' | | 438 | @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.' |
411 | @echo '*** May result in a failed build or corrupt binaries!' | | 439 | @echo '*** May result in a failed build or corrupt binaries!' |
412 | .elif defined(EXTERNAL_TOOLCHAIN) | | 440 | .elif defined(EXTERNAL_TOOLCHAIN) |
413 | @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.' | | 441 | @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.' |
414 | .endif | | 442 | .endif |
415 | .if defined(NBUILDJOBS) | | 443 | .if defined(NBUILDJOBS) |
416 | @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!' | | 444 | @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!' |
417 | .endif | | 445 | .endif |
--- src/build.sh 2011/12/05 23:04:39 1.252
+++ src/build.sh 2012/01/22 03:53:32 1.253
| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #! /usr/bin/env sh | | 1 | #! /usr/bin/env sh |
2 | # $NetBSD: build.sh,v 1.252 2011/12/05 23:04:39 jym Exp $ | | 2 | # $NetBSD: build.sh,v 1.253 2012/01/22 03:53:32 tsutsui Exp $ |
3 | # | | 3 | # |
4 | # Copyright (c) 2001-2011 The NetBSD Foundation, Inc. | | 4 | # Copyright (c) 2001-2011 The NetBSD Foundation, Inc. |
5 | # All rights reserved. | | 5 | # All rights reserved. |
6 | # | | 6 | # |
7 | # This code is derived from software contributed to The NetBSD Foundation | | 7 | # This code is derived from software contributed to The NetBSD Foundation |
8 | # by Todd Vierling and Luke Mewburn. | | 8 | # by Todd Vierling and Luke Mewburn. |
9 | # | | 9 | # |
10 | # Redistribution and use in source and binary forms, with or without | | 10 | # Redistribution and use in source and binary forms, with or without |
11 | # modification, are permitted provided that the following conditions | | 11 | # modification, are permitted provided that the following conditions |
12 | # are met: | | 12 | # are met: |
13 | # 1. Redistributions of source code must retain the above copyright | | 13 | # 1. Redistributions of source code must retain the above copyright |
14 | # notice, this list of conditions and the following disclaimer. | | 14 | # notice, this list of conditions and the following disclaimer. |
15 | # 2. Redistributions in binary form must reproduce the above copyright | | 15 | # 2. Redistributions in binary form must reproduce the above copyright |
| @@ -854,26 +854,30 @@ Usage: ${progname} [-EhnorUuxy] [-a arch | | | @@ -854,26 +854,30 @@ Usage: ${progname} [-EhnorUuxy] [-a arch |
854 | releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR. | | 854 | releasekernel=conf Install kernel built by kernel=conf to RELEASEDIR. |
855 | installmodules=idir Run "make installmodules" to \`idir' to install all | | 855 | installmodules=idir Run "make installmodules" to \`idir' to install all |
856 | kernel modules. | | 856 | kernel modules. |
857 | modules Build kernel modules. | | 857 | modules Build kernel modules. |
858 | rumptest Do a linktest for rump (for developers). | | 858 | rumptest Do a linktest for rump (for developers). |
859 | sets Create binary sets in | | 859 | sets Create binary sets in |
860 | RELEASEDIR/RELEASEMACHINEDIR/binary/sets. | | 860 | RELEASEDIR/RELEASEMACHINEDIR/binary/sets. |
861 | DESTDIR should be populated beforehand. | | 861 | DESTDIR should be populated beforehand. |
862 | sourcesets Create source sets in RELEASEDIR/source/sets. | | 862 | sourcesets Create source sets in RELEASEDIR/source/sets. |
863 | syspkgs Create syspkgs in | | 863 | syspkgs Create syspkgs in |
864 | RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. | | 864 | RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. |
865 | iso-image Create CD-ROM image in RELEASEDIR/iso. | | 865 | iso-image Create CD-ROM image in RELEASEDIR/iso. |
866 | iso-image-source Create CD-ROM image with source in RELEASEDIR/iso. | | 866 | iso-image-source Create CD-ROM image with source in RELEASEDIR/iso. |
| | | 867 | live-image Create bootable live image in |
| | | 868 | RELEASEDIR/RELEASEMACHINEDIR/installation/liveimage. |
| | | 869 | install-image Create bootable installation image in |
| | | 870 | RELEASEDIR/RELEASEMACHINEDIR/installation/installimage. |
867 | params Display various make(1) parameters. | | 871 | params Display various make(1) parameters. |
868 | | | 872 | |
869 | Options: | | 873 | Options: |
870 | -a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE] | | 874 | -a arch Set MACHINE_ARCH to arch. [Default: deduced from MACHINE] |
871 | -B buildid Set BUILDID to buildid. | | 875 | -B buildid Set BUILDID to buildid. |
872 | -C cdextras Append cdextras to CDEXTRA variable for inclusion on CD-ROM. | | 876 | -C cdextras Append cdextras to CDEXTRA variable for inclusion on CD-ROM. |
873 | -D dest Set DESTDIR to dest. [Default: destdir.MACHINE] | | 877 | -D dest Set DESTDIR to dest. [Default: destdir.MACHINE] |
874 | -E Set "expert" mode; disables various safety checks. | | 878 | -E Set "expert" mode; disables various safety checks. |
875 | Should not be used without expert knowledge of the build system. | | 879 | Should not be used without expert knowledge of the build system. |
876 | -h Print this help message. | | 880 | -h Print this help message. |
877 | -j njob Run up to njob jobs in parallel; see make(1) -j. | | 881 | -j njob Run up to njob jobs in parallel; see make(1) -j. |
878 | -M obj Set obj root directory to obj; sets MAKEOBJDIRPREFIX. | | 882 | -M obj Set obj root directory to obj; sets MAKEOBJDIRPREFIX. |
879 | Unsets MAKEOBJDIR. | | 883 | Unsets MAKEOBJDIR. |
| @@ -1125,26 +1129,34 @@ parseoptions() | | | @@ -1125,26 +1129,34 @@ parseoptions() |
1125 | ;; | | 1129 | ;; |
1126 | | | 1130 | |
1127 | makewrapper|cleandir|obj|tools|build|distribution|release|sets|sourcesets|syspkgs|params) | | 1131 | makewrapper|cleandir|obj|tools|build|distribution|release|sets|sourcesets|syspkgs|params) |
1128 | ;; | | 1132 | ;; |
1129 | | | 1133 | |
1130 | iso-image) | | 1134 | iso-image) |
1131 | op=iso_image # used as part of a variable name | | 1135 | op=iso_image # used as part of a variable name |
1132 | ;; | | 1136 | ;; |
1133 | | | 1137 | |
1134 | iso-image-source) | | 1138 | iso-image-source) |
1135 | op=iso_image_source # used as part of a variable name | | 1139 | op=iso_image_source # used as part of a variable name |
1136 | ;; | | 1140 | ;; |
1137 | | | 1141 | |
| | | 1142 | live-image) |
| | | 1143 | op=live_image # used as part of a variable name |
| | | 1144 | ;; |
| | | 1145 | |
| | | 1146 | install-image) |
| | | 1147 | op=install_image # used as part of a variable name |
| | | 1148 | ;; |
| | | 1149 | |
1138 | kernel=*|releasekernel=*) | | 1150 | kernel=*|releasekernel=*) |
1139 | arg=${op#*=} | | 1151 | arg=${op#*=} |
1140 | op=${op%%=*} | | 1152 | op=${op%%=*} |
1141 | [ -n "${arg}" ] || | | 1153 | [ -n "${arg}" ] || |
1142 | bomb "Must supply a kernel name with \`${op}=...'" | | 1154 | bomb "Must supply a kernel name with \`${op}=...'" |
1143 | ;; | | 1155 | ;; |
1144 | | | 1156 | |
1145 | modules) | | 1157 | modules) |
1146 | op=modules | | 1158 | op=modules |
1147 | ;; | | 1159 | ;; |
1148 | | | 1160 | |
1149 | install=*|installmodules=*) | | 1161 | install=*|installmodules=*) |
1150 | arg=${op#*=} | | 1162 | arg=${op#*=} |
| @@ -1622,27 +1634,27 @@ createmakewrapper() | | | @@ -1622,27 +1634,27 @@ createmakewrapper() |
1622 | else | | 1634 | else |
1623 | makewrapout=">>\${makewrapper}" | | 1635 | makewrapout=">>\${makewrapper}" |
1624 | fi | | 1636 | fi |
1625 | | | 1637 | |
1626 | case "${KSH_VERSION:-${SH_VERSION}}" in | | 1638 | case "${KSH_VERSION:-${SH_VERSION}}" in |
1627 | *PD\ KSH*|*MIRBSD\ KSH*) | | 1639 | *PD\ KSH*|*MIRBSD\ KSH*) |
1628 | set +o braceexpand | | 1640 | set +o braceexpand |
1629 | ;; | | 1641 | ;; |
1630 | esac | | 1642 | esac |
1631 | | | 1643 | |
1632 | eval cat <<EOF ${makewrapout} | | 1644 | eval cat <<EOF ${makewrapout} |
1633 | #! ${HOST_SH} | | 1645 | #! ${HOST_SH} |
1634 | # Set proper variables to allow easy "make" building of a NetBSD subtree. | | 1646 | # Set proper variables to allow easy "make" building of a NetBSD subtree. |
1635 | # Generated from: \$NetBSD: build.sh,v 1.252 2011/12/05 23:04:39 jym Exp $ | | 1647 | # Generated from: \$NetBSD: build.sh,v 1.253 2012/01/22 03:53:32 tsutsui Exp $ |
1636 | # with these arguments: ${_args} | | 1648 | # with these arguments: ${_args} |
1637 | # | | 1649 | # |
1638 | | | 1650 | |
1639 | EOF | | 1651 | EOF |
1640 | { | | 1652 | { |
1641 | for f in ${makeenv}; do | | 1653 | for f in ${makeenv}; do |
1642 | if eval "[ -z \"\${$f}\" -a \"\${${f}-X}\" = \"X\" ]"; then | | 1654 | if eval "[ -z \"\${$f}\" -a \"\${${f}-X}\" = \"X\" ]"; then |
1643 | eval echo "unset ${f}" | | 1655 | eval echo "unset ${f}" |
1644 | else | | 1656 | else |
1645 | eval echo "${f}=\'\$$(echo ${f})\'\;\ export\ ${f}" | | 1657 | eval echo "${f}=\'\$$(echo ${f})\'\;\ export\ ${f}" |
1646 | fi | | 1658 | fi |
1647 | done | | 1659 | done |
1648 | | | 1660 | |
| @@ -1950,26 +1962,37 @@ main() | | | @@ -1950,26 +1962,37 @@ main() |
1950 | cleandir|obj|build|distribution|release|sourcesets|syspkgs|params) | | 1962 | cleandir|obj|build|distribution|release|sourcesets|syspkgs|params) |
1951 | ${runcmd} "${makewrapper}" ${parallel} ${op} || | | 1963 | ${runcmd} "${makewrapper}" ${parallel} ${op} || |
1952 | bomb "Failed to make ${op}" | | 1964 | bomb "Failed to make ${op}" |
1953 | statusmsg "Successful make ${op}" | | 1965 | statusmsg "Successful make ${op}" |
1954 | ;; | | 1966 | ;; |
1955 | | | 1967 | |
1956 | iso-image|iso-image-source) | | 1968 | iso-image|iso-image-source) |
1957 | ${runcmd} "${makewrapper}" ${parallel} \ | | 1969 | ${runcmd} "${makewrapper}" ${parallel} \ |
1958 | CDEXTRA="$CDEXTRA" ${op} || | | 1970 | CDEXTRA="$CDEXTRA" ${op} || |
1959 | bomb "Failed to make ${op}" | | 1971 | bomb "Failed to make ${op}" |
1960 | statusmsg "Successful make ${op}" | | 1972 | statusmsg "Successful make ${op}" |
1961 | ;; | | 1973 | ;; |
1962 | | | 1974 | |
| | | 1975 | live-image) |
| | | 1976 | ${runcmd} "${makewrapper}" ${parallel} ${op} || |
| | | 1977 | bomb "Failed to make ${op}" |
| | | 1978 | statusmsg "Successful make ${op}" |
| | | 1979 | ;; |
| | | 1980 | |
| | | 1981 | install-image) |
| | | 1982 | ${runcmd} "${makewrapper}" ${parallel} ${op} || |
| | | 1983 | bomb "Failed to make ${op}" |
| | | 1984 | statusmsg "Successful make ${op}" |
| | | 1985 | ;; |
1963 | kernel=*) | | 1986 | kernel=*) |
1964 | arg=${op#*=} | | 1987 | arg=${op#*=} |
1965 | buildkernel "${arg}" | | 1988 | buildkernel "${arg}" |
1966 | ;; | | 1989 | ;; |
1967 | | | 1990 | |
1968 | releasekernel=*) | | 1991 | releasekernel=*) |
1969 | arg=${op#*=} | | 1992 | arg=${op#*=} |
1970 | releasekernel "${arg}" | | 1993 | releasekernel "${arg}" |
1971 | ;; | | 1994 | ;; |
1972 | | | 1995 | |
1973 | modules) | | 1996 | modules) |
1974 | buildmodules | | 1997 | buildmodules |
1975 | ;; | | 1998 | ;; |
--- src/distrib/Makefile 2012/01/04 03:43:34 1.17
+++ src/distrib/Makefile 2012/01/22 03:53:32 1.18
| @@ -1,22 +1,24 @@ | | | @@ -1,22 +1,24 @@ |
1 | # $NetBSD: Makefile,v 1.17 2012/01/04 03:43:34 riz Exp $ | | 1 | # $NetBSD: Makefile,v 1.18 2012/01/22 03:53:32 tsutsui Exp $ |
2 | | | 2 | |
3 | .include <bsd.own.mk> | | 3 | .include <bsd.own.mk> |
4 | | | 4 | |
5 | .if ${MKMAN} != "no" | | 5 | .if ${MKMAN} != "no" |
6 | SUBDIR= notes .WAIT | | 6 | SUBDIR= notes .WAIT |
7 | .endif | | 7 | .endif |
8 | | | 8 | |
9 | SUBDIR+= utils | | 9 | SUBDIR+= utils |
10 | | | 10 | |
11 | .if exists(${MACHINE}/miniroot/Makefile.inc) | | 11 | .if exists(${MACHINE}/miniroot/Makefile.inc) |
12 | SUBDIR+= miniroot .WAIT | | 12 | SUBDIR+= miniroot .WAIT |
13 | .endif | | 13 | .endif |
14 | | | 14 | |
15 | .if exists(${RELEASEMACHINE}/Makefile) | | 15 | .if exists(${RELEASEMACHINE}/Makefile) |
16 | SUBDIR+= ${RELEASEMACHINE} | | 16 | SUBDIR+= ${RELEASEMACHINE} |
17 | .endif | | 17 | .endif |
18 | | | 18 | |
19 | TARGETS+=release | | 19 | TARGETS+=release |
20 | TARGETS+=iso_image | | 20 | TARGETS+=iso_image |
| | | 21 | TARGETS+=live_image |
| | | 22 | TARGETS+=install_image |
21 | | | 23 | |
22 | .include <bsd.subdir.mk> | | 24 | .include <bsd.subdir.mk> |
--- src/distrib/Makefile.inc 2007/03/06 21:56:47 1.9
+++ src/distrib/Makefile.inc 2012/01/22 03:53:32 1.10
| @@ -1,5 +1,7 @@ | | | @@ -1,5 +1,7 @@ |
1 | # $NetBSD: Makefile.inc,v 1.9 2007/03/06 21:56:47 bouyer Exp $ | | 1 | # $NetBSD: Makefile.inc,v 1.10 2012/01/22 03:53:32 tsutsui Exp $ |
2 | | | 2 | |
3 | .include "../Makefile.inc" | | 3 | .include "../Makefile.inc" |
4 | | | 4 | |
5 | iso_image: .PHONY | | 5 | iso_image: .PHONY |
| | | 6 | live_image: .PHONY |
| | | 7 | install_image: .PHONY |
--- src/distrib/amd64/Makefile 2011/01/18 00:22:56 1.5
+++ src/distrib/amd64/Makefile 2012/01/22 03:53:32 1.6
| @@ -1,16 +1,24 @@ | | | @@ -1,16 +1,24 @@ |
1 | # $NetBSD: Makefile,v 1.5 2011/01/18 00:22:56 jym Exp $ | | 1 | # $NetBSD: Makefile,v 1.6 2012/01/22 03:53:32 tsutsui Exp $ |
2 | | | 2 | |
3 | SUBDIR= | | 3 | SUBDIR= |
4 | SUBDIR+= ramdisks | | 4 | SUBDIR+= ramdisks |
5 | SUBDIR+= .WAIT | | 5 | SUBDIR+= .WAIT |
6 | SUBDIR+= instkernel | | 6 | SUBDIR+= instkernel |
7 | SUBDIR+= kmod | | 7 | SUBDIR+= kmod |
8 | SUBDIR+= .WAIT | | 8 | SUBDIR+= .WAIT |
9 | SUBDIR+= cdroms | | 9 | SUBDIR+= cdroms |
10 | SUBDIR+= floppies | | 10 | SUBDIR+= floppies |
| | | 11 | SUBDIR+= liveimage |
| | | 12 | SUBDIR+= installimage |
11 | TARGETS+= release | | 13 | TARGETS+= release |
12 | | | 14 | |
13 | iso_image: | | 15 | iso_image: |
14 | ${MAKEDIRTARGET} cdroms iso_image | | 16 | ${MAKEDIRTARGET} cdroms iso_image |
15 | | | 17 | |
| | | 18 | live_image: |
| | | 19 | ${MAKEDIRTARGET} liveimage live_image |
| | | 20 | |
| | | 21 | install_image: |
| | | 22 | ${MAKEDIRTARGET} installimage install_image |
| | | 23 | |
16 | .include <bsd.subdir.mk> | | 24 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
.include <bsd.own.mk>
INSTIMGBASE= amd64inst # gives ${IMGBASE}.img
BOOTDISK= sd0 # for USB flash etc.
IMAGEMB= 550 # for all installation binaries
PRIMARY_BOOT= bootxx_ffsv1
SECONDARY_BOOT= boot
SECONDARY_BOOT_ARG= # unnecessary
USE_MBR= yes
CLEANFILES+= boot.cfg
prepare_md_post:
${TOOL_SED} \
-e "s/@@MACHINE@@/${MACHINE}/" \
-e "s/@@VERSION@@/${DISTRIBVER}/" \
< ${.CURDIR}/boot.cfg.in > boot.cfg
DISTRIBDIR!= cd ${.CURDIR}/../.. ; pwd
SYSINSTDIR!= cd ${DISTRIBDIR}/utils/sysinst/arch/${MACHINE} && ${PRINTOBJDIR}
SPEC_EXTRA= ${.CURDIR}/spec.inst
IMGFILE_EXTRA= \
${DISTRIBDIR}/common/10-resolv.conf libexec/dhcpcd-hooks \
${DISTRIBDIR}/common/99-print-sysinst libexec/dhcpcd-hooks \
${.CURDIR}/etc.ttys etc/ttys \
${.CURDIR}/etc.rc etc/rc \
${.CURDIR}/install.sh . \
${.OBJDIR}/boot.cfg . \
${SYSINSTDIR}/sysinstmsgs.de . \
${SYSINSTDIR}/sysinstmsgs.es . \
${SYSINSTDIR}/sysinstmsgs.fr . \
${SYSINSTDIR}/sysinstmsgs.pl . \
${SYSINSTDIR}/sysinst .
.include "${DISTRIBDIR}/common/bootimage/Makefile.installimage"
banner=Welcome to the NetBSD/@@MACHINE@@ @@VERSION@@ installation image
banner================================================================================
banner=
banner=ACPI (Advanced Configuration and Power Interface) should work on all modern
banner=and legacy hardware. However if you do encounter a problem while booting,
banner=try disabling it and report a bug at http://www.NetBSD.org/.
menu=Install NetBSD:boot netbsd
menu=Install NetBSD (no ACPI):boot netbsd -2
menu=Install NetBSD (no ACPI, no SMP):boot netbsd -12
menu=Drop to boot prompt:prompt
timeout=30
clear=1
# $NetBSD: etc.rc,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
#
# Copyright (c) 1997 Perry E. Metzger
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed for the
# NetBSD Project. See http://www.NetBSD.org/ for
# information about NetBSD.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
# hack to get around bugs in kernfs's rootdev/rrootdev lookup.
ls -l /dev/* > /dev/null 2>&1
mount -u /
mount -t tmpfs tmpfs /tmp
# create a gettytab to autologin and run sysinst
echo "# Autostart sysinst" > /tmp/gettytab
echo -n "sysinst:al=root:lo=/install.sh:im=:sp#" >> /tmp/gettytab
stty speed >> /tmp/gettytab
cp /tmp/gettytab /etc
# done, move on to multiuser mode
exit 0
# $NetBSD: etc.ttys,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
#
# re-launch the sysinst wrapper script on console
#
# name getty type status comments
#
console "/usr/libexec/getty sysinst" wsvt25 on secure
#! /bin/sh -m
# $NetBSD: install.sh,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
#
# -
# Copyright (c) 2010 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Martin Husemann <martin@NetBSD.org>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# setup basic environment
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
termfile=/tmp/sysinst.term
# Check if we are on a framebuffer or on serial console and default
# the terminal type accordingly.
# There is no /var/db/dev.db, so sysctl might not map the devicename properly;
# ttyE0 is 90,0 -> 0x5a00
case $(sysctl -nx kern.consdev) in
002f000000000000)
TERM=wsvt25
;;
*)
if [ -r ${termfile} ]; then
. ${termfile}
else
TERM=vt220
fi
;;
esac
export TERM
HOME=/
export HOME
BLOCKSIZE=1k
export BLOCKSIZE
EDITOR=ed
export EDITOR
SHELL=/bin/sh
export SHELL
umask 022
stty newcrt werase ^W intr ^C kill ^U erase ^?
if [ $TERM != "wsvt25" ]; then
cat << "EOM"
You are using a serial console, we do not know your terminal emulation.
Please select one, typical values are:
vt100
ansi
xterm
EOM
echo -n "Terminal type (just hit ENTER for '$TERM'): "
read ans
if [ -n "$ans" ];then
TERM=$ans
fi
fi
# run the installation or upgrade script.
cd /
cmd=./sysinst
while [ -n "${cmd}" ]
do
${cmd}
if [ $? = 4 ]; then
echo "Oops, something went wrong - we will try again"
exit
else
if [ -n "$(jobs)" ]; then
tput clear
echo "You have stopped sysinst, return to it by" \
"typing 'exit' or ^D."
${SHELL} -i
cmd="fg"
else
cmd=""
fi
fi
done
# remember terminal type, now that we know it for sure
echo "TERM=${TERM}" > ${termfile}
echo
echo "To return to the installer, quit this shell by typing 'exit' or ^D."
exec ${SHELL}
# $NetBSD: spec.inst,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
./mnt2 type=dir mode=0755 uname=root gname=wheel
./targetroot type=dir mode=0755 uname=root gname=wheel
./libexec/dhcpcd-hooks/10-resolv.conf type=file mode=0444 uname=root gname=wheel
./libexec/dhcpcd-hooks/99-print-sysinst type=file mode=0444 uname=root gname=wheel
./install.sh type=file mode=0755 uname=root gname=wheel
./sysinst type=file mode=0755 uname=root gname=wheel
./sysinstmsgs.de type=file mode=0444 uname=root gname=wheel
./sysinstmsgs.es type=file mode=0444 uname=root gname=wheel
./sysinstmsgs.fr type=file mode=0444 uname=root gname=wheel
./sysinstmsgs.pl type=file mode=0444 uname=root gname=wheel
# for sysinst "install from local directory" default
./release type=link mode=0755 uname=root gname=wheel link=.
# XXX what to do for files in ${RELEASEMACHINEDIR}?
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
SUBDIR+= usbimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK?= wd0 # for emulators
PRIMARY_BOOT= bootxx_ffsv1
SECONDARY_BOOT= boot
SECONDARY_BOOT_ARG= # unnecessary
USE_MBR= yes
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
LIVEIMGBASE= amd64emu # gives ${IMGBASE}.img
BOOTDISK= wd0 # for QEMU etc.
.include "${.CURDIR}/../Makefile.liveimage"
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
LIVEIMGBASE= amd64live # gives ${IMGBASE}.img
BOOTDISK= sd0 # for USB flash etc.
IMAGEMB= 1536 # 2GB USB flash memories aren't 2GiB
OMIT_SWAPIMG= yes # no need to write swap
.include "${.CURDIR}/../Makefile.liveimage"
--- src/distrib/common/Makefile.bootcd 2012/01/14 22:56:30 1.18
+++ src/distrib/common/Makefile.bootcd 2012/01/22 03:53:32 1.19
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.bootcd,v 1.18 2012/01/14 22:56:30 jmcneill Exp $ | | 1 | # $NetBSD: Makefile.bootcd,v 1.19 2012/01/22 03:53:32 tsutsui Exp $ |
2 | # | | 2 | # |
3 | # Makefile snipped to create a CD/DVD ISO | | 3 | # Makefile snipped to create a CD/DVD ISO |
4 | # | | 4 | # |
5 | | | 5 | |
6 | # XXX TODO: | | 6 | # XXX TODO: |
7 | # 1) merge with src/distrib/cdrom | | 7 | # 1) merge with src/distrib/cdrom |
8 | # 2) teach makefs to add data from more than 1 directory (see below) | | 8 | # 2) teach makefs to add data from more than 1 directory (see below) |
9 | | | 9 | |
10 | # | | 10 | # |
11 | # Required variables: | | 11 | # Required variables: |
12 | # CDBASE Basename of the iso | | 12 | # CDBASE Basename of the iso |
13 | # | | 13 | # |
14 | # Optional variables: | | 14 | # Optional variables: |
| @@ -38,26 +38,32 @@ | | | @@ -38,26 +38,32 @@ |
38 | | | 38 | |
39 | BOOT?= ${DESTDIR}/usr/mdec/boot | | 39 | BOOT?= ${DESTDIR}/usr/mdec/boot |
40 | BOOTXX_CD9660?= ${DESTDIR}/usr/mdec/bootxx_cd9660 | | 40 | BOOTXX_CD9660?= ${DESTDIR}/usr/mdec/bootxx_cd9660 |
41 | CDRELEASE?= false | | 41 | CDRELEASE?= false |
42 | CDSOURCE?= false | | 42 | CDSOURCE?= false |
43 | .if ${CDRELEASE} == false | | 43 | .if ${CDRELEASE} == false |
44 | CDROMS_RELEASEDIR?= ${MACHINE}/installation/cdrom | | 44 | CDROMS_RELEASEDIR?= ${MACHINE}/installation/cdrom |
45 | .else | | 45 | .else |
46 | CDROMS_RELEASEDIR?= iso | | 46 | CDROMS_RELEASEDIR?= iso |
47 | .endif | | 47 | .endif |
48 | .if defined(CDRELEASE_NOISOS) | | 48 | .if defined(CDRELEASE_NOISOS) |
49 | CDRELEASE_EXCLUDE= -s ',./installation/cdrom.*,,gp' | | 49 | CDRELEASE_EXCLUDE= -s ',./installation/cdrom.*,,gp' |
50 | .endif | | 50 | .endif |
| | | 51 | .if !defined(CDRELEASE_LIVEIMAGE) |
| | | 52 | CDRELEASE_EXCLUDE+= -s ',./installation/liveimage.*,,gp' |
| | | 53 | .endif |
| | | 54 | .if !defined(CDRELEASE_INSTALLIMAGE) |
| | | 55 | CDRELEASE_EXCLUDE+= -s ',./installation/installimage.*,,gp' |
| | | 56 | .endif |
51 | | | 57 | |
52 | .include <bsd.sys.mk> # for HOST_SH | | 58 | .include <bsd.sys.mk> # for HOST_SH |
53 | .include <bsd.own.mk> # For PRINTOBJDIR | | 59 | .include <bsd.own.mk> # For PRINTOBJDIR |
54 | .include <bsd.kernobj.mk> # For KERNSRCDIR | | 60 | .include <bsd.kernobj.mk> # For KERNSRCDIR |
55 | | | 61 | |
56 | DISTRIBVER!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh | | 62 | DISTRIBVER!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh |
57 | DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s | | 63 | DISTRIBREV!= ${HOST_SH} ${KERNSRCDIR}/conf/osrelease.sh -s |
58 | ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z | | 64 | ISO_VOLID!= echo NETBSD_${DISTRIBREV} | tr a-z A-Z |
59 | PUBLISHER?= The_NetBSD_Project | | 65 | PUBLISHER?= The_NetBSD_Project |
60 | .if defined(CDMAKEFSOPTIONS) | | 66 | .if defined(CDMAKEFSOPTIONS) |
61 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER},${CDMAKEFSOPTIONS} | | 67 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER},${CDMAKEFSOPTIONS} |
62 | .else | | 68 | .else |
63 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER} | | 69 | _CDMAKEFSOPTIONS= rockridge,label=${ISO_VOLID},publisher=${PUBLISHER} |
# $NetBSD: Makefile.bootimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
#
# Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Makefile to create a bootable FS image for USB flash or emulators
#
#
# Required variables:
# RELEASEDIR
# Should be defined in nbmake-${MACHINE}
# IMGBASE
# Basename of the image
#
# Optional variables:
# BOOTDISK
# device name of target bootable disk specified in /etc/fstab
# (default: sd0)
# USE_MBR
# set yes if target disk image requires MBR partition
# (defautl: no)
# USE_SUNLABEL
# set yes if target disk image requires Sun's label
# (default: no)
# INSTALLBOOT_AFTER_DISKLABEL (untested)
# set yes if the target ${MACHINE} requires disklabel
# to run installboot(8), like hp300
# (default: empty)
# IMAGEMB
# target image size in MB
# (default: 2048)
# SWAPMB
# swap size in target image in MB
# (default: 128)
# KERN_SET
# kernel set name which should be extracted into image
# (default: kern-GENERIC)
# SETS
# binary sets that should be extracted into image
# (default: modules base etc comp games man misc tests text
# xbase xcomp xetc xfont xserver)
# SETS_DIR
# directory path where binary sets are stored
# (default: ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets)
# IMGFILE_EXTRA
# list of additional files to be copied into images,
# containing one or more tuples of the form:
# FILE TARGETPATH
# for installation image etc.
# (default: empty)
# IMGDIR_EXTRA
# list of additional directories to be copied into images,
# containing one or more tuples of the form:
# DIR TARGETPATH
# for installation image etc.
# (default: empty)
# XXX: currently permittions in IMGDIR_EXTRA are not handled
# IMGDIR_EXCLUDE
# pax(1) options to exclude files which should not copied
# into TARGETPATH in IMGDIR_EXTRA
# (default: empty)
# FSTAB_IN
# template file of /etc/fstab
# (default: ${DISTRIBDIR}/common/bootimage/fstab.in)
# SPEC_IN
# default files of spec file for makefs(8)
# (default: ${DISTRIBDIR}/common/bootimage/spec.in)
# SPEC_EXTRA
# additional files of spec file for makefs(8)
# (default: empty)
# IMGMAKEFSOPTIONS
# options passed to makefs(8) to create root file system
# (default: -o bsize=16384,fsize=2048,density=8192)
# PRIMARY_BOOT
# primary boot loader that should be installed into
# the target image via installboot(8)
# (default: empty)
# SECONDARY_BOOT
# secondary bootloader that should be put into the target image
# (default: empty)
# SECONDARY_BOOT_ARG
# extra arguments that should be passed to installboot(8)
# to specify the secondary bootloader
# (default: empty)
# DISKPROTO_IN
# template file of disklabel -R
# (default: ${DISTRIBDIR}/common/bootimage/diskproto.in
# or ${DISTRIBDIR}/common/bootimage/diskproto.mbr.in)
# OMIT_SWAPIMG
# no need to put swap partition into image (for USB stick)
# (default: no)
#
.include <bsd.sys.mk> # for HOST_SH
.include <bsd.own.mk> #
.include <bsd.endian.mk> # for TARGET_ENDIANNESS
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
.if empty(IMGBASE)
.BEGIN:
@echo "Error: IMGBASE is not set"
@false
.endif
.if empty(RELEASEDIR)
.BEGIN:
@echo "Error: RELEASEDIR is not set"
@false
.endif
# should be defined elsewhere?
CAT?= cat
CHMOD?= chmod
CP?= cp
DD?= dd
MKDIR?= mkdir -p
RM?= rm
#
# common definitions for image
#
BOOTDISK?= sd0
USE_MBR?= no
USE_SUNLABEL?= no
INSTALLBOOT_AFTER_DISKLABEL?= no
#
# size parameters for image
#
IMAGEMB?= 2048 # 2048MB
SWAPMB?= 128 # 128MB
IMAGESECTORS!= expr ${IMAGEMB} \* 1024 \* 1024 / 512
SWAPSECTORS!= expr ${SWAPMB} \* 1024 \* 1024 / 512
.if ${USE_MBR} == "no"
LABELSECTORS?= 0
.else
#LABELSECTORS?= 63 # historical
#LABELSECTORS?= 32 # 16KB aligned
LABELSECTORS?= 2048 # 1MB aligned for modern flash devices
.endif
FSSECTORS!= expr ${IMAGESECTORS} - ${SWAPSECTORS} - ${LABELSECTORS}
FSSIZE!= expr ${FSSECTORS} \* 512
# parameters for disklabel and MBR
HEADS= 64
SECTORS= 32
CYLINDERS!= expr ${IMAGESECTORS} / \( ${HEADS} \* ${SECTORS} \)
SECPERCYLINDERS!= expr ${HEADS} \* ${SECTORS}
MBRHEADS= 255
MBRSECTORS= 63
MBRCYLINDERS!= expr ${IMAGESECTORS} / \( ${MBRHEADS} \* ${MBRSECTORS} \)
MBRNETBSD= 169
BSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS}
FSOFFSET= ${LABELSECTORS}
SWAPOFFSET!= expr ${LABELSECTORS} + ${FSSECTORS}
# parameters for sunlabel
FSCYLINDERS!= expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \)
SWAPCYLINDERS!= expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \)
#
# definitions to create root fs
#
SETS_DEFAULT= modules base etc comp games man misc tests text
.if ${MKX11} != "no"
SETS_DEFAULT+= xbase xcomp xetc xfont xserver
.endif
KERN_SET?= kern-GENERIC
SETS?= ${SETS_DEFAULT}
IMG_SETS= ${KERN_SET} ${SETS}
SETS_DIR?= ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
FSTAB_IN?= ${DISTRIBDIR}/common/bootimage/fstab.in
SPEC_IN?= ${DISTRIBDIR}/common/bootimage/spec.in
IMGMAKEFSOPTIONS?= -o bsize=16384,fsize=2048,density=8192
WORKDIR?= work
WORKSPEC?= work.spec
WORKFSTAB?= work.fstab
WORKRCCONF?= work.rc.conf
WORKFS?= work.rootfs
TARGETFS?= imgroot.fs
CLEANFILES+= ${WORKSPEC} ${WORKFSTAB} ${WORKRCCONF} ${WORKFS}
CLEANFILES+= ${TARGETFS}
#
# create root file system for the image
#
${TARGETFS}: prepare_md_post
@if [ ! -d ${RELEASEDIR}/${RELEASEMACHINEDIR} ]; then \
echo "Missing ${RELEASEDIR}/${RELEASEMACHINEDIR}, aborting"; \
false; \
fi;
@${MKDIR} ${WORKDIR}
.for set in ${IMG_SETS}
@if [ ! -f ${SETS_DIR}/${set}.tgz ]; then \
echo "Missing ${SETS_DIR}/${set}.tgz, aborting"; \
false; \
fi
@echo Extracting ${set}.tgz ...
@(cd ${WORKDIR}; ${TOOL_PAX} -rnz -f ${SETS_DIR}/${set}.tgz .)
.endfor
.if defined(SECONDARY_BOOT)
@echo Copying secondary boot...
${CP} -f ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR}
.endif
@echo Preparing /etc/fstab ...
${TOOL_SED} "s/@@BOOTDISK@@/${BOOTDISK}/" < ${FSTAB_IN} > ${WORKFSTAB}
${CP} ${WORKFSTAB} ${WORKDIR}/etc/fstab
@echo Setting rc_configured=YES in /etc/rc.conf ...
${TOOL_SED} "s/rc_configured=NO/rc_configured=YES/" \
< ${WORKDIR}/etc/rc.conf > ${WORKRCCONF}
${CP} ${WORKRCCONF} ${WORKDIR}/etc/rc.conf
.if defined(IMGDIR_EXTRA)
@echo Copying extra dirs...
.for _SRCDIR _TARGET in ${IMGDIR_EXTRA}
@if [ ! -d ${_SRCDIR} ]; then \
echo "${_SRCDIR} is not directory, aborting"; \
false; \
fi
${MKDIR} ${WORKDIR}/${_TARGET}
(cd ${_SRCDIR} ; \
${TOOL_PAX} -rw -pe -v \
${IMGDIR_EXCLUDE} \
. ${.OBJDIR}/${WORKDIR}/${_TARGET} )
.endfor
.endif
.if defined(IMGFILE_EXTRA)
@echo Copying extra files...
.for _SRC _TARGET in ${IMGFILE_EXTRA}
@if [ ! -f ${_SRC} ]; then \
echo "${_SRC} in IMGFILE_EXTRA not found, aborting"; \
false; \
fi
@if [ -f ${_SRC} ]; then \
echo ${CP} ${_SRC} ${WORKDIR}/${_TARGET}; \
${CP} ${_SRC} ${WORKDIR}/${_TARGET}; \
fi
.endfor
.endif
@echo Preparing spec files for makefs...
${RM} -f ${WORKSPEC}
cat ${WORKDIR}/etc/mtree/* | \
${TOOL_SED} -e 's/ size=[0-9]*//' > ${WORKSPEC}
${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all | \
${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,' >> ${WORKSPEC}
cat ${SPEC_IN} >> ${WORKSPEC}
.if defined(SECONDARY_BOOT)
echo "./${SECONDARY_BOOT} type=file uname=root gname=wheel mode=0444" \
>> ${WORKSPEC}
.endif
.if defined(SPEC_EXTRA)
cat ${SPEC_EXTRA} >> ${WORKSPEC}
.endif
@echo Createing rootfs...
# XXX /var/spool/ftp/hidden is unreadable
${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden
${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE} \
-B ${TARGET_ENDIANNESS} \
-F ${WORKSPEC} -N ${WORKDIR}/etc \
${IMGMAKEFSOPTIONS} \
${WORKFS} ${WORKDIR}
.if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} == "no"
${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKFS} \
${WORKDIR}/usr/mdec/${PRIMARY_BOOT} ${SECONDARY_BOOT_ARG}
.endif
@echo done.
mv ${WORKFS} ${.TARGET}
#
# definitions to create image
#
.if ${USE_MBR} != "no"
DISKPROTO_IN?= ${DISTRIBDIR}/common/bootimage/diskproto.mbr.in
.else
DISKPROTO_IN?= ${DISTRIBDIR}/common/bootimage/diskproto.in
.endif
OMIT_SWAPIMG?= no
WORKMBR?= work.mbr
WORKSWAP?= work.swap
WORKLABEL?= work.diskproto
WORKIMG?= work.img
CLEANFILES+= ${WORKMBR} ${WORKSWAP}
CLEANFILES+= ${WORKLABEL}.tmp ${WORKLABEL}
CLEANFILES+= ${WORKIMG} ${IMGBASE}.img
${WORKLABEL}:
${TOOL_SED} \
-e "s/@@SECTORS@@/${SECTORS}/" \
-e "s/@@HEADS@@/${HEADS}/" \
-e "s/@@SECPERCYLINDERS@@/${SECPERCYLINDERS}/" \
-e "s/@@CYLINDERS@@/${CYLINDERS}/" \
-e "s/@@IMAGESECTORS@@/${IMAGESECTORS}/" \
-e "s/@@FSSECTORS@@/${FSSECTORS}/" \
-e "s/@@FSOFFSET@@/${FSOFFSET}/" \
-e "s/@@SWAPSECTORS@@/${SWAPSECTORS}/" \
-e "s/@@SWAPOFFSET@@/${SWAPOFFSET}/" \
-e "s/@@BSDPARTSECTORS@@/${BSDPARTSECTORS}/" \
< ${DISKPROTO_IN} > ${WORKLABEL}.tmp
mv ${WORKLABEL}.tmp ${WORKLABEL}
${IMGBASE}.img: ${TARGETFS} ${WORKLABEL}
.if ${LABELSECTORS} != "0"
@echo creating MBR labels...
${DD} if=/dev/zero of=${WORKMBR} seek=$$((${IMAGESECTORS} - 1)) count=1
${TOOL_FDISK} -f -u \
-b ${MBRCYLINDERS}/${MBRHEADS}/${MBRSECTORS} \
-0 -a -s ${MBRNETBSD}/${FSOFFSET}/${BSDPARTSECTORS} \
-i -c ${WORKDIR}/usr/mdec/mbr \
-F ${WORKMBR}
${DD} if=${WORKMBR} count=${LABELSECTORS} | \
${CAT} - ${TARGETFS} > ${WORKIMG}
.else
${CP} ${TARGETFS} ${WORKIMG}
.endif
.if ${OMIT_SWAPIMG} == "no"
${DD} if=/dev/zero of=${WORKSWAP} seek=$$((${SWAPSECTORS} - 1)) count=1
${CAT} ${WORKSWAP} >> ${WORKIMG}
.endif
.if ${USE_SUNLABEL} != "no"
@echo Creating sun disklabel...
printf 'V ncyl %d\nV nhead %d\nV nsect %d\na %d %d/0/0\nb %d %d/0/0\nW\n' \
${CYLINDERS} ${HEADS} ${SECTORS} \
${FSOFFSET} ${FSCYLINDERS} ${FSCYLINDERS} ${SWAPCYLINDERS} | \
${TOOL_SUNLABEL} -nq ${WORKIMG}
.endif
${TOOL_DISKLABEL} -R -F ${WORKIMG} ${WORKLABEL}
.if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} != "no"
${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKIMG} \
${WORKDIR}/usr/mdec/${PRIMARY_BOOT}
.endif
mv ${WORKIMG} ${.TARGET}
CLEANFILES+= ${IMGBASE}.img.gz ${IMGBASE}.img.gz.tmp
${IMGBASE}.img.gz: ${IMGBASE}.img
${TOOL_GZIP} -9c ${IMGBASE}.img > ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
clean:
@if [ -d ${WORKDIR}/var/spool/ftp/hidden ]; then \
${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden; \
fi # XXX
${RM} -fr ${WORKDIR}
prepare_md_post: .PHONY
image_md_post: .PHONY
image_md_pre: .PHONY
.include <bsd.prog.mk>
# $NetBSD: Makefile.installimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
#
# Common Makefile to create a bootable installation image for USB flash etc.
#
#
# Required variables:
# INSTIMGBASE
# Basename of the liveimage
#
# See Makefile.bootimage for other variables.
#
.if empty(INSTIMGBASE)
.BEGIN:
@echo "Error: INSTIMGBASE is not set"
@false
.endif
.if empty(RELEASEDIR)
.BEGIN:
@echo "Error: RELEASEDIR is not set"
@false
.endif
SWAPMB= 0 # no swap
OMIT_SWAPIMG= yes # nothing to write
KERN_SET?= kern-GENERIC
SETS?= modules base etc
FSTAB_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in
.if ${USE_MBR} != "no"
DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in
.else
DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
.endif
# XXX: no permittion info for makefs(8)
IMGDIR_EXTRA= ${RELEASEDIR}/${RELEASEMACHINEDIR} ${RELEASEMACHINEDIR}
IMGDIR_EXCLUDE= -s ',./installation/cdrom.*,,gp'
IMGDIR_EXCLUDE+= -s ',./installation/liveimage.*,,gp'
IMGDIR_EXCLUDE+= -s ',./installation/installimage.*,,gp'
IMGBASE= ${INSTIMGBASE}
.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
# INSTIMG_RELEASEDIR specifies where to install ${INSTIMGBASE}.img.gz.
# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
# but also set default here for manual builds.
INSTIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/installimage
# should be defined elsewhere?
MKDIR?= mkdir -p
install_image: ${IMGBASE}.img.gz
${MKDIR} ${INSTIMG_RELEASEDIR}
${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
# note ${MAKESUM} will be calculated in src/etc/Makefile
release:
# $NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
#
# Common Makefile to create a bootable FS image for USB flash or emulators
#
#
# Required variables:
# LIVEIMGBASE
# Basename of the liveimage
#
# See Makefile.bootimage for other variables.
#
.if empty(LIVEIMGBASE)
.BEGIN:
@echo "Error: LIVEIMGBASE is not set"
@false
.endif
.if empty(RELEASEDIR)
.BEGIN:
@echo "Error: RELEASEDIR is not set"
@false
.endif
IMGBASE= ${LIVEIMGBASE}
.include "${NETBSDSRCDIR}/distrib/common/bootimage/Makefile.bootimage"
# LIVEIMG_RELEASEDIR specifies where to install ${LIVEIMGBASE}.img.gz.
# This should be passed from etc/Makefile or etc/etc.${MACHINE}/Makefile.inc
# but also set default here for manual builds.
LIVEIMG_RELEASEDIR?= ${RELEASEMACHINEDIR}/installation/liveimage
# should be defined elsewhere?
MKDIR?= mkdir -p
live_image: ${IMGBASE}.img.gz
${MKDIR} ${LIVEIMG_RELEASEDIR}
${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR}
# note ${MAKESUM} will be calculated in src/etc/Makefile
release:
# $NetBSD: diskproto.in,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
type: ESDI
disk: image
label:
flags:
bytes/sector: 512
sectors/track: @@SECTORS@@
tracks/cylinder: @@HEADS@@
sectors/cylinder: @@SECPERCYLINDERS@@
cylinders: @@CYLINDERS@@
total sectors: @@IMAGESECTORS@@
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: @@FSSECTORS@@ @@FSOFFSET@@ 4.2BSD 1024 8192 16
b: @@SWAPSECTORS@@ @@SWAPOFFSET@@ swap
c: @@IMAGESECTORS@@ 0 unused 0 0
# $NetBSD: diskproto.mbr.in,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
type: ESDI
disk: image
label:
flags:
bytes/sector: 512
sectors/track: @@SECTORS@@
tracks/cylinder: @@HEADS@@
sectors/cylinder: @@SECPERCYLINDERS@@
cylinders: @@CYLINDERS@@
total sectors: @@IMAGESECTORS@@
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: @@FSSECTORS@@ @@FSOFFSET@@ 4.2BSD 1024 8192 16
b: @@SWAPSECTORS@@ @@SWAPOFFSET@@ swap
c: @@BSDPARTSECTORS@@ @@FSOFFSET@@ unused 0 0
d: @@IMAGESECTORS@@ 0 unused 0 0
# $NetBSD: diskproto.noswap.in,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
type: ESDI
disk: image
label:
flags:
bytes/sector: 512
sectors/track: @@SECTORS@@
tracks/cylinder: @@HEADS@@
sectors/cylinder: @@SECPERCYLINDERS@@
cylinders: @@CYLINDERS@@
total sectors: @@IMAGESECTORS@@
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: @@FSSECTORS@@ @@FSOFFSET@@ 4.2BSD 1024 8192 16
c: @@IMAGESECTORS@@ 0 unused 0 0
# $NetBSD: diskproto.noswap.mbr.in,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
type: ESDI
disk: image
label:
flags:
bytes/sector: 512
sectors/track: @@SECTORS@@
tracks/cylinder: @@HEADS@@
sectors/cylinder: @@SECPERCYLINDERS@@
cylinders: @@CYLINDERS@@
total sectors: @@IMAGESECTORS@@
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0 # microseconds
track-to-track seek: 0 # microseconds
drivedata: 0
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: @@FSSECTORS@@ @@FSOFFSET@@ 4.2BSD 1024 8192 16
c: @@BSDPARTSECTORS@@ @@FSOFFSET@@ unused 0 0
d: @@IMAGESECTORS@@ 0 unused 0 0
/dev/@@BOOTDISK@@a / ffs rw,log 1 1
/dev/@@BOOTDISK@@b none none sw 0 0
ptyfs /dev/pts ptyfs rw 0 0
kernfs /kern kernfs rw,noauto 0 0
procfs /proc procfs rw,noauto 0 0
/dev/@@BOOTDISK@@a / ffs rw,log 1 1
tmpfs /tmp tmpfs rw 0 0
# $NetBSD: spec.in,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
./netbsd type=file mode=0755 uname=root gname=wheel
./kern type=dir mode=0755 uname=root gname=wheel
./proc type=dir mode=0755 uname=root gname=wheel
./tmp type=dir mode=1777 uname=root gname=wheel
--- src/distrib/i386/Makefile 2008/12/01 10:11:26 1.8
+++ src/distrib/i386/Makefile 2012/01/22 03:53:32 1.9
| @@ -1,16 +1,24 @@ | | | @@ -1,16 +1,24 @@ |
1 | # $NetBSD: Makefile,v 1.8 2008/12/01 10:11:26 ad Exp $ | | 1 | # $NetBSD: Makefile,v 1.9 2012/01/22 03:53:32 tsutsui Exp $ |
2 | | | 2 | |
3 | SUBDIR= | | 3 | SUBDIR= |
4 | SUBDIR+= ramdisks | | 4 | SUBDIR+= ramdisks |
5 | SUBDIR+= .WAIT | | 5 | SUBDIR+= .WAIT |
6 | SUBDIR+= instkernel | | 6 | SUBDIR+= instkernel |
7 | SUBDIR+= kmod | | 7 | SUBDIR+= kmod |
8 | SUBDIR+= .WAIT | | 8 | SUBDIR+= .WAIT |
9 | SUBDIR+= cdroms | | 9 | SUBDIR+= cdroms |
10 | SUBDIR+= floppies | | 10 | SUBDIR+= floppies |
| | | 11 | SUBDIR+= liveimage |
| | | 12 | SUBDIR+= installimage |
11 | TARGETS+= release | | 13 | TARGETS+= release |
12 | | | 14 | |
13 | iso_image: | | 15 | iso_image: |
14 | ${MAKEDIRTARGET} cdroms iso_image | | 16 | ${MAKEDIRTARGET} cdroms iso_image |
15 | | | 17 | |
| | | 18 | live_image: |
| | | 19 | ${MAKEDIRTARGET} liveimage live_image |
| | | 20 | |
| | | 21 | install_image: |
| | | 22 | ${MAKEDIRTARGET} installimage install_image |
| | | 23 | |
16 | .include <bsd.subdir.mk> | | 24 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
.include <bsd.own.mk>
INSTIMGBASE= i386inst # gives ${IMGBASE}.img
BOOTDISK= sd0 # for USB flash etc.
IMAGEMB= 512 # for all installation binaries
PRIMARY_BOOT= bootxx_ffsv1
SECONDARY_BOOT= boot
SECONDARY_BOOT_ARG= # unnecessary
USE_MBR= yes
CLEANFILES+= boot.cfg
prepare_md_post:
${TOOL_SED} \
-e "s/@@MACHINE@@/${MACHINE}/" \
-e "s/@@VERSION@@/${DISTRIBVER}/" \
< ${.CURDIR}/boot.cfg.in > boot.cfg
DISTRIBDIR!= cd ${.CURDIR}/../.. ; pwd
SYSINSTDIR!= cd ${DISTRIBDIR}/utils/sysinst/arch/${MACHINE} && ${PRINTOBJDIR}
SPEC_EXTRA= ${.CURDIR}/spec.inst
IMGFILE_EXTRA= \
${DISTRIBDIR}/common/10-resolv.conf libexec/dhcpcd-hooks \
${DISTRIBDIR}/common/99-print-sysinst libexec/dhcpcd-hooks \
${.CURDIR}/etc.ttys etc/ttys \
${.CURDIR}/etc.rc etc/rc \
${.CURDIR}/install.sh . \
${.OBJDIR}/boot.cfg . \
${SYSINSTDIR}/sysinstmsgs.de . \
${SYSINSTDIR}/sysinstmsgs.es . \
${SYSINSTDIR}/sysinstmsgs.fr . \
${SYSINSTDIR}/sysinstmsgs.pl . \
${SYSINSTDIR}/sysinst .
.include "${DISTRIBDIR}/common/bootimage/Makefile.installimage"
banner=Welcome to the NetBSD/@@MACHINE@@ @@VERSION@@ installation image
banner================================================================================
banner=
banner=ACPI (Advanced Configuration and Power Interface) should work on all modern
banner=and legacy hardware. However if you do encounter a problem while booting,
banner=try disabling it and report a bug at http://www.NetBSD.org/.
menu=Install NetBSD:boot netbsd
menu=Install NetBSD (no ACPI):boot netbsd -2
menu=Install NetBSD (no ACPI, no SMP):boot netbsd -12
menu=Drop to boot prompt:prompt
timeout=30
clear=1
# $NetBSD: etc.rc,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
#
# Copyright (c) 1997 Perry E. Metzger
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
# must display the following acknowledgement:
# This product includes software developed for the
# NetBSD Project. See http://www.NetBSD.org/ for
# information about NetBSD.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
# hack to get around bugs in kernfs's rootdev/rrootdev lookup.
ls -l /dev/* > /dev/null 2>&1
mount -u /
mount -t tmpfs tmpfs /tmp
# create a gettytab to autologin and run sysinst
echo "# Autostart sysinst" > /tmp/gettytab
echo -n "sysinst:al=root:lo=/install.sh:im=:sp#" >> /tmp/gettytab
stty speed >> /tmp/gettytab
cp /tmp/gettytab /etc
# done, move on to multiuser mode
exit 0
# $NetBSD: etc.ttys,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
#
# re-launch the sysinst wrapper script on console
#
# name getty type status comments
#
console "/usr/libexec/getty sysinst" wsvt25 on secure
#! /bin/sh -m
# $NetBSD: install.sh,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
#
# -
# Copyright (c) 2010 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Martin Husemann <martin@NetBSD.org>.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# setup basic environment
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
termfile=/tmp/sysinst.term
# Check if we are on a framebuffer or on serial console and default
# the terminal type accordingly.
# There is no /var/db/dev.db, so sysctl might not map the devicename properly;
# ttyE0 is 90,0 -> 0x5a00
case $(sysctl -nx kern.consdev) in
002f000000000000)
TERM=wsvt25
;;
*)
if [ -r ${termfile} ]; then
. ${termfile}
else
TERM=vt220
fi
;;
esac
export TERM
HOME=/
export HOME
BLOCKSIZE=1k
export BLOCKSIZE
EDITOR=ed
export EDITOR
SHELL=/bin/sh
export SHELL
umask 022
stty newcrt werase ^W intr ^C kill ^U erase ^?
if [ $TERM != "wsvt25" ]; then
cat << "EOM"
You are using a serial console, we do not know your terminal emulation.
Please select one, typical values are:
vt100
ansi
xterm
EOM
echo -n "Terminal type (just hit ENTER for '$TERM'): "
read ans
if [ -n "$ans" ];then
TERM=$ans
fi
fi
# run the installation or upgrade script.
cd /
cmd=./sysinst
while [ -n "${cmd}" ]
do
${cmd}
if [ $? = 4 ]; then
echo "Oops, something went wrong - we will try again"
exit
else
if [ -n "$(jobs)" ]; then
tput clear
echo "You have stopped sysinst, return to it by" \
"typing 'exit' or ^D."
${SHELL} -i
cmd="fg"
else
cmd=""
fi
fi
done
# remember terminal type, now that we know it for sure
echo "TERM=${TERM}" > ${termfile}
echo
echo "To return to the installer, quit this shell by typing 'exit' or ^D."
exec ${SHELL}
# $NetBSD: spec.inst,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
./mnt2 type=dir mode=0755 uname=root gname=wheel
./targetroot type=dir mode=0755 uname=root gname=wheel
./libexec/dhcpcd-hooks/10-resolv.conf type=file mode=0444 uname=root gname=wheel
./libexec/dhcpcd-hooks/99-print-sysinst type=file mode=0444 uname=root gname=wheel
./install.sh type=file mode=0755 uname=root gname=wheel
./sysinst type=file mode=0755 uname=root gname=wheel
./sysinstmsgs.de type=file mode=0444 uname=root gname=wheel
./sysinstmsgs.es type=file mode=0444 uname=root gname=wheel
./sysinstmsgs.fr type=file mode=0444 uname=root gname=wheel
./sysinstmsgs.pl type=file mode=0444 uname=root gname=wheel
# for sysinst "install from local directory" default
./release type=link mode=0755 uname=root gname=wheel link=.
# XXX what to do for files in ${RELEASEMACHINEDIR}?
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
SUBDIR+= usbimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK?= wd0 # for emulators
PRIMARY_BOOT= bootxx_ffsv1
SECONDARY_BOOT= boot
SECONDARY_BOOT_ARG= # unnecessary
USE_MBR= yes
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
LIVEIMGBASE= i386emu # gives ${IMGBASE}.img
BOOTDISK= wd0 # for QEMU etc.
.include "${.CURDIR}/../Makefile.liveimage"
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
LIVEIMGBASE= i386live # gives ${IMGBASE}.img
BOOTDISK= sd0 # for USB flash etc.
IMAGEMB= 1536 # 2GB USB flash memories aren't 2GiB
OMIT_SWAPIMG= yes # no need to write swap
.include "${.CURDIR}/../Makefile.liveimage"
--- src/distrib/pmax/Makefile 2007/03/06 21:57:15 1.4
+++ src/distrib/pmax/Makefile 2012/01/22 03:53:32 1.5
| @@ -1,9 +1,12 @@ | | | @@ -1,9 +1,12 @@ |
1 | # $NetBSD: Makefile,v 1.4 2007/03/06 21:57:15 bouyer Exp $ | | 1 | # $NetBSD: Makefile,v 1.5 2012/01/22 03:53:32 tsutsui Exp $ |
2 | | | 2 | |
3 | SUBDIR= ramdisk .WAIT instkernel .WAIT cdroms | | 3 | SUBDIR= ramdisk .WAIT instkernel .WAIT cdroms liveimage |
4 | TARGETS+= release | | 4 | TARGETS+= release |
5 | | | 5 | |
6 | iso_image: | | 6 | iso_image: |
7 | ${MAKEDIRTARGET} cdroms iso_image | | 7 | ${MAKEDIRTARGET} cdroms iso_image |
8 | | | 8 | |
| | | 9 | live_image: |
| | | 10 | ${MAKEDIRTARGET} liveimage live_image |
| | | 11 | |
9 | .include <bsd.subdir.mk> | | 12 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
LIVEIMGBASE= pmaxlive # gives ${IMGBASE}.img
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK= sd0
PRIMARY_BOOT= bootxx_ffs
#SECONDARY_BOOT= # boot.pmax is extracted from base.tgz
SECONDARY_BOOT_ARG= # nothing
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
--- src/distrib/sparc/Makefile 2007/03/06 21:57:23 1.7
+++ src/distrib/sparc/Makefile 2012/01/22 03:53:33 1.8
| @@ -1,9 +1,12 @@ | | | @@ -1,9 +1,12 @@ |
1 | # $NetBSD: Makefile,v 1.7 2007/03/06 21:57:23 bouyer Exp $ | | 1 | # $NetBSD: Makefile,v 1.8 2012/01/22 03:53:33 tsutsui Exp $ |
2 | | | 2 | |
3 | SUBDIR= instfs ramdisk .WAIT bootfs .WAIT cdroms | | 3 | SUBDIR= instfs ramdisk .WAIT bootfs .WAIT cdroms liveimage |
4 | TARGETS+= release | | 4 | TARGETS+= release |
5 | | | 5 | |
6 | iso_image: | | 6 | iso_image: |
7 | ${MAKEDIRTARGET} cdroms iso_image | | 7 | ${MAKEDIRTARGET} cdroms iso_image |
8 | | | 8 | |
| | | 9 | live_image: |
| | | 10 | ${MAKEDIRTARGET} liveimage live_image |
| | | 11 | |
9 | .include <bsd.subdir.mk> | | 12 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
LIVEIMGBASE= sparcemu # gives ${IMGBASE}.img
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK= sd0
PRIMARY_BOOT= bootxx
SECONDARY_BOOT= boot
SECONDARY_BOOT_ARG= /${SECONDARY_BOOT}
USE_SUNLABEL= yes
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
--- src/distrib/sparc64/Makefile 2007/03/06 21:57:24 1.7
+++ src/distrib/sparc64/Makefile 2012/01/22 03:53:33 1.8
| @@ -1,9 +1,12 @@ | | | @@ -1,9 +1,12 @@ |
1 | # $NetBSD: Makefile,v 1.7 2007/03/06 21:57:24 bouyer Exp $ | | 1 | # $NetBSD: Makefile,v 1.8 2012/01/22 03:53:33 tsutsui Exp $ |
2 | | | 2 | |
3 | SUBDIR= instfs .WAIT xminiroot bootfs .WAIT cdroms | | 3 | SUBDIR= instfs .WAIT xminiroot bootfs .WAIT cdroms liveimage |
4 | TARGETS+= release | | 4 | TARGETS+= release |
5 | | | 5 | |
6 | iso_image: | | 6 | iso_image: |
7 | ${MAKEDIRTARGET} cdroms iso_image | | 7 | ${MAKEDIRTARGET} cdroms iso_image |
8 | | | 8 | |
| | | 9 | live_image: |
| | | 10 | ${MAKEDIRTARGET} liveimage live_image |
| | | 11 | |
9 | .include <bsd.subdir.mk> | | 12 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
LIVEIMGBASE= sparc64emu # gives ${IMGBASE}.img
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK= sd0 # for QEMU
#BOOTDISK= wd0 # for Ultra5/10 image?
PRIMARY_BOOT= bootblk
#SECONDARY_BOOT= # nothing
#SECONDARY_BOOT_ARG= # unnecessary
USE_SUNLABEL= yes
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
--- src/distrib/sun2/Makefile 2008/06/23 02:16:54 1.9
+++ src/distrib/sun2/Makefile 2012/01/22 03:53:33 1.10
| @@ -1,22 +1,25 @@ | | | @@ -1,22 +1,25 @@ |
1 | # $NetBSD: Makefile,v 1.9 2008/06/23 02:16:54 matt Exp $ | | 1 | # $NetBSD: Makefile,v 1.10 2012/01/22 03:53:33 tsutsui Exp $ |
2 | | | 2 | |
3 | SUBDIR= ramdisk miniroot cdroms | | 3 | SUBDIR= ramdisk miniroot cdroms liveimage |
4 | TARGETS+= release | | 4 | TARGETS+= release |
5 | | | 5 | |
6 | .include <bsd.own.mk> | | 6 | .include <bsd.own.mk> |
7 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" | | 7 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" |
8 | | | 8 | |
9 | release: check_RELEASEDIR .WAIT \ | | 9 | release: check_RELEASEDIR .WAIT \ |
10 | ${DESTDIR}/usr/mdec/bootyy ${DESTDIR}/usr/mdec/netboot \ | | 10 | ${DESTDIR}/usr/mdec/bootyy ${DESTDIR}/usr/mdec/netboot \ |
11 | ${DESTDIR}/usr/mdec/tapeboot MakeBootTape MakeInstTape | | 11 | ${DESTDIR}/usr/mdec/tapeboot MakeBootTape MakeInstTape |
12 | ${RELEASE_INSTALL} \ | | 12 | ${RELEASE_INSTALL} \ |
13 | ${DESTDIR}/usr/mdec/bootyy ${DESTDIR}/usr/mdec/netboot \ | | 13 | ${DESTDIR}/usr/mdec/bootyy ${DESTDIR}/usr/mdec/netboot \ |
14 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/netboot | | 14 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/netboot |
15 | ${RELEASE_INSTALL} ${DESTDIR}/usr/mdec/tapeboot \ | | 15 | ${RELEASE_INSTALL} ${DESTDIR}/usr/mdec/tapeboot \ |
16 | ${.CURDIR}/MakeBootTape ${.CURDIR}/MakeInstTape \ | | 16 | ${.CURDIR}/MakeBootTape ${.CURDIR}/MakeInstTape \ |
17 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/tapeimage | | 17 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/tapeimage |
18 | | | 18 | |
19 | iso_image: | | 19 | iso_image: |
20 | ${MAKEDIRTARGET} cdroms iso_image | | 20 | ${MAKEDIRTARGET} cdroms iso_image |
21 | | | 21 | |
| | | 22 | live_image: |
| | | 23 | ${MAKEDIRTARGET} liveimage live_image |
| | | 24 | |
22 | .include <bsd.subdir.mk> | | 25 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
LIVEIMGBASE= sun2emu # gives ${IMGBASE}.img
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK= sd0
PRIMARY_BOOT= bootxx
SECONDARY_BOOT= ufsboot
SECONDARY_BOOT_ARG= /${SECONDARY_BOOT}
#USE_SUNLABEL= yes # sun2 PROM doesn't read sunlabel
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
--- src/distrib/sun3/Makefile 2008/06/23 02:16:54 1.10
+++ src/distrib/sun3/Makefile 2012/01/22 03:53:33 1.11
| @@ -1,25 +1,28 @@ | | | @@ -1,25 +1,28 @@ |
1 | # $NetBSD: Makefile,v 1.10 2008/06/23 02:16:54 matt Exp $ | | 1 | # $NetBSD: Makefile,v 1.11 2012/01/22 03:53:33 tsutsui Exp $ |
2 | | | 2 | |
3 | SUBDIR= ramdisk miniroot .WAIT cdroms | | 3 | SUBDIR= ramdisk miniroot .WAIT cdroms liveimage |
4 | TARGETS+= release | | 4 | TARGETS+= release |
5 | | | 5 | |
6 | .include <bsd.own.mk> | | 6 | .include <bsd.own.mk> |
7 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" | | 7 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" |
8 | | | 8 | |
9 | release: check_RELEASEDIR .WAIT \ | | 9 | release: check_RELEASEDIR .WAIT \ |
10 | ${DESTDIR}/usr/mdec/netboot ${DESTDIR}/usr/mdec/tapeboot \ | | 10 | ${DESTDIR}/usr/mdec/netboot ${DESTDIR}/usr/mdec/tapeboot \ |
11 | MakeBootTape MakeInstTape | | 11 | MakeBootTape MakeInstTape |
12 | ${RELEASE_INSTALL} \ | | 12 | ${RELEASE_INSTALL} \ |
13 | ${DESTDIR}/usr/mdec/netboot \ | | 13 | ${DESTDIR}/usr/mdec/netboot \ |
14 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/netboot | | 14 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/netboot |
15 | ${RELEASE_INSTALL} \ | | 15 | ${RELEASE_INSTALL} \ |
16 | ${DESTDIR}/usr/mdec/tapeboot \ | | 16 | ${DESTDIR}/usr/mdec/tapeboot \ |
17 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/tapeimage | | 17 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/tapeimage |
18 | ${RELEASE_INSTALL} \ | | 18 | ${RELEASE_INSTALL} \ |
19 | ${.CURDIR}/MakeBootTape ${.CURDIR}/MakeInstTape \ | | 19 | ${.CURDIR}/MakeBootTape ${.CURDIR}/MakeInstTape \ |
20 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/tapeimage | | 20 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/tapeimage |
21 | | | 21 | |
22 | iso_image: | | 22 | iso_image: |
23 | ${MAKEDIRTARGET} cdroms iso_image | | 23 | ${MAKEDIRTARGET} cdroms iso_image |
24 | | | 24 | |
| | | 25 | live_image: |
| | | 26 | ${MAKEDIRTARGET} liveimage live_image |
| | | 27 | |
25 | .include <bsd.subdir.mk> | | 28 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
LIVEIMGBASE= sun3emu # gives ${IMGBASE}.img
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK= sd0
PRIMARY_BOOT= bootxx
SECONDARY_BOOT= ufsboot
SECONDARY_BOOT_ARG= /${SECONDARY_BOOT}
USE_SUNLABEL= yes
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
--- src/distrib/vax/Makefile 2008/06/23 02:16:54 1.18
+++ src/distrib/vax/Makefile 2012/01/22 03:53:33 1.19
| @@ -1,16 +1,19 @@ | | | @@ -1,16 +1,19 @@ |
1 | # $NetBSD: Makefile,v 1.18 2008/06/23 02:16:54 matt Exp $ | | 1 | # $NetBSD: Makefile,v 1.19 2012/01/22 03:53:33 tsutsui Exp $ |
2 | | | 2 | |
3 | .include <bsd.own.mk> | | 3 | .include <bsd.own.mk> |
4 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" | | 4 | .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" |
5 | | | 5 | |
6 | SUBDIR= ramdisk .WAIT ramdisk-kernel .WAIT floppy cdroms | | 6 | SUBDIR= ramdisk .WAIT ramdisk-kernel .WAIT floppy cdroms liveimage |
7 | TARGETS+= release | | 7 | TARGETS+= release |
8 | | | 8 | |
9 | release: check_RELEASEDIR .WAIT ${DESTDIR}/usr/mdec/boot | | 9 | release: check_RELEASEDIR .WAIT ${DESTDIR}/usr/mdec/boot |
10 | ${RELEASE_INSTALL} ${DESTDIR}/usr/mdec/boot \ | | 10 | ${RELEASE_INSTALL} ${DESTDIR}/usr/mdec/boot \ |
11 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/netboot | | 11 | ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/netboot |
12 | | | 12 | |
13 | iso_image: | | 13 | iso_image: |
14 | ${MAKEDIRTARGET} cdroms iso_image | | 14 | ${MAKEDIRTARGET} cdroms iso_image |
15 | | | 15 | |
| | | 16 | live_image: |
| | | 17 | ${MAKEDIRTARGET} liveimage live_image |
| | | 18 | |
16 | .include <bsd.subdir.mk> | | 19 | .include <bsd.subdir.mk> |
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:31 tsutsui Exp $
SUBDIR=
SUBDIR+= emuimage
TARGETS+= release live_image
.include <bsd.subdir.mk>
# $NetBSD: Makefile,v 1.1 2012/01/22 03:53:32 tsutsui Exp $
LIVEIMGBASE= vaxlive # gives ${IMGBASE}.img
.include <bsd.own.mk>
KERN_SET= kern-GENERIC
BOOTDISK= ra0
IMAGEMB= 1024 # ra0 can't handle 2GB image
PRIMARY_BOOT= xxboot
#SECONDARY_BOOT= # boot is extracted from base.tgz
SECONDARY_BOOT_ARG= # nothing
.include "${.CURDIR}/../../../common/bootimage/Makefile.liveimage"
--- src/etc/Makefile 2012/01/15 17:36:55 1.395
+++ src/etc/Makefile 2012/01/22 03:53:33 1.396
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile,v 1.395 2012/01/15 17:36:55 joerg Exp $ | | 1 | # $NetBSD: Makefile,v 1.396 2012/01/22 03:53:33 tsutsui Exp $ |
2 | # from: @(#)Makefile 8.7 (Berkeley) 5/25/95 | | 2 | # from: @(#)Makefile 8.7 (Berkeley) 5/25/95 |
3 | | | 3 | |
4 | # Environment variables without default values: | | 4 | # Environment variables without default values: |
5 | # DESTDIR must be set before anything in this file will work. | | 5 | # DESTDIR must be set before anything in this file will work. |
6 | # RELEASEDIR is where the tarred up stuff for a snapshot or | | 6 | # RELEASEDIR is where the tarred up stuff for a snapshot or |
7 | # release will be placed. | | 7 | # release will be placed. |
8 | # | | 8 | # |
9 | # Environment variables with default values: | | 9 | # Environment variables with default values: |
10 | # LOCALTIME will set the default local time for the system you | | 10 | # LOCALTIME will set the default local time for the system you |
11 | # build; it determines what /etc/localtime is symlink'd to. | | 11 | # build; it determines what /etc/localtime is symlink'd to. |
12 | # KERNSRCDIR points to kernel source; it is set by default to ../sys, | | 12 | # KERNSRCDIR points to kernel source; it is set by default to ../sys, |
13 | # but can be overridden. | | 13 | # but can be overridden. |
14 | # KERNOBJDIR is the kernel build directory, it defaults to | | 14 | # KERNOBJDIR is the kernel build directory, it defaults to |
| @@ -465,26 +465,53 @@ iso-image-mi: .PHONY check_DESTDIR check | | | @@ -465,26 +465,53 @@ iso-image-mi: .PHONY check_DESTDIR check |
465 | # Overridden by etc.$MACHINE/Makefile.inc | | 465 | # Overridden by etc.$MACHINE/Makefile.inc |
466 | # | | 466 | # |
467 | iso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup | | 467 | iso-image-md-pre: .PHONY check_DESTDIR check_RELEASEDIR iso-image-setup |
468 | # (empty -- look in the machine-dependent Makefile.inc) | | 468 | # (empty -- look in the machine-dependent Makefile.inc) |
469 | | | 469 | |
470 | # iso-image-md-post -- | | 470 | # iso-image-md-post -- |
471 | # Fixup the CD-image to be bootable. | | 471 | # Fixup the CD-image to be bootable. |
472 | # Overridden by etc.$MACHINE/Makefile.inc | | 472 | # Overridden by etc.$MACHINE/Makefile.inc |
473 | # | | 473 | # |
474 | iso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi | | 474 | iso-image-md-post: .PHONY check_DESTDIR check_RELEASEDIR iso-image-mi |
475 | # (empty -- look in the machine-dependent Makefile.inc) | | 475 | # (empty -- look in the machine-dependent Makefile.inc) |
476 | | | 476 | |
477 | | | 477 | |
| | | 478 | # live-image -- |
| | | 479 | # Standalone target to create live images after the release was composed. |
| | | 480 | # Should be run after "make release" in src and xsrc. |
| | | 481 | # LIVEIMG_RELEASEDIR specifies where to install live images and |
| | | 482 | # it can be set in MD etc.${MACHINE}/Makefile.inc. |
| | | 483 | # |
| | | 484 | LIVEIMG_RELEASEDIR?= ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/liveimage |
| | | 485 | |
| | | 486 | live-image: .PHONY check_DESTDIR check_RELEASEDIR |
| | | 487 | ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib live_image \ |
| | | 488 | LIVEIMG_RELEASEDIR=${LIVEIMG_RELEASEDIR} |
| | | 489 | ${MAKESUMS} -t ${LIVEIMG_RELEASEDIR} '*.img.gz' |
| | | 490 | |
| | | 491 | # install-image -- |
| | | 492 | # Standalone target to create installation images |
| | | 493 | # after the release was composed. |
| | | 494 | # Should be run after "make release" in src and xsrc. |
| | | 495 | # INSTIMG_RELEASEDIR specifies where to install live images and |
| | | 496 | # it can be set in MD etc.${MACHINE}/Makefile.inc. |
| | | 497 | # |
| | | 498 | INSTIMG_RELEASEDIR?= ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/installimage |
| | | 499 | |
| | | 500 | install-image: .PHONY check_DESTDIR check_RELEASEDIR |
| | | 501 | ${MAKEDIRTARGET} ${NETBSDSRCDIR}/distrib install_image \ |
| | | 502 | INSTIMG_RELEASEDIR=${INSTIMG_RELEASEDIR} |
| | | 503 | ${MAKESUMS} -t ${INSTIMG_RELEASEDIR} '*.img.gz' |
| | | 504 | |
478 | # snap_pre -- | | 505 | # snap_pre -- |
479 | # Create ${RELEASEDIR} and necessary subdirectories. | | 506 | # Create ${RELEASEDIR} and necessary subdirectories. |
480 | # | | 507 | # |
481 | snap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution | | 508 | snap_pre: .PHONY check_DESTDIR check_RELEASEDIR distribution |
482 | ${INSTALL} -d -m 755 ${RELEASEDIR} | | 509 | ${INSTALL} -d -m 755 ${RELEASEDIR} |
483 | .if ${MKUPDATE} == "no" | | 510 | .if ${MKUPDATE} == "no" |
484 | # Could be a mount point, ignore the errors | | 511 | # Could be a mount point, ignore the errors |
485 | -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR} | | 512 | -/bin/rm -rf ${RELEASEDIR}/${RELEASEMACHINEDIR} |
486 | .endif | | 513 | .endif |
487 | ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR} | | 514 | ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR} |
488 | .for dir in ${INSTALLATION_DIRS} | | 515 | .for dir in ${INSTALLATION_DIRS} |
489 | ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir} | | 516 | ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR}/${dir} |
490 | .endfor | | 517 | .endfor |