From 3a96085b999220c4da0c5ef7d1f7ba26b9ddfb98 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 31 Dec 2017 18:47:16 +0100 Subject: dec-multia: make netboot possible, add aboot bootloader --- package/aboot/Makefile | 24 + package/aboot/src/COPYING | 339 +++ package/aboot/src/ChangeLog | 214 ++ package/aboot/src/ChangeLog.cvs | 110 + package/aboot/src/INSTALL | 28 + package/aboot/src/Makefile | 150 ++ package/aboot/src/README | 169 ++ package/aboot/src/TODO | 11 + package/aboot/src/aboot.c | 289 +++ package/aboot/src/aboot.conf | 10 + package/aboot/src/aboot.lds | 26 + package/aboot/src/b2c.c | 70 + package/aboot/src/cons.c | 190 ++ package/aboot/src/disk.c | 854 ++++++++ package/aboot/src/doc/faq/.cvsignore | 1 + package/aboot/src/doc/faq/Makefile | 9 + package/aboot/src/doc/faq/SRM-HOWTO.sgml | 2293 ++++++++++++++++++++ package/aboot/src/doc/man/Makefile | 51 + package/aboot/src/doc/man/README | 32 + package/aboot/src/doc/man/aboot.8 | 57 + package/aboot/src/doc/man/aboot.conf.5 | 81 + package/aboot/src/doc/man/aboot.conf.sgml | 106 + package/aboot/src/doc/man/aboot.sgml | 83 + package/aboot/src/doc/man/abootconf.8 | 96 + package/aboot/src/doc/man/abootconf.sgml | 141 ++ package/aboot/src/doc/man/de/Makefile | 46 + package/aboot/src/doc/man/de/aboot.conf.sgml | 108 + package/aboot/src/doc/man/de/aboot.sgml | 89 + package/aboot/src/doc/man/de/abootconf.sgml | 146 ++ .../aboot/src/doc/man/de/docbook2man-de-spec.pl | 1304 +++++++++++ package/aboot/src/doc/man/de/e2writeboot.8 | 45 + package/aboot/src/doc/man/de/isomarkboot.sgml | 92 + package/aboot/src/doc/man/de/netabootwrap.sgml | 107 + package/aboot/src/doc/man/de/sdisklabel.sgml | 247 +++ package/aboot/src/doc/man/de/srmbootfat.sgml | 86 + package/aboot/src/doc/man/de/srmbootraw.sgml | 84 + package/aboot/src/doc/man/de/swriteboot.8 | 61 + package/aboot/src/doc/man/e2writeboot.8 | 42 + package/aboot/src/doc/man/isomarkboot.8 | 58 + package/aboot/src/doc/man/isomarkboot.sgml | 97 + package/aboot/src/doc/man/netabootwrap.sgml | 102 + package/aboot/src/doc/man/sdisklabel.8 | 152 ++ package/aboot/src/doc/man/sdisklabel.copyright | 32 + package/aboot/src/doc/man/sdisklabel.sgml | 246 +++ package/aboot/src/doc/man/swriteboot.8 | 58 + package/aboot/src/fs/dummy.c | 80 + package/aboot/src/fs/ext2.c | 623 ++++++ package/aboot/src/fs/iso.c | 59 + package/aboot/src/fs/ufs.c | 485 +++++ package/aboot/src/head.S | 173 ++ package/aboot/src/include/aboot.h | 47 + package/aboot/src/include/bootfs.h | 25 + package/aboot/src/include/config.h | 12 + package/aboot/src/include/cons.h | 47 + package/aboot/src/include/disklabel.h | 105 + package/aboot/src/include/hwrpb.h | 220 ++ package/aboot/src/include/iso.h | 292 +++ package/aboot/src/include/isolib.h | 30 + package/aboot/src/include/linux/ext2_fs.h | 591 +++++ package/aboot/src/include/pal.h | 51 + package/aboot/src/include/setjmp.h | 68 + package/aboot/src/include/string.h | 31 + package/aboot/src/include/system.h | 326 +++ package/aboot/src/include/ufs.h | 691 ++++++ package/aboot/src/include/utils.h | 24 + package/aboot/src/lib/Makefile | 42 + package/aboot/src/lib/_longjmp.S | 61 + package/aboot/src/lib/_setjmp.S | 36 + package/aboot/src/lib/divide.S | 160 ++ package/aboot/src/lib/isolib.c | 1590 ++++++++++++++ package/aboot/src/lib/memcpy.c | 23 + package/aboot/src/lib/memset.c | 28 + package/aboot/src/lib/string.c | 252 +++ package/aboot/src/lib/vsprintf.c | 317 +++ package/aboot/src/net.c | 146 ++ package/aboot/src/netabootwrap.c | 185 ++ package/aboot/src/netwrap.h | 17 + package/aboot/src/sdisklabel/.cvsignore | 2 + package/aboot/src/sdisklabel/Makefile | 15 + package/aboot/src/sdisklabel/README | 105 + package/aboot/src/sdisklabel/library.c | 79 + package/aboot/src/sdisklabel/library.h | 8 + package/aboot/src/sdisklabel/sdisklabel.c | 241 ++ package/aboot/src/sdisklabel/swriteboot.c | 226 ++ package/aboot/src/srmbootfat/COPYING | 349 +++ package/aboot/src/srmbootfat/Makefile | 24 + package/aboot/src/srmbootfat/README | 5 + package/aboot/src/srmbootfat/msdos.h | 160 ++ package/aboot/src/srmbootfat/srmbootfat.c | 246 +++ package/aboot/src/srmbootfat/srmbootfat.sgml | 85 + package/aboot/src/srmbootfat/srmbootraw.c | 101 + package/aboot/src/srmbootfat/srmbootraw.sgml | 84 + package/aboot/src/tools/.cvsignore | 5 + package/aboot/src/tools/Makefile | 22 + package/aboot/src/tools/abootconf.c | 125 ++ package/aboot/src/tools/bio.c | 178 ++ package/aboot/src/tools/bio.h | 4 + package/aboot/src/tools/e2lib.c | 1473 +++++++++++++ package/aboot/src/tools/e2lib.h | 332 +++ package/aboot/src/tools/e2writeboot.c | 254 +++ package/aboot/src/tools/elfencap.c | 61 + package/aboot/src/tools/isomarkboot.c | 239 ++ package/aboot/src/tools/objstrip.c | 260 +++ package/aboot/src/utils.c | 292 +++ package/aboot/src/zip/gzip.h | 96 + package/aboot/src/zip/inflate.c | 827 +++++++ package/aboot/src/zip/misc.c | 316 +++ package/aboot/src/zip/unzip.c | 139 ++ 108 files changed, 21826 insertions(+) create mode 100644 package/aboot/Makefile create mode 100644 package/aboot/src/COPYING create mode 100644 package/aboot/src/ChangeLog create mode 100644 package/aboot/src/ChangeLog.cvs create mode 100644 package/aboot/src/INSTALL create mode 100644 package/aboot/src/Makefile create mode 100644 package/aboot/src/README create mode 100644 package/aboot/src/TODO create mode 100644 package/aboot/src/aboot.c create mode 100644 package/aboot/src/aboot.conf create mode 100644 package/aboot/src/aboot.lds create mode 100644 package/aboot/src/b2c.c create mode 100644 package/aboot/src/cons.c create mode 100644 package/aboot/src/disk.c create mode 100644 package/aboot/src/doc/faq/.cvsignore create mode 100644 package/aboot/src/doc/faq/Makefile create mode 100644 package/aboot/src/doc/faq/SRM-HOWTO.sgml create mode 100644 package/aboot/src/doc/man/Makefile create mode 100644 package/aboot/src/doc/man/README create mode 100644 package/aboot/src/doc/man/aboot.8 create mode 100644 package/aboot/src/doc/man/aboot.conf.5 create mode 100644 package/aboot/src/doc/man/aboot.conf.sgml create mode 100644 package/aboot/src/doc/man/aboot.sgml create mode 100644 package/aboot/src/doc/man/abootconf.8 create mode 100644 package/aboot/src/doc/man/abootconf.sgml create mode 100644 package/aboot/src/doc/man/de/Makefile create mode 100644 package/aboot/src/doc/man/de/aboot.conf.sgml create mode 100644 package/aboot/src/doc/man/de/aboot.sgml create mode 100644 package/aboot/src/doc/man/de/abootconf.sgml create mode 100644 package/aboot/src/doc/man/de/docbook2man-de-spec.pl create mode 100644 package/aboot/src/doc/man/de/e2writeboot.8 create mode 100644 package/aboot/src/doc/man/de/isomarkboot.sgml create mode 100644 package/aboot/src/doc/man/de/netabootwrap.sgml create mode 100644 package/aboot/src/doc/man/de/sdisklabel.sgml create mode 100644 package/aboot/src/doc/man/de/srmbootfat.sgml create mode 100644 package/aboot/src/doc/man/de/srmbootraw.sgml create mode 100644 package/aboot/src/doc/man/de/swriteboot.8 create mode 100644 package/aboot/src/doc/man/e2writeboot.8 create mode 100644 package/aboot/src/doc/man/isomarkboot.8 create mode 100644 package/aboot/src/doc/man/isomarkboot.sgml create mode 100644 package/aboot/src/doc/man/netabootwrap.sgml create mode 100644 package/aboot/src/doc/man/sdisklabel.8 create mode 100644 package/aboot/src/doc/man/sdisklabel.copyright create mode 100644 package/aboot/src/doc/man/sdisklabel.sgml create mode 100644 package/aboot/src/doc/man/swriteboot.8 create mode 100644 package/aboot/src/fs/dummy.c create mode 100644 package/aboot/src/fs/ext2.c create mode 100644 package/aboot/src/fs/iso.c create mode 100644 package/aboot/src/fs/ufs.c create mode 100644 package/aboot/src/head.S create mode 100644 package/aboot/src/include/aboot.h create mode 100644 package/aboot/src/include/bootfs.h create mode 100644 package/aboot/src/include/config.h create mode 100644 package/aboot/src/include/cons.h create mode 100644 package/aboot/src/include/disklabel.h create mode 100644 package/aboot/src/include/hwrpb.h create mode 100644 package/aboot/src/include/iso.h create mode 100644 package/aboot/src/include/isolib.h create mode 100644 package/aboot/src/include/linux/ext2_fs.h create mode 100644 package/aboot/src/include/pal.h create mode 100644 package/aboot/src/include/setjmp.h create mode 100644 package/aboot/src/include/string.h create mode 100644 package/aboot/src/include/system.h create mode 100644 package/aboot/src/include/ufs.h create mode 100644 package/aboot/src/include/utils.h create mode 100644 package/aboot/src/lib/Makefile create mode 100644 package/aboot/src/lib/_longjmp.S create mode 100644 package/aboot/src/lib/_setjmp.S create mode 100644 package/aboot/src/lib/divide.S create mode 100644 package/aboot/src/lib/isolib.c create mode 100644 package/aboot/src/lib/memcpy.c create mode 100644 package/aboot/src/lib/memset.c create mode 100644 package/aboot/src/lib/string.c create mode 100644 package/aboot/src/lib/vsprintf.c create mode 100644 package/aboot/src/net.c create mode 100644 package/aboot/src/netabootwrap.c create mode 100644 package/aboot/src/netwrap.h create mode 100644 package/aboot/src/sdisklabel/.cvsignore create mode 100644 package/aboot/src/sdisklabel/Makefile create mode 100644 package/aboot/src/sdisklabel/README create mode 100644 package/aboot/src/sdisklabel/library.c create mode 100644 package/aboot/src/sdisklabel/library.h create mode 100644 package/aboot/src/sdisklabel/sdisklabel.c create mode 100644 package/aboot/src/sdisklabel/swriteboot.c create mode 100644 package/aboot/src/srmbootfat/COPYING create mode 100644 package/aboot/src/srmbootfat/Makefile create mode 100644 package/aboot/src/srmbootfat/README create mode 100644 package/aboot/src/srmbootfat/msdos.h create mode 100644 package/aboot/src/srmbootfat/srmbootfat.c create mode 100644 package/aboot/src/srmbootfat/srmbootfat.sgml create mode 100644 package/aboot/src/srmbootfat/srmbootraw.c create mode 100644 package/aboot/src/srmbootfat/srmbootraw.sgml create mode 100644 package/aboot/src/tools/.cvsignore create mode 100644 package/aboot/src/tools/Makefile create mode 100644 package/aboot/src/tools/abootconf.c create mode 100644 package/aboot/src/tools/bio.c create mode 100644 package/aboot/src/tools/bio.h create mode 100644 package/aboot/src/tools/e2lib.c create mode 100644 package/aboot/src/tools/e2lib.h create mode 100644 package/aboot/src/tools/e2writeboot.c create mode 100644 package/aboot/src/tools/elfencap.c create mode 100644 package/aboot/src/tools/isomarkboot.c create mode 100644 package/aboot/src/tools/objstrip.c create mode 100644 package/aboot/src/utils.c create mode 100644 package/aboot/src/zip/gzip.h create mode 100644 package/aboot/src/zip/inflate.c create mode 100644 package/aboot/src/zip/misc.c create mode 100644 package/aboot/src/zip/unzip.c (limited to 'package/aboot') diff --git a/package/aboot/Makefile b/package/aboot/Makefile new file mode 100644 index 000000000..e49a773ea --- /dev/null +++ b/package/aboot/Makefile @@ -0,0 +1,24 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= aboot +PKG_VERSION:= 1.0 +PKG_RELEASE:= 1 +PKG_DESCR:= srm boot loader for alpha machines +PKG_SECTION:= base/boot + +NO_DISTFILES:= 1 + +PKG_ARCH_DEPENDS:= alpha + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,ABOOT,aboot,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION))) + +CONFIG_STYLE:= manual + +aboot-install: + +include $(ADK_TOPDIR)/mk/pkg-bottom.mk diff --git a/package/aboot/src/COPYING b/package/aboot/src/COPYING new file mode 100644 index 000000000..a43ea2126 --- /dev/null +++ b/package/aboot/src/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/package/aboot/src/ChangeLog b/package/aboot/src/ChangeLog new file mode 100644 index 000000000..c46c6fc08 --- /dev/null +++ b/package/aboot/src/ChangeLog @@ -0,0 +1,214 @@ +2004-04-08 Will Woods + * Change include path (should fix compilation for 2.6 kernels) + * Add/fix extra_args patch - allows you to add extra arguments after + the configuration number (e.g. "1 console=ttyS0") + * Fix warning about bcopy + * Version is now 1.0_pre20040408 + +2003-12-01 Will Woods + * Patch for USB console from Jeff.Wiedemeier@hp.com + * Patch to check kernel memory against console memory descriptors, also + from Jeff. These two patches should allow booting on Wildfire. + +2003-11-07 Will Woods + * Changed version number to 1.0pre1 (aboot should hit 1.0 before + they stop making the Alpha, I think) + * Merged doc changes from 0.10 branch + * Reverted 0.10 changes out of HEAD (the tag aboot_010pre2 marks the + state just before the rollback) + +2003-03-21 Will Woods + * Added include/string.h, since we have our own string.c, replaced + #includes of with "string.h" since linux/string.h + no longer has user-includable prototypes. + (thanks to Kelledin for the idea) + * Changed #includes of our headers to use quotes instead of <> + * Don't build with -mcpu=ev4 (default code works on ev4 and is smaller) + * Cleaned up a couple other warnings + +2003-01-14 Will Woods + * Fixed typos in man pages ("True 64") + * Bumped version number to 0.9b + * Released 0.9b. Hooray! + +2002-09-18 Will Woods + * branched the 0.9 tree to add bugfixes + * fixed some compilation errors with newer gcc/glibc versions + * added newer manpages + +2001-11-14 Will Woods + * sdisklabel/sdisklabel.c: fixed my fix to the cylinder counting bug. + oops. also added (currently undocumented) "force" flag, to skip + error checking in sdisklabel. + +2001-10-26 Will Woods + * Released aboot 0.9. Yay! + +2001-10-25 Will Woods + * sdisklabel/sdisklabel.c: fixed cylinder-counting bug + +2001-10-11 Will Woods + * applied a patch from the debian version of aboot. Here's the debian + maintainer's changelog: + + * New upstream (from CVS) + * I am calling this version of aboot from CVS 0.8. + * Minor tweeks to make it compile with kernel 2.4.x headers. + * e2writeboot now returns non-zero on error. Closes: #107757 + -- Gregory W. Johnson Wed, 15 Aug 2001 + + Since he called his version 0.8, I will call this the 0.9 tree, to + avoid confusion. Hence this is aboot 0.9pre1. + +2001-10-09 Will Woods + * aboot.c, disk.c, include/config.c: replaced ABOOT_MINOR and + ABOOT_MAJOR with ABOOT_VERSION. Bumped version number to 0.8pre2. + * aboot.c: fixed ELF header bug that snuck in somewhere. + * fs/ext2.c, Makefile: fixes for proper #includes to allow compilation + of userspace testing aboot against the 2.4 kernel. + +2001-10-08 Will Woods + * fs/ext2.c: Fixed elusive overflow bug. If part of the kernel was + past the 524,287th block (given 4096 bytes per block) the byte offset + was too big to fit in an int. + * sdisklabel/sdisklabel.c: borrowed code from fdisk for getting + the correct size of the disk. + +2001-07-10 Will Woods + * aboot.c, tools/objstrip.c: elf_check_arch takes different arguments + in Linux 2.4 than it did in 2.2; added an aboot_elf_check_arch which + does the right thing based on version info from linux/version.h. + * disk.c: a function called get_options exists in 2.4 kernels, so + aboot's get_options function was renamed get_aboot_options(). + (both changes based on a patch by Christian Groessler ) + +2001-04-26 Will Woods + * disk.c: changed /etc/aboot.conf and aboot.conf back to their + original settings. If it ain't broke, why fix it? + * added the man pages in doc/man, written by Helge Kreutzmann + (Thanks Helge!) + +2001-03-20 Will Woods + * disk.c: swapped position of /etc/aboot.conf and aboot.conf in the + configs array, making /aboot.conf the default. + * isolib.c: added parse_rock_ridge_inode and get_rock_ridge_symlink + adapted from rock.c in the linux kernel source. + * isolib.c: added iso_follow_link and iso_readdir, adapted from + fs/ext2.c + * made minor changes here and there to quiet gcc warnings - + initializing variables to 0, casting variables properly, etc + +2000-06-27 David Huggins-Daines + + * sdisklabel/sdisklabel.c (main): Off-by-one error in argument + checking (not my fault!). + * disk.c (load_raw): This didn't work at all. I've changed it to + use an uncompressed kernel with headers. Eventually it will be + fixed so that it can accept compressed kernels as well (by + checking for gzip magic numbers). + * lib/vsprintf.c (vsprintf): Patch from Matt Wilson, fix the 'h' + format in vsprintf(). + * utils.c: Patch from Matt Wilson , to allow + compiling against linux 2.3 header files. + +2000-05-02 David Huggins-Daines + + * Makefile: Added the ability to build a debugging aboot that runs + as a userspace program. Great for filesystem code debugging. + Also, optimize for size instead of speed. + * aboot.c: Remove a.out support, add multiple ELF pheader + support. Also make the parameter offset, and kernel stack offset + non-hardcoded in order to deal with new, bigger consoles. + * disk.c: Change "plain" to "uncompressed" and load_aout() to + load_uncompressed(). Implement multiple pheaders for raw boot + (untested) and uncompressed boot (tested). Also look for + alternative config files (needed for CD booting and such) + * fs/ext2.c: Cache the root inode, and do proper 64-bit arithmetic + in ext2_iget() so that >2G filesystems work reliably (doh!) + * head.S: make run_kernel() assembly in order to save a few bytes. + * include/aboot.h: prototype run_kernel as attribute((noreturn)), + maybe this will save a few bytes too. + * fs/ufs.c: Implement dummy fstat(). I don't really know if the + UFS code still works, and I'm tempted to remove it. + * include/cons.h: Add a definition of the CTB, though we don't + really use it yet. + * include/iso.h: Rock Ridge constants + * lib/isolib.c: Rock Ridge filenames, code cleanup, and fix the + bug where 2048-byte blocks don't work. + * zip/misc.c: necessary stuff for multiple pheaders. + +2000-04-10 David Huggins-Daines + + * lib/isolib.c (iso_iget): Gar! More stupidity in the ISO code, + now fixed (see comment about *pnt being overwritten). With luck + this should be 0.7 final, so I won't need to do another 0.6 + +2000-04-02 David Huggins-Daines + + * lib/isolib.c: Fix some obvious stupidity in the ISO code (could + cause a failure to load the kernel in some cases due to reading + past the end of the device. + * sdisklabel/swriteboot.c (read_configured_partition): Eek! I + thought I had fixed the problems I created with installing aboot + on new disks. Obviously I didn't. Thanks to Martin Lucina + for inadvertently finding the case I missed. + +2000-03-23 David Huggins-Daines + + * cons.c: Patch from David North , via + Greg W. Johnson (gwj@debian.org), fixes serial console output on + some boxes. + * fs/iso.c: gwj@debian.org: silence compiler warnings + * include/isolib.h: ditto + * lib/string.c: ditto + * sdisklabel/swriteboot.c: add abootconf functionality to + swriteboot (where it probably belongs) + +2000-03-06 David Huggins-Daines + + * aboot-0.6: At long last we have a new aboot. This is somewhat + of an interim release, as it doesn't have all the features I'd + like (it doesn't list directories or follow symlinks on ISO9660 or + UFS filesystems, for example, nor does it support initrd), but it + integrates the large number of patches that have been added by + various distributions, adds symlink-following, initrd, and + directory-listing support on ext2 at least, and generally works + better. + +Sat Aug 17 18:58:36 1996 David Mosberger-Tang + + * disk.c (get_boot_device): New function. If it guesses wrong, + explicitly specify bootdevice= via commandline. + (get_options): Add support for bootdevice= and bootfile= options + to enable Red Hat installation. + + * sdisklabel/library.c (overlaplabel): FORCE is now a bitset. + If bit i is set, overlaps with partition i+1 are allowed. + * sdisklabel/sdisklabel.c (set_partition): Update accordingly. + + * sdisklabel/swriteboot.c (main): Make 1 be the first partition + (not 0) to be consistent with Linux kernel numbering. Make + force_overlap a bitset so we can force more than one overlapping + partition. + + * disk.c (load_kernel): If kernel load fails, drop into + interactive mode. + + * fs/ext2.c (ext2_iget): Make OFFSET a long, not an int so we can + boot from a partition that starts at an offset > 2GB. + +Fri May 10 16:48:25 1996 David Mosberger-Tang + + * main.c: split out disk booting into disk.c and netbooting into + net.c. + +Fairly recently: + * Network booting support added by Dave Larson + + +A long time ago: + * Default commandline argument handling by Michael Schwingen + + +A very long time ago: + * Filesystem support added by David Mosberger diff --git a/package/aboot/src/ChangeLog.cvs b/package/aboot/src/ChangeLog.cvs new file mode 100644 index 000000000..88c7b450b --- /dev/null +++ b/package/aboot/src/ChangeLog.cvs @@ -0,0 +1,110 @@ +2001-07-13 23:06 wwoods + + * ChangeLog, INSTALL, aboot.c, disk.c, lib/isolib.c, + tools/objstrip.c: Incorporated patch from Christian Groessler + to make aboot compile against Linux 2.4 + +2001-04-26 23:39 wwoods + + * ChangeLog, Makefile, README, disk.c, doc/man/Makefile, + doc/man/README, doc/man/aboot.8, doc/man/aboot.conf.5, + doc/man/aboot.conf.sgml, doc/man/aboot.sgml, doc/man/abootconf.8, + doc/man/abootconf.sgml, doc/man/e2writeboot.8, + doc/man/swriteboot.8, include/config.h: Changed default config file + location back to /etc/aboot.conf Added man pages written by Helge + Kreutzmann + +2001-04-02 23:21 wwoods + + * ChangeLog: updated ChangeLog + +2001-04-02 23:11 wwoods + + * Makefile, README, disk.c, fs/iso.c, include/config.h, + include/isolib.h, lib/Makefile, lib/isolib.c: * added full + rockridge support - symlinks and long filenames are now properly + supported on ISO filesystems. * changed default aboot.conf + location to /aboot.conf * fixed crash when booting from a directory + with a long filename on ISO fs + +2000-06-27 18:14 dhd + + * README: Remove reference to documentation directory which no + longer exists + +2000-06-27 18:08 dhd + + * README: Doh! Update the README to the correct version number :-) + +2000-06-27 18:08 dhd + + * aboot.c: If DEBUG is defined, dump the ELF header information + *before* loading the kernel, to aid debugging. + +2000-06-27 18:07 dhd + + * ChangeLog, disk.c: Change "raw" booting to actually work, which + required making it no longer be "raw". + + Okay, so maybe this will be 0.7a for real... + +2000-06-27 16:52 dhd + + * ChangeLog, sdisklabel/sdisklabel.c: Fix sdisklabel to not + segfault with too few arguments. I wonder if anybody actually uses + this program. + +2000-06-27 16:47 dhd + + * ChangeLog, disk.c, utils.c, lib/vsprintf.c: 0.7a release, I + think. Fixes: + + * Concatenating the kernel with aboot in the boot sectors didn't + work. + * aboot didn't compile with Linux 2.3 headers (msw@redhat.com) + * vsprintf() didn't do the right thing in certain obscure cases + (msw@redhat.com) + +2000-06-27 16:44 dhd + + * .cvsignore, sdisklabel/.cvsignore, tools/.cvsignore: Ignore + various generated files + +2000-05-03 05:58 dhd + + * COPYING, ChangeLog, INSTALL, Makefile, README, TODO, aboot.c, + aboot.conf, aboot.lds, cons.c, disk.c, head.S, net.c, utils.c, + fs/dummy.c, fs/ext2.c, fs/iso.c, fs/ufs.c, include/aboot.h, + include/bootfs.h, include/config.h, include/cons.h, + include/disklabel.h, include/iso.h, include/isolib.h, + include/setjmp.h, include/ufs.h, include/utils.h, lib/Makefile, + lib/_longjmp.S, lib/_setjmp.S, lib/divide.S, lib/isolib.c, + lib/memcpy.c, lib/memset.c, lib/string.c, lib/vsprintf.c, + sdisklabel/Makefile, sdisklabel/README, sdisklabel/library.c, + sdisklabel/library.h, sdisklabel/sdisklabel.c, + sdisklabel/swriteboot.8, sdisklabel/swriteboot.c, tools/Makefile, + tools/abootconf.c, tools/bio.c, tools/bio.h, tools/e2writeboot.8, + tools/e2lib.c, tools/e2lib.h, tools/e2writeboot.c, + tools/elfencap.c, tools/isomarkboot.c, tools/objstrip.c, + zip/gzip.h, zip/inflate.c, zip/misc.c, zip/unzip.c: Initial + revision + +2000-05-03 05:58 dhd + + * COPYING, ChangeLog, INSTALL, Makefile, README, TODO, aboot.c, + aboot.conf, aboot.lds, cons.c, disk.c, head.S, net.c, utils.c, + fs/dummy.c, fs/ext2.c, fs/iso.c, fs/ufs.c, include/aboot.h, + include/bootfs.h, include/config.h, include/cons.h, + include/disklabel.h, include/iso.h, include/isolib.h, + include/setjmp.h, include/ufs.h, include/utils.h, lib/Makefile, + lib/_longjmp.S, lib/_setjmp.S, lib/divide.S, lib/isolib.c, + lib/memcpy.c, lib/memset.c, lib/string.c, lib/vsprintf.c, + sdisklabel/Makefile, sdisklabel/README, sdisklabel/library.c, + sdisklabel/library.h, sdisklabel/sdisklabel.c, + sdisklabel/swriteboot.8, sdisklabel/swriteboot.c, tools/Makefile, + tools/abootconf.c, tools/bio.c, tools/bio.h, tools/e2writeboot.8, + tools/e2lib.c, tools/e2lib.h, tools/e2writeboot.c, + tools/elfencap.c, tools/isomarkboot.c, tools/objstrip.c, + zip/gzip.h, zip/inflate.c, zip/misc.c, zip/unzip.c: Initial import + (from 0.7 release) + diff --git a/package/aboot/src/INSTALL b/package/aboot/src/INSTALL new file mode 100644 index 000000000..107940de2 --- /dev/null +++ b/package/aboot/src/INSTALL @@ -0,0 +1,28 @@ +Thu Jun 27 03:23:08 1996 + +- Edit Makefile and include/config.h to suite your needs. For most + purposes, the distributed version should work fine. Note that + the CONFIG_FILE_PARTITION macro is still present like in earlier + version, but since aboot-0.5 allows you to select a partition via + the boot-commandline, the value for that macro is not as critical + anymore. Users of certain versions of gcc (2.96 and later?) + may need to add '-ffreestanding' flag to CFLAGS, in the Makefile. + +- Type "make". + +- To install the newly created aboot image (named "bootlx"), in most cases, + you use swriteboot (found in the sdisklabel directory), like this: + + # swriteboot -c[boot partition #] [boot device] bootlx + + for example, on my system, the kernel images (and aboot.conf) are on my + root partition, /dev/sda2. hence: + + # swriteboot -c2 /dev/sda bootlx + + DON'T DO THIS UNLESS YOU'RE SURE OF THE PARTITION INFO. If you don't know + exactly what you're doing, and your system already boots okay, there's no + reason to be installing a new bootloader. + + For more info, read the SRM HOWTO, in doc/faq/srm.html, or at: + http://www.alphalinux.org/faq/srm.html diff --git a/package/aboot/src/Makefile b/package/aboot/src/Makefile new file mode 100644 index 000000000..12450e735 --- /dev/null +++ b/package/aboot/src/Makefile @@ -0,0 +1,150 @@ +# +# aboot/Makefile +# +# This file is subject to the terms and conditions of the GNU General Public +# License. See the file "COPYING" in the main directory of this archive +# for more details. +# +# Copyright (c) 1995, 1996 by David Mosberger (davidm@cs.arizona.edu) +# + +# location of linux kernel sources (must be absolute path): +KSRC = /usr/src/linux +VMLINUX = $(KSRC)/vmlinux +VMLINUXGZ = $(KSRC)/arch/alpha/boot/vmlinux.gz + +# for userspace testing +#TESTING = yes + +# for boot testing +#CFGDEFS = -DDEBUG_ISO -DDEBUG_ROCK -DDEBUG_EXT2 -DDEBUG + +bindir = $(DESTDIR)/sbin +bootdir = $(DESTDIR)/boot + +export + +# +# There shouldn't be any need to change anything below this line. +# +TOP = $(shell pwd) +LOADADDR = 20000000 + +ifndef $($(CC)) +CC ?= gcc +endif + +ifeq ($(TESTING),) +override CPPFLAGS += $(CFGDEFS) -I$(TOP)/include +override CFLAGS += $(CPPFLAGS) -D__KERNEL__ -mcpu=ev4 -Os -Wall -fno-builtin -Wcast-align -mno-fp-regs -ffixed-8 -fno-builtin-printf +else +override CPPFLAGS += -DTESTING $(CFGDEFS) -I$(TOP)/include +override CFLAGS += $(CPPFLAGS) -O -g3 -Wall -D__KERNEL__ -ffixed-8 +endif + +ABOOT_LDFLAGS = -static -N -Taboot.lds +override ASFLAGS += $(CPPFLAGS) + + +.c.s: + $(CC) $(CFLAGS) -S -o $*.s $< +.s.o: + $(AS) -o $*.o $< +.c.o: + $(CC) $(CFLAGS) -c -o $*.o $< +.S.s: + $(CC) $(ASFLAGS) -D__ASSEMBLY__ -traditional -E -o $*.o $< +.S.o: + $(CC) $(ASFLAGS) -D__ASSEMBLY__ -traditional -c -o $*.o $< + +NET_OBJS = net.o +DISK_OBJS = disk.o fs/ext2.o fs/ufs.o fs/dummy.o fs/iso.o +ifeq ($(TESTING),) +ABOOT_OBJS = \ + head.o aboot.o cons.o utils.o \ + zip/misc.o zip/unzip.o zip/inflate.o +else +ABOOT_OBJS = aboot.o zip/misc.o zip/unzip.o zip/inflate.o +endif +LIBS = lib/libaboot.a + +all: diskboot net_aboot.nh + +diskboot: bootlx sdisklabel/sdisklabel sdisklabel/swriteboot \ + tools/e2writeboot tools/abootconf \ + tools/elfencap + +netboot: vmlinux.bootp + +bootloader.h: net_aboot.nh b2c + ./b2c net_aboot.nh bootloader.h bootloader + +netabootwrap: netabootwrap.c bootloader.h + $(CC) $@.c $(CFLAGS) -o $@ + + +bootlx: aboot tools/objstrip + tools/objstrip -vb aboot bootlx + +install-man: + make -C doc/man install + +install-man-gz: + make -C doc/man install-gz + +install: tools/abootconf tools/e2writeboot \ + sdisklabel/swriteboot + install -d $(bindir) $(bootdir) + install -c tools/abootconf $(bindir) + install -c tools/e2writeboot $(bindir) + install -c sdisklabel/swriteboot $(bindir) + install -c bootlx $(bootdir) + +installondisk: bootlx sdisklabel/swriteboot + sdisklabel/swriteboot -vf0 /dev/sda bootlx vmlinux.gz + +ifeq ($(TESTING),) +aboot: $(ABOOT_OBJS) $(DISK_OBJS) $(LIBS) + $(LD) $(ABOOT_LDFLAGS) $(ABOOT_OBJS) $(DISK_OBJS) -o $@ $(LIBS) +else +aboot: $(ABOOT_OBJS) $(DISK_OBJS) $(LIBS) + $(CC) $(ABOOT_OBJS) $(DISK_OBJS) -o $@ $(LIBS) +endif + +vmlinux.bootp: net_aboot.nh $(VMLINUXGZ) net_pad + cat net_aboot.nh $(VMLINUXGZ) net_pad > $@ + +net_aboot.nh: net_aboot tools/objstrip + $(CROSS)strip net_aboot + tools/objstrip -vb net_aboot $@ + +net_aboot: $(ABOOT_OBJS) $(ABOOT_OBJS) $(NET_OBJS) $(LIBS) + $(LD) $(ABOOT_LDFLAGS) $(ABOOT_OBJS) $(NET_OBJS) -o $@ $(LIBS) + +net_pad: + dd if=/dev/zero of=$@ bs=512 count=1 + +clean: sdisklabel/clean tools/clean lib/clean + rm -f aboot abootconf net_aboot net_aboot.nh net_pad vmlinux.bootp \ + $(ABOOT_OBJS) $(DISK_OBJS) $(NET_OBJS) bootlx \ + include/ksize.h vmlinux.nh b2c bootloader.h netabootwrap + +distclean: clean + find . -name \*~ | xargs rm -f + +lib/%: + make -C lib $* CPPFLAGS="$(CPPFLAGS)" TESTING="$(TESTING)" + +tools/%: + make -C tools $* CPPFLAGS="$(CPPFLAGS)" + +sdisklabel/%: + make -C sdisklabel $* CPPFLAGS="$(CPPFLAGS)" + +vmlinux.nh: $(VMLINUX) tools/objstrip + tools/objstrip -vb $(VMLINUX) vmlinux.nh + +include/ksize.h: vmlinux.nh + echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'` > $@ + +dep: diff --git a/package/aboot/src/README b/package/aboot/src/README new file mode 100644 index 000000000..b5d3f0a2c --- /dev/null +++ b/package/aboot/src/README @@ -0,0 +1,169 @@ +This is release 0.9 of aboot, the Linux/Alpha loader for SRM. + +Aboot is based on the standard Linux/Alpha bootloader, with extensions +by David Mosberger and Michael Schwingen (prompt for arguments, kernel +argument mapping using /etc/aboot.conf file). It is currently maintained +by Will Woods. + +For more information about aboot and SRM, see the SRM Firmware HOWTO, in +doc/faq/srm.html, or at http://www.alphalinux.org/faq/srm.html + +Good luck and enjoy... + +-Will Woods Oct 25, 2001 + +--- + +New with version 0.9: + + - new and (hopefully) improved man pages + - Crash when booting from a path containing a long filename on isofs fixed + - listing directories on isofs works + - symlinks on isofs work + - Failure to boot when kernel was past the 2GB boundary on ext2 fs fixed + - cylinder-counting bug in sdisklabel fixed + +[Note: there was no (official) version 0.8.] + +New with version 0.7: + + - aboot now supports an initial ramdisk, which can be loaded from an + arbitrary file on any supported filesystem. To use this, pass an + 'initrd=/path/to/file' argument in the boot flags, or use the 'i' + command from the interactive menu. + + - a.out support has been removed. + + - (as of 0.7a) "raw" booting no longer is - you must use an + uncompressed ELF kernel. + + - Many bugs in the ISO filesystem code have been found and fixed. + + - swriteboot incorporates the functionality of abootconf. + +New with version 0.6: + + - The various patches from the Red Hat, Debian, and SuSE packages + have been merged back in. + + - ext2 partitions with >1024 byte block sizes and sparse superblocks + are now (hopefully) supported. (from Red Hat?) + + - aboot can now follow symbolic links on ext2 filesystems. + + - aboot no longer passes the bootdevice= and bootfile= flags to the + kernel, as the code for guessing the boot device was completely + broken, and these options are not used at all by current kernels. + + - aboot is now built as an ELF image (since that's what the current + toolchain supports), and code to strip it accordingly has been + added (from Richard Henderson) + + - isomarkboot now has an option to specify the root filesystem image + to be loaded (from Debian) + + - swriteboot tries to preserve the boot partition setting from a + previous aboot installation. + +New with version 0.5: + + - IMPORTANT: e2writeboot now expects a _raw_ file, not an ECOFF + object file. So be sure to write aboot using the command: + + e2writeboot /dev/fd0 bootlx + + This change has been made so e2writeboot and s2writeboot are more + consistent. It also makes it easier to support multiple object + file formats. + + - The location the partition containing /etc/aboot.conf can now be + specified on the commandline: -fl 3:0 selects the aboot.conf line + 0 on partition 3. + + - Booting of ELF object files is now supported. In the process of + adding ELF suport, the build tool has been rewritten from scratch + (it's now a lot simpler despite supporting two object file + formats). + + - Booting from an ext2fs partition that starts at an offset >= 2GB + now works. + + - If the kernel load fails, aboot now drops into interactive mode + instead of + + - swriteboot now supports an option to force installation of aboot even + if there is an overlap between the aboot image and some partition. E.g., + if partition 1 and 3 start at sector 0 (as is commonly the case for disks + partitioned under OSF/1), you can specify: + + swriteboot -f1 -f3 /dev/sdc bootlx + + WARNING: Using -f will obviously destroy any filesystem that may be + present on the specified partition. Use at your own risk. + + - NOTE: I'd like to remove sdisklabel in future distributions (minlabel + should be all you need). Let me know if you feel strongly about this + (one way or the other). + +New with version 0.4: + + - abootconf allows to set (or query) the number of the partition that + aboot will use to lookup /etc/aboot.conf. + - support for net boot added (thanks to Dave Larson ) + - iso9660 filesystem support added (based on Dave Rusling's MILO sources) + +New with version 0.31: + + - e2writeboot is now included in the distribution. + - started with writing man pages for e2writeboot and swriteboot; pretty + cryptic, I believe, but heck, it's the best there is! :-) + +New with version 0.3: + + - The commandline prompt changed to "aboot>". + + - The contents of /etc/aboot.conf can be displayed with a commandline + argument consisting of a single 'h'. After displaying the configuration + file, aboot will prompt for a commandline just like for the 'i' option. + + - At the "aboot>" prompt, the user can enter a single 'h' to display + the configuration file. Entering an empty line or a line consisting + of a single 'i' will keep the user in the "aboot>" prompt loop. + + - Booting of raw (headerless) kernels is now supported again. A raw + boot is requested by specifying a filename consisting of a single + '-' character only. Booting ECOFF kernels off a disk without filesystem + is now supported via partition number 0 (in aboot-0.2, this was incorrectly + called a "raw boot"). For example, to boot a compressed ECOFF file, + one could specify the filename "0/-" (filename "-" on the zeroth + partition). You can use the swriteboot command to write the kernel + for a filesystem-less boot. + + - Booting from floppy disks now works again. + +New with version 0.2: + + - If the kernel commandline consists of a single 'i', aboot prompts for + kernel file and commandline arguments (useful on machines such as + the Jensen, where the SRM limits commandline arguments to 1 argument). + + - If the kernel commandline consists of a single digit, aboot looks up + the default configuration with that number in the file /etc/aboot.conf + on a compile-time defined partition of the bootdrive, and uses the + parameters given there as commandline arguments for the kernel (useful + where the SRM limits default commandline arguments to 8 characters, + and does not support setting a default filename). + + - If the kernel filename consists of a single '-' or is empty, aboot + will perform a raw boot. This involves loading a kernel starting at + the disk sector after the aboot code (currently, 162). This kernel + must be a header-less ("raw") binary without any ECOFF header. + +New with version 0.1: + + - Compressed kernels (using gzip) are supported (faster loading, less + disk usage). + + - You can load the kernel from an UFS or EXT2 filesystem on any partition + of the boot disk. + diff --git a/package/aboot/src/TODO b/package/aboot/src/TODO new file mode 100644 index 000000000..74a99d261 --- /dev/null +++ b/package/aboot/src/TODO @@ -0,0 +1,11 @@ +- more documentation (aboot man page, improve e2writeboot & swriteboot + man pages) + +- I suspect that EOF detection does not work on UFS filesystems - + i.e., reading the configuration file may cause a hang on such a + filesystem when the desired config line is not found. I have not fixed + this since I could not check the changes - look at the top of + iext2_breadi to see how I fixed nblks there MS + +- Netbooting support and UFS may be broken. Either they'll get fixed + or they will be dropped, as neither is particularly useful. diff --git a/package/aboot/src/aboot.c b/package/aboot/src/aboot.c new file mode 100644 index 000000000..90614a72c --- /dev/null +++ b/package/aboot/src/aboot.c @@ -0,0 +1,289 @@ +/* + * aboot.c + * + * This file is part of aboot, the SRM bootloader for Linux/Alpha + * Copyright (C) 1996 Linus Torvalds, David Mosberger, and Michael Schwingen. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include "hwrpb.h" +#include "system.h" + +#include +#include +#include + +#include "aboot.h" +#include "config.h" +#include "cons.h" +#include "setjmp.h" +#include "utils.h" +#include "string.h" + +struct bootfs * bfs = 0; /* filesystem to boot from */ +char * dest_addr = 0; +jmp_buf jump_buffer; + +unsigned long start_addr = START_ADDR; /* default only */ +struct segment* chunks; +int nchunks; + +char boot_file[256] = ""; +char initrd_file[256] = ""; +char kernel_args[256] = ""; +char * bss_start = 0; +long bss_size = 0; /* size of bss */ +unsigned long initrd_start = 0; +unsigned long initrd_size = 0; + +/* Offsets from start_addr (yes, they are negative, because start_addr + is actually the load address plus the text offset) */ +#define PARAM_OFFSET -0x6000 /* load address + 0xa000 */ +#define STACK_OFFSET -0xe000 /* load address + 0x2000 */ + +/* eventually we may have to deal with 44-bit physical addressing and + also possibly larger pages */ +unsigned long page_offset = 0xfffffc0000000000; +unsigned long page_shift = 13; + +static unsigned long entry_addr = START_ADDR; + +/* + * The decompression code calls this function after decompressing the + * first block of the object file. The first block must contain all + * the relevant header information. + */ +long +first_block (const char *buf, long blocksize) +{ + Elf64_Ehdr *elf; + Elf64_Phdr *phdrs; + int i, j; + + elf = (Elf64_Ehdr *) buf; + + if (elf->e_ident[0] != 0x7f + || elf->e_ident[1] != 'E' + || elf->e_ident[2] != 'L' + || elf->e_ident[3] != 'F') + { + /* Fail silently, it might be a compressed file */ + return -1; + } + if (elf->e_ident[EI_CLASS] != ELFCLASS64 + || elf->e_ident[EI_DATA] != ELFDATA2LSB + || elf->e_machine != EM_ALPHA) + { + printf("aboot: ELF executable not for this machine\n"); + return -1; + } + + /* Looks like an ELF binary. */ + if (elf->e_type != ET_EXEC) { + printf("aboot: not an executable ELF file\n"); + return -1; + } + + if (elf->e_phoff + elf->e_phnum * sizeof(*phdrs) > (unsigned) blocksize) + { + printf("aboot: " + "ELF program headers not in first block (%ld)\n", + (long) elf->e_phoff); + return -1; + } + + phdrs = (struct elf_phdr *) (buf + elf->e_phoff); + chunks = malloc(sizeof(struct segment) * elf->e_phnum); + start_addr = phdrs[0].p_vaddr; /* assume they are sorted */ + entry_addr = elf->e_entry; + +#ifdef DEBUG + printf("aboot: %d program headers, start address %#lx, entry %#lx\n", + elf->e_phnum, start_addr, entry_addr); +#endif + + for (i = j = 0; i < elf->e_phnum; ++i) { + int status; + + if (phdrs[i].p_type != PT_LOAD) + continue; + + chunks[j].addr = phdrs[i].p_vaddr; + chunks[j].offset = phdrs[i].p_offset; + chunks[j].size = phdrs[i].p_filesz; + +#ifdef DEBUG + printf("aboot: PHDR %d vaddr %#lx offset %#lx size %#lx\n", + i, chunks[j].addr, chunks[j].offset, chunks[j].size); +#endif + +#ifndef TESTING + status = check_memory(chunks[j].addr, chunks[j].size); + if (status) { + printf("aboot: Can't load kernel.\n" + " Memory at %lx - %lx (PHDR %i) " + "is %s\n", + chunks[j].addr, + chunks[j].addr + chunks[j].size - 1, + i, + (status == -ENOMEM) ? + "Not Found" : + "Busy (Reserved)"); + return -1; + } +#endif + + if (phdrs[i].p_memsz > phdrs[i].p_filesz) { + if (bss_size > 0) { + printf("aboot: Can't load kernel.\n" + " Multiple BSS segments" + " (PHDR %d)\n", i); + return -1; + } + bss_start = (char *) (phdrs[i].p_vaddr + + phdrs[i].p_filesz); + bss_size = (phdrs[i].p_memsz - phdrs[i].p_filesz); + } + + j++; + } + nchunks = j; +#ifdef DEBUG + printf("aboot: bss at 0x%p, size %#lx\n", bss_start, bss_size); +#endif + + return 0; +} + +static void +get_boot_args(void) +{ + long result; + + /* get boot command line: */ +#ifdef TESTING + const char *e; + if ((e = getenv("BOOTED_FILE"))) { + strncpy(boot_file, e, sizeof(boot_file)-1); + boot_file[sizeof(boot_file)-1] = 0; + } else { + strcpy(boot_file, "vmlinux.gz"); + } + if ((e = getenv("BOOTED_OSFLAGS"))) { + strncpy(kernel_args, e, sizeof(kernel_args)-1); + kernel_args[sizeof(kernel_args)-1] = 0; + } else { + strcpy(kernel_args, "i"); + } +#else + result = cons_getenv(ENV_BOOTED_FILE, boot_file, sizeof(boot_file)); + if (result < 0) { + printf("aboot: warning: can't get ENV_BOOTED_FILE " + "(result=%lx)!\n", result); + strcpy(boot_file, "vmlinux.gz"); + } + result = cons_getenv(ENV_BOOTED_OSFLAGS, +