Compare commits
199 Commits
1.0
...
a27de93bfe
Author | SHA1 | Date | |
---|---|---|---|
a27de93bfe | |||
f6e6323bf7 | |||
539026f92b | |||
5b42a8d15b | |||
57d9815a48 | |||
ba52a77532 | |||
04bd2398e4 | |||
09d1218e22 | |||
1b345f3cb2 | |||
036dc79d99 | |||
2bef753269 | |||
c5531c36c3 | |||
895688d085 | |||
3d71025331 | |||
58f1fc7975 | |||
86a52fa755 | |||
e52a9a4871 | |||
9d2fe5306d | |||
b59ebbab15 | |||
df81adfaa2 | |||
b4da22f2cf | |||
3c6be8d7ad | |||
16ffe5ff5c | |||
415110895e | |||
c9dbaadba7 | |||
e05e98f7ea | |||
04ed6b37ee | |||
c6433201a4 | |||
2c8c706aca | |||
4bb68f6702 | |||
07dc125b43 | |||
2502564de3 | |||
4c91542775 | |||
68db69c9bf | |||
b15108a01f | |||
1a545d74b3 | |||
d69cbea692 | |||
82b0c397f8 | |||
d584de049e | |||
756d128e4c | |||
13106b7bdb | |||
f3a98a1407 | |||
efe8057ee0 | |||
b314f24a5e | |||
be97663762 | |||
7759ecc296 | |||
71d227811f | |||
d01df2ee8b | |||
0e3f2e6252 | |||
942364551a | |||
2a00f0fe4b | |||
fe88b87bda | |||
da84ed6b7e | |||
9852d871c0 | |||
b392eaa4c1 | |||
e63f04c399 | |||
12cf678343 | |||
83251adb36 | |||
5e7d8ba878 | |||
c48e283772 | |||
a72f326d17 | |||
9a63db8986 | |||
3d2b8caa58 | |||
4fff5657e6 | |||
21c0d96ddc | |||
02df669220 | |||
eeda4f38f5 | |||
aa2a79585b | |||
a18c6bb409 | |||
8951e0636e | |||
6b05f497c8 | |||
7d2a3797c3 | |||
c4b658842b | |||
33cf02869b | |||
6bd9625562 | |||
3c3922f99a | |||
d7c2376925 | |||
dbc51b810d | |||
eeec328bef | |||
391ed2f0f1 | |||
f06744e2fa | |||
dd60f5ee3b | |||
360cff937c | |||
87bd74c74f | |||
22812b1a06 | |||
95c26b0ce4 | |||
7f2671342e | |||
f667080ee4 | |||
431f9c1c0c | |||
57362fa374 | |||
846b540c42 | |||
d67cb83633 | |||
8ac03608a4 | |||
c02a9a2a94 | |||
3122435982 | |||
013c1e174f | |||
ec26c7845e | |||
9938238cb3 | |||
9251519d7a | |||
19a14be866 | |||
8c2190b598 | |||
4057597197 | |||
1c25a15760 | |||
e349d47c90 | |||
4cdccda8cb | |||
386dfc194b | |||
ef464c1ed0 | |||
8c5424569d | |||
dd18f517a8 | |||
386de37eb2 | |||
612306ff93 | |||
00ca9d7273 | |||
854ce6b5cc | |||
55533d5184 | |||
3f8ac07728 | |||
5e89db5b3b | |||
a1e69a69c0 | |||
f9cd12759a | |||
871f9f0884 | |||
1d5e368b52 | |||
e8b0690a58 | |||
d0e7c4cf8a | |||
1f3e8708f7 | |||
12a5e208f3 | |||
7c09914672 | |||
279cc5e2a9 | |||
27006c6c4c | |||
f756bcc3a2 | |||
eae49b735a | |||
1c943ccfd1 | |||
494eb804bd | |||
aab285b9e9 | |||
52297663f8 | |||
96868b5d32 | |||
fcaf9b7ecd | |||
54b4aefa66 | |||
14362f9929 | |||
e71c0aa1c7 | |||
42778f91fa | |||
df4b9b913c | |||
ef37ca982b | |||
b37d0328c5 | |||
f1268ba0fc | |||
315a6414dc | |||
a9b3e9916d | |||
3ec2cbd2e7 | |||
9c45cd2829 | |||
8309d27b63 | |||
baf988a2e1 | |||
50c091ee5c | |||
bac0e2e1e2 | |||
e1e23ae057 | |||
85422b2328 | |||
2e7928ec7a | |||
2888156b3c | |||
042564d62e | |||
b20ee547c6 | |||
01714b8d71 | |||
0a1c072561 | |||
4d1619ab6a | |||
0a622672c0 | |||
0a9ac34273 | |||
cbfb910b43 | |||
fcc3b5b267 | |||
8c35faf113 | |||
592ffa1602 | |||
e25243cb0c | |||
cafd8776b5 | |||
a31897d419 | |||
d55c0986dc | |||
34fd154e7e | |||
c313cfd37e | |||
3ed94977cd | |||
ee3e2a2a3d | |||
897eeff870 | |||
ad4968f29d | |||
584c02c3c5 | |||
8c3b37d38e | |||
86fe89f965 | |||
a8c543740a | |||
2bcf6b68e6 | |||
b43cf19b3c | |||
2a82e889e8 | |||
22115e7251 | |||
84b5df020b | |||
6a95bc6014 | |||
8e14a565c7 | |||
9a2af32600 | |||
1b9bb7ed50 | |||
48b451c6b8 | |||
17cb092b9a | |||
1c3749325b | |||
b4e21eca05 | |||
8cdf11965a | |||
c35a2024ae | |||
d7d396d148 | |||
f712a2642f | |||
6c412d2bf2 | |||
a22918ebab |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/build
|
||||
/platforms/*/INFO/
|
||||
/log
|
||||
/log/
|
||||
/log/*
|
||||
|
556
LICENSE
556
LICENSE
@ -1,231 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
“This License” refers to version 3 of the GNU General Public License.
|
||||
|
||||
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
||||
|
||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
||||
|
||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
||||
|
||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
|
||||
|
||||
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
|
||||
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
|
||||
|
||||
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
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.
|
||||
|
||||
16. Limitation of Liability.
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
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 state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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
|
||||
|
||||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program 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.
|
||||
Gnomovision version 69, Copyright (C) year 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, your program's commands might be different; for a GUI interface, you would use an “about box”.
|
||||
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 school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
|
||||
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:
|
||||
|
||||
The GNU 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 Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 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 Lesser General
|
||||
Public License instead of this License.
|
||||
|
351
README.md
351
README.md
@ -1,44 +1,341 @@
|
||||
# mageia4arm
|
||||
mageia4arm
|
||||
==========
|
||||
|
||||
Short :
|
||||
-------
|
||||
* [Français](#francais)
|
||||
* [English](#english)
|
||||
|
||||
|
||||
<a id="francais"/>
|
||||
Français
|
||||
--------
|
||||
|
||||
* [Description](#fr_desc)
|
||||
* [Rapidement](#fr_quick)
|
||||
* [Créer une image](#fr_creatimg)
|
||||
* [Aide](#fr_help)
|
||||
* [Premier démarrage](#fr_1stStart)
|
||||
* [Nouvelle plateforme](#fr_newPlat)
|
||||
* [Fichier de configuration](#fr_file-conf)
|
||||
* [Fichier chroot](#fr_file-second)
|
||||
* [Fichier de fonctions personnalisées](#fr_file-spe)
|
||||
* [Fichier extlinux](#fr_file-extlinux)
|
||||
* [Autres fichiers](#fr_file_others)
|
||||
* [Extras](#fr_extras)
|
||||
* [Graver l'image](#fr_burn)
|
||||
* [Compresser l'image](#fr_compress)
|
||||
* [Générer une checksum](#fr_gen_chksum)
|
||||
* [Signer la checksum](#fr_sign)
|
||||
* [Vérifier une signature](#fr_verify)
|
||||
* [Étendre la partition](#fr_extend)
|
||||
|
||||
|
||||
<a id="fr_desc"></a>
|
||||
### Description :
|
||||
Outils servant à générer une image Mageia pour systèmes à base de processeurs arm
|
||||
|
||||
Démarrage rapide:
|
||||
<a id="fr_quick"/>
|
||||
### Démarrage rapide :
|
||||
|
||||
Choisissez le dossier de configuration adapté à votre besoin (rpi ou xu4), sinon créez un nouveau dossier de configuration, copiez le fichier "mageia4arm.cfg.template"" à l'interieur et modifiez le selon vos besoins.
|
||||
Par défaut l'utilisateur est "pi"" avec le mot de passe "raspberry", et l'administrateur "root" avec le mot de passe "piroot"
|
||||
Avoir une copie de ce dépot :
|
||||
```
|
||||
git clone https://git.labolyon.fr/DTux/mageia4arm
|
||||
```
|
||||
Choisissez le dossier de configuration adapté à votre besoin (rpi ou xu4), sinon créez un nouveau dossier de configuration, copiez le fichier "mageia4arm.cfg.template" à l'interieur et modifiez le selon vos besoins.
|
||||
Par défaut l'utilisateur est "pi" avec le mot de passe "raspberry", et l'administrateur "root" avec le mot de passe "piroot".
|
||||
|
||||
Créer l'image:
|
||||
create_arm_img_urpmi.sh --all --config <dossier de configuration>
|
||||
<a id="fr_creatimg"/>
|
||||
### Créer l'image :
|
||||
create_arm_image.sh --all --config \<dossier de configuration\>
|
||||
Par exemple :
|
||||
```
|
||||
su -
|
||||
<mot de passe root>
|
||||
cd /home/user/workspace/mageia4arm/
|
||||
./create_arm_image.sh --all --target bananaPro --size 4 --tainted --nonfree --build-path ./build --config bananaPro 2>&1 | tee -a ./build.log
|
||||
```
|
||||
Avec cette commande, toutes les étapes (--all) du processus de création pour (--target) la bananaPro sont exécuter. L'image final tiendra sur une carte de (--size) 4Go. Les dépots tainted et nonfree seront activé. Le chemin de construction (--build-path) sera ./build. Finalement, la configuration (--config) sera bananaPro. La suite de la commande, 2>&1 redirige la sortie d'erreur dans la sortie standart et le tout est dupliqué (| tee -a) dans le fichier build.log pour le déboguage.
|
||||
|
||||
Aide:
|
||||
create_arm_img_urpmi.sh -h|--help
|
||||
<a id="fr_help"/>
|
||||
### Aide :
|
||||
create_arm_image.sh -h|--help
|
||||
|
||||
Vous pouvez adapter le script "second_stage_install.sh"" afin de compléter l'installation.
|
||||
Des scripts sont disponibles dans le dossier "tools", ils sont copié dans usr/local/bin/ dans l'image.
|
||||
Vous pouvez adapter le script "second_stage_install.sh" afin de compléter l'installation.
|
||||
Des scripts sont disponibles dans le dossier "tools", ils sont copié dans /usr/local/bin/ dans l'image.
|
||||
|
||||
Premier lancement de l'image sur le raspberry pi:
|
||||
. lancer drakkeyboard afin de configurer le clavier
|
||||
. si vous avez besoin d'un gestionnaire graphique, lancer le script:
|
||||
install_graphical.sh \<gestionnaire-graphique\>( xfce, lxqt, plasma, ...) voir les métapaquetages disponibles dans "Environnement graphique" dans le gestionnaire de logiciels.
|
||||
<a id="fr_1stStart"/>
|
||||
### Premier lancement de l'image sur le raspberry pi :
|
||||
- lancer drakkeyboard afin de configurer le clavier
|
||||
- si vous avez besoin d'un gestionnaire graphique, lancer le script :<br/>install_graphical.sh \<gestionnaire-graphique\>( xfce, lxqt, plasma, ...) voir les métapaquetages disponibles dans "Environnement graphique" dans le gestionnaire de logiciels.
|
||||
|
||||
|
||||
<a id="fr_newPlat"/>
|
||||
### Ajouter une nouvelle plateforme :
|
||||
Pour ajouter une nouvelle plateforme, il faut le dossier au nom du matériel dans le dossier platforms contenant le fichier mageia4arm.cfg comprennant les informations relatif à la distribution Mageia, le fichier second_stage_install.sh qui vient installer le système, le fichier specialFunctions.sh qui implémentes les fonctions pour affiner l'installation à la plateforme et extlinux.conf.
|
||||
|
||||
This repository contains script to make image for arm based systems from Mageia repositories.
|
||||
<a id="fr_file-conf"/>
|
||||
#### mageia4arm.cfg
|
||||
Un modèle est présent à la source de ce projet. Il contient les variables nécessaire à l'installation de Mageia, comme la version, l'architecture, le mirroir, les mots de passes etc.
|
||||
|
||||
Quick start:
|
||||
<a id="fr_file-second"/>
|
||||
#### second_stage_install.sh
|
||||
Ce script est lancé avec chroot, ainsi nous pouvons exécuter des opérations personnalisées comme l'installation de paquets non présents des dépots de Mageia. Ce script vient aussi définir les groupes de fichiers.
|
||||
|
||||
Choose the config dir you need (rpi or xu4), else create a new config directory with "mageia4arm.cfg.template"" in and modify it as you need.
|
||||
By default username is "pi"" with password "raspberry" and root password is "piroot".
|
||||
<a id="fr_file-spe"/>
|
||||
#### specialFunctions.sh
|
||||
Ce script complémente le processus d'installation pour des éléments spécifiques à la plateformes, comme le partitionnement, la manière de mettre en place le chargeur de démarrage, le téléchargements de fichiers externe, etc.
|
||||
Le script doit implémenter ces quatres fonctions :
|
||||
```
|
||||
function preImgCreation() {
|
||||
#Possibilité de télécharger des éléments supplémentaires ici.
|
||||
return 0
|
||||
}
|
||||
function postPrepareChroot() {
|
||||
#Possibilité de copier des fichiers spécifique à la plateforme avant de lancer le script second_stage_install.sh.
|
||||
return 0
|
||||
}
|
||||
function burningBootloader() {
|
||||
#Plusieurs méthodes sont possibles pour flasher le chargeur de démarrage, et dépendent de la plateforme.
|
||||
return 0
|
||||
}
|
||||
function copyingCustomSystem() {
|
||||
#Possibilité de copier des fichiers dans le système monté.
|
||||
return 0
|
||||
}
|
||||
```
|
||||
Si l'une de ces fonctions ne retourne pas 0, la création de l'image échoue.
|
||||
|
||||
create_arm_img_urpmi.sh --all --config <your config dir>
|
||||
<a id="fr_file-extlinux"/>
|
||||
#### extlinux.conf
|
||||
Extlinux.conf est un script utilisé par le chargeur de démarrage (s'il est capable de le gérer, uboot le peut), pour spécifier la version du noyau à démarrer. Le script est normalement généré automatiquement par les outils de Mageia à chaque installation/mise à jour d'un noyau. Malheureusement, lors de la création d'une image de Mageia en chroot, l'outil refuse de générer ce fichier, de plus si le fichier est manquant, lors de la mise à jour du noyau, l'outil de Mageia génère un fichier erroné avec des entrées vides que u-boot refuse.
|
||||
Il vaut mieux créer ce fichier, même s'il n'est pas primordiale. D'autant plus que lors de la mise à jour d'un noyau, l'outil de Mageia reprends les arguments de la commande de démarrage pour les nouvelles versions.
|
||||
|
||||
Help:
|
||||
create_arm_img_urpmi.sh -h|--help
|
||||
La structure basique du fichier est :
|
||||
```
|
||||
default linux
|
||||
timeout 20
|
||||
menu title Welcome to Mageia-Minimal.
|
||||
|
||||
you can adapt the script "second_stage_install.sh"" to complete the installation.
|
||||
Some scripts are available in directory "tools". they are copied in /usr/local/bin/ in the image.
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
```
|
||||
Les balises :
|
||||
- \<FDTDIR\> est automatiquement généré par le script ./mageia4arm/create_arm_image.sh
|
||||
- \<UUID\> est récupéré par le script ./mageia4arm/create_arm_image.sh , il peut être nécessaire d'ajouter une initrd pour utiliser l'UUID, autrement il faut spécifier /dev/mmcblkXpY .
|
||||
- \<BOOT_ARGS\> est défini dans le fichier ./mageia4arm/platforms/\<LaPlateforme\>/mageia4arm.cfg .
|
||||
|
||||
First launch of the image on raspberry pi:
|
||||
. launch drakkeyboard for configure keyboard layout.
|
||||
. if you need a graphical environment, launch the script :
|
||||
install_graphical.sh \<graphical environment\> ( xfce, lxqt, plasma, ...), see "Graphical environment" in the Mageia application manager' meta packages.
|
||||
|
||||
Il est possible d'ajouter la ligne `initrd /boot/initrd.img` si un fichier initrd a été généré par dracut.
|
||||
|
||||
|
||||
<a id="fr_file-others"/>
|
||||
#### Autres
|
||||
Bien sûr, d'autres fichiers sont nécessaires. Il faut avoir l'arborescence du matériel (soit DTB/DTS, soit script.bin), le chargeur de démarrage spécifique à la plateforme ainsi qu'un noyau compatible avec l'architecture de la plateforme.
|
||||
|
||||
<a id="fr_extras"/>
|
||||
### Extras :
|
||||
Diverses informations complémentaires.
|
||||
|
||||
<a id="fr_burn"/>
|
||||
#### Graver une image
|
||||
Il est possible de graver l'image avec dd, souvent les cartes SD sont disponibles sous le nom mmcblkX avec X leurs numéros.
|
||||
```
|
||||
dd if=./build/Mageia-7-bananaPro1.img of=/dev/mmcblkX
|
||||
```
|
||||
On peut ajouter une barre de progression :
|
||||
```
|
||||
pv ./build/Mageia-7-bananaPro1.img | dd of=/dev/mmcblkX
|
||||
```
|
||||
|
||||
<a id="fr_compress"/>
|
||||
#### Compresser une image
|
||||
Pour compresser l'image, de plusieurs Go en quelques centaines de Mo pour la mettre en ligne par exemple, il est possible d'exécuter la commande suivante :
|
||||
```
|
||||
dd if=./build/Mageia-7-bananaPro1.img | gzip -9 | dd of=./build/Mageia-7-bananaPro1.img.gz
|
||||
```
|
||||
Avec une barre d'avancement :
|
||||
```
|
||||
pv ./build/Mageia-7-bananaPro1.img | gzip -9 | dd of=./build/Mageia-7-bananaPro1.img.gz
|
||||
```
|
||||
Il est possible d'utiliser d'autre logiciel de compression comme xz par exemple.
|
||||
|
||||
<a id="fr_gen_chksum"/>
|
||||
#### Calculer les sommes de contrôles
|
||||
Pour s'assurer qu'un fichier a été bien téléchargé, pour vérifier son intégrité, il est d'usage de comparer la somme de contrôle. On peut la calculer avec l'algorithme MD5, SHA1, SHA256, SHA512. Par exemple :
|
||||
```
|
||||
cd /home/user/workspace/mageia4arm/build
|
||||
md5sum Mageia-7-bananaPro1.img > Mageia-7-bananaPro1.img.md5
|
||||
```
|
||||
Il est possible de remplacer la commande md5sum par sha1sum ou sha256sum ou encore sha512sum.
|
||||
|
||||
<a id="fr_sign"/>
|
||||
#### Signer les sommes de contrôles
|
||||
Pour assurer les utilisateurs que le fichier téléchargé vient bien de vous et non d'un tiers malveillant, il est possible de signer la somme de contrôle avec votre clef.
|
||||
```
|
||||
cd /home/user/workspace/mageia4arm/build
|
||||
gpg --sign Mageia-7-bananaPro1.img.md5
|
||||
```
|
||||
La commande génère automatiquement le fichier de signature reprenant le nom du fichier à l'identique et ajoutant l'extension .gpg.
|
||||
|
||||
<a id="fr_verify"/>
|
||||
#### Vérifier les sommes de contrôles
|
||||
Pour vérifier une somme de contrôle, il faut joindre le créateur de l'image, lui faire confiance, ajouter sa clef à son trousseau de clef. Ensuite, il est possible d'exécuter la commande suivante :
|
||||
```
|
||||
cd /home/user/Téléchargements/
|
||||
gpg --verify Mageia-7-bananaPro1.img.md5
|
||||
```
|
||||
|
||||
<a id="fr_extend"/>
|
||||
#### Étendre la partition
|
||||
L'image créé peut contenir une partition root très réduite. Ceci permet d'économiser de la place pour la construction, le stockage de l'image et sûrtout un temps réduit pour graver l'image sur une carte sd.
|
||||
Il est possible d'étendre cette partition pour profiter pleinement de l'entièreté de la carte SD. Le plus simple est avec l'utilitaire growpart dans le paquet cloud-utils-growpart.
|
||||
Les valeurs X et Y sont à remplacer par le périphérique et la dernière partition du périphérique à étendre.
|
||||
```
|
||||
#Vérifier la partition, il peut être demandé pour l'étape suivante.
|
||||
e2fsck -f /dev/mmcblkXpY
|
||||
|
||||
#Défini la nouvelle taille. (Change de langue avec LC_ALL car growpart ne supporte pas 'octet'.
|
||||
LC_ALL=C growpart /dev/mmcblkX partitionNumber
|
||||
|
||||
#Change la taille
|
||||
resize2fs /dev/mmcblkXpY
|
||||
|
||||
#Synchronise, vide le cache USB et assure que les données sont sur la clef.
|
||||
sync
|
||||
```
|
||||
|
||||
|
||||
<a id="english"/>
|
||||
English
|
||||
-------
|
||||
|
||||
* [Description](#en_desc)
|
||||
* [Quickly](#en_quick)
|
||||
* [Create an image](#en_creatimg)
|
||||
* [Help](#en_help)
|
||||
* [First boot](#en_1stStart)
|
||||
* [New Platform](#en_newPlat)
|
||||
* [Configuration File](#en_file-conf)
|
||||
* [chroot Filechroot](#en_file-second)
|
||||
* [Custom function File](#en_file-spe)
|
||||
* [extlinux File](#en_file-extlinux)
|
||||
* [Other Files](#en_file-others)
|
||||
* [Extras](#en_extras)
|
||||
* [Burn the image](#en_burn)
|
||||
* [Compress the Image](#en_compress)
|
||||
* [Generate the Checksum](#en_gen_chksum)
|
||||
* [Sign the Checksum](#en_sign)
|
||||
* [Verify the Signature](#en_verify)
|
||||
* [extending the partition](#en_extend)
|
||||
|
||||
<a id="en_desc"/>
|
||||
### Description:
|
||||
This repository contains script to make image for arm based systems from Mageia repositories.
|
||||
|
||||
<a id="en_quick"/>
|
||||
<a id="en_creatimg"/>
|
||||
### Quick start:
|
||||
|
||||
Choose the config dir you need (rpi or xu4), else create a new config directory with "mageia4arm.cfg.template" in and modify it as you need.
|
||||
By default username is "pi" with password "raspberry" and root password is "piroot".
|
||||
|
||||
create_arm_image.sh --all --config <your config dir\>
|
||||
Example given :
|
||||
```
|
||||
su -
|
||||
<root password>
|
||||
cd /home/user/workspace/mageia4arm/
|
||||
./create_arm_image.sh --all --target bananaPro --size 4 --tainted --nonfree --build-path ./build --config bananaPro 2>&1 | tee -a ./build.log
|
||||
```
|
||||
With such command, all steps of the build process for the bananaPro will be executed. The final image will fit into a 4 GB SD card. The nonfree and tainted repositories will be activated. The build path will be the directory ./build. Finaly, the configuration is for bananaPro. The rest of the command, 2>&1 redirect the stderr stream into the stdout and it will be duplicated inside the build.log file for debug purpose.
|
||||
|
||||
<a id="en_help"/>
|
||||
### Help:
|
||||
create_arm_image.sh -h|--help
|
||||
|
||||
you can adapt the script "second_stage_install.sh" to complete the installation.
|
||||
Some scripts are available in directory "tools". they are copied in /usr/local/bin/ in the image.
|
||||
|
||||
<a id="en_1stStart"/>
|
||||
### First launch of the image on raspberry pi:
|
||||
- launch drakkeyboard to configure keyboard layout.
|
||||
- if you need a graphical environment, launch the script :<br/>install_graphical.sh \<graphical environment\> ( xfce, lxqt, plasma, ...), see "Graphical environment" in the Mageia application manager meta packages.
|
||||
|
||||
|
||||
<a id="en_newPlat"/>
|
||||
### Adding a new platform:
|
||||
To add a new platform, a new folder needs to be created in the platforms directory with the name of the platform containing the mageia4arm.cfg configuration file about the Mageia distribution itself, the second_stage_install.sh script which install the system, the specialFunctions.sh script which implements functions in order to fit the platform and the extlinux.conf file.
|
||||
|
||||
<a id="en_file-conf"/>
|
||||
#### mageia4arm.cfg
|
||||
A template file is located in the root of the project. It contains all necessary variables for the installation of Mageia, as the version, architecture, mirroir, password etc.
|
||||
|
||||
<a id="en_file-second"/>
|
||||
#### second_stage_install.sh
|
||||
This script is launched with chroot, then we can execute custom operation as installing packages that are not from Mageia.org. This script also defines some files groups.
|
||||
|
||||
<a id="en_file-spe"/>
|
||||
#### specialFunctions.sh
|
||||
This script add into the installation process some elements specific to the platform, as the partitionning, the fashon to set the bootloader, downloading external files, etc.
|
||||
It must implement the four next functons :
|
||||
```
|
||||
function preImgCreation() {
|
||||
#Here it is possible to download external file.
|
||||
return 0
|
||||
}
|
||||
function postPrepareChroot() {
|
||||
#Possibility to copy/paste platform related files before to launch the second_stage_install.sh script.
|
||||
return 0
|
||||
}
|
||||
function burningBootloader() {
|
||||
#There are several methods to flash the bootloader and depend on the platform.
|
||||
return 0
|
||||
}
|
||||
function copyingCustomSystem() {
|
||||
#It is possible to copy files into the mounted system.=
|
||||
return 0
|
||||
}
|
||||
```
|
||||
If one of this functions does not return 0, the process is stoped.
|
||||
|
||||
<a id="en_file-extlinux"/>
|
||||
#### extlinux.conf
|
||||
extlinux.conf is a script used by the bootloader (if it is able to manage it, uboot does) in order to select specific kernel version to start with boot arguments. This script is normaly automatically generated by Mageia's tools at each kernel installation/update. Unfortunately, when creating the image of Mageia in chroot, the tool refuses to generate the file, moreover, if the file is missing, at the first kernel update, the tool will create it with empty entries which makes uboot failing to parse it.
|
||||
It is better to generate this file, even if it isn't mandatory. It is even better as the tool take into account the boot arguments of previous kernel and add it for the new one and regenerate automatically the file.
|
||||
|
||||
The basic file is:
|
||||
```
|
||||
default linux
|
||||
timeout 20
|
||||
menu title Welcome to Mageia-Minimal.
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
```
|
||||
The tags :
|
||||
- \<FDTDIR\> is automatically generated by the script ./mageia4arm/create_arm_image.sh
|
||||
- \<UUID\> is automatically reused bu the script ./mageia4arm/create_arm_image.sh , it might be necessary to add an initrd in order to user the UUID, otherwise it should be specify /dev/mmcblkXpY .
|
||||
- \<BOOT_ARGS\> is defined in the configuration file ./mageia4arm/platforms/\<ThePlatform\>/mageia4arm.cfg
|
||||
|
||||
|
||||
It is also possible to add the line `initrd /boot/initrd.img` if a initrd file has been generated by dracut.
|
||||
|
||||
<a id="en_file-others"/>
|
||||
#### others
|
||||
Of course, other files are necessary. The device tree (DTB/DTS or script.bin) is necessary, a specific bootloader for the platform and a compatible kernel with that architecture.
|
||||
|
||||
|
||||
<a id="en_extras"/>
|
||||
<a id="en_burn"/>
|
||||
<a id="en_compress"/>
|
||||
<a id="en_gen_chksum"/>
|
||||
<a id="en_sign"/>
|
||||
<a id="en_verify"/>
|
||||
<a id="en_extend"/>
|
||||
### extras:
|
||||
Not translated.
|
||||
|
@ -1 +0,0 @@
|
||||
pi.rapsberry
|
1055
create_arm_image.sh
Executable file
1055
create_arm_image.sh
Executable file
File diff suppressed because it is too large
Load Diff
@ -1,871 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
function title()
|
||||
{
|
||||
echo -e "\e[1;32m$1\e[0m"
|
||||
}
|
||||
|
||||
function info()
|
||||
{
|
||||
echo -e "\e[36m$1\e[0m"
|
||||
}
|
||||
|
||||
function warning()
|
||||
{
|
||||
echo -e "\e[1;35m$1\e[0m"
|
||||
}
|
||||
|
||||
function error()
|
||||
{
|
||||
echo -e "\e[1;31m$1\e[0m"
|
||||
}
|
||||
|
||||
SOURCE_PATH="$(/bin/dirname "$(readlink -f "$0")")"
|
||||
INSTALL_PATH="$SOURCE_PATH/arm"
|
||||
FILES_PATH="$SOURCE_PATH/files"
|
||||
CMDNAME=$(/bin/basename -z "$0")
|
||||
|
||||
#while read -r;do
|
||||
# for MAGEIA_VERSION in $REPLY
|
||||
# do
|
||||
# if [ $MAGEIA_VERSION <= 5 ];then
|
||||
# echo 'Mageia version >= 6 is needed'
|
||||
# exit
|
||||
# fi
|
||||
# break
|
||||
# done
|
||||
#done < /etc/version
|
||||
|
||||
|
||||
|
||||
function help()
|
||||
{
|
||||
echo "$CMDNAME [option] [size of image in Go]"
|
||||
echo "Options:"
|
||||
echo "--all create ready to burn image of Mageia $MAGEIA_VERSION"
|
||||
echo "--clean Clean all (suppress all) to make a new image"
|
||||
echo "--size size of image default: 7Go"
|
||||
echo "--create-chroot Create the chroot directory"
|
||||
echo "--addmedia add mirrors"
|
||||
echo "--update-mirror update urpmi database"
|
||||
echo "--install-basesystem install base system"
|
||||
echo "--chroot chroot to arm directory and launch packages installation"
|
||||
echo "--create-image Create the image of Mageia $MAGEIA_VERSION"
|
||||
echo "--build-path Path to the build directory of the image of Mageia $MAGEIA_VERSION"
|
||||
echo "--target target system (for now rpi, odroid)"
|
||||
echo "--target-version version of the taget (0, 1, 2, 3 for rpi, 3 or 4 for odroid)"
|
||||
echo "--config Path to config files"
|
||||
echo "--bootfs filesystem of boot partition (ext4 or vfat) default: etx4"
|
||||
echo -e "\nFor image size, make sure it fit on physical support. (Default size is 7 Go)"
|
||||
}
|
||||
|
||||
|
||||
# cleaning build space
|
||||
function clean()
|
||||
{
|
||||
# Unmounting /dev /proc /sys in chroot
|
||||
title "Cleaning"
|
||||
if ! [ -z "$(mountpoint -qd "$BUILD_PATH/dev")" ];then
|
||||
info "Unmounting $BUILD_PATH/dev"
|
||||
umount "$BUILD_PATH/dev"
|
||||
if ! [ $? -ne 0 ];then
|
||||
error "line $LINENO can't unmount $BUILD_PATH/dev : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if ! [ -z "$(mountpoint -qd "$BUILD_PATH/sys")" ];then
|
||||
info "Unmounting $BUILD_PATH/sys"
|
||||
umount "$BUILD_PATH/sys"
|
||||
if ! [ $? -ne 0 ];then
|
||||
error "line $LINENO can't unmount $BUILD_PATH/sys : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if ! [ -z "$(mountpoint -qd "$BUILD_PATH/proc")" ];then
|
||||
info "Unmounting $BUILD_PATH/proc"
|
||||
umount "$BUILD_PATH/proc"
|
||||
if ! [ $? -ne 0 ];then
|
||||
error "line $LINENO can't unmount $BUILD_PATH/proc : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Removing old Build directory
|
||||
if [ -d "$BUILD_PATH" ];then
|
||||
info "Removing $BUILD_PATH"
|
||||
/bin/rm -Rf "$BUILD_PATH"
|
||||
else
|
||||
warning "$BUILD_PATH does not exists"
|
||||
fi
|
||||
# removing old image
|
||||
if [ -e "$IMAGE" ];then
|
||||
info "Removing $IMAGE"
|
||||
/bin/rm -f "$INSTALL_PATH/$IMAGE"
|
||||
else
|
||||
warning "$IMAGE does not exists"
|
||||
fi
|
||||
# removing loop devices
|
||||
for LOOP in $(ls /dev/loop*[0-9]p1)
|
||||
do
|
||||
X=${LOOP:0:10}
|
||||
if [ -e "$X" ];then
|
||||
info "removing $X"
|
||||
partx -d "$X"
|
||||
fi
|
||||
done
|
||||
# Removing boot and root directory
|
||||
if [ -d "$BOOT" ];then
|
||||
info "Removing $BOOT"
|
||||
/bin/rmdir "$BOOT"
|
||||
else
|
||||
warning "$BOOT does not exists"
|
||||
fi
|
||||
if [ -d "$ROOT" ];then
|
||||
info "Removing $ROOT"
|
||||
/bin/rmdir "$ROOT"
|
||||
else
|
||||
warning "$ROOT does not exists"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
# creation of install path and copy of qemu ( installing it if not yet installed )
|
||||
|
||||
function createchroot()
|
||||
{
|
||||
title "Making chroot"
|
||||
if ! [ -f /bin/qemu-arm-static ]; then
|
||||
title "Qemu package not present : installing qemu packages"
|
||||
/sbin/urpmi --auto --no-recommends qemu-user-static
|
||||
if ! [ $? -eq 0 ];then
|
||||
error "line $LINENO can't install qemu-user-static : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Starting qemu service if not started
|
||||
/bin/systemctl is-active systemd-binfmt.service
|
||||
if [ $? -ne 0 ]; then
|
||||
title "Starting systemd-binfmt.service"
|
||||
/bin/systemctl start systemd-binfmt.service
|
||||
if ! [ $? -ne 0 ];then
|
||||
error "line $LINENO can't start qemu-user-static : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create Build path
|
||||
if ! [ -d "$BUILD_PATH" ];then
|
||||
warning "Build path ( $BUILD_PATH ) does not exists, do you want i create it ? [Y|n] "
|
||||
read yn
|
||||
if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then
|
||||
title "Creating $BUILD_PATH"
|
||||
/bin/mkdir -p "$BUILD_PATH/usr/bin" "$BUILD_PATH/usr/lib/binfmt.d"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO can't create $BUILD_PATH : exiting"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
info "Build path exists"
|
||||
fi
|
||||
#Copying qemu
|
||||
/bin/cp /bin/qemu-arm-static "$BUILD_PATH/usr/bin/"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO can't copy /bin/qemu-user-static to $BUILD_PATH/usr/bin/ : exiting"
|
||||
exit 1
|
||||
fi
|
||||
/bin/cp /usr/lib/binfmt.d/qemu-arm-static.conf "$BUILD_PATH/usr/lib/binfmt.d"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO can't copy /usr/lib/binfmt.d/qemu-arm-static.conf to $BUILD_PATH/usr/lib/binfmt.d : exiting"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# adding Mageia repositories
|
||||
function addmedia()
|
||||
{
|
||||
title "Creating media $MIRROR"
|
||||
/sbin/urpmi.addmedia --urpmi-root "$BUILD_PATH" --distrib "$MIRROR"
|
||||
err=$?
|
||||
if [ $err -ne 0 ];then
|
||||
error "line $LINENO error $err - can't add medias from $MIRROR : exiting"
|
||||
exit 1
|
||||
fi
|
||||
title "activating non-free and tainted"
|
||||
/sbin/urpmi.update --urpmi-root "$BUILD_PATH" --no-ignore Nonfree\ Release Nonfree\ Updates Tainted\ Release Tainted\ Updates
|
||||
err=$?
|
||||
if [ $err -ne 0 ];then
|
||||
error "line $LINENO error $err - can't activate medias : exiting"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function updatemirror()
|
||||
{
|
||||
title "updating mirror"
|
||||
/sbin/urpmi.update -a --urpmi-root "$BUILD_PATH"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO can't update mirrors : exiting"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function installbasesystem()
|
||||
{
|
||||
title "installing basesystem"
|
||||
/sbin/urpmi --urpmi-root "$BUILD_PATH" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 shadow-utils basesystem-minimal
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error installing shadow-utils or basesystem-minimal : exiting"
|
||||
exit 1
|
||||
fi
|
||||
#/sbin/urpmi --urpmi-root "$BUILD_PATH" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 basesystem-minimal
|
||||
#if [ $? -ne 0 ];then
|
||||
# error "line $LINENO error installing basesystem-minimal : exiting"
|
||||
# exit 1
|
||||
#fi
|
||||
/sbin/urpmi --urpmi-root "$BUILD_PATH" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200 urpmi locales-fr systemd u-boot
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error installing urpmi or locales.fr : exiting"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function preparechroot()
|
||||
{
|
||||
title "Preparing chrooting in $BUILD_PATH"
|
||||
info "making /etc/hostname"
|
||||
echo "$HOSTNAME" > "$BUILD_PATH/etc/hostname"
|
||||
|
||||
info "copying second stage script in $BUILD_PATH"
|
||||
echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh $BUILD_PATH/"
|
||||
cp "$SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh" "$BUILD_PATH/second_stage_install.sh"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error copying $SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh : exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
info "creation of user account"
|
||||
echo "/bin/passwd << EOF
|
||||
$ROOT_PWD
|
||||
$ROOT_PWD
|
||||
EOF
|
||||
/sbin/useradd $ID_USER
|
||||
/bin/passwd $ID_USER << EOF
|
||||
$PASSWORD
|
||||
$PASSWORD
|
||||
EOF" >>"$BUILD_PATH/second_stage_install.sh"
|
||||
|
||||
|
||||
|
||||
info "Copying skel in root directory"
|
||||
/bin/rsync -a /etc/skel/ "$BUILD_PATH/root/"
|
||||
|
||||
|
||||
case $TARGET in
|
||||
ODROID)
|
||||
#TEMPORARY CODE
|
||||
#copying kernel odroid not existing in mageia repos
|
||||
info "copying kernel-odroid rpm in $BUILD_PATH/root"
|
||||
echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm $BUILD_PATH/root/"
|
||||
/usr/bin/cp "$SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm" "$BUILD_PATH/root/"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error copying $SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm : exiting"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
rpi)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function jumpchroot()
|
||||
{
|
||||
title "chrooting to $BUILD_PATH"
|
||||
info "mounting dev, sys, proc directories in chroot"
|
||||
/bin/mount -B /dev "$BUILD_PATH/dev"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error mounting $BUILD_PATH/dev : exiting"
|
||||
exit 1
|
||||
fi
|
||||
/bin/mount -B /sys "$BUILD_PATH/sys"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error mounting $BUILD_PATH/sys : exiting"
|
||||
exit 1
|
||||
fi
|
||||
/bin/mount -B /proc "$BUILD_PATH/proc"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error mounting $BUILD_PATH/proc : exiting"
|
||||
exit 1
|
||||
fi
|
||||
info "Copying resolv.conf"
|
||||
/bin/cp -a /etc/resolv.conf "$BUILD_PATH/etc/"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error copying $BUILD_PATH/etc/resolv.conf : exiting"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$OPT" = "chroot" ];then
|
||||
/sbin/chroot "$BUILD_PATH"
|
||||
else
|
||||
/sbin/chroot --userspec root:root "$BUILD_PATH" /bin/bash -v -c 'sh /second_stage_install.sh'
|
||||
fi
|
||||
RET=$?
|
||||
if [ $RET -ne 0 ];then
|
||||
error "line $LINENO Warning : chrooting to $BUILD_PATH retrurn an error $RET"
|
||||
ERRORN=$((ERRORN++))
|
||||
fi
|
||||
info "unmounting dev, sys, proc"
|
||||
/bin/umount -lf "$BUILD_PATH/dev"
|
||||
if [ $? -ne 0 ];then
|
||||
warning "line $LINENO Warning : error unmounting $BUILD_PATH/dev, continuing anyway"
|
||||
ERRORN=$((ERRORN++))
|
||||
fi
|
||||
/bin/umount -lf "$BUILD_PATH/sys"
|
||||
if [ $? -ne 0 ];then
|
||||
warning "line $LINENO Warning : error unmounting $BUILD_PATH/sys, continuing anyway"
|
||||
ERRORN=$((ERRORN++))
|
||||
fi
|
||||
/bin/umount -lf "$BUILD_PATH/proc"
|
||||
if [ $? -ne 0 ];then
|
||||
warning "line $LINENO Warning : error unmounting $BUILD_PATH/proc, continuing anyway"
|
||||
ERRORN=$((ERRORN++))
|
||||
fi
|
||||
}
|
||||
|
||||
function verify_disk_space()
|
||||
{
|
||||
title "Verifying if there is enough space on disk to make the image"
|
||||
DISK_SPACE=$(/usr/bin/df -BG --output=avail "$INSTALL_PATH" | sed '1d;s/[^0-9]//g')
|
||||
info "Free disk space: ${DISK_SPACE}G"
|
||||
if [ $DISK_SPACE -lt $IMAGE_SIZE ];then
|
||||
warning "image size is greater than disk space"
|
||||
info "correct the problem and relaunch the script with parameter --create-rpi-image"
|
||||
info "$0 --size $IMAGE_SIZE --create-rpi-image"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
function createxu3image()
|
||||
{
|
||||
title "Creating Odroid XU3-XU4 image"
|
||||
createimage
|
||||
if [ -z "$BOOTFS" ];then
|
||||
BOOTFS="ext4"
|
||||
fi
|
||||
formatpartitions "$BOOTFS" ext4
|
||||
copyingsystem
|
||||
}
|
||||
|
||||
|
||||
function createrpiimage()
|
||||
{
|
||||
title "Creating Pi image"
|
||||
|
||||
if ! [ -d "$FIRMWARE_PATH/$FIRMWARE_DIR" ];then # the firmware directory does not exists
|
||||
echo "$(ls *.zip| wc -l)"
|
||||
if [ "$(ls *.zip| wc -l)" -eq 0 ];then # the firmware archive does not exists
|
||||
warning "The raspberry pi firmware need to be downloaded"
|
||||
info "Downloading FIRMWARE_FILENAME"
|
||||
wget $FIRMWARE_DOWNLOAD_URL
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error downloading raspberry firmware at $FIRMWARE_DOWNLOAD_URL :exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
info "extracting firmware"
|
||||
unzip -d "$FIRMWARE_PATH" *.zip
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error unzipping $FIRMWARE_PATH : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
title "Making raspberry pi image"
|
||||
|
||||
createimage
|
||||
if [ -z $BOOTFS ];then
|
||||
BOOTFS="vfat"
|
||||
fi
|
||||
formatpartitions $BOOTFS ext4
|
||||
copyingsystem
|
||||
|
||||
}
|
||||
|
||||
createimage()
|
||||
{
|
||||
title " in $IMAGE"
|
||||
if [ -f "$INSTALL_PATH/$IMAGE" ];then
|
||||
warning "Deleting previous image"
|
||||
/bin/rm -f "$INSTALL_PATH/$IMAGE"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error can't remove previous image at $INSTALL_PATH/$IMAGE : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
warning "please wait until end of image creation"
|
||||
/bin/dd if=/dev/zero of="$INSTALL_PATH/$IMAGE" bs=1MB count=$(( $IMAGE_SIZE * 1024 ))
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO can't make image at $INSTALL_PATH/$IMAGE : exiting"
|
||||
exit 1
|
||||
fi
|
||||
info "making partitions"
|
||||
DEVICE=$(/sbin/losetup -f --show "$INSTALL_PATH/$IMAGE")
|
||||
/sbin/fdisk "$DEVICE" << EOF
|
||||
n
|
||||
p
|
||||
1
|
||||
|
||||
+128M
|
||||
t
|
||||
c
|
||||
n
|
||||
p
|
||||
2
|
||||
|
||||
|
||||
a
|
||||
1
|
||||
a
|
||||
2
|
||||
w
|
||||
EOF
|
||||
|
||||
# Activate loop device
|
||||
/sbin/losetup -d "$DEVICE"
|
||||
DEVICE=$(/sbin/partx -va "$INSTALL_PATH/$IMAGE" | /bin/grep -m 1 -E -o '/dev/loop.?')
|
||||
info "device $DEVICE"
|
||||
info "partitions list:"
|
||||
info "$(/sbin/partx -v "$INSTALL_PATH/$IMAGE")"
|
||||
BOOTP="${DEVICE}p1"
|
||||
ROOTP="${DEVICE}p2"
|
||||
}
|
||||
|
||||
formatpartitions()
|
||||
{
|
||||
info "Formatting partitions"
|
||||
info "Boot : $BOOTP as $1"
|
||||
"/sbin/mkfs.$1" "$BOOTP"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error formating $BOOTP : exiting"
|
||||
/sbin/losetup -d "$DEVICE"
|
||||
exit 1
|
||||
fi
|
||||
info "Root : $ROOTP as $2"
|
||||
"/sbin/mkfs.$2" "$ROOTP"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error formating $ROOTP : exiting"
|
||||
/sbin/losetup -d "$DEVICE"
|
||||
exit 1
|
||||
fi
|
||||
BOOT_UUID=$(blkid -s UUID -o value UUID "$BOOTP")
|
||||
info "Boot UUID: $BOOT_UUID"
|
||||
ROOT_UUID=$(blkid -s UUID -o value UUID "$ROOTP")
|
||||
info "Root UUID: $ROOT_UUID"
|
||||
}
|
||||
|
||||
copyingsystem()
|
||||
{
|
||||
info "mounting partitions, making mountpoint if necessary"
|
||||
if ! [ -d "$BOOT" ];then
|
||||
/bin/mkdir "$BOOT"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error making directory $BOOT : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if ! [ -d "$ROOT" ];then
|
||||
/bin/mkdir "$ROOT"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error making directory $ROOT : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
/bin/mount "$BOOTP" "$BOOT"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error mounting $BOOTP : exiting"
|
||||
exit 1
|
||||
fi
|
||||
/bin/mount "$ROOTP" "$ROOT"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error mounting $ROOTP : exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
info "making /etc/fstab"
|
||||
echo "proc /proc proc defaults 0 0
|
||||
UUID=$BOOT_UUID /mnt/rpi_boot vfat defaults 0 0
|
||||
UUID=$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PATH"/etc/fstab
|
||||
|
||||
|
||||
case $TARGET in
|
||||
rpi)
|
||||
|
||||
info "copying 10-vchiq-permissions.rules"
|
||||
cp "$SOURCE_PATH/$CONFIG_PATH/10-vchiq-permissions.rules" "$BUILD_PATH/etc/udev/rules.d/"
|
||||
info "Making /etc/modules"
|
||||
echo "vchiq
|
||||
snd_bcm2835
|
||||
vc4
|
||||
brcmfmac" >> "$BUILD_PATH"/etc/modules
|
||||
|
||||
RPI_BOOT="$BUILD_PATH/mnt/rpi_boot"
|
||||
if ! [ -d "$RPI_BOOT" ];then
|
||||
mkdir -p "$RPI_BOOT"
|
||||
fi
|
||||
info "copying modprobe.conf"
|
||||
/bin/cp -a "$SOURCE_PATH/$CONFIG_PATH/modprobe.conf" "$BUILD_PATH/etc/"
|
||||
chown root:root "$BUILD_PATH/etc/modprobe.conf"
|
||||
|
||||
info "making /boot/extlinux/extlinux.conf"
|
||||
mkdir -p "$BUILD_PATH/boot/extlinux"
|
||||
sed -e s/\<UUID\>/$ROOT_UUID/g $SOURCE_PATH/$CONFIG_PATH/extlinux.conf >"$BUILD_PATH/boot/extlinux/extlinux.conf"
|
||||
KERNEL_ID=`basename $BUILD_PATH/usr/lib/linux-*`
|
||||
sed -i -e s/\<FDTDIR\>/$KERNEL_ID/g "$BUILD_PATH/boot/extlinux/extlinux.conf"
|
||||
info "copying firmware, overlays in rpi boot partition"
|
||||
# cp -a "$BUILD_PATH/usr/lib/linux-"* "$BOOT/dtb"
|
||||
cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/start"* "$RPI_BOOT/"
|
||||
cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/fixup"* "$RPI_BOOT/"
|
||||
cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/bootcode.bin"* "$RPI_BOOT/"
|
||||
cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/overlays" "$RPI_BOOT/"
|
||||
|
||||
info "copying u-boot binary to $RPI_BOOT"
|
||||
case $TARGET_VERSION in
|
||||
2)
|
||||
info "copying u-boot for $TARGET 2"
|
||||
cp "$BUILD_PATH/usr/lib/u-boot/rpi_2/u-boot.bin" "$RPI_BOOT/kernel7.img"
|
||||
;;
|
||||
0)
|
||||
info "copying u-boot for $TARGET 0"
|
||||
cp "$BUILD_PATH/usr/lib/u-boot/rpi_0_w/u-boot.bin" "$RPI_BOOT/kernel7.img"
|
||||
;;
|
||||
1)
|
||||
info "copying u-boot for $TARGET 1"
|
||||
cp "$BUILD_PATH/usr/lib/u-boot/rpi/u-boot.bin" "$RPI_BOOT/kernel7.img"
|
||||
;;
|
||||
3_32)
|
||||
info "copying u-boot for $TARGET 3 32 bits"
|
||||
cp "$BUILD_PATH/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "$RPI_BOOT/kernel7.img"
|
||||
;;
|
||||
3+)
|
||||
info "copying u-boot for $TARGET 3b+ 32 bits"
|
||||
cp "$BUILD_PATH/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "$RPI_BOOT/kernel7.img"
|
||||
;;
|
||||
esac
|
||||
|
||||
# info "copying raspberry optionals files in opt"
|
||||
# /bin/rsync -rlptDH "$FIRMWARE_PATH/$FIRMWARE_DIR/opt/" "$BUILD_PATH/opt/"
|
||||
|
||||
info "copying wifi firmware file missing in kernel-firmware-nonfree"
|
||||
if ! [ -d "$ROOT/usr/lib/firmware/brcm/" ];then
|
||||
/bin/mkdir -p "$ROOT/usr/lib/firmware/brcm/"
|
||||
fi
|
||||
if ! [ -f "$ROOT/usr/lib/firmware/brcm/brcmfmac434"* ];then
|
||||
/bin/cp "$SOURCE_PATH/$CONFIG_PATH/brcmfmac434"* "$ROOT/usr/lib/firmware/brcm/"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO error copying wifi firmware in $ROOTP/usr/lib/firmware/brcm/ : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
info "copying tools in /usr/local/bin/"
|
||||
/bin/cp -a "$SOURCE_PATH/tools/" "$BUILD_PATH/usr/local/bin/"
|
||||
# /bin/cp -a "$SOURCE_PATH/rpi/sed_extlinux.conf.sh" "$BUILD_PATH/usr/local/bin/"
|
||||
if ! [ $? -eq 0 ];then
|
||||
error "line $LINENO error copying tools"
|
||||
ERRORN=$((ERRORN++))
|
||||
fi
|
||||
# info "copying "
|
||||
;;
|
||||
ODROID)
|
||||
;;
|
||||
esac
|
||||
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -a --exclude "$RPI_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
|
||||
/bin/rsync -a "$RPI_BOOT/" "$BOOT/"
|
||||
# /bin/mkdir "$ROOT/boot"
|
||||
|
||||
copyingcommon
|
||||
# Syncing devices before unmounting
|
||||
/usr/bin/sync
|
||||
/usr/bin/umount "$BOOT" "$ROOT"
|
||||
if [ $? -eq 0 ];then
|
||||
/bin/rmdir "$BOOT" "$ROOT"
|
||||
else
|
||||
error "line $LINENO error unmounting $ROOT or $BOOT : exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/usr/sbin/partx -d "$DEVICE"
|
||||
if [ $? -ne 0 ];then
|
||||
error "line $LINENO warning : error unmounting $DEVICE "
|
||||
exit 1
|
||||
fi
|
||||
warning "You can now burn the image ( $IMAGE ) on SD card"
|
||||
}
|
||||
|
||||
# Copying files common to all systems
|
||||
copyingcommon()
|
||||
{
|
||||
title "Copying common files and configuration"
|
||||
rsync -aP "$SOURCE_PATH/common/" "$ROOT/"
|
||||
rsync -aP "$SOURCE_PATH/tools/*.sh" "$ROOT/usr/local/bin/"
|
||||
chown root:root "$ROOT/usr/local/bin/"
|
||||
}
|
||||
|
||||
if [ $# == 0 ];then
|
||||
help
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
# parsing commandline
|
||||
TEMP=$(getopt -o h,a --long all,help,clean,create-chroot,addmedia,create-image,,config:,target:,target-version:,chroot,bootfs:,install-basesystem,update-mirror,build-path:,size: -n $CMDNAME -- "$@")
|
||||
if [ $? -ne 0 ] ; then error "line $LINENO Failed parsing options." >&2 ; exit 1 ; fi
|
||||
eval set -- "$TEMP"
|
||||
|
||||
echo "$TEMP"
|
||||
# Note the quotes around `$TEMP': they are essential!
|
||||
while true;
|
||||
do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
-a|--all)
|
||||
OPT="all"
|
||||
shift 1
|
||||
;;
|
||||
--clean)
|
||||
OPT="clean"
|
||||
shift
|
||||
;;
|
||||
--size)
|
||||
IMAGE_SIZE=$2
|
||||
shift 2
|
||||
;;
|
||||
--build-path)
|
||||
INSTALL_PATH="$2"
|
||||
shift 2
|
||||
;;
|
||||
--chroot)
|
||||
if [ -z $OPT ];then
|
||||
OPT="chroot"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
--create-chroot)
|
||||
if [ -z $OPT ];then
|
||||
OPT="createchroot"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
--addmedia)
|
||||
if [ -z $OPT ];then
|
||||
OPT="addmedia"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
--update-mirror)
|
||||
if [ -z $OPT ];then
|
||||
OPT="updatemirror"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
--install-basesystem)
|
||||
if [ -z $OPT ];then
|
||||
OPT="installbasesystem"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
--create-image)
|
||||
if [ -z $OPT ];then
|
||||
CREATEIMAGE=true
|
||||
OPT="createimage"
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
--target)
|
||||
TARGET=$2
|
||||
shift 2
|
||||
;;
|
||||
--target-version)
|
||||
TARGET_VERSION=$2
|
||||
shift 2
|
||||
;;
|
||||
--config)
|
||||
CONFIG_PATH="$2"
|
||||
shift 2
|
||||
;;
|
||||
--bootfs)
|
||||
BOOTFS=$2
|
||||
shift 2
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break;;
|
||||
*)
|
||||
error "Parameter $1 does not exists "
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
|
||||
info "Option: "$OPT
|
||||
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET$TARGET_VERSION.img"
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
# path of config file
|
||||
if ! [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then
|
||||
info " Config path does not exists, defaulting to ./$TARGET"
|
||||
CONFIG_PATH="$SOURCE_PATH/$TARGET"
|
||||
fi
|
||||
|
||||
if [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then
|
||||
if [ -e "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg" ];then
|
||||
info "using $SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg as config"
|
||||
. "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg"
|
||||
else
|
||||
warning "Config file does not exists, do you want i copy template ? [Y|n] "
|
||||
read yn
|
||||
if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then
|
||||
/usr/bin/cp "$SOURCE_PATH/mageia4arm.cfg.template" "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg"
|
||||
warning "You need now to modify the config file ($SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg) and relaunch the script"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
else
|
||||
warning "Config directory does not exists, do you want i make it and copy the template file in? [Y|n] "
|
||||
read yn
|
||||
if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then
|
||||
/usr/bin/mkdir "$SOURCE_PATH/$CONFIG_PATH/"
|
||||
/usr/bin/cp "$SOURCE_PATH/config.template" "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg"
|
||||
warning "You need now to modify the config file ($SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg) and relaunch the script"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
# assign function for building image of TARGET ( rpi, odroid )
|
||||
case $TARGET in
|
||||
odroid)
|
||||
CREATEIMG="createxu3image"
|
||||
;;
|
||||
rpi)
|
||||
CREATEIMG="createrpiimage"
|
||||
;;
|
||||
*)
|
||||
error "No Target : $TARGET"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
info "target : $TARGET"
|
||||
info "source path: $SOURCE_PATH"
|
||||
info "Install path: $INSTALL_PATH"
|
||||
info "Build path: $BUILD_PATH"
|
||||
info "Commande : $CMDNAME"
|
||||
info "Firmware path : $FIRMWARE_PATH"
|
||||
info "Firmware dir : $FIRMWARE_DIR"
|
||||
|
||||
# Defining default image size to 7 go
|
||||
if [[ "$IMAGE_SIZE" -lt 7 ]] || [[ "$IMAGE_SIZE" -gt 128 ]];then
|
||||
IMAGE_SIZE=7
|
||||
fi
|
||||
|
||||
# change dir to install path and create it if not existing
|
||||
if [ "$OPT" != "clean" ];then
|
||||
info "cd $INSTALL_PATH"
|
||||
if ! [ -e "$INSTALL_PATH" ];then
|
||||
/bin/mkdir -p "$INSTALL_PATH"
|
||||
if [ -z $? ];then
|
||||
error "line $LINENO can't make directory $INSTALL_PATH , exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
cd "$INSTALL_PATH"
|
||||
if [ -z $? ];then
|
||||
error "line $LINENO can't change to directory $INSTALL_PATH , exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
#if no parameters then display help message
|
||||
if [ -z $OPT ];then
|
||||
OPT="--help"
|
||||
fi
|
||||
|
||||
info "Image size is: $IMAGE_SIZE Go"
|
||||
|
||||
case $OPT in
|
||||
clean)
|
||||
clean
|
||||
;;
|
||||
all)
|
||||
verify_disk_space
|
||||
if [ $? -eq 1 ];then
|
||||
echo -e "Not enough space on disk\nDo you want to continue anyway ? [Y,n]"
|
||||
read yn
|
||||
if [ $yn = "n" ];then
|
||||
exit 6
|
||||
fi
|
||||
fi
|
||||
createchroot
|
||||
addmedia
|
||||
updatemirror
|
||||
installbasesystem
|
||||
preparechroot
|
||||
jumpchroot
|
||||
$CREATEIMG
|
||||
;;
|
||||
createchroot)
|
||||
createchroot
|
||||
;;
|
||||
chroot)
|
||||
jumpchroot
|
||||
;;
|
||||
addmedia)
|
||||
addmedia
|
||||
;;
|
||||
updatemirror)
|
||||
updatemirror
|
||||
;;
|
||||
createimage)
|
||||
verify_disk_space
|
||||
if [ $? -eq 1 ];then
|
||||
warning "Not enough space on disk"
|
||||
exit 6
|
||||
fi
|
||||
$CREATEIMG
|
||||
;;
|
||||
installbasesystem)
|
||||
installbasesystem
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if ! [ -z $ERRORN ];then
|
||||
warning "Some errors occurs : $ERRORN errors"
|
||||
fi
|
@ -1,22 +0,0 @@
|
||||
# File generated by DrakX/drakboot
|
||||
default Mageia
|
||||
timeout 20
|
||||
menu title Boot Menu
|
||||
|
||||
label Mageia
|
||||
kernel /boot/vmlinuz
|
||||
initrd /boot/initrd
|
||||
fdtdir /usr/lib/linux-4.19.11-desktop-2.mga7
|
||||
append root=UUID=f9fdc05d-2cc9-42d8-a8dc-2f79ff008045 dwc_otg.lpm_enable=0 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 elevator=deadline cma=256M\@512M audit=0 disable_overscan=1
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
initrd /boot/initrd.img
|
||||
fdtdir /usr/lib/linux-4.19.12-desktop-2.mga7
|
||||
append root=UUID=f9fdc05d-2cc9-42d8-a8dc-2f79ff008045 8250.nr_uarts=1 console=ttyS0,115200 console=tty1 elevator=deadline cma=256M@512M
|
||||
|
||||
label desktop 4.19.12-2.mga7
|
||||
kernel /boot/vmlinuz-4.19.12-desktop-2.mga7
|
||||
initrd /boot/initrd-4.19.12-desktop-2.mga7.img
|
||||
fdtdir /usr/lib/linux-4.19.12-desktop-2.mga7
|
||||
append root=UUID=f9fdc05d-2cc9-42d8-a8dc-2f79ff008045 8250.nr_uarts=1 console=ttyS0,115200 console=tty1 elevator=deadline cma=256M@512M
|
23
init.d/mandrake_firstime
Normal file
23
init.d/mandrake_firstime
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# Description: Launch Mageia Configuration for the first time.
|
||||
# (c) Mandriva, Chmouel Boudjnah <chmouel@mandriva.com>
|
||||
# $Id$
|
||||
|
||||
FLO=/var/log/first_boot_log
|
||||
touch $FLO
|
||||
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# If fail erase the temporary file
|
||||
trap 'rm -f /var/lock/TMP_1ST' 1 2 3 15
|
||||
|
||||
SYSTEM=
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[ -s $FLO ] || rm -f $FLO
|
||||
|
||||
# Finish
|
||||
rm -f /var/lock/TMP_1ST
|
40
mageia4arm-dnf.conf
Normal file
40
mageia4arm-dnf.conf
Normal file
@ -0,0 +1,40 @@
|
||||
# mageia4arm dnf configuration
|
||||
[main]
|
||||
keepcache=1
|
||||
debuglevel=2
|
||||
reposdir=/dev/null
|
||||
logfile=/var/log/mga4arm-dnf.log
|
||||
retries=20
|
||||
obsoletes=1
|
||||
syslog_ident=mageia4arm
|
||||
syslog_device=
|
||||
metadata_expire=0
|
||||
best=1
|
||||
protected_packages=
|
||||
install_weak_deps=0
|
||||
zchunk=0
|
||||
deltarpm=0
|
||||
|
||||
# repos
|
||||
|
||||
[mageia]
|
||||
name=Mageia $releasever - $arch
|
||||
#baseurl=http://mirrors.kernel.org/mageia/distrib/$releasever/$arch/media/core/release/
|
||||
#metalink=https://mirrors.mageia.org/metalink?distrib=mageia-$releasever&arch=$arch§ion=core&repo=release
|
||||
mirrorlist=https://www.mageia.org/mirrorlist/?release=$releasever&arch=$arch§ion=core&repo=release
|
||||
fastestmirror=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///usr/share/distribution-gpg-keys/mageia/RPM-GPG-KEY-Mageia
|
||||
enabled=1
|
||||
skip_if_unavailable=False
|
||||
|
||||
[updates]
|
||||
name=Mageia $releasever - $arch - Updates
|
||||
#baseurl=http://mirrors.kernel.org/mageia/distrib/$releasever/$arch/media/core/updates/
|
||||
#metalink=https://mirrors.mageia.org/metalink?distrib=mageia-$releasever&arch=$arch§ion=core&repo=updates
|
||||
mirrorlist=https://www.mageia.org/mirrorlist/?release=$releasever&arch=$arch§ion=core&repo=updates
|
||||
fastestmirror=1
|
||||
gpgcheck=1
|
||||
gpgkey=file:///usr/share/distribution-gpg-keys/mageia/RPM-GPG-KEY-Mageia
|
||||
enabled=1
|
||||
skip_if_unavailable=False
|
@ -17,14 +17,14 @@
|
||||
# Mageia version 7 or later, cauldron.
|
||||
# TO MODIFY
|
||||
MAGEIA_VERSION=""
|
||||
# Arm version arm7hl, aarch64
|
||||
# Arm version armv7hl, aarch64
|
||||
# TO MODIFY
|
||||
ARM_VERSION=""
|
||||
|
||||
# Target plateform (xu or rpi)
|
||||
# Target plateform (odroid or rpi)
|
||||
# TO MODIFY
|
||||
TARGET=""
|
||||
# Target version (0,2,3 for raspi, 3or 4 for odroid)
|
||||
# Target version (0,2,3 for raspi, 3 or 4 for odroid)
|
||||
#TO MODIFY
|
||||
TARGET_VERSION=""
|
||||
|
||||
@ -53,8 +53,8 @@ PASSWORD="user password"
|
||||
#root password
|
||||
ROOT_PWD="root password"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
#BOOTFS=ext4
|
||||
@ -62,5 +62,5 @@ HOSTNAME="$TARGET.$ID_USER"
|
||||
#kernel package to install (just needed for odroid)
|
||||
#KERNEL=kernel-odroid
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
#Path where the raspberry pi firmware is/will be installed ( just needed for raspberry pi )
|
||||
FIRMWARE_PATH="$INSTALL_PATH/"
|
||||
|
120
platforms/bananaPro/README.md
Normal file
120
platforms/bananaPro/README.md
Normal file
@ -0,0 +1,120 @@
|
||||
Banana Pro SBC
|
||||
==========
|
||||
|
||||
Short
|
||||
-----
|
||||
* [Board Informations](#SBC_INFO)
|
||||
* [U-Boot](#UBOOT_INFO)
|
||||
* [Kernel](#KERNEL_INFO)
|
||||
|
||||
<a id="SBC_INFO"/>
|
||||
# About the Banana Pro SBC from LeMaker
|
||||
|
||||
## External links
|
||||
http://wiki.lemaker.org/BananaPro/Pi:Building_u-boot,_script.bin_and_linux-kernel#Building_the_kernel
|
||||
http://wiki.lemaker.org/BananaPro/Pi:Setting_up_the_bootable_SD_card
|
||||
https://sites.google.com/site/manisbutareed/bringing-my-beagles-to-heel/selected-annotated-u-boot-commands
|
||||
https://linux-sunxi.org/Mainline_Kernel_Howto
|
||||
https://linux-sunxi.org/Manual_build_howto#Setting_up_the_boot_partition
|
||||
https://stackoverflow.com/questions/28891221/uenv-txt-vs-boot-scr
|
||||
https://github.com/linux-sunxi/u-boot-sunxi/wiki
|
||||
|
||||
## LeMaker BPS (board package support)
|
||||
git clone --recursive https://github.com/LeMaker/lemaker-bsp.git
|
||||
./fex2bin ../sunxi-boards/sys_config/a20/BananaPro.fex ../../mageia4arm/bananaPro/script.bin
|
||||
|
||||
<a id="UBOOT_INFO"/>
|
||||
# About U-Boot
|
||||
The mainline U-Boot is used for this port.
|
||||
## Mainline
|
||||
```
|
||||
CONFIG_PATH=~/workspaces/mageia4arm/platforms/bananaPro
|
||||
git clone https://gitlab.denx.de/u-boot/u-boot
|
||||
cd u-boot
|
||||
make CROSS_COMPILE=arm-linux-gnu- Bananapro_defconfig
|
||||
cp ${CONFIG_PATH}/UBOOT.config ./.config
|
||||
#Just modify few unimportant things, like prompt, name, ...
|
||||
make ARCH=arm CROSS_COMPILE=arm-linux-gnu- -j8
|
||||
make ARCH=arm CROSS_COMPILE=arm-linux-gnu-
|
||||
#cp ./u-boot.dtb ${CONFIG_PATH}/sun7i-a20-bananapro.dtb
|
||||
cp -f ./u-boot.dtb ${CONFIG_PATH}/u-boot.dtb
|
||||
cp -f ./arch/arm/dts/sun7i-a20-bananapro.dtb ${CONFIG_PATH}/sun7i-a20-bananapro.dtb
|
||||
cp -f ./u-boot-sunxi-with-spl.bin ${CONFIG_PATH}/u-boot-sunxi-with-spl.bin
|
||||
#Inside "specialFunctions.sh"
|
||||
#dd if=${CONFIG_PATH}/u-boot-sunxi-with-spl.bin of=${DEVICE} bs=1024 seek=8
|
||||
|
||||
echo '
|
||||
setenv KERNEL_FILE /boot/vmlinuz
|
||||
setenv INIT_FILE /boot/initrd.img
|
||||
#setenv DTB_FILE /boot/sun7i-a20-bananapro.dtb
|
||||
setenv DTB_FILE /boot/u-boot.dtb
|
||||
|
||||
setenv KERNEL_ADDR 0x40008000
|
||||
#setenv INIT_ADDR 0x45000000
|
||||
setenv INIT_ADDR -
|
||||
setenv DTB_ADDR 0x48000000
|
||||
|
||||
ext4load mmc 0:1 ${KERNEL_ADDR} ${KERNEL_FILE}
|
||||
#ext4load mmc 0:1 ${INIT_ADDR} ${INIT_FILE}
|
||||
ext4load mmc 0:1 ${DTB_ADDR} ${DTB_FILE}
|
||||
|
||||
setenv bootargs console=ttyS0,115200 disp.screen0_output_mode=EDID:1024x768p50 hdmi.audio=EDID:0 root=/dev/mmcblk0p1 rootfstype=ext4 elevator=deadline rootwait
|
||||
|
||||
#printenv
|
||||
bootz ${KERNEL_ADDR} ${INIT_ADDR} ${DTB_ADDR}
|
||||
|
||||
#Compile boot.scr : mkimage -C none -A arm -T script -d "${CONFIG_PATH}/boot.cmd" "${CONFIG_PATH}/boot.scr"
|
||||
' >${CONFIG_PATH}/boot.cmd
|
||||
```
|
||||
|
||||
mkimage -C none -A arm -T script -d ${CONFIG_PATH}/boot.cmd ${CONFIG_PATH}/boot.scr
|
||||
|
||||
## UBoot Sunxi From LeMaker
|
||||
Obsolet, see 'LeMaker BPS (board package support)'.
|
||||
|
||||
## UBoot Sunxi
|
||||
Generic u-boot for sunxi
|
||||
```
|
||||
git clone https://github.com/linux-sunxi/u-boot-sunxi
|
||||
make CROSS_COMPILE=arm-linux-gnu- Bananapro_config
|
||||
make CROSS_COMPILE=arm-linux-gnu- -j8
|
||||
make CROSS_COMPILE=arm-linux-gnu-
|
||||
#Need network support to give the MAC address.
|
||||
#Do not activate boot timing.
|
||||
#Default conf use bootz and dtb tree.
|
||||
```
|
||||
|
||||
## Default LeMaker script
|
||||
```
|
||||
setenv bootargs console=ttyS0,115200 noinitrd
|
||||
disp.screen0_output_mode=EDID:1280x720p50 init=/init
|
||||
root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
|
||||
fatload mmc 0 0x43000000 script.bin
|
||||
fatload mmc 0 0x48000000 uImage
|
||||
bootm 0x48000000
|
||||
```
|
||||
|
||||
## DTB from Linux Mainline
|
||||
```
|
||||
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git --depth=1
|
||||
make ARCH=arm CROSS_COMPILE=arm-linux-gnu- sunxi_defconfig
|
||||
ARCH=arm CROSS_COMPILE=arm-linux-gnu- make -j8 dtbs
|
||||
cp ./arch/arm/boot/dts/sun7i-a20-bananapro.dtb ./sun7i-a20-bananapro.dtb
|
||||
```
|
||||
|
||||
<a id="KERNEL_INFO"/>
|
||||
# About the Kernel
|
||||
|
||||
Not Written.
|
||||
|
||||
## Generate symlink
|
||||
```
|
||||
#Generating a symbolic relative link to the "last" kernel :
|
||||
ln -r -s ./vmlinuz-5.2.13-desktop-2.mga7 ./vmlinuz
|
||||
rm -f ./vmlinuz && ln -r -s ./vmlinuz-5.3.1-desktop-2.mga7 ./vmlinuz
|
||||
```
|
||||
|
||||
## Commands used :
|
||||
./create_arm_image.sh --clean --config bananaPro --build-path ./build
|
||||
./create_arm_image.sh --all --target bananaPro --size 2 --tainted --nonfree --build-path ./build --config bananaPro 2>&1 | tee -a ./log/creation.log
|
||||
dd if=./build/Mageia-7-bananaPro1.img | pv | dd of=/dev/mmcblk0 ; sync
|
1472
platforms/bananaPro/UBOOT.config
Normal file
1472
platforms/bananaPro/UBOOT.config
Normal file
File diff suppressed because it is too large
Load Diff
17
platforms/bananaPro/boot.cmd
Normal file
17
platforms/bananaPro/boot.cmd
Normal file
@ -0,0 +1,17 @@
|
||||
setenv KERNEL_FILE /boot/uvmlinuz
|
||||
setenv DTB_FILE /boot/u-boot.dtb
|
||||
setenv INIT_FILE /boot/initrd
|
||||
|
||||
setenv KERNEL_ADDR 0x40008000
|
||||
setenv DTB_ADDR 0x45000000
|
||||
setenv INIT_ADDR 0x48000000
|
||||
setenv INIT_ADDR -
|
||||
|
||||
ext4load mmc 0:1 ${KERNEL_ADDR} ${KERNEL_FILE}
|
||||
ext4load mmc 0:1 ${DTB_ADDR} ${DTB_FILE}
|
||||
#ext4load mmc 0:1 ${INIT_ADDR} ${INIT_FILE}
|
||||
|
||||
setenv bootargs console=ttyS0,115200 disp.screen0_output_mode=EDID:1024x768p50 hdmi.audio=EDID:0 root=/dev/mmcblk0p1 rootfstype=ext4 elevator=deadline rootwait
|
||||
|
||||
#printenv
|
||||
bootz ${KERNEL_ADDR} ${INIT_ADDR} ${DTB_ADDR}
|
14
platforms/bananaPro/extlinux.conf
Normal file
14
platforms/bananaPro/extlinux.conf
Normal file
@ -0,0 +1,14 @@
|
||||
menu title Welcome to Mageia-Minimal.
|
||||
timeout 10
|
||||
default Mageia
|
||||
|
||||
label Mageia
|
||||
kernel /boot/vmlinuz
|
||||
initrd /boot/initrd.img
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
append root=/dev/mmcblk0p1 <BOOT_ARGS>
|
76
platforms/bananaPro/mageia4arm.cfg
Normal file
76
platforms/bananaPro/mageia4arm.cfg
Normal file
@ -0,0 +1,76 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#BananaPro informations : http://wiki.lemaker.org/BananaPro/Pi:Building_u-boot,_script.bin_and_linux-kernel#Installation
|
||||
#BananaPro sources : https://github.com/LeMaker/lemaker-bsp
|
||||
# Kernel : https://github.com/LeMaker/linux-sunxi
|
||||
# FEX (DTS) : https://github.com/LeMaker/sunxi-boards
|
||||
|
||||
# Mageia version 7 or later, cauldron.
|
||||
MAGEIA_VERSION="7"
|
||||
# Arm version armv7hl, aarch64
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
# Target plateform (odroid or rpi)
|
||||
TARGET="bananaPro"
|
||||
# Target version (0,2,3 for raspi, 3 or 4 for odroid)
|
||||
TARGET_VERSION="1"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/${MAGEIA_VERSION}/${ARM_VERSION}"
|
||||
|
||||
# image will be created here
|
||||
# INSTALL_PATH="./${TARGET}"
|
||||
# Should not be in this configuration file, it isn't related to the configuration but to the build platform.
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="${INSTALL_PATH}/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}.img"
|
||||
|
||||
# Default user
|
||||
# If not set, no user will be defined.
|
||||
# ID_USER="banana"
|
||||
# PASSWORD="bananaPro"
|
||||
|
||||
#root password
|
||||
#If not set, no root password, at the first login, the system will ask for a password.
|
||||
# ROOT_PWD="ProR00t"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="${TARGET}"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
SEPARATE_BOOT_PARTITION=0
|
||||
BOOTFS="ext4"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#kernel package to install
|
||||
KERNEL="kernel-desktop"
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='console=ttyS0,115200 disp.screen0_output_mode=EDID:1024x768p50 hdmi.audio=EDID:0'
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed ( just needed for raspberry pi )
|
||||
# FIRMWARE_PATH="${INSTALL_PATH}/"
|
||||
#FIRMWARE_DIR="firmware-stable"
|
||||
#FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"
|
125
platforms/bananaPro/second_stage_install.sh
Normal file
125
platforms/bananaPro/second_stage_install.sh
Normal file
@ -0,0 +1,125 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
export ARCH=arm
|
||||
|
||||
/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage
|
||||
|
||||
/usr/bin/chown :systemd-journal -R /var/log/journal
|
||||
|
||||
#Install all packages you need
|
||||
/usr/bin/dnf --setopt=ignorearch=True --nogpgcheck --assumeyes install basesystem chrony polkit lockdev rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make rsync binutils ldetect usbutils #kernel-desktop-latest # systemd-bootchart libcap-utils keyutils mindi-busybox plymouth-scripts lvm2 #dmsetup
|
||||
|
||||
#For dracut :
|
||||
# /usr/bin/dnf --setopt=ignorearch=True --nogpgcheck --assumeyes install u-boot-tools mindi-busybox plymouth-scripts #systemd-bootchart libcap-utils keyutils lvm2 #dmsetup
|
||||
|
||||
# ############################
|
||||
# ## For compiling a module ##
|
||||
# ############################
|
||||
# BUG : Make does not like to build inside chroot. It doesn't find tools. Impossible to build any module there.
|
||||
# /usr/bin/dnf --setopt=ignorearch=True --nogpgcheck --assumeyes install kernel-source-latest
|
||||
# #See if it is a Server or Desktop kernel :
|
||||
# rpm -q kernel-serveur-latest
|
||||
# if [ 0 -ne ${?} ]; then
|
||||
# K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/' )
|
||||
# else
|
||||
# K_INST_VERSION=$(rpm -q kernel-serveur-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/' )
|
||||
# fi
|
||||
# #Recover the kernel module path :
|
||||
# K_MOD_PATH=$(urpmf "modules/${K_INST_VERSION}$" | cut -d ':' -f 2)
|
||||
# #Recover the source version :
|
||||
# K_SRC_VERSION=$(rpm -q kernel-source-latest | sed -e 's/kernel-source-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\1-\2/' )
|
||||
# #Recover the source path :
|
||||
# K_SRC_PATH=$(urpmf "src/kernel-${K_SRC_VERSION}$" | cut -d ':' -f 2)
|
||||
# #Set the default Mageia's configuration file into the source path :
|
||||
# cp /boot/config-${K_INST_VERSION} ${K_SRC_PATH}/.config
|
||||
# ## Can't go further... Make does not like to build inside chroot. It doesn't find tools.
|
||||
# ## Impossible to build any module there.
|
||||
|
||||
|
||||
# ####################################################
|
||||
# ## To embed a module inside the early boot initrd ##
|
||||
# ####################################################
|
||||
# #Set the kernel name :
|
||||
# KERNELVERSION="5.3.7-desktop-4.mga7"
|
||||
K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
|
||||
# #Set the list of added modules and omitted modules :
|
||||
# DRIVER_ADD_LIST="8250_dw"
|
||||
# DRIVER_OMI_LIST="drm"
|
||||
# #Create a configuration file inside the FS, it will be used by dracut for all kernel update
|
||||
# echo -e "# Omiting drm as it failed for arm :\nomit_dracutmodules+=\" ${DRIVER_OMI_LIST} \"\n\n# Driver to add for banana Pro (serial) :\nadd_drivers+=\" ${DRIVER_ADD_LIST} \"\n" > /etc/dracut.conf.d/30-bananapro.conf
|
||||
# #Generate the initrd :
|
||||
# OUTPUT=$(ARCH=arm CROSS_COMPILE=arm-linux-gnu- dracut --no-compress --force --no-hostonly --local --no-early-microcode --confdir "/etc/dracut.conf.d" --kmoddir="/lib/modules/${K_INST_VERSION}" --xz --printsize --kernel-image /boot/vmlinuz --fstab initrd-${K_INST_VERSION}.img ${K_INST_VERSION} 2>&1 | tee /dev/tty )
|
||||
dracut --no-compress --force --no-hostonly --local --no-early-microcode --confdir "/etc/dracut.conf.d" --kmoddir="/lib/modules/${K_INST_VERSION}" --xz --printsize --kernel-image /boot/vmlinuz --fstab /boot/initrd-${K_INST_VERSION}.img ${K_INST_VERSION}
|
||||
ln -r -s /boot/initrd-${K_INST_VERSION}.img /boot/initrd.img
|
||||
# #Add the uboot header to the initrd file, first, find the file :
|
||||
# INITRD_FILE="$(echo "${OUTPUT}" | grep "Creating initramfs image file" | sed -e "s/^[*:[:space:][:alnum:]]*'//" -e "s/'.*$//" )"
|
||||
# #Add the uboot header, the result file will contain a 'u' as prefix-name.
|
||||
# mkimage -A arm -T ramdisk -C lzma -n initrd -d ${INITRD_FILE} "$(dirname "${INITRD_FILE}")/u$(basename "${INITRD_FILE}")"
|
||||
# #generate a symlink relative r and symbolic s :
|
||||
# rm -f /boot/initrd
|
||||
# ln -r -s "$(dirname "${INITRD_FILE}")/u$(basename "${INITRD_FILE}")" /boot/initrd
|
||||
|
||||
###########################################
|
||||
## Install a package from testing repo : ##
|
||||
###########################################
|
||||
# dnf --refresh --enablerepo=updates_testing-\* --assumeyes install kernel-desktop-latest
|
||||
|
||||
############################################
|
||||
## Installing the kernel (not on testing) ##
|
||||
############################################
|
||||
# dnf --refresh --assumeyes install kernel-desktop-latest
|
||||
|
||||
###############################################
|
||||
## Create a symlink for the lastest kernel : ##
|
||||
###############################################
|
||||
## As long as the first installed kernel remains installed, the boot.scr script will continue to work, even if the extlinux.conf file is not working with uboot anymore.
|
||||
# #Last rpm package :
|
||||
# KERNELRPM=$(rpm -qa --last | grep "^kernel-[sd]e[[:alpha:]]*-[[:digit:]]" | head -n 1 | cut -d ' ' -f 1 | sed -e 's/\(kernel-[[:alnum:]]*-[\.[:digit:]]*-[\.[:alnum:]]*\)-.*/\1/' )
|
||||
# #Get the vmlinuz file :
|
||||
# VMLINUZ=$(urpmf ${KERNELRPM} | grep "boot/vmlinuz" | cut -d ':' -f 2)
|
||||
#Get the vmlinuz file :
|
||||
VMLINUZ=$(ls --sort=time -1 /boot/vmlinuz-[[:digit:]]* | head -n 1)
|
||||
rm -f /boot/uvmlinuz
|
||||
ln -r -s "${VMLINUZ}" /boot/uvmlinuz #For the uboot script
|
||||
# Normally, /boot/vmlinuz is generated with the /sbin/installkernel script, but it is not generated with chroot.
|
||||
ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
|
||||
|
||||
################################
|
||||
## Create the extlinux script ##
|
||||
################################
|
||||
# BUG : installkernel call bootloader-config which doesn't process inside a chroot.
|
||||
# echo -e "\nTrying to generate extlinux script\n"
|
||||
# K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
|
||||
# /sbin/installkernel %{kversion}-$kernel_flavour-%{buildrpmrel}
|
||||
# bash -x /sbin/installkernel ${K_INST_VERSION}
|
||||
# perl -d /usr/sbin/bootloader-config --kernel-version ${K_INST_VERSION} --initrd-options '' --action add-kernel
|
||||
# /usr/sbin/bootloader-config --kernel-version ${K_INST_VERSION} --initrd-options '' --action add-kernel
|
||||
# echo -e "\nEnd trying to generate extlinux script with errcode ${?}\n"
|
||||
|
||||
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
||||
/usr/bin/chown :daemon /etc/wpa_supplicant.conf
|
||||
/usr/bin/chown :tty /bin/write /bin/wall
|
||||
/usr/bin/chown :lock /sbin/lockdev
|
||||
/usr/bin/chown :bin /sbin/traceroute
|
||||
/usr/bin/chown polkitd /etc/polkit-1/rules.d
|
||||
|
||||
|
||||
## DO NOT EXIT THE SCRIPT. A second part is automatically added in this script during the process in order to create the default user and set root password.
|
88
platforms/bananaPro/specialFunctions.sh
Executable file
88
platforms/bananaPro/specialFunctions.sh
Executable file
@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#Fdisk partitionment commands :
|
||||
DEFAULT=""
|
||||
NEW_DOSTAB="o"
|
||||
NEW_PART="n"
|
||||
PRIMARY="p"
|
||||
CHANGE_TYPE="t"
|
||||
TYPE_FAT32LBA="c"
|
||||
CHANGE_BOOTFLAG="a"
|
||||
APPLY="w"
|
||||
|
||||
# PART_BOOT=1
|
||||
# PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
# PART_BOOT_SIZE="+128M"
|
||||
#
|
||||
# PART_ROOT=2
|
||||
# PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
# PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
PART_BOOTandROOT="1"
|
||||
PART_BOOTandROOT_FIRST_SECTOR="${DEFAULT}"
|
||||
PART_BOOTandROOT_SIZE="${DEFAULT}"
|
||||
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOTandROOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOTandROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${APPLY}\n"
|
||||
# FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
title "Creating Banana Pro image"
|
||||
#Nothing to download.
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
# info "copying kernel-desktop, dtb, boot.scr and vmlinuz symlink in ${BUILD_PATH}/boot"
|
||||
info "copying dtb and boot.scr in ${BUILD_PATH}/boot"
|
||||
#Generating uboot autoboot script :
|
||||
mkimage -C none -A arm -T script -d "${CONFIG_PATH}/boot.cmd" "${BUILD_PATH}/boot/boot.scr"
|
||||
/usr/bin/cp --preserve=mode "${CONFIG_PATH}/u-boot.dtb" "${BUILD_PATH}/boot/"
|
||||
# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/sun7i-a20-bananapro.dtb" "${BUILD_PATH}/boot/"
|
||||
# /usr/bin/cp --preserve=mode -d "${CONFIG_PATH}/vmlinuz" "${BUILD_PATH}/boot/"
|
||||
# /usr/bin/cp --preserve=mode -r "${CONFIG_PATH}/lib" "${BUILD_PATH}/"
|
||||
return 0
|
||||
}
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
# DEVICE is set just before this function and looped.
|
||||
title "Burning the bootloader..."
|
||||
dd if=${CONFIG_PATH}/u-boot-sunxi-with-spl.bin of=${DEVICE} bs=1024 seek=8
|
||||
return 0
|
||||
}
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
#${BOOT} defined to the path to the mounted boot partition.
|
||||
# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/vmlinuz-5.3.1-desktop-2.mga7" "${BOOT}"
|
||||
# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/sun7i-a20-bananapro.dtb" "${BOOT}"
|
||||
# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/boot.scr" "${BOOT}/"
|
||||
# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/uboot.env" "${BOOT}/"
|
||||
# /usr/bin/cp --preserve=mode "${CONFIG_PATH}/uEnv.txt" "${BOOT}/"
|
||||
# /usr/bin/cp --preserve=mode -d "${CONFIG_PATH}/vmlinuz" "${BOOT}/"
|
||||
# cp --preserve=mode -R "${BUILD_PATH}/boot/extlinux" "${BOOT}/"
|
||||
return 0
|
||||
}
|
BIN
platforms/bananaPro/u-boot-sunxi-with-spl.bin
Normal file
BIN
platforms/bananaPro/u-boot-sunxi-with-spl.bin
Normal file
Binary file not shown.
BIN
platforms/bananaPro/u-boot.dtb
Normal file
BIN
platforms/bananaPro/u-boot.dtb
Normal file
Binary file not shown.
66
platforms/mageia4arm.cfg
Normal file
66
platforms/mageia4arm.cfg
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Mageia version 7 or later, cauldron.
|
||||
# TO MODIFY
|
||||
MAGEIA_VERSION=""
|
||||
# Arm version armv7hl, aarch64
|
||||
# TO MODIFY
|
||||
ARM_VERSION=""
|
||||
|
||||
# Target plateform (odroid or rpi)
|
||||
# TO MODIFY
|
||||
TARGET=""
|
||||
# Target version (0,2,3 for raspi, 3 or 4 for odroid)
|
||||
#TO MODIFY
|
||||
TARGET_VERSION=""
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
|
||||
# image will be created here
|
||||
# TO MODIFY
|
||||
INSTALL_PATH="/path/to/$TARGET"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
# Default user
|
||||
# TO MODIFY
|
||||
ID_USER="user login"
|
||||
PASSWORD="user password"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="root password"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
#BOOTFS=ext4
|
||||
|
||||
#kernel package to install (just needed for odroid)
|
||||
#KERNEL=kernel-odroid
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed ( just needed for raspberry pi )
|
||||
FIRMWARE_PATH="$INSTALL_PATH/"
|
10
platforms/rpi1/extlinux.conf
Normal file
10
platforms/rpi1/extlinux.conf
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default linux
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
63
platforms/rpi1/mageia4arm.cfg
Normal file
63
platforms/rpi1/mageia4arm.cfg
Normal file
@ -0,0 +1,63 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="6"
|
||||
ARM_VERSION="armv5tl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="1"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
|
||||
INSTALL_PATH="/mnt/perso/raspi1"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET$TARGET_VERSION.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Default user
|
||||
ID_USER="pi"
|
||||
PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
BOOTFS="vfat"
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0'
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
||||
FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"
|
@ -1,5 +1,5 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <dtux@free.fr>
|
||||
#
|
||||
# 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
|
||||
@ -26,10 +26,8 @@ TARGET_VERSION="3_32"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
|
||||
INSTALL_PATH="/mnt/perso/raspi-test"
|
||||
INSTALL_PATH="<change this>"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
@ -38,6 +36,7 @@ BUILD_PATH="$INSTALL_PATH/build"
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
#no need to be changed
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
@ -52,6 +51,7 @@ ROOT_PWD="piroot"
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
#DO NOT CHANGE THIS
|
||||
BOOTFS="vfat"
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
@ -23,7 +23,7 @@
|
||||
#Install all packages you need
|
||||
# No verifying rpm due to a bug in packages, some are not signed
|
||||
|
||||
/usr/sbin/urpmi --auto --no-verify-rpm basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make binutils dracut u-boot rsync kernel-desktop-latest mlocate drakx-kbd-mouse-x11
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make binutils dracut u-boot rsync kernel-desktop-latest mlocate drakx-kbd-mouse-x11
|
||||
|
||||
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
147
platforms/rpi1/specialFunctions.sh
Executable file
147
platforms/rpi1/specialFunctions.sh
Executable file
@ -0,0 +1,147 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#RPI partitionning :
|
||||
DEFAULT=""
|
||||
NEW_PART=n
|
||||
PRIMARY=p
|
||||
CHANGE_TYPE=t
|
||||
CHANGE_BOOTFLAG=a
|
||||
APPLY=w
|
||||
|
||||
PART_BOOT=1
|
||||
PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_BOOT_SIZE="+128M"
|
||||
|
||||
PART_ROOT=2
|
||||
PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
TYPE_FAT32LBA=c
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
title "Creating Pi image"
|
||||
|
||||
if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists
|
||||
echo "$(ls *.zip| wc -l)"
|
||||
if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists
|
||||
warning "The raspberry pi firmware need to be downloaded"
|
||||
info "Downloading FIRMWARE_FILENAME"
|
||||
wget ${FIRMWARE_DOWNLOAD_URL}
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
info "extracting firmware"
|
||||
unzip -d "${FIRMWARE_PATH}" *.zip
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
title "Making raspberry pi image"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
info "copying 10-vchiq-permissions.rules"
|
||||
cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/"
|
||||
info "Making /etc/modules"
|
||||
echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules
|
||||
|
||||
ARM_BOOT="${BUILD_PATH}/mnt/arm_boot"
|
||||
if ! [ -d "${ARM_BOOT}" ]; then
|
||||
mkdir -p "${ARM_BOOT}"
|
||||
fi
|
||||
info "copying modprobe.conf"
|
||||
/usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/"
|
||||
chown root:root "${BUILD_PATH}/etc/modprobe.conf"
|
||||
|
||||
info "copying firmware, overlays in rpi boot partition"
|
||||
# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/"
|
||||
cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/"
|
||||
|
||||
info "copying u-boot binary to ${ARM_BOOT}"
|
||||
case ${TARGET_VERSION} in
|
||||
"0")
|
||||
info "copying u-boot for ${TARGET} 0"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"1")
|
||||
info "copying u-boot for ${TARGET} 1"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"2")
|
||||
info "copying u-boot for ${TARGET} 2"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3_32")
|
||||
info "copying u-boot for ${TARGET} 3 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3+")
|
||||
info "copying u-boot for ${TARGET} 3b+ 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
esac
|
||||
|
||||
# info "copying raspberry optionals files in opt"
|
||||
# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/"
|
||||
|
||||
info "copying wifi firmware file missing in kernel-firmware-nonfree"
|
||||
if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then
|
||||
/bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/"
|
||||
fi
|
||||
if ! [[ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]]; then
|
||||
/bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
fi
|
||||
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -rlptogDH --exclude "${ARM_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||
/bin/rsync -rlptogDH "${ARM_BOOT}/" "${BOOT}/"
|
||||
return 0
|
||||
}
|
1
platforms/rpi2/10-vchiq-permissions.rules
Normal file
1
platforms/rpi2/10-vchiq-permissions.rules
Normal file
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
|
66
platforms/rpi2/brcmfmac43430-sdio.txt
Normal file
66
platforms/rpi2/brcmfmac43430-sdio.txt
Normal file
@ -0,0 +1,66 @@
|
||||
# NVRAM file for BCM943430WLPTH
|
||||
# 2.4 GHz, 20 MHz BW mode
|
||||
|
||||
# The following parameter values are just placeholders, need to be updated.
|
||||
manfid=0x2d0
|
||||
prodid=0x0727
|
||||
vendid=0x14e4
|
||||
devid=0x43e2
|
||||
boardtype=0x0727
|
||||
boardrev=0x1101
|
||||
boardnum=22
|
||||
macaddr=00:90:4c:c5:12:38
|
||||
sromrev=11
|
||||
boardflags=0x00404201
|
||||
boardflags3=0x08000000
|
||||
xtalfreq=37400
|
||||
nocrc=1
|
||||
ag0=255
|
||||
aa2g=1
|
||||
ccode=ALL
|
||||
|
||||
pa0itssit=0x20
|
||||
extpagain2g=0
|
||||
#PA parameters for 2.4GHz, measured at CHIP OUTPUT
|
||||
pa2ga0=-168,7161,-820
|
||||
AvVmid_c0=0x0,0xc8
|
||||
cckpwroffset0=5
|
||||
|
||||
# PPR params
|
||||
maxp2ga0=84
|
||||
txpwrbckof=6
|
||||
cckbw202gpo=0
|
||||
legofdmbw202gpo=0x66111111
|
||||
mcsbw202gpo=0x77711111
|
||||
propbw202gpo=0xdd
|
||||
|
||||
# OFDM IIR :
|
||||
ofdmdigfilttype=18
|
||||
ofdmdigfilttypebe=18
|
||||
# PAPD mode:
|
||||
papdmode=1
|
||||
papdvalidtest=1
|
||||
pacalidx2g=42
|
||||
papdepsoffset=-22
|
||||
papdendidx=58
|
||||
|
||||
# LTECX flags
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0102
|
||||
ltecxfnsel=0x44
|
||||
ltecxgcigpio=0x01
|
||||
|
||||
il0macaddr=00:90:4c:c5:12:38
|
||||
wl0id=0x431b
|
||||
|
||||
deadman_to=0xffffffff
|
||||
# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
|
||||
muxenab=0x1
|
||||
# CLDO PWM voltage settings - 0x4 - 1.1 volt
|
||||
#cldo_pwm=0x4
|
||||
|
||||
#VCO freq 326.4MHz
|
||||
spurconfig=0x3
|
||||
|
||||
edonthd20l=-75
|
||||
edoffthd20ul=-80
|
BIN
platforms/rpi2/brcmfmac43455-sdio.clm_blob
Normal file
BIN
platforms/rpi2/brcmfmac43455-sdio.clm_blob
Normal file
Binary file not shown.
92
platforms/rpi2/brcmfmac43455-sdio.txt
Normal file
92
platforms/rpi2/brcmfmac43455-sdio.txt
Normal file
@ -0,0 +1,92 @@
|
||||
# Cloned from bcm94345wlpagb_p2xx.txt
|
||||
NVRAMRev=$Rev: 498373 $
|
||||
sromrev=11
|
||||
vendid=0x14e4
|
||||
devid=0x43ab
|
||||
manfid=0x2d0
|
||||
prodid=0x06e4
|
||||
#macaddr=00:90:4c:c5:12:38
|
||||
macaddr=b8:27:eb:74:f2:6c
|
||||
nocrc=1
|
||||
boardtype=0x6e4
|
||||
boardrev=0x1304
|
||||
|
||||
#XTAL 37.4MHz
|
||||
xtalfreq=37400
|
||||
|
||||
btc_mode=1
|
||||
#------------------------------------------------------
|
||||
#boardflags: 5GHz eTR switch by default
|
||||
# 2.4GHz eTR switch by default
|
||||
# bit1 for btcoex
|
||||
boardflags=0x00480201
|
||||
boardflags2=0x40800000
|
||||
boardflags3=0x48200100
|
||||
phycal_tempdelta=15
|
||||
rxchain=1
|
||||
txchain=1
|
||||
aa2g=1
|
||||
aa5g=1
|
||||
tssipos5g=1
|
||||
tssipos2g=1
|
||||
femctrl=0
|
||||
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
|
||||
pa2ga0=-129,6525,-718
|
||||
pa2ga1=-149,4408,-601
|
||||
pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
|
||||
pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
|
||||
itrsw=1
|
||||
pdoffsetcckma0=2
|
||||
pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
|
||||
pdoffset2g40ma0=16
|
||||
pdoffset40ma0=0x8888
|
||||
pdoffset80ma0=0x8888
|
||||
extpagain5g=2
|
||||
extpagain2g=2
|
||||
tworangetssi2g=1
|
||||
tworangetssi5g=1
|
||||
# LTECX flags
|
||||
# WCI2
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0504
|
||||
ltecxfnsel=0x22
|
||||
ltecxgcigpio=0x32
|
||||
|
||||
maxp2ga0=80
|
||||
ofdmlrbw202gpo=0x0022
|
||||
dot11agofdmhrbw202gpo=0x4442
|
||||
mcsbw202gpo=0x98444422
|
||||
mcsbw402gpo=0x98444422
|
||||
maxp5ga0=82,82,82,82
|
||||
mcsbw205glpo=0xb9555000
|
||||
mcsbw205gmpo=0xb9555000
|
||||
mcsbw205ghpo=0xb9555000
|
||||
mcsbw405glpo=0xb9555000
|
||||
mcsbw405gmpo=0xb9555000
|
||||
mcsbw405ghpo=0xb9555000
|
||||
mcsbw805glpo=0xb9555000
|
||||
mcsbw805gmpo=0xb9555000
|
||||
mcsbw805ghpo=0xb9555000
|
||||
|
||||
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
|
||||
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
|
||||
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
|
||||
vcodivmode=1
|
||||
deadman_to=481500000
|
||||
|
||||
ed_thresh2g=-54
|
||||
ed_thresh5g=-54
|
||||
eu_edthresh2g=-54
|
||||
eu_edthresh5g=-54
|
||||
ldo1=4
|
||||
rawtempsense=0x1ff
|
||||
cckPwrIdxCorr=3
|
||||
cckTssiDelay=150
|
||||
ofdmTssiDelay=150
|
||||
txpwr2gAdcScale=1
|
||||
txpwr5gAdcScale=1
|
||||
dot11b_opts=0x3aa85
|
||||
cbfilttype=1
|
||||
fdsslevel_ch11=6
|
10
platforms/rpi2/extlinux.conf
Normal file
10
platforms/rpi2/extlinux.conf
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default linux
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
64
platforms/rpi2/mageia4arm.cfg
Normal file
64
platforms/rpi2/mageia4arm.cfg
Normal file
@ -0,0 +1,64 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="2"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
|
||||
INSTALL_PATH="/mnt/perso/raspi2"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET$TARGET_VERSION.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Default user
|
||||
ID_USER="pi"
|
||||
PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
BOOTFS="vfat"
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0'
|
||||
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
||||
FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"
|
@ -1,5 +1,5 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <dtux@free.fr>
|
||||
#
|
||||
# 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
|
||||
@ -15,18 +15,19 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="cauldron"
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="3_32"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
|
||||
INSTALL_PATH="/mnt/perso/raspi-test"
|
||||
INSTALL_PATH="<change this>"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
@ -35,6 +36,7 @@ BUILD_PATH="$INSTALL_PATH/build"
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
#no need to be changed
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
@ -49,11 +51,9 @@ ROOT_PWD="piroot"
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
#DO NOT CHANGE THIS
|
||||
BOOTFS="vfat"
|
||||
|
||||
#kernel package to install (just needed for odroid)
|
||||
KERNEL=""
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
3
platforms/rpi2/modprobe.conf
Normal file
3
platforms/rpi2/modprobe.conf
Normal file
@ -0,0 +1,3 @@
|
||||
alias wlan0 brcmfmac
|
||||
alias eth0 smsc95xx
|
||||
alias usb0 rndis_host
|
43
platforms/rpi2/second_stage_install.sh
Normal file
43
platforms/rpi2/second_stage_install.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage
|
||||
|
||||
/usr/bin/chown :systemd-journal -R /var/log/journal
|
||||
|
||||
#Install all packages you need
|
||||
# No verifying rpm due to a bug in packages, some are not signed
|
||||
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make binutils dracut u-boot rsync kernel-desktop-latest mlocate drakx-kbd-mouse-x11 glibc-i18ndata
|
||||
|
||||
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
||||
/usr/bin/chown :daemon /etc/wpa_supplicant.conf
|
||||
/usr/bin/chown :tty /bin/write /bin/wall
|
||||
/usr/bin/chown :lock /sbin/lockdev
|
||||
/usr/bin/chown :bin /sbin/traceroute
|
||||
/usr/bin/chown polkitd /etc/polkit-1/rules.d
|
||||
|
||||
KV=`basename /boot/vmlinuz-*`
|
||||
KV=${KV#vmlinuz-}
|
||||
dracut --kver $KV
|
||||
rm -f $0
|
||||
cp /boot/vmlinuz-* /boot/vmlinuz
|
||||
cp /boot/initrd-* /boot/initrd
|
||||
|
||||
alternatives --set soundprofile /etc/sound/profiles/alsa
|
146
platforms/rpi2/specialFunctions.sh
Executable file
146
platforms/rpi2/specialFunctions.sh
Executable file
@ -0,0 +1,146 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#RPI partitionning :
|
||||
DEFAULT=""
|
||||
NEW_PART=n
|
||||
PRIMARY=p
|
||||
CHANGE_TYPE=t
|
||||
CHANGE_BOOTFLAG=a
|
||||
APPLY=w
|
||||
|
||||
PART_BOOT=1
|
||||
PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_BOOT_SIZE="+128M"
|
||||
|
||||
PART_ROOT=2
|
||||
PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
TYPE_FAT32LBA=c
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
title "Creating Pi image"
|
||||
|
||||
if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists
|
||||
echo "$(ls *.zip| wc -l)"
|
||||
if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists
|
||||
warning "The raspberry pi firmware need to be downloaded"
|
||||
info "Downloading FIRMWARE_FILENAME"
|
||||
wget ${FIRMWARE_DOWNLOAD_URL}
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
info "extracting firmware"
|
||||
unzip -d "${FIRMWARE_PATH}" *.zip
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
title "Making raspberry pi image"
|
||||
return 0
|
||||
}
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
info "copying 10-vchiq-permissions.rules"
|
||||
cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/"
|
||||
info "Making /etc/modules"
|
||||
echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules
|
||||
|
||||
ARM_BOOT="${BUILD_PATH}/mnt/arm_boot"
|
||||
if ! [ -d "${ARM_BOOT}" ]; then
|
||||
mkdir -p "${ARM_BOOT}"
|
||||
fi
|
||||
info "copying modprobe.conf"
|
||||
/usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/"
|
||||
chown root:root "${BUILD_PATH}/etc/modprobe.conf"
|
||||
|
||||
info "copying firmware, overlays in rpi boot partition"
|
||||
# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/"
|
||||
cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/"
|
||||
|
||||
info "copying u-boot binary to ${ARM_BOOT}"
|
||||
case ${TARGET_VERSION} in
|
||||
"0")
|
||||
info "copying u-boot for ${TARGET} 0"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"1")
|
||||
info "copying u-boot for ${TARGET} 1"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"2")
|
||||
info "copying u-boot for ${TARGET} 2"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3_32")
|
||||
info "copying u-boot for ${TARGET} 3 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3+")
|
||||
info "copying u-boot for ${TARGET} 3b+ 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
esac
|
||||
|
||||
# info "copying raspberry optionals files in opt"
|
||||
# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/"
|
||||
|
||||
info "copying wifi firmware file missing in kernel-firmware-nonfree"
|
||||
if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then
|
||||
/bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/"
|
||||
fi
|
||||
if ! [[ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]]; then
|
||||
/bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
fi
|
||||
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -rlptogDH --exclude "${ARM_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||
/bin/rsync -rlptogDH "${ARM_BOOT}/" "${BOOT}/"
|
||||
return 0
|
||||
}
|
1
platforms/rpi3+/10-vchiq-permissions.rules
Normal file
1
platforms/rpi3+/10-vchiq-permissions.rules
Normal file
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
|
66
platforms/rpi3+/brcmfmac43430-sdio.txt
Normal file
66
platforms/rpi3+/brcmfmac43430-sdio.txt
Normal file
@ -0,0 +1,66 @@
|
||||
# NVRAM file for BCM943430WLPTH
|
||||
# 2.4 GHz, 20 MHz BW mode
|
||||
|
||||
# The following parameter values are just placeholders, need to be updated.
|
||||
manfid=0x2d0
|
||||
prodid=0x0727
|
||||
vendid=0x14e4
|
||||
devid=0x43e2
|
||||
boardtype=0x0727
|
||||
boardrev=0x1101
|
||||
boardnum=22
|
||||
macaddr=00:90:4c:c5:12:38
|
||||
sromrev=11
|
||||
boardflags=0x00404201
|
||||
boardflags3=0x08000000
|
||||
xtalfreq=37400
|
||||
nocrc=1
|
||||
ag0=255
|
||||
aa2g=1
|
||||
ccode=ALL
|
||||
|
||||
pa0itssit=0x20
|
||||
extpagain2g=0
|
||||
#PA parameters for 2.4GHz, measured at CHIP OUTPUT
|
||||
pa2ga0=-168,7161,-820
|
||||
AvVmid_c0=0x0,0xc8
|
||||
cckpwroffset0=5
|
||||
|
||||
# PPR params
|
||||
maxp2ga0=84
|
||||
txpwrbckof=6
|
||||
cckbw202gpo=0
|
||||
legofdmbw202gpo=0x66111111
|
||||
mcsbw202gpo=0x77711111
|
||||
propbw202gpo=0xdd
|
||||
|
||||
# OFDM IIR :
|
||||
ofdmdigfilttype=18
|
||||
ofdmdigfilttypebe=18
|
||||
# PAPD mode:
|
||||
papdmode=1
|
||||
papdvalidtest=1
|
||||
pacalidx2g=42
|
||||
papdepsoffset=-22
|
||||
papdendidx=58
|
||||
|
||||
# LTECX flags
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0102
|
||||
ltecxfnsel=0x44
|
||||
ltecxgcigpio=0x01
|
||||
|
||||
il0macaddr=00:90:4c:c5:12:38
|
||||
wl0id=0x431b
|
||||
|
||||
deadman_to=0xffffffff
|
||||
# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
|
||||
muxenab=0x1
|
||||
# CLDO PWM voltage settings - 0x4 - 1.1 volt
|
||||
#cldo_pwm=0x4
|
||||
|
||||
#VCO freq 326.4MHz
|
||||
spurconfig=0x3
|
||||
|
||||
edonthd20l=-75
|
||||
edoffthd20ul=-80
|
BIN
platforms/rpi3+/brcmfmac43455-sdio.clm_blob
Normal file
BIN
platforms/rpi3+/brcmfmac43455-sdio.clm_blob
Normal file
Binary file not shown.
92
platforms/rpi3+/brcmfmac43455-sdio.txt
Normal file
92
platforms/rpi3+/brcmfmac43455-sdio.txt
Normal file
@ -0,0 +1,92 @@
|
||||
# Cloned from bcm94345wlpagb_p2xx.txt
|
||||
NVRAMRev=$Rev: 498373 $
|
||||
sromrev=11
|
||||
vendid=0x14e4
|
||||
devid=0x43ab
|
||||
manfid=0x2d0
|
||||
prodid=0x06e4
|
||||
#macaddr=00:90:4c:c5:12:38
|
||||
macaddr=b8:27:eb:74:f2:6c
|
||||
nocrc=1
|
||||
boardtype=0x6e4
|
||||
boardrev=0x1304
|
||||
|
||||
#XTAL 37.4MHz
|
||||
xtalfreq=37400
|
||||
|
||||
btc_mode=1
|
||||
#------------------------------------------------------
|
||||
#boardflags: 5GHz eTR switch by default
|
||||
# 2.4GHz eTR switch by default
|
||||
# bit1 for btcoex
|
||||
boardflags=0x00480201
|
||||
boardflags2=0x40800000
|
||||
boardflags3=0x48200100
|
||||
phycal_tempdelta=15
|
||||
rxchain=1
|
||||
txchain=1
|
||||
aa2g=1
|
||||
aa5g=1
|
||||
tssipos5g=1
|
||||
tssipos2g=1
|
||||
femctrl=0
|
||||
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
|
||||
pa2ga0=-129,6525,-718
|
||||
pa2ga1=-149,4408,-601
|
||||
pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
|
||||
pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
|
||||
itrsw=1
|
||||
pdoffsetcckma0=2
|
||||
pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
|
||||
pdoffset2g40ma0=16
|
||||
pdoffset40ma0=0x8888
|
||||
pdoffset80ma0=0x8888
|
||||
extpagain5g=2
|
||||
extpagain2g=2
|
||||
tworangetssi2g=1
|
||||
tworangetssi5g=1
|
||||
# LTECX flags
|
||||
# WCI2
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0504
|
||||
ltecxfnsel=0x22
|
||||
ltecxgcigpio=0x32
|
||||
|
||||
maxp2ga0=80
|
||||
ofdmlrbw202gpo=0x0022
|
||||
dot11agofdmhrbw202gpo=0x4442
|
||||
mcsbw202gpo=0x98444422
|
||||
mcsbw402gpo=0x98444422
|
||||
maxp5ga0=82,82,82,82
|
||||
mcsbw205glpo=0xb9555000
|
||||
mcsbw205gmpo=0xb9555000
|
||||
mcsbw205ghpo=0xb9555000
|
||||
mcsbw405glpo=0xb9555000
|
||||
mcsbw405gmpo=0xb9555000
|
||||
mcsbw405ghpo=0xb9555000
|
||||
mcsbw805glpo=0xb9555000
|
||||
mcsbw805gmpo=0xb9555000
|
||||
mcsbw805ghpo=0xb9555000
|
||||
|
||||
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
|
||||
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
|
||||
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
|
||||
vcodivmode=1
|
||||
deadman_to=481500000
|
||||
|
||||
ed_thresh2g=-54
|
||||
ed_thresh5g=-54
|
||||
eu_edthresh2g=-54
|
||||
eu_edthresh5g=-54
|
||||
ldo1=4
|
||||
rawtempsense=0x1ff
|
||||
cckPwrIdxCorr=3
|
||||
cckTssiDelay=150
|
||||
ofdmTssiDelay=150
|
||||
txpwr2gAdcScale=1
|
||||
txpwr5gAdcScale=1
|
||||
dot11b_opts=0x3aa85
|
||||
cbfilttype=1
|
||||
fdsslevel_ch11=6
|
10
platforms/rpi3+/extlinux.conf
Normal file
10
platforms/rpi3+/extlinux.conf
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default linux
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
65
platforms/rpi3+/mageia4arm.cfg
Normal file
65
platforms/rpi3+/mageia4arm.cfg
Normal file
@ -0,0 +1,65 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="3+"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/${MAGEIA_VERSION}/${ARM_VERSION}"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
|
||||
# image will be created here
|
||||
# INSTALL_PATH="/mnt/perso/raspi-test"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="${INSTALL_PATH}/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}.img"
|
||||
|
||||
#Default user
|
||||
ID_USER="pi"
|
||||
PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="${TARGET}"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
SEPARATE_BOOT_PARTITION=1
|
||||
BOOTFS="vfat"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0'
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="${INSTALL_PATH}"
|
||||
FIRMWARE_DIR="firmware-stable"
|
||||
FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"
|
||||
|
3
platforms/rpi3+/modprobe.conf
Normal file
3
platforms/rpi3+/modprobe.conf
Normal file
@ -0,0 +1,3 @@
|
||||
alias wlan0 brcmfmac
|
||||
alias eth0 smsc95xx
|
||||
alias usb0 rndis_host
|
43
platforms/rpi3+/second_stage_install.sh
Normal file
43
platforms/rpi3+/second_stage_install.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage
|
||||
|
||||
/usr/bin/chown :systemd-journal -R /var/log/journal
|
||||
|
||||
#Install all packages you need
|
||||
# No verifying rpm due to a bug in packages, some are not signed
|
||||
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make binutils dracut u-boot rsync kernel-desktop-latest mlocate drakx-kbd-mouse-x11 glibc-i18ndata
|
||||
|
||||
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
||||
/usr/bin/chown :daemon /etc/wpa_supplicant.conf
|
||||
/usr/bin/chown :tty /bin/write /bin/wall
|
||||
/usr/bin/chown :lock /sbin/lockdev
|
||||
/usr/bin/chown :bin /sbin/traceroute
|
||||
/usr/bin/chown polkitd /etc/polkit-1/rules.d
|
||||
|
||||
KV=`basename /boot/vmlinuz-*`
|
||||
KV=${KV#vmlinuz-}
|
||||
dracut --kver $KV
|
||||
rm -f $0
|
||||
cp /boot/vmlinuz-* /boot/vmlinuz
|
||||
cp /boot/initrd-* /boot/initrd
|
||||
|
||||
alternatives --set soundprofile /etc/sound/profiles/alsa
|
147
platforms/rpi3+/specialFunctions.sh
Executable file
147
platforms/rpi3+/specialFunctions.sh
Executable file
@ -0,0 +1,147 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#RPI partitionning :
|
||||
DEFAULT=""
|
||||
NEW_PART=n
|
||||
PRIMARY=p
|
||||
CHANGE_TYPE=t
|
||||
CHANGE_BOOTFLAG=a
|
||||
APPLY=w
|
||||
|
||||
PART_BOOT=1
|
||||
PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_BOOT_SIZE="+128M"
|
||||
|
||||
PART_ROOT=2
|
||||
PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
TYPE_FAT32LBA=c
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
title "Creating Pi image"
|
||||
|
||||
if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists
|
||||
echo "$(ls *.zip| wc -l)"
|
||||
if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists
|
||||
warning "The raspberry pi firmware need to be downloaded"
|
||||
info "Downloading FIRMWARE_FILENAME"
|
||||
wget ${FIRMWARE_DOWNLOAD_URL}
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
info "extracting firmware"
|
||||
unzip -d "${FIRMWARE_PATH}" *.zip
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
title "Making raspberry pi image"
|
||||
return 0
|
||||
}
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
info "copying 10-vchiq-permissions.rules"
|
||||
cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/"
|
||||
info "Making /etc/modules"
|
||||
echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules
|
||||
|
||||
ARM_BOOT="${BUILD_PATH}/mnt/arm_boot"
|
||||
if ! [ -d "${ARM_BOOT}" ]; then
|
||||
mkdir -p "${ARM_BOOT}"
|
||||
fi
|
||||
info "copying modprobe.conf"
|
||||
/usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/"
|
||||
chown root:root "${BUILD_PATH}/etc/modprobe.conf"
|
||||
|
||||
info "copying firmware, overlays in rpi boot partition"
|
||||
# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/"
|
||||
cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/"
|
||||
|
||||
info "copying u-boot binary to ${ARM_BOOT}"
|
||||
case ${TARGET_VERSION} in
|
||||
"0")
|
||||
info "copying u-boot for ${TARGET} 0"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"1")
|
||||
info "copying u-boot for ${TARGET} 1"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"2")
|
||||
info "copying u-boot for ${TARGET} 2"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3_32")
|
||||
info "copying u-boot for ${TARGET} 3 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3+")
|
||||
info "copying u-boot for ${TARGET} 3b+ 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
esac
|
||||
|
||||
# info "copying raspberry optionals files in opt"
|
||||
# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/"
|
||||
|
||||
info "copying wifi firmware file missing in kernel-firmware-nonfree"
|
||||
if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then
|
||||
/bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/"
|
||||
fi
|
||||
if ! [[ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]]; then
|
||||
/bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
fi
|
||||
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -rlptogDH --exclude "${ARM_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||
/bin/rsync -rlptogDH "${ARM_BOOT}/" "${BOOT}/"
|
||||
return 0
|
||||
}
|
1
platforms/rpi3+64/10-vchiq-permissions.rules
Normal file
1
platforms/rpi3+64/10-vchiq-permissions.rules
Normal file
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
|
66
platforms/rpi3+64/brcmfmac43430-sdio.txt
Normal file
66
platforms/rpi3+64/brcmfmac43430-sdio.txt
Normal file
@ -0,0 +1,66 @@
|
||||
# NVRAM file for BCM943430WLPTH
|
||||
# 2.4 GHz, 20 MHz BW mode
|
||||
|
||||
# The following parameter values are just placeholders, need to be updated.
|
||||
manfid=0x2d0
|
||||
prodid=0x0727
|
||||
vendid=0x14e4
|
||||
devid=0x43e2
|
||||
boardtype=0x0727
|
||||
boardrev=0x1101
|
||||
boardnum=22
|
||||
macaddr=00:90:4c:c5:12:38
|
||||
sromrev=11
|
||||
boardflags=0x00404201
|
||||
boardflags3=0x08000000
|
||||
xtalfreq=37400
|
||||
nocrc=1
|
||||
ag0=255
|
||||
aa2g=1
|
||||
ccode=ALL
|
||||
|
||||
pa0itssit=0x20
|
||||
extpagain2g=0
|
||||
#PA parameters for 2.4GHz, measured at CHIP OUTPUT
|
||||
pa2ga0=-168,7161,-820
|
||||
AvVmid_c0=0x0,0xc8
|
||||
cckpwroffset0=5
|
||||
|
||||
# PPR params
|
||||
maxp2ga0=84
|
||||
txpwrbckof=6
|
||||
cckbw202gpo=0
|
||||
legofdmbw202gpo=0x66111111
|
||||
mcsbw202gpo=0x77711111
|
||||
propbw202gpo=0xdd
|
||||
|
||||
# OFDM IIR :
|
||||
ofdmdigfilttype=18
|
||||
ofdmdigfilttypebe=18
|
||||
# PAPD mode:
|
||||
papdmode=1
|
||||
papdvalidtest=1
|
||||
pacalidx2g=42
|
||||
papdepsoffset=-22
|
||||
papdendidx=58
|
||||
|
||||
# LTECX flags
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0102
|
||||
ltecxfnsel=0x44
|
||||
ltecxgcigpio=0x01
|
||||
|
||||
il0macaddr=00:90:4c:c5:12:38
|
||||
wl0id=0x431b
|
||||
|
||||
deadman_to=0xffffffff
|
||||
# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
|
||||
muxenab=0x1
|
||||
# CLDO PWM voltage settings - 0x4 - 1.1 volt
|
||||
#cldo_pwm=0x4
|
||||
|
||||
#VCO freq 326.4MHz
|
||||
spurconfig=0x3
|
||||
|
||||
edonthd20l=-75
|
||||
edoffthd20ul=-80
|
BIN
platforms/rpi3+64/brcmfmac43455-sdio.clm_blob
Normal file
BIN
platforms/rpi3+64/brcmfmac43455-sdio.clm_blob
Normal file
Binary file not shown.
92
platforms/rpi3+64/brcmfmac43455-sdio.txt
Normal file
92
platforms/rpi3+64/brcmfmac43455-sdio.txt
Normal file
@ -0,0 +1,92 @@
|
||||
# Cloned from bcm94345wlpagb_p2xx.txt
|
||||
NVRAMRev=$Rev: 498373 $
|
||||
sromrev=11
|
||||
vendid=0x14e4
|
||||
devid=0x43ab
|
||||
manfid=0x2d0
|
||||
prodid=0x06e4
|
||||
#macaddr=00:90:4c:c5:12:38
|
||||
macaddr=b8:27:eb:74:f2:6c
|
||||
nocrc=1
|
||||
boardtype=0x6e4
|
||||
boardrev=0x1304
|
||||
|
||||
#XTAL 37.4MHz
|
||||
xtalfreq=37400
|
||||
|
||||
btc_mode=1
|
||||
#------------------------------------------------------
|
||||
#boardflags: 5GHz eTR switch by default
|
||||
# 2.4GHz eTR switch by default
|
||||
# bit1 for btcoex
|
||||
boardflags=0x00480201
|
||||
boardflags2=0x40800000
|
||||
boardflags3=0x48200100
|
||||
phycal_tempdelta=15
|
||||
rxchain=1
|
||||
txchain=1
|
||||
aa2g=1
|
||||
aa5g=1
|
||||
tssipos5g=1
|
||||
tssipos2g=1
|
||||
femctrl=0
|
||||
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
|
||||
pa2ga0=-129,6525,-718
|
||||
pa2ga1=-149,4408,-601
|
||||
pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
|
||||
pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
|
||||
itrsw=1
|
||||
pdoffsetcckma0=2
|
||||
pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
|
||||
pdoffset2g40ma0=16
|
||||
pdoffset40ma0=0x8888
|
||||
pdoffset80ma0=0x8888
|
||||
extpagain5g=2
|
||||
extpagain2g=2
|
||||
tworangetssi2g=1
|
||||
tworangetssi5g=1
|
||||
# LTECX flags
|
||||
# WCI2
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0504
|
||||
ltecxfnsel=0x22
|
||||
ltecxgcigpio=0x32
|
||||
|
||||
maxp2ga0=80
|
||||
ofdmlrbw202gpo=0x0022
|
||||
dot11agofdmhrbw202gpo=0x4442
|
||||
mcsbw202gpo=0x98444422
|
||||
mcsbw402gpo=0x98444422
|
||||
maxp5ga0=82,82,82,82
|
||||
mcsbw205glpo=0xb9555000
|
||||
mcsbw205gmpo=0xb9555000
|
||||
mcsbw205ghpo=0xb9555000
|
||||
mcsbw405glpo=0xb9555000
|
||||
mcsbw405gmpo=0xb9555000
|
||||
mcsbw405ghpo=0xb9555000
|
||||
mcsbw805glpo=0xb9555000
|
||||
mcsbw805gmpo=0xb9555000
|
||||
mcsbw805ghpo=0xb9555000
|
||||
|
||||
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
|
||||
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
|
||||
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
|
||||
vcodivmode=1
|
||||
deadman_to=481500000
|
||||
|
||||
ed_thresh2g=-54
|
||||
ed_thresh5g=-54
|
||||
eu_edthresh2g=-54
|
||||
eu_edthresh5g=-54
|
||||
ldo1=4
|
||||
rawtempsense=0x1ff
|
||||
cckPwrIdxCorr=3
|
||||
cckTssiDelay=150
|
||||
ofdmTssiDelay=150
|
||||
txpwr2gAdcScale=1
|
||||
txpwr5gAdcScale=1
|
||||
dot11b_opts=0x3aa85
|
||||
cbfilttype=1
|
||||
fdsslevel_ch11=6
|
10
platforms/rpi3+64/extlinux.conf
Normal file
10
platforms/rpi3+64/extlinux.conf
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default linux
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
101
platforms/rpi3+64/mageia4arm.cfg
Normal file
101
platforms/rpi3+64/mageia4arm.cfg
Normal file
@ -0,0 +1,101 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="aarch64"
|
||||
# ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="3+64"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/${MAGEIA_VERSION}/${ARM_VERSION}"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
|
||||
# image will be created here
|
||||
# INSTALL_PATH="/mnt/perso/raspi-test"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="${INSTALL_PATH}/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}.img"
|
||||
|
||||
#Default user
|
||||
# ID_USER="pi"
|
||||
# PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
# ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="${TARGET}"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
SEPARATE_BOOT_PARTITION=1
|
||||
BOOTFS="vfat"
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0'
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
||||
INFORMATION="
|
||||
https://elinux.org/RPi_Software
|
||||
https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
|
||||
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/bootcode.bin
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/bcm2710-rpi-3-b-plus.dtb
|
||||
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4.dat #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4.elf #Rpi4
|
||||
|
||||
#Debug (implicitly used with start_debug=1)
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup_db.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start_db.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4db.elf #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4db.dat #Rpi4
|
||||
|
||||
#Low GPU Memory (=16MB)
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup_cd.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start_cd.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4cd.elf #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4cd.dat #Rpi4
|
||||
|
||||
#Testing versions (eXtra features) (like camera module) (implicitly used with start_x=1 ) :
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup_x.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start_x.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4x.elf #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4x.dat #Rpi4
|
||||
"
|
||||
FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/bcm2710-rpi-3-b-plus.dtb
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/fixup.dat
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/fixup_x.dat
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/start_x.elf
|
||||
"
|
56
platforms/rpi3+64/mageia4arm.cfg.original
Normal file
56
platforms/rpi3+64/mageia4arm.cfg.original
Normal file
@ -0,0 +1,56 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <dtux@free.fr>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
INSTALL_PATH="<change this>"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
#no need to be changed
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Default user
|
||||
ID_USER="pi"
|
||||
PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
#DO NOT CHANGE THIS
|
||||
BOOTFS="vfat"
|
||||
|
||||
#Path where the raspberry pi firmware is/will be downloaded
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
3
platforms/rpi3+64/modprobe.conf
Normal file
3
platforms/rpi3+64/modprobe.conf
Normal file
@ -0,0 +1,3 @@
|
||||
alias wlan0 brcmfmac
|
||||
alias eth0 smsc95xx
|
||||
alias usb0 rndis_host
|
55
platforms/rpi3+64/second_stage_install.sh
Normal file
55
platforms/rpi3+64/second_stage_install.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
export ARCH=arm
|
||||
|
||||
/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage
|
||||
|
||||
/usr/bin/chown :systemd-journal -R /var/log/journal
|
||||
|
||||
#Install all packages you need
|
||||
# No verifying rpm due to a bug in packages, some are not signed
|
||||
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make binutils dracut u-boot rsync kernel-desktop-latest mlocate drakx-kbd-mouse-x11 glibc-i18ndata
|
||||
|
||||
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
||||
/usr/bin/chown :daemon /etc/wpa_supplicant.conf
|
||||
/usr/bin/chown :tty /bin/write /bin/wall
|
||||
/usr/bin/chown :lock /sbin/lockdev
|
||||
/usr/bin/chown :bin /sbin/traceroute
|
||||
/usr/bin/chown polkitd /etc/polkit-1/rules.d
|
||||
|
||||
# KV=$(basename /boot/vmlinuz-*)
|
||||
# KV=${KV#vmlinuz-}
|
||||
# dracut --kver $KV
|
||||
|
||||
VMLINUZ=$(ls --sort=time -1 /boot/vmlinuz-[[:digit:]]* | head -n 1)
|
||||
# Normally, /boot/vmlinuz is generated with the /sbin/installkernel script, but it is not generated with chroot.
|
||||
rm -f /boot/vmlinuz
|
||||
ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
|
||||
|
||||
rm -f ${0}
|
||||
|
||||
K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
|
||||
dracut --no-compress --force --no-hostonly --local --no-early-microcode --confdir "/etc/dracut.conf.d" --kmoddir="/lib/modules/${K_INST_VERSION}" --xz --printsize --kernel-image /boot/vmlinuz --fstab /boot/initrd-${K_INST_VERSION}.img ${K_INST_VERSION}
|
||||
ln -r -s /boot/initrd-${K_INST_VERSION}.img /boot/initrd.img
|
||||
echo "Dracut done."
|
||||
|
||||
alternatives --set soundprofile /etc/sound/profiles/alsa
|
155
platforms/rpi3+64/specialFunctions.sh
Executable file
155
platforms/rpi3+64/specialFunctions.sh
Executable file
@ -0,0 +1,155 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#RPI partitionning :
|
||||
DEFAULT=""
|
||||
NEW_PART=n
|
||||
PRIMARY=p
|
||||
CHANGE_TYPE=t
|
||||
CHANGE_BOOTFLAG=a
|
||||
APPLY=w
|
||||
|
||||
PART_BOOT=1
|
||||
PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_BOOT_SIZE="+128M"
|
||||
|
||||
PART_ROOT=2
|
||||
PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
TYPE_FAT32LBA=c
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
|
||||
title "Download binary blob for Rpi"
|
||||
for i in ${FIRMWARE_DOWNLOAD_URL}; do
|
||||
info "Download ${i}"
|
||||
curl -L -O -J ${i} -s
|
||||
done
|
||||
|
||||
# if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists
|
||||
# echo "$(ls *.zip| wc -l)"
|
||||
# if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists
|
||||
# warning "The raspberry pi firmware need to be downloaded"
|
||||
# info "Downloading FIRMWARE_FILENAME"
|
||||
# wget ${FIRMWARE_DOWNLOAD_URL}
|
||||
# # curl -L -O -J ${FIRMWARE_DOWNLOAD_URL}
|
||||
# # curl -L ${FIRMWARE_DOWNLOAD_URL} -o firmware-stable.zip
|
||||
# if [ ${?} -ne 0 ]; then
|
||||
# error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting"
|
||||
# exit 1
|
||||
# fi
|
||||
# fi
|
||||
# info "extracting firmware"
|
||||
# unzip -d "${FIRMWARE_PATH}" *.zip
|
||||
# if [ ${?} -ne 0 ]; then
|
||||
# error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting"
|
||||
# exit 1
|
||||
# fi
|
||||
# fi
|
||||
|
||||
title "Creating Pi image"
|
||||
title "Making raspberry pi image"
|
||||
return 0
|
||||
}
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
info "copying 10-vchiq-permissions.rules"
|
||||
cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/"
|
||||
info "Making /etc/modules"
|
||||
echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules
|
||||
|
||||
ARM_BOOT="${BUILD_PATH}/mnt/arm_boot"
|
||||
if ! [ -d "${ARM_BOOT}" ]; then
|
||||
mkdir -p "${ARM_BOOT}"
|
||||
fi
|
||||
info "copying modprobe.conf"
|
||||
/usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/"
|
||||
chown root:root "${BUILD_PATH}/etc/modprobe.conf"
|
||||
|
||||
info "copying firmware, overlays in rpi boot partition"
|
||||
# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/"
|
||||
cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/"
|
||||
|
||||
info "copying u-boot binary to ${ARM_BOOT}"
|
||||
case ${TARGET_VERSION} in
|
||||
"0")
|
||||
info "copying u-boot for ${TARGET} 0"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"1")
|
||||
info "copying u-boot for ${TARGET} 1"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"2")
|
||||
info "copying u-boot for ${TARGET} 2"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3_32")
|
||||
info "copying u-boot for ${TARGET} 3 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3+")
|
||||
info "copying u-boot for ${TARGET} 3b+ 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
esac
|
||||
|
||||
# info "copying raspberry optionals files in opt"
|
||||
# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/"
|
||||
|
||||
info "copying wifi firmware file missing in kernel-firmware-nonfree"
|
||||
if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then
|
||||
/bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/"
|
||||
fi
|
||||
if ! [[ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]]; then
|
||||
/bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
fi
|
||||
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -rlptogDH --exclude "${ARM_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||
/bin/rsync -rlptogDH "${ARM_BOOT}/" "${BOOT}/"
|
||||
return 0
|
||||
}
|
3
platforms/rpi3/10-monitor.conf
Normal file
3
platforms/rpi3/10-monitor.conf
Normal file
@ -0,0 +1,3 @@
|
||||
Section "Extensions"
|
||||
Option "DPMS" "Disable"
|
||||
EndSection
|
1
platforms/rpi3/10-vchiq-permissions.rules
Normal file
1
platforms/rpi3/10-vchiq-permissions.rules
Normal file
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
|
66
platforms/rpi3/brcmfmac43430-sdio.txt
Normal file
66
platforms/rpi3/brcmfmac43430-sdio.txt
Normal file
@ -0,0 +1,66 @@
|
||||
# NVRAM file for BCM943430WLPTH
|
||||
# 2.4 GHz, 20 MHz BW mode
|
||||
|
||||
# The following parameter values are just placeholders, need to be updated.
|
||||
manfid=0x2d0
|
||||
prodid=0x0727
|
||||
vendid=0x14e4
|
||||
devid=0x43e2
|
||||
boardtype=0x0727
|
||||
boardrev=0x1101
|
||||
boardnum=22
|
||||
macaddr=00:90:4c:c5:12:38
|
||||
sromrev=11
|
||||
boardflags=0x00404201
|
||||
boardflags3=0x08000000
|
||||
xtalfreq=37400
|
||||
nocrc=1
|
||||
ag0=255
|
||||
aa2g=1
|
||||
ccode=ALL
|
||||
|
||||
pa0itssit=0x20
|
||||
extpagain2g=0
|
||||
#PA parameters for 2.4GHz, measured at CHIP OUTPUT
|
||||
pa2ga0=-168,7161,-820
|
||||
AvVmid_c0=0x0,0xc8
|
||||
cckpwroffset0=5
|
||||
|
||||
# PPR params
|
||||
maxp2ga0=84
|
||||
txpwrbckof=6
|
||||
cckbw202gpo=0
|
||||
legofdmbw202gpo=0x66111111
|
||||
mcsbw202gpo=0x77711111
|
||||
propbw202gpo=0xdd
|
||||
|
||||
# OFDM IIR :
|
||||
ofdmdigfilttype=18
|
||||
ofdmdigfilttypebe=18
|
||||
# PAPD mode:
|
||||
papdmode=1
|
||||
papdvalidtest=1
|
||||
pacalidx2g=42
|
||||
papdepsoffset=-22
|
||||
papdendidx=58
|
||||
|
||||
# LTECX flags
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0102
|
||||
ltecxfnsel=0x44
|
||||
ltecxgcigpio=0x01
|
||||
|
||||
il0macaddr=00:90:4c:c5:12:38
|
||||
wl0id=0x431b
|
||||
|
||||
deadman_to=0xffffffff
|
||||
# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
|
||||
muxenab=0x1
|
||||
# CLDO PWM voltage settings - 0x4 - 1.1 volt
|
||||
#cldo_pwm=0x4
|
||||
|
||||
#VCO freq 326.4MHz
|
||||
spurconfig=0x3
|
||||
|
||||
edonthd20l=-75
|
||||
edoffthd20ul=-80
|
BIN
platforms/rpi3/brcmfmac43455-sdio.clm_blob
Normal file
BIN
platforms/rpi3/brcmfmac43455-sdio.clm_blob
Normal file
Binary file not shown.
92
platforms/rpi3/brcmfmac43455-sdio.txt
Normal file
92
platforms/rpi3/brcmfmac43455-sdio.txt
Normal file
@ -0,0 +1,92 @@
|
||||
# Cloned from bcm94345wlpagb_p2xx.txt
|
||||
NVRAMRev=$Rev: 498373 $
|
||||
sromrev=11
|
||||
vendid=0x14e4
|
||||
devid=0x43ab
|
||||
manfid=0x2d0
|
||||
prodid=0x06e4
|
||||
#macaddr=00:90:4c:c5:12:38
|
||||
macaddr=b8:27:eb:74:f2:6c
|
||||
nocrc=1
|
||||
boardtype=0x6e4
|
||||
boardrev=0x1304
|
||||
|
||||
#XTAL 37.4MHz
|
||||
xtalfreq=37400
|
||||
|
||||
btc_mode=1
|
||||
#------------------------------------------------------
|
||||
#boardflags: 5GHz eTR switch by default
|
||||
# 2.4GHz eTR switch by default
|
||||
# bit1 for btcoex
|
||||
boardflags=0x00480201
|
||||
boardflags2=0x40800000
|
||||
boardflags3=0x48200100
|
||||
phycal_tempdelta=15
|
||||
rxchain=1
|
||||
txchain=1
|
||||
aa2g=1
|
||||
aa5g=1
|
||||
tssipos5g=1
|
||||
tssipos2g=1
|
||||
femctrl=0
|
||||
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
|
||||
pa2ga0=-129,6525,-718
|
||||
pa2ga1=-149,4408,-601
|
||||
pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
|
||||
pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
|
||||
itrsw=1
|
||||
pdoffsetcckma0=2
|
||||
pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
|
||||
pdoffset2g40ma0=16
|
||||
pdoffset40ma0=0x8888
|
||||
pdoffset80ma0=0x8888
|
||||
extpagain5g=2
|
||||
extpagain2g=2
|
||||
tworangetssi2g=1
|
||||
tworangetssi5g=1
|
||||
# LTECX flags
|
||||
# WCI2
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0504
|
||||
ltecxfnsel=0x22
|
||||
ltecxgcigpio=0x32
|
||||
|
||||
maxp2ga0=80
|
||||
ofdmlrbw202gpo=0x0022
|
||||
dot11agofdmhrbw202gpo=0x4442
|
||||
mcsbw202gpo=0x98444422
|
||||
mcsbw402gpo=0x98444422
|
||||
maxp5ga0=82,82,82,82
|
||||
mcsbw205glpo=0xb9555000
|
||||
mcsbw205gmpo=0xb9555000
|
||||
mcsbw205ghpo=0xb9555000
|
||||
mcsbw405glpo=0xb9555000
|
||||
mcsbw405gmpo=0xb9555000
|
||||
mcsbw405ghpo=0xb9555000
|
||||
mcsbw805glpo=0xb9555000
|
||||
mcsbw805gmpo=0xb9555000
|
||||
mcsbw805ghpo=0xb9555000
|
||||
|
||||
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
|
||||
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
|
||||
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
|
||||
vcodivmode=1
|
||||
deadman_to=481500000
|
||||
|
||||
ed_thresh2g=-54
|
||||
ed_thresh5g=-54
|
||||
eu_edthresh2g=-54
|
||||
eu_edthresh5g=-54
|
||||
ldo1=4
|
||||
rawtempsense=0x1ff
|
||||
cckPwrIdxCorr=3
|
||||
cckTssiDelay=150
|
||||
ofdmTssiDelay=150
|
||||
txpwr2gAdcScale=1
|
||||
txpwr5gAdcScale=1
|
||||
dot11b_opts=0x3aa85
|
||||
cbfilttype=1
|
||||
fdsslevel_ch11=6
|
10
platforms/rpi3/extlinux.conf
Normal file
10
platforms/rpi3/extlinux.conf
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default linux
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
69
platforms/rpi3/mageia4arm.cfg
Normal file
69
platforms/rpi3/mageia4arm.cfg
Normal file
@ -0,0 +1,69 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
# Activate / deactivate nonfree et tainted
|
||||
# value 0 to deactivate or 1 to activate
|
||||
NONFREE="0"
|
||||
TAINTED="0"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="3_32"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
|
||||
INSTALL_PATH="/mnt/perso/raspi-test"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Default user
|
||||
ID_USER="pi"
|
||||
PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
BOOTFS="vfat"
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0'
|
||||
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
||||
FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"
|
||||
|
59
platforms/rpi3/mageia4arm.cfg.original
Normal file
59
platforms/rpi3/mageia4arm.cfg.original
Normal file
@ -0,0 +1,59 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <dtux@free.fr>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="3_32"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
INSTALL_PATH="<change this>"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
#no need to be changed
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Default user
|
||||
ID_USER="pi"
|
||||
PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
#DO NOT CHANGE THIS
|
||||
BOOTFS="vfat"
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
3
platforms/rpi3/modprobe.conf
Normal file
3
platforms/rpi3/modprobe.conf
Normal file
@ -0,0 +1,3 @@
|
||||
alias wlan0 brcmfmac
|
||||
alias eth0 smsc95xx
|
||||
alias usb0 rndis_host
|
43
platforms/rpi3/second_stage_install.sh
Normal file
43
platforms/rpi3/second_stage_install.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage
|
||||
|
||||
/usr/bin/chown :systemd-journal -R /var/log/journal
|
||||
|
||||
#Install all packages you need
|
||||
# No verifying rpm due to a bug in packages, some are not signed
|
||||
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make binutils dracut u-boot rsync kernel-desktop-latest mlocate drakx-kbd-mouse-x11 glibc-i18ndata
|
||||
|
||||
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
||||
/usr/bin/chown :daemon /etc/wpa_supplicant.conf
|
||||
/usr/bin/chown :tty /bin/write /bin/wall
|
||||
/usr/bin/chown :lock /sbin/lockdev
|
||||
/usr/bin/chown :bin /sbin/traceroute
|
||||
/usr/bin/chown polkitd /etc/polkit-1/rules.d
|
||||
|
||||
KV=`basename /boot/vmlinuz-*`
|
||||
KV=${KV#vmlinuz-}
|
||||
dracut --kver $KV
|
||||
rm -f $0
|
||||
cp /boot/vmlinuz-* /boot/vmlinuz
|
||||
cp /boot/initrd-* /boot/initrd
|
||||
|
||||
alternatives --set soundprofile /etc/sound/profiles/alsa
|
146
platforms/rpi3/specialFunctions.sh
Executable file
146
platforms/rpi3/specialFunctions.sh
Executable file
@ -0,0 +1,146 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#RPI partitionning :
|
||||
DEFAULT=""
|
||||
NEW_PART=n
|
||||
PRIMARY=p
|
||||
CHANGE_TYPE=t
|
||||
CHANGE_BOOTFLAG=a
|
||||
APPLY=w
|
||||
|
||||
PART_BOOT=1
|
||||
PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_BOOT_SIZE="+128M"
|
||||
|
||||
PART_ROOT=2
|
||||
PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
TYPE_FAT32LBA=c
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
title "Creating Pi image"
|
||||
|
||||
if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists
|
||||
echo "$(ls *.zip| wc -l)"
|
||||
if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists
|
||||
warning "The raspberry pi firmware need to be downloaded"
|
||||
info "Downloading FIRMWARE_FILENAME"
|
||||
wget ${FIRMWARE_DOWNLOAD_URL}
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
info "extracting firmware"
|
||||
unzip -d "${FIRMWARE_PATH}" *.zip
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
title "Making raspberry pi image"
|
||||
return 0
|
||||
}
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
info "copying 10-vchiq-permissions.rules"
|
||||
cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/"
|
||||
info "Making /etc/modules"
|
||||
echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules
|
||||
|
||||
ARM_BOOT="${BUILD_PATH}/mnt/arm_boot"
|
||||
if ! [ -d "${ARM_BOOT}" ]; then
|
||||
mkdir -p "${ARM_BOOT}"
|
||||
fi
|
||||
info "copying modprobe.conf"
|
||||
/usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/"
|
||||
chown root:root "${BUILD_PATH}/etc/modprobe.conf"
|
||||
|
||||
info "copying firmware, overlays in rpi boot partition"
|
||||
# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/"
|
||||
cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/"
|
||||
|
||||
info "copying u-boot binary to ${ARM_BOOT}"
|
||||
case ${TARGET_VERSION} in
|
||||
"0")
|
||||
info "copying u-boot for ${TARGET} 0"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"1")
|
||||
info "copying u-boot for ${TARGET} 1"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"2")
|
||||
info "copying u-boot for ${TARGET} 2"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3_32")
|
||||
info "copying u-boot for ${TARGET} 3 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3+")
|
||||
info "copying u-boot for ${TARGET} 3b+ 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
esac
|
||||
|
||||
# info "copying raspberry optionals files in opt"
|
||||
# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/"
|
||||
|
||||
info "copying wifi firmware file missing in kernel-firmware-nonfree"
|
||||
if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then
|
||||
/bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/"
|
||||
fi
|
||||
if ! [[ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]]; then
|
||||
/bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
fi
|
||||
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -rlptogDH --exclude "${ARM_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||
/bin/rsync -rlptogDH "${ARM_BOOT}/" "${BOOT}/"
|
||||
return 0
|
||||
}
|
1
platforms/rpi4/10-vchiq-permissions.rules
Normal file
1
platforms/rpi4/10-vchiq-permissions.rules
Normal file
@ -0,0 +1 @@
|
||||
SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"
|
BIN
platforms/rpi4/bcm2711-rpi-4-b.dtb
Normal file
BIN
platforms/rpi4/bcm2711-rpi-4-b.dtb
Normal file
Binary file not shown.
66
platforms/rpi4/brcmfmac43430-sdio.txt
Normal file
66
platforms/rpi4/brcmfmac43430-sdio.txt
Normal file
@ -0,0 +1,66 @@
|
||||
# NVRAM file for BCM943430WLPTH
|
||||
# 2.4 GHz, 20 MHz BW mode
|
||||
|
||||
# The following parameter values are just placeholders, need to be updated.
|
||||
manfid=0x2d0
|
||||
prodid=0x0727
|
||||
vendid=0x14e4
|
||||
devid=0x43e2
|
||||
boardtype=0x0727
|
||||
boardrev=0x1101
|
||||
boardnum=22
|
||||
macaddr=00:90:4c:c5:12:38
|
||||
sromrev=11
|
||||
boardflags=0x00404201
|
||||
boardflags3=0x08000000
|
||||
xtalfreq=37400
|
||||
nocrc=1
|
||||
ag0=255
|
||||
aa2g=1
|
||||
ccode=ALL
|
||||
|
||||
pa0itssit=0x20
|
||||
extpagain2g=0
|
||||
#PA parameters for 2.4GHz, measured at CHIP OUTPUT
|
||||
pa2ga0=-168,7161,-820
|
||||
AvVmid_c0=0x0,0xc8
|
||||
cckpwroffset0=5
|
||||
|
||||
# PPR params
|
||||
maxp2ga0=84
|
||||
txpwrbckof=6
|
||||
cckbw202gpo=0
|
||||
legofdmbw202gpo=0x66111111
|
||||
mcsbw202gpo=0x77711111
|
||||
propbw202gpo=0xdd
|
||||
|
||||
# OFDM IIR :
|
||||
ofdmdigfilttype=18
|
||||
ofdmdigfilttypebe=18
|
||||
# PAPD mode:
|
||||
papdmode=1
|
||||
papdvalidtest=1
|
||||
pacalidx2g=42
|
||||
papdepsoffset=-22
|
||||
papdendidx=58
|
||||
|
||||
# LTECX flags
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0102
|
||||
ltecxfnsel=0x44
|
||||
ltecxgcigpio=0x01
|
||||
|
||||
il0macaddr=00:90:4c:c5:12:38
|
||||
wl0id=0x431b
|
||||
|
||||
deadman_to=0xffffffff
|
||||
# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
|
||||
muxenab=0x1
|
||||
# CLDO PWM voltage settings - 0x4 - 1.1 volt
|
||||
#cldo_pwm=0x4
|
||||
|
||||
#VCO freq 326.4MHz
|
||||
spurconfig=0x3
|
||||
|
||||
edonthd20l=-75
|
||||
edoffthd20ul=-80
|
BIN
platforms/rpi4/brcmfmac43455-sdio.clm_blob
Normal file
BIN
platforms/rpi4/brcmfmac43455-sdio.clm_blob
Normal file
Binary file not shown.
92
platforms/rpi4/brcmfmac43455-sdio.txt
Normal file
92
platforms/rpi4/brcmfmac43455-sdio.txt
Normal file
@ -0,0 +1,92 @@
|
||||
# Cloned from bcm94345wlpagb_p2xx.txt
|
||||
NVRAMRev=$Rev: 498373 $
|
||||
sromrev=11
|
||||
vendid=0x14e4
|
||||
devid=0x43ab
|
||||
manfid=0x2d0
|
||||
prodid=0x06e4
|
||||
#macaddr=00:90:4c:c5:12:38
|
||||
macaddr=b8:27:eb:74:f2:6c
|
||||
nocrc=1
|
||||
boardtype=0x6e4
|
||||
boardrev=0x1304
|
||||
|
||||
#XTAL 37.4MHz
|
||||
xtalfreq=37400
|
||||
|
||||
btc_mode=1
|
||||
#------------------------------------------------------
|
||||
#boardflags: 5GHz eTR switch by default
|
||||
# 2.4GHz eTR switch by default
|
||||
# bit1 for btcoex
|
||||
boardflags=0x00480201
|
||||
boardflags2=0x40800000
|
||||
boardflags3=0x48200100
|
||||
phycal_tempdelta=15
|
||||
rxchain=1
|
||||
txchain=1
|
||||
aa2g=1
|
||||
aa5g=1
|
||||
tssipos5g=1
|
||||
tssipos2g=1
|
||||
femctrl=0
|
||||
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
|
||||
pa2ga0=-129,6525,-718
|
||||
pa2ga1=-149,4408,-601
|
||||
pa5ga0=-185,6836,-815,-186,6838,-815,-184,6859,-815,-184,6882,-818
|
||||
pa5ga1=-202,4285,-574,-201,4312,-578,-196,4391,-586,-201,4294,-575
|
||||
itrsw=1
|
||||
pdoffsetcckma0=2
|
||||
pdoffset2gperchan=0,-2,1,0,1,0,1,1,1,0,0,-1,-1,0
|
||||
pdoffset2g40ma0=16
|
||||
pdoffset40ma0=0x8888
|
||||
pdoffset80ma0=0x8888
|
||||
extpagain5g=2
|
||||
extpagain2g=2
|
||||
tworangetssi2g=1
|
||||
tworangetssi5g=1
|
||||
# LTECX flags
|
||||
# WCI2
|
||||
ltecxmux=0
|
||||
ltecxpadnum=0x0504
|
||||
ltecxfnsel=0x22
|
||||
ltecxgcigpio=0x32
|
||||
|
||||
maxp2ga0=80
|
||||
ofdmlrbw202gpo=0x0022
|
||||
dot11agofdmhrbw202gpo=0x4442
|
||||
mcsbw202gpo=0x98444422
|
||||
mcsbw402gpo=0x98444422
|
||||
maxp5ga0=82,82,82,82
|
||||
mcsbw205glpo=0xb9555000
|
||||
mcsbw205gmpo=0xb9555000
|
||||
mcsbw205ghpo=0xb9555000
|
||||
mcsbw405glpo=0xb9555000
|
||||
mcsbw405gmpo=0xb9555000
|
||||
mcsbw405ghpo=0xb9555000
|
||||
mcsbw805glpo=0xb9555000
|
||||
mcsbw805gmpo=0xb9555000
|
||||
mcsbw805ghpo=0xb9555000
|
||||
|
||||
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
|
||||
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
|
||||
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
|
||||
|
||||
vcodivmode=1
|
||||
deadman_to=481500000
|
||||
|
||||
ed_thresh2g=-54
|
||||
ed_thresh5g=-54
|
||||
eu_edthresh2g=-54
|
||||
eu_edthresh5g=-54
|
||||
ldo1=4
|
||||
rawtempsense=0x1ff
|
||||
cckPwrIdxCorr=3
|
||||
cckTssiDelay=150
|
||||
ofdmTssiDelay=150
|
||||
txpwr2gAdcScale=1
|
||||
txpwr5gAdcScale=1
|
||||
dot11b_opts=0x3aa85
|
||||
cbfilttype=1
|
||||
fdsslevel_ch11=6
|
10
platforms/rpi4/extlinux.conf
Normal file
10
platforms/rpi4/extlinux.conf
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default linux
|
||||
|
||||
label linux
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
101
platforms/rpi4/mageia4arm.cfg
Normal file
101
platforms/rpi4/mageia4arm.cfg
Normal file
@ -0,0 +1,101 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="cauldron"
|
||||
ARM_VERSION="aarch64"
|
||||
# ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
#version of the target
|
||||
# 0, 1, 2 ,3_32 for rpi and 3 or 4 for odroid
|
||||
TARGET_VERSION="4"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/${MAGEIA_VERSION}/${ARM_VERSION}"
|
||||
#MIRROR="/mnt/STOCK/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
|
||||
# image will be created here
|
||||
# INSTALL_PATH="/mnt/perso/raspi-test"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="${INSTALL_PATH}/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-${TARGET}.img"
|
||||
|
||||
#Default user
|
||||
# ID_USER="pi"
|
||||
# PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
# ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="${TARGET}"
|
||||
|
||||
#Mount point of image's partitions
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
SEPARATE_BOOT_PARTITION=1
|
||||
BOOTFS="vfat"
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0'
|
||||
|
||||
#Path where the raspberry pi firmware is/will be installed
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
||||
INFORMATION="
|
||||
https://elinux.org/RPi_Software
|
||||
https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
|
||||
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/bootcode.bin
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/bcm2710-rpi-3-b-plus.dtb
|
||||
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4.dat #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4.elf #Rpi4
|
||||
|
||||
#Debug (implicitly used with start_debug=1)
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup_db.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start_db.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4db.elf #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4db.dat #Rpi4
|
||||
|
||||
#Low GPU Memory (=16MB)
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup_cd.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start_cd.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4cd.elf #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4cd.dat #Rpi4
|
||||
|
||||
#Testing versions (eXtra features) (like camera module) (implicitly used with start_x=1 ) :
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup_x.dat
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start_x.elf
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/start4x.elf #Rpi4
|
||||
https://github.com/raspberrypi/firmware/blob/master/boot/fixup4x.dat #Rpi4
|
||||
"
|
||||
FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/bcm2711-rpi-4-b.dtb
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/fixup4.dat
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/start4.elf
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/fixup4x.dat
|
||||
https://github.com/raspberrypi/firmware/raw/master/boot/start4x.elf
|
||||
"
|
56
platforms/rpi4/mageia4arm.cfg.original
Normal file
56
platforms/rpi4/mageia4arm.cfg.original
Normal file
@ -0,0 +1,56 @@
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <dtux@free.fr>
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
|
||||
#target plateform (xu3-4 or rpi)
|
||||
TARGET="rpi"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
INSTALL_PATH="<change this>"
|
||||
|
||||
# Build directory will be created here
|
||||
BUILD_PATH="$INSTALL_PATH/build"
|
||||
|
||||
#name of the image
|
||||
IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET.img"
|
||||
|
||||
#Mount point of image's partitions
|
||||
#no need to be changed
|
||||
BOOT="/mnt/boot"
|
||||
ROOT="/mnt/root"
|
||||
|
||||
#Default user
|
||||
ID_USER="pi"
|
||||
PASSWORD="raspberry"
|
||||
|
||||
#root password
|
||||
ROOT_PWD="piroot"
|
||||
|
||||
#Hostname
|
||||
HOSTNAME="$TARGET.$ID_USER"
|
||||
|
||||
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
|
||||
#DO NOT CHANGE THIS
|
||||
BOOTFS="vfat"
|
||||
|
||||
#Path where the raspberry pi firmware is/will be downloaded
|
||||
FIRMWARE_PATH="$INSTALL_PATH"
|
||||
FIRMWARE_DIR="firmware-stable"
|
3
platforms/rpi4/modprobe.conf
Normal file
3
platforms/rpi4/modprobe.conf
Normal file
@ -0,0 +1,3 @@
|
||||
alias wlan0 brcmfmac
|
||||
alias eth0 smsc95xx
|
||||
alias usb0 rndis_host
|
55
platforms/rpi4/second_stage_install.sh
Normal file
55
platforms/rpi4/second_stage_install.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
export ARCH=arm
|
||||
|
||||
/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage
|
||||
|
||||
/usr/bin/chown :systemd-journal -R /var/log/journal
|
||||
|
||||
#Install all packages you need
|
||||
# No verifying rpm due to a bug in packages, some are not signed
|
||||
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make binutils dracut u-boot rsync kernel-desktop-latest mlocate drakx-kbd-mouse-x11 glibc-i18ndata
|
||||
|
||||
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
||||
/usr/bin/chown :daemon /etc/wpa_supplicant.conf
|
||||
/usr/bin/chown :tty /bin/write /bin/wall
|
||||
/usr/bin/chown :lock /sbin/lockdev
|
||||
/usr/bin/chown :bin /sbin/traceroute
|
||||
/usr/bin/chown polkitd /etc/polkit-1/rules.d
|
||||
|
||||
# KV=$(basename /boot/vmlinuz-*)
|
||||
# KV=${KV#vmlinuz-}
|
||||
# dracut --kver $KV
|
||||
|
||||
VMLINUZ=$(ls --sort=time -1 /boot/vmlinuz-[[:digit:]]* | head -n 1)
|
||||
# Normally, /boot/vmlinuz is generated with the /sbin/installkernel script, but it is not generated with chroot.
|
||||
rm -f /boot/vmlinuz
|
||||
ln -r -s "${VMLINUZ}" /boot/vmlinuz #For extlinux.conf
|
||||
|
||||
rm -f ${0}
|
||||
|
||||
K_INST_VERSION=$(rpm -q kernel-desktop-latest | sed -e 's/kernel-\([[:alnum:]]*\)-latest-\([\.[:digit:]]*\)-\([\.[:alnum:]]*\).*$/\2-\1-\3/')
|
||||
dracut --no-compress --force --no-hostonly --local --no-early-microcode --confdir "/etc/dracut.conf.d" --kmoddir="/lib/modules/${K_INST_VERSION}" --xz --printsize --kernel-image /boot/vmlinuz --fstab /boot/initrd-${K_INST_VERSION}.img ${K_INST_VERSION}
|
||||
ln -r -s /boot/initrd-${K_INST_VERSION}.img /boot/initrd.img
|
||||
echo "Dracut done."
|
||||
|
||||
alternatives --set soundprofile /etc/sound/profiles/alsa
|
159
platforms/rpi4/specialFunctions.sh
Executable file
159
platforms/rpi4/specialFunctions.sh
Executable file
@ -0,0 +1,159 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#RPI partitionning :
|
||||
DEFAULT=""
|
||||
NEW_PART=n
|
||||
PRIMARY=p
|
||||
CHANGE_TYPE=t
|
||||
CHANGE_BOOTFLAG=a
|
||||
APPLY=w
|
||||
|
||||
PART_BOOT=1
|
||||
PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_BOOT_SIZE="+128M"
|
||||
|
||||
PART_ROOT=2
|
||||
PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
TYPE_FAT32LBA=c
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
|
||||
title "Download binary blob for Rpi"
|
||||
for i in ${FIRMWARE_DOWNLOAD_URL}; do
|
||||
info "Download ${i}"
|
||||
curl -L -O -J ${i} -s
|
||||
done
|
||||
|
||||
# if ! [ -d "${FIRMWARE_PATH}/${FIRMWARE_DIR}" ]; then # the firmware directory does not exists
|
||||
# echo "$(ls *.zip| wc -l)"
|
||||
# if [ "$(ls *.zip| wc -l)" -eq 0 ]; then # the firmware archive does not exists
|
||||
# warning "The raspberry pi firmware need to be downloaded"
|
||||
# info "Downloading FIRMWARE_FILENAME"
|
||||
# wget ${FIRMWARE_DOWNLOAD_URL}
|
||||
# # curl -L -O -J ${FIRMWARE_DOWNLOAD_URL}
|
||||
# # curl -L ${FIRMWARE_DOWNLOAD_URL} -o firmware-stable.zip
|
||||
# if [ ${?} -ne 0 ]; then
|
||||
# error "line ${LINENO} error downloading raspberry firmware at ${FIRMWARE_DOWNLOAD_URL}: exiting"
|
||||
# exit 1
|
||||
# fi
|
||||
# fi
|
||||
# info "extracting firmware"
|
||||
# unzip -d "${FIRMWARE_PATH}" *.zip
|
||||
# if [ ${?} -ne 0 ]; then
|
||||
# error "line ${LINENO} error unzipping ${FIRMWARE_PATH} : exiting"
|
||||
# exit 1
|
||||
# fi
|
||||
# fi
|
||||
|
||||
title "Creating Pi image"
|
||||
title "Making raspberry pi image"
|
||||
return 0
|
||||
}
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
#Nothing to do. (Except replacing default function.)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
info "copying 10-vchiq-permissions.rules"
|
||||
cp --preserve=mode "${CONFIG_PATH}/10-vchiq-permissions.rules" "${BUILD_PATH}/etc/udev/rules.d/"
|
||||
info "Making /etc/modules"
|
||||
echo -e "vchiq\nsnd_bcm2835\nvc4\nbrcmfmac" >> "${BUILD_PATH}"/etc/modules
|
||||
|
||||
ARM_BOOT="${BUILD_PATH}/mnt/arm_boot"
|
||||
if ! [ -d "${ARM_BOOT}" ]; then
|
||||
mkdir -p "${ARM_BOOT}"
|
||||
fi
|
||||
info "copying modprobe.conf"
|
||||
/usr/bin/cp -v --preserve=mode "${CONFIG_PATH}/modprobe.conf" "${BUILD_PATH}/etc/"
|
||||
chown root:root "${BUILD_PATH}/etc/modprobe.conf"
|
||||
|
||||
info "copying firmware, overlays in rpi boot partition"
|
||||
# cp -v --preserve=mode "${BUILD_PATH}/usr/lib/linux-"* "${BOOT}/dtb"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/start"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/fixup"* "${ARM_BOOT}/"
|
||||
cp -v --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/bootcode.bin"* "${ARM_BOOT}/"
|
||||
cp -vR --preserve=mode "${FIRMWARE_PATH}/${FIRMWARE_DIR}/boot/overlays" "${ARM_BOOT}/"
|
||||
|
||||
info "copying u-boot binary to ${ARM_BOOT}"
|
||||
case ${TARGET_VERSION} in
|
||||
"0")
|
||||
info "copying u-boot for ${TARGET} 0"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_0_w/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"1")
|
||||
info "copying u-boot for ${TARGET} 1"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"2")
|
||||
info "copying u-boot for ${TARGET} 2"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_2/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3_32")
|
||||
info "copying u-boot for ${TARGET} 3 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"3+")
|
||||
info "copying u-boot for ${TARGET} 3b+ 32 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
"4")
|
||||
info "copying u-boot for ${TARGET} 4 64 bits"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/rpi_4/u-boot.bin" "${ARM_BOOT}/kernel.img"
|
||||
;;
|
||||
esac
|
||||
|
||||
# info "copying raspberry optionals files in opt"
|
||||
# /bin/rsync -rlptDH "${FIRMWARE_PATH}/${FIRMWARE_DIR}/opt/" "${BUILD_PATH}/opt/"
|
||||
|
||||
info "copying wifi firmware file missing in kernel-firmware-nonfree"
|
||||
if ! [ -d "${ROOT}/usr/lib/firmware/brcm/" ]; then
|
||||
/bin/mkdir -p "${ROOT}/usr/lib/firmware/brcm/"
|
||||
fi
|
||||
if ! [[ -f "${ROOT}/usr/lib/firmware/brcm/brcmfmac434"* ]]; then
|
||||
/bin/cp --preserve=mode "${CONFIG_PATH}/brcmfmac434"* "${ROOT}/usr/lib/firmware/brcm/"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error copying wifi firmware in ${ROOTP}/usr/lib/firmware/brcm/ : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
fi
|
||||
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -rlptogDH --exclude "${ARM_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||
/bin/rsync -rlptogDH "${ARM_BOOT}/" "${BOOT}/"
|
||||
return 0
|
||||
}
|
@ -13,11 +13,11 @@ setenv macaddr "00:1e:06:61:7a:87
|
||||
|
||||
|
||||
|
||||
setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0"
|
||||
setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=<UUID> rootwait ro fsck.repair=yes net.ifnames=0"
|
||||
|
||||
|
||||
|
||||
# --- Screen Configuration for HDMI --- #
|
||||
# --- Screen Configuration for HDMI --- #
|
||||
# ---------------------------------------
|
||||
# Uncomment only ONE line! Leave all commented for automatic selection.
|
||||
# Uncomment only the setenv line!
|
||||
@ -43,7 +43,7 @@ setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841
|
||||
# 1440x900 with monitor provided EDID information.
|
||||
# setenv videoconfig "video=HDMI-A-1:1440x900@60"
|
||||
# -----------------------------------------------
|
||||
# 1440x900 without monitor data using generic information
|
||||
# 1440x900 without monitor data using generic information
|
||||
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1440x900.bin"
|
||||
# -----------------------------------------------
|
||||
# 1280x1024 without monitor data using generic information
|
||||
@ -61,16 +61,16 @@ setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841
|
||||
# 1024x600 without monitor data using generic information (ODROID VU7+)
|
||||
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/1024x600.bin"
|
||||
# -----------------------------------------------
|
||||
# 800x600 without monitor data using generic information
|
||||
# 800x600 without monitor data using generic information
|
||||
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/800x600.bin"
|
||||
# -----------------------------------------------
|
||||
# 800x480 without monitor data using generic information (ODROID 7")
|
||||
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/800x480.bin"
|
||||
# -----------------------------------------------
|
||||
# 720x576 without monitor data using generic information
|
||||
# 720x576 without monitor data using generic information
|
||||
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/720x576.bin"
|
||||
# -----------------------------------------------
|
||||
# 720x480 without monitor data using generic information
|
||||
# 720x480 without monitor data using generic information
|
||||
# setenv videoconfig "drm_kms_helper.edid_firmware=edid/720x480.bin"
|
||||
# -----------------------------------------------
|
||||
# 640x480 without monitor data using generic information
|
||||
@ -124,13 +124,13 @@ setenv disable_vu7 "true" # false
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Forces the HDMI subsystem to ignore the check if the cable is connected or
|
||||
# Forces the HDMI subsystem to ignore the check if the cable is connected or
|
||||
# not.
|
||||
# false : disable the detection and force it as connected.
|
||||
# true : let cable, board and monitor decide the connection status.
|
||||
#
|
||||
#
|
||||
# default: true
|
||||
#
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
setenv HPD "true"
|
||||
|
||||
@ -209,7 +209,7 @@ setenv hdmi_phy_control "hdmi_tx_amp_lvl=${hdmi_tx_amp_lvl} hdmi_tx_lvl_ch0=${hd
|
||||
# Load kernel, initrd and dtb in that sequence
|
||||
fatload mmc 0:1 0x40008000 zImage
|
||||
fatload mmc 0:1 0x42000000 uInitrd
|
||||
fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb
|
||||
fatload mmc 0:1 0x44000000 <DTB>
|
||||
|
||||
# set FDT address
|
||||
fdt addr 0x44000000
|
||||
@ -218,7 +218,7 @@ if test "${cecenable}" = "false"; then fdt rm /cec@101B0000; fi
|
||||
if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
|
||||
|
||||
# final boot args
|
||||
setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control} ${hid_quirks}"
|
||||
setenv bootargs "${bootrootfs} ${videoconfig} smsc95xx.macaddr=${macaddr} governor=${governor} ${hdmi_phy_control} ${hid_quirks}"
|
||||
# drm.debug=0xff"
|
||||
# Boot the board
|
||||
bootz 0x40008000 0x42000000 0x44000000
|
BIN
platforms/xu4/boot.tar.gz
Normal file
BIN
platforms/xu4/boot.tar.gz
Normal file
Binary file not shown.
10
platforms/xu4/extlinux.conf
Normal file
10
platforms/xu4/extlinux.conf
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default Mageia
|
||||
|
||||
label Mageia
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> <BOOT_ARGS>
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
10
platforms/xu4/extlinux.conf.orig
Normal file
10
platforms/xu4/extlinux.conf.orig
Normal file
@ -0,0 +1,10 @@
|
||||
menu Welcome to Mageia-Minimal.
|
||||
timeout 20
|
||||
default Mageia
|
||||
|
||||
label Mageia
|
||||
kernel /boot/vmlinuz
|
||||
append root=UUID=<UUID> dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0
|
||||
fdtdir /usr/lib/<FDTDIR>
|
||||
initrd /boot/initrd
|
||||
|
@ -15,13 +15,14 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
MAGEIA_VERSION="cauldron"
|
||||
MAGEIA_VERSION="7"
|
||||
ARM_VERSION="armv7hl"
|
||||
TARGET="xu4"
|
||||
TARGET="odroid"
|
||||
TARGET_VERSION="xu4"
|
||||
|
||||
# URL of the Mageia mirror used to install ( see mirrors.mageia.org )
|
||||
MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
|
||||
#MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
MIRROR="http://192.168.1.252/mageia/distrib/$MAGEIA_VERSION/$ARM_VERSION"
|
||||
# image will be created here
|
||||
INSTALL_PATH="/mnt/perso/xu4-test/"
|
||||
|
||||
@ -48,5 +49,8 @@ HOSTNAME="xu4.odroid"
|
||||
#Filesystem of boot partitions (default ext4)
|
||||
BOOTFS=ext4
|
||||
|
||||
#The arguments for the Kernel
|
||||
BOOT_ARGS='dwc_otg.lpm_enable=0 console=ttyS0,115200 kgdboc=ttyS0,115200 console=tty1 rootwait fsck.repair=1 8250.nr_uarts=1 elevator=deadline cma=256M\@512M audit=0'
|
||||
|
||||
#kernel package to install
|
||||
KERNEL=kernel-odroid
|
BIN
platforms/xu4/sd_fuse/bl1.bin.hardkernel
Normal file
BIN
platforms/xu4/sd_fuse/bl1.bin.hardkernel
Normal file
Binary file not shown.
BIN
platforms/xu4/sd_fuse/bl2.bin.hardkernel.720k_uboot
Executable file
BIN
platforms/xu4/sd_fuse/bl2.bin.hardkernel.720k_uboot
Executable file
Binary file not shown.
91
platforms/xu4/sd_fuse/sd_fusing.sh
Executable file
91
platforms/xu4/sd_fuse/sd_fusing.sh
Executable file
@ -0,0 +1,91 @@
|
||||
#
|
||||
# Copyright (C) 2011 Samsung Electronics Co., Ltd.
|
||||
# http://www.samsung.com/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
####################################
|
||||
set -x
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
echo "usage: ./sd_fusing.sh <SD Reader's device file>"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -b $1 ]
|
||||
then
|
||||
echo "$1 reader is identified."
|
||||
else
|
||||
echo "$1 is NOT identified."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -d /sys/block/${1##*/}boot0 ]; then
|
||||
echo "$1 is an eMMC card, disabling ${1##*/}boot0 ro"
|
||||
if ! echo -n 0 | sudo tee /sys/block/${1##*/}boot0/force_ro; then
|
||||
echo "Enabling r/w for $1boot0 failed"
|
||||
exit 1
|
||||
fi
|
||||
emmc=1
|
||||
fi
|
||||
|
||||
####################################
|
||||
# fusing images
|
||||
|
||||
if [ -n "$emmc" ]; then
|
||||
signed_bl1_position=0
|
||||
bl2_position=30
|
||||
uboot_position=62
|
||||
tzsw_position=1502
|
||||
device=$1boot0
|
||||
else
|
||||
signed_bl1_position=1
|
||||
bl2_position=31
|
||||
uboot_position=63
|
||||
tzsw_position=1503
|
||||
device=$1
|
||||
fi
|
||||
|
||||
env_position=2015
|
||||
|
||||
# Get the U-Boot blob
|
||||
if [ -f ./u-boot-dtb.bin ]; then
|
||||
uboot="./u-boot-dtb.bin"
|
||||
elif [ -f ./u-boot.bin ]; then
|
||||
uboot="./u-boot.bin"
|
||||
elif [ -f ../u-boot-dtb.bin ]; then
|
||||
uboot="../u-boot-dtb.bin"
|
||||
elif [ -f ./u-boot.bin.hardkernel ]; then
|
||||
uboot="./u-boot.bin.hardkernel"
|
||||
else
|
||||
echo "U-Boot blob not found."
|
||||
exit
|
||||
fi
|
||||
|
||||
#<BL1 fusing>
|
||||
echo "BL1 fusing"
|
||||
sudo dd iflag=dsync oflag=dsync if=./bl1.bin.hardkernel of=$device seek=$signed_bl1_position
|
||||
|
||||
#<BL2 fusing>
|
||||
echo "BL2 fusing"
|
||||
sudo dd iflag=dsync oflag=dsync if=./bl2.bin.hardkernel.720k_uboot of=$device seek=$bl2_position
|
||||
|
||||
#<u-boot fusing>
|
||||
echo "u-boot fusing"
|
||||
sudo dd iflag=dsync oflag=dsync if=$uboot of=$device seek=$uboot_position
|
||||
|
||||
#<TrustZone S/W fusing>
|
||||
echo "TrustZone S/W fusing"
|
||||
sudo dd iflag=dsync oflag=dsync if=./tzsw.bin.hardkernel of=$device seek=$tzsw_position
|
||||
|
||||
#<u-boot env erase>
|
||||
echo "u-boot env erase..."
|
||||
sudo dd iflag=dsync oflag=dsync if=/dev/zero of=$device seek=$env_position bs=512 count=32
|
||||
|
||||
####################################
|
||||
#<Message Display>
|
||||
echo "U-boot image is fused successfully."
|
||||
echo "Eject $1 and insert it again."
|
BIN
platforms/xu4/sd_fuse/tzsw.bin.hardkernel
Normal file
BIN
platforms/xu4/sd_fuse/tzsw.bin.hardkernel
Normal file
Binary file not shown.
BIN
platforms/xu4/sd_fuse/u-boot.bin.hardkernel
Executable file
BIN
platforms/xu4/sd_fuse/u-boot.bin.hardkernel
Executable file
Binary file not shown.
@ -22,9 +22,9 @@
|
||||
|
||||
#Install all packages you need
|
||||
|
||||
/usr/sbin/urpmi --auto --no-verify-rpm /root/kernel-odroid-4.14.y-1.armv7hl.rpm basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make dracut u-boot-tools rsync
|
||||
#/usr/sbin/urpmi --urpmi-root "$BUILD_PATH" --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200
|
||||
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install /root/kernel-odroid-4.14.y-1.armv7hl.rpm basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make dracut u-boot-tools rsync kernel-desktop-latest
|
||||
#/usr/bin/dnf --installroot="$BUILD_PATH" --setopt=ignorearch=True --nogpgcheck --assumeyes install
|
||||
/usr/bin/dnf --nogpgcheck --assumeyes install /root/u-boot-20180507-3.mga7.armv7hl.rpm
|
||||
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
|
||||
/usr/bin/chown :daemon /etc/wpa_supplicant.conf
|
||||
/usr/bin/chown :tty /bin/write /bin/wall
|
103
platforms/xu4/specialFunctions.sh
Executable file
103
platforms/xu4/specialFunctions.sh
Executable file
@ -0,0 +1,103 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017-2018 Daniel Tartavel-jeannot <contact@librepc.com>
|
||||
# Copyright (C) 2019-2020 Jean-Baptiste Biernacki <j.biernacki@free.fr>
|
||||
#
|
||||
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#RPI partitionning :
|
||||
DEFAULT=""
|
||||
NEW_PART=n
|
||||
PRIMARY=p
|
||||
CHANGE_TYPE=t
|
||||
CHANGE_BOOTFLAG=a
|
||||
APPLY=w
|
||||
|
||||
PART_BOOT=1
|
||||
PART_BOOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_BOOT_SIZE="+128M"
|
||||
|
||||
PART_ROOT=2
|
||||
PART_ROOT_FIRST_SECTOR=${DEFAULT}
|
||||
PART_ROOT_SIZE=${DEFAULT}
|
||||
|
||||
TYPE_FAT32LBA=c
|
||||
|
||||
FDISK_SCRIPT="${NEW_PART}\n${PRIMARY}\n${PART_BOOT}\n${PART_BOOT_FIRST_SECTOR}\n${PART_BOOT_SIZE}\n${CHANGE_TYPE}\n${TYPE_FAT32LBA}\n${NEW_PART}\n${PRIMARY}\n${PART_ROOT}\n${PART_ROOT_FIRST_SECTOR}\n${PART_ROOT_SIZE}\n${CHANGE_BOOTFLAG}\n${PART_BOOT}\n${CHANGE_BOOTFLAG}\n${PART_ROOT}\n${APPLY}\n"
|
||||
|
||||
|
||||
function preImgCreation()
|
||||
{
|
||||
title "Creating Odroid XU3-XU4 image"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function postPrepareChroot()
|
||||
{
|
||||
#TEMPORARY CODE
|
||||
#copying kernel odroid not existing in mageia repos
|
||||
info "copying kernel-odroid and u-boot rpms in ${BUILD_PATH}/root"
|
||||
#echo "/bin/cp ${CONFIG_PATH}/kernel-odroid-4.14.y-1.armv7hl.rpm ${BUILD_PATH}/root/"
|
||||
/usr/bin/cp --preserve=mode "${CONFIG_PATH}/kernel-odroid-4.14.y-1.armv7hl.rpm" "${BUILD_PATH}/root/"
|
||||
#echo "/bin/cp ${CONFIG_PATH}/u-boot-20180507-3.mga7.armv7hl.rpm ${BUILD_PATH}/root/"
|
||||
/usr/bin/cp --preserve=mode "${CONFIG_PATH}/u-boot-20180507-3.mga7.armv7hl.rpm" "${BUILD_PATH}/root/"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error copying ${CONFIG_PATH}/kernel-odroid-4.14.y-1.armv7hl.rpm : exiting"
|
||||
exit ${ERR_1}
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
function bunrningBootloader()
|
||||
{
|
||||
if [ ${TARGET} = "odroid" ]; then
|
||||
info "installing blobs"
|
||||
pushd "${CONFIG_PATH}/sd_fuse"
|
||||
if [ ${?} -ne 0 ]; then
|
||||
error "line ${LINENO} error directory ${CONFIG_PATH}/sd_fuse does not exists : exiting"
|
||||
exit ${ERR_1}
|
||||
else
|
||||
./sd_fusing.sh "${DEVICE}"
|
||||
fi
|
||||
pushd
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
function copyingCustomSystem()
|
||||
{
|
||||
ODROID_BOOT="${BUILD_PATH}/mnt/odroid_boot"
|
||||
if ! [ -d "${ODROID_BOOT}" ]; then
|
||||
rm -rf "${ODROID_BOOT}"
|
||||
mkdir -p "${ODROID_BOOT}"
|
||||
fi
|
||||
case ${TARGET_VERSION} in
|
||||
"xu4")
|
||||
info "copying u-boot for ${TARGET} ${TARGET_VERSION}"
|
||||
cp --preserve=mode "${BUILD_PATH}/usr/lib/u-boot/${TARGET}-${TARGET_VERSION}/u-boot.bin" "${ARM_BOOT}/"
|
||||
;;
|
||||
esac
|
||||
### temporary code waiting inclusion of xu4 in Mageia kernel and u-boot
|
||||
|
||||
info "Copying extlinux.conf on ${ODROID_BOOT}"
|
||||
cp --preserve=mode -R "${BUILD_PATH}/boot/extlinux" "${ODROID_BOOT}/"
|
||||
info "copying Mageia image to root partition"
|
||||
/bin/rsync -rlptogDH --exclude "${ODROID_BOOT}/" --exclude "qemu-arm-static*" "${BUILD_PATH}/" "${ROOT}/"
|
||||
/bin/rsync -rlptogDH "${ODROID_BOOT}/" "${BOOT}/"
|
||||
return 0
|
||||
}
|
||||
|
BIN
platforms/xu4/u-boot-20180507-3.mga7.armv7hl.rpm
Normal file
BIN
platforms/xu4/u-boot-20180507-3.mga7.armv7hl.rpm
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
fatload mmc 0:1 ${kernel_addr_r} vmlinuz
|
||||
fatload mmc 0:1 ${fdt_addr_r} bcm2710-rpi-3-b.dtb
|
||||
fatload mmc 0:1 ${ramdisk_addr_r} initrd.img
|
||||
setenv bootargs console=ttyAMA0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait panic=10
|
||||
bootz ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user