├── .gitignore
├── LICENSE
├── README.md
├── app-installation-script.sh
├── bootstrap
├── boot
│ ├── devices.tar.gz
│ ├── functions
│ └── scripts
│ │ ├── breezy
│ │ ├── dapper
│ │ ├── edgy
│ │ ├── etch
│ │ ├── etch-m68k
│ │ ├── feisty
│ │ ├── gutsy
│ │ ├── hardy
│ │ ├── hoary
│ │ ├── hoary.buildd
│ │ ├── intrepid
│ │ ├── jaunty
│ │ ├── jessie
│ │ ├── karmic
│ │ ├── lenny
│ │ ├── lucid
│ │ ├── maverick
│ │ ├── natty
│ │ ├── oldstable
│ │ ├── oneiric
│ │ ├── potato
│ │ ├── precise
│ │ ├── quantal
│ │ ├── raring
│ │ ├── sarge
│ │ ├── sarge.buildd
│ │ ├── sarge.fakechroot
│ │ ├── saucy
│ │ ├── sid
│ │ ├── squeeze
│ │ ├── stable
│ │ ├── testing
│ │ ├── trusty
│ │ ├── unstable
│ │ ├── utopic
│ │ ├── vivid
│ │ ├── warty
│ │ ├── warty.buildd
│ │ ├── wheezy
│ │ ├── wily
│ │ ├── woody
│ │ ├── woody.buildd
│ │ └── xenial
├── build
├── prepare
└── sink
├── doc
└── .gitkeep
├── mode-bridge-script.sh
├── scripts
└── old
│ ├── autoscript-network
│ ├── autoscript-services
│ └── autoscript-system
└── test.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | /bootstrap/debian/
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
341 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Community Cube
2 | ==============
3 |
4 | _Discover how two geeks invented a kick-ass technology that helps normal people protect themselves from government snoopers._
5 | 
6 |
7 | ## What is Community Cube(C-Cube)?
8 |
9 | ***COMMUNITY CUBE*** is a technology that makes protecting your privacy easy. Thanks to a unique combination of open hardware and software, it’s both a server and a provider of free secure services. You can trust us, we are fully open.
10 |
11 | ***C-Cube*** is a plug and play, open source, energy efficient server designed from the ground up with security and privacy in mind.
12 |
13 | ###Why do we need this technology?
14 |
15 | The Internet is full of ___free___ services. Most are offered by __large corporations__ that work for the _common good_. Right?
16 |
17 | **NOT TRUE!**. They are giving you something for _free_ because they want something in return - your personal data. By **burying** the details in their _terms and conditions page_, that ***almost nobody reads***, they are in fact hiding their nefarious intentions.
18 |
19 | **Community Cube** operates exactly the opposite, because we integrate into each **C-Cube** a carefully selected security audited services, you no longer need to depend on the good intentions of these big corporations.
20 |
21 | Community Cube initiative work as a __Peered Cooperativeness Project__ that intends to be the biggest world wide cooperative company allowing investment only to purchase of *boxes* and connecting them to the ***C-Cube*** network.
22 |
23 | ## What ain't Community Cube? (..and will never be)
24 |
25 | - A private society or corporation.
26 | - Head managed.
27 | - Difficult to use.
28 |
29 | ## Features Comparison
30 |
31 | Some of __C-Cube__ services has being provided by some time, but un-integrated and with some flaws, let's show you:
32 |
33 | 
34 |
35 | If you want more information about the software that we picked check [here](https://cageos.org/index.php?page=apps).
36 |
37 | ## Why not just use existing Darknets/F2net?
38 |
39 | None of _F2Friend-nets_, _darknets_, _private-nets_, _Libre-nets_, _peering-nets_, _deep-web_ are the first choice for any non-technical end users, they need a product to protect their-selves. Most of _secured_ services work inside those _pseudoF2Fnets_ that often don't offer a ***decentralized real world interconnection***, and almost all don't offer a ***soft migration*** way for a those end users, often trained, for a commercial centralized product.
40 |
41 | ## Community Cube protect us against...?
42 |
43 | Bad people with bad intentions like:
44 |
45 | - **Sniffers**: those that are checking your traffic
46 | - **Government spy/monitoring institutions passive actions**: like passive bots collecting general data from worldwide, if they target anyone... that is another story.
47 | - **CommunityCube evil nodes**: a box Owned for those _bad people_.
48 | - **Malicious internet nodes**: better known as _blackbones_.
49 | - **Your internet provider (ISP)**: if they would trying anything with your data.
50 |
51 | ## How does it protect me?
52 |
53 | In technical words , to protect you, Community Cube does:
54 |
55 | - Filtering virus, exploits _malware_, ads , bad IP-sources and bad content.
56 | - Decentralizing the services (doing impossible to apply big data to you )
57 | - Open authentication (dissolve legal relation between user and name-ip), Dark-nets (anonymisation of IP)
58 | - Forcing encryption for all communications and data storage and in rest.
59 | - Filtering the data that expose you, like scripts,cookies, browser info,etc.
60 |
61 |
62 | ## How C-Cube network works?
63 |
64 | In our decentralized system your valuable information is encrypted three times:
65 |
66 | 1. Before it even leaves your computer, in the web browser
67 | 2. In the collaboration tool before the data goes to the hard disk
68 | 3. When backing up to the grid, the slices will also be encrypted.
69 |
70 | 
71 |
72 | You want more information, you can check [here](https://cageos.org/index.php?page=network) for more information or [here](https://213.129.164.215:4580/dokuwiki/doku.php?id=communitycube_overview) for a lot more information.
73 |
74 | ## How to collaborate?
75 |
76 | Easy as fork us and send pull requests, but if you want to get in touch with us meet us in our web page [CageOS](www.cageos.org).
77 |
78 | ## Which hardware is needed to run C-Cube?
79 |
80 | This is on discussion yet, but the idea is to offer a solution that can be deployable on a public distribution with your own hardware, but as standalone we have this models:
81 |
82 | - **C-Cube** has two presentations:
83 |
84 | |Low-end model - Odroid C2| High-end model - Odroid XU4|
85 | |--------|--------|
86 | |Odroid C2 | Odroid XU4 |
87 | |ssd 8gbc10|ssd 8gbc10|
88 | |USB2ETH | HDD 2TB|
89 | |2xWLAN 1watt| SB2ETH |
90 | |Batteries|2xWLAN 1watt|
91 | |CASE| CASE|
92 | |RoboPeak Usb tft screen |RoboPeak Usb tft screen |
93 |
94 | 
95 |
96 | More information [here](https://213.129.164.215:4580/dokuwiki/doku.php?id=technical:hardware:communitycube_-_odroid_xu3_lite).
97 |
98 |
99 | ## Setup
100 |
101 | There are 2 ways to join to CommunityCube network
102 |
103 | ##### 1. Setup CommunityCube software on Physical/Virtual machine.
104 | ##### 2. Setup CommunityCube software on Odroid XU3/XU4/C1+/C2.
105 |
106 | #### Steps to setup on Physical/Virtual machine.
107 |
108 | **Step 1: Checking requirements**
109 |
110 | Your Physical/Virtual machine need to meet the minimum requirements:
111 |
112 | 1. 2 network interface
113 | 2. 1 GB of Physical memory
114 | 3. 16 GB of free space
115 |
116 | If your machine is ok with requirement, then you can process to next step.
117 |
118 | **Step 2: Setup the network.**
119 |
120 | In this step you need to connect one interface of your machine to Internet, and other one to local network device.
121 |
122 | **Step 3. Executing scripts.**
123 |
124 | In this step you need to download and execute the following scripts on your machine with given order.
125 |
126 | **1. test.sh (Initialization script)**
127 |
128 | Script workflow
129 |
130 | 1. Check User
131 | * You need to run script as root user
132 |
133 | 2. Check Platform
134 | * Platform should be Debian 7/8, Ubuntu 12.04/14.04
135 |
136 | 3. Check Hardware
137 | * If you are running this script on odroid it should detect Intel processor
138 |
139 | 4. Check Requirements
140 | * Machine should match the requirements mentioned above
141 |
142 | 5. Check Internet
143 | * Check Internet connection.
144 |
145 | 6. Prepare perositories
146 | * Update repositories for necessary packages
147 |
148 | 7. Download packages
149 | * Download necessary packages
150 |
151 | 8. Install packages
152 | * Install necessary packages
153 |
154 | >You can find Initialization workflow [here](https://213.129.164.215:4580/dokuwiki/doku.php?id=initialization_workflow)
155 |
156 | **2. app-installation-script.sh (Configuration script)**
157 |
158 | It aims to configure all the packages and services.
159 |
160 |
161 | #### Steps to setup on Odroid board.
162 |
163 | **Step 1. Get an odroid and assemble it.**
164 |
165 | There are several seperate modules that need to be connected to odroid board.
166 |
167 | You can find more information about necessary modules [here](https://213.129.164.215:4580/dokuwiki/doku.php?id=technical:hardware:communitycube_-_odroid_xu3_lite).
168 |
169 | **Step 2. Executing scripts.**
170 |
171 | In this step you need to download and execute the following scripts on your machine with given order.
172 |
173 | **1. test.sh (Initialization script)**
174 |
175 | Script workflow
176 |
177 | 1. Check User
178 | * You need to run script as root user
179 |
180 | 2. Check Platform
181 | * Platform should be Debian 7/8, Ubuntu 12.04/14.04
182 |
183 | 3. Check Hardware
184 | * If you are running this script on odroid it should detect ARM processor
185 |
186 | 4. Check If Assembled
187 | * All neccessary modules should be connected to odroid board
188 |
189 | 5. Configure Bridge Interfaces
190 | * eth0 and wlan0 will be bridged into interface br0
191 | * eth1 and wlan1 will be bridged into interface br1
192 | * In ethernet network, br0 should be connected to Internet and br0 to local network
193 | * In wireless network, bridge interdace with wore powerful wlan will be connected to Internet and other one to local network
194 |
195 | 6. Check Internet
196 | * Check Internet connection.
197 |
198 | 7. Prepare perositories
199 | * Apdate repositories for necessary packages
200 |
201 | 8. Download packages
202 | * Download necessary packages
203 |
204 | 9. Install packages
205 | * Install necessary packages
206 |
207 |
208 | >You can find Initialization workflow [here](https://213.129.164.215:4580/dokuwiki/doku.php?id=initialization_workflow)
209 |
210 | **2. app-installation-script.sh (Configuration script)**
211 |
212 | It aims to configure all the packages and services.
213 |
214 |
215 | ## License
216 | >You can check out the full license [here](https://github.com/CommunityCube/debian-autoscript/blob/master/LICENSE)
217 |
218 | This project is licensed under the terms of the **GNU GPL V2** license.
219 |
--------------------------------------------------------------------------------
/app-installation-script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # ---------------------------------------------------------
3 | # This script aims to configure all the packages and
4 | # services which have been installed by test.sh script.
5 | # This script is functionally seperated into 3 parts
6 | # 1. Configuration of Network Interfaces
7 | # 2. Configuration of Revers Proxy Services
8 | # 3. Configuration of Applications
9 | # ---------------------------------------------------------
10 |
11 |
12 | # Global variables list
13 | EXT_INETRFACE="N/A" # External interface variable
14 | INT_INTERfACE="N/A" # Internal interface variable
15 |
16 |
17 | # ---------------------------------------------------------
18 | # This function checks user.
19 | # Script must be executed by root user, otherwise it will
20 | # output an error and terminate further execution.
21 | # ---------------------------------------------------------
22 | check_root ()
23 | {
24 | echo -ne "Checking user root ... "
25 | if [ "$(whoami)" != "root" ]; then
26 | echo "Fail"
27 | echo "You need to be root to proceed. Exiting"
28 | exit 1
29 | else
30 | echo "OK"
31 | fi
32 | }
33 |
34 |
35 | # ---------------------------------------------------------
36 | # Function to get varibales from /tmp/variables.log file
37 | # Variables to be initialized are:
38 | # PLATFORM
39 | # HARDWARE
40 | # PROCESSOR
41 | # EXT_INTERFACE
42 | # INT_INTERFACE
43 | # ----------------------------------------------------------
44 | get_variables()
45 | {
46 | echo "Initializing variables ..."
47 | if [ -e /tmp/variables.log ]; then
48 | PLATFORM=`cat /tmp/variables.log | grep "Platform" | awk {'print $2'}`
49 | HARDWARE=`cat /tmp/variables.log | grep "Hardware" | awk {'print $2'}`
50 | PROCESSOR=`cat /tmp/variables.log | grep "Processor" | awk {'print $2'}`
51 | EXT_INTERFACE=`cat /tmp/variables.log | grep "Ext_int" | awk {'print $2'}`
52 | INT_INTERFACE=`cat /tmp/variables.log | grep "Int_int" | awk {'print $2'}`
53 | if [ -z "$PLATFORM" -o -z "$HARDWARE" -o -z "$PROCESSOR" \
54 | -o -z "$EXT_INTERFACE" -o -z "$INT_INTERFACE" ]; then
55 | echo "Error: Can not detect variables. Exiting"
56 | exit 5
57 | else
58 | echo "Platform: $PLATFORM"
59 | echo "Hardware: $HARDWARE"
60 | echo "Processor: $PROCESSOR"
61 | echo "Ext Interface: $EXT_INTERFACE"
62 | echo "Int Interface: $INT_INTERFACE"
63 | fi
64 | else
65 | echo "Error: Can not find variables file. Exiting"
66 | exit 6
67 | fi
68 | }
69 |
70 |
71 | # ---------------------------------------------------------
72 | # This function checks network interfaces.
73 | # The interface connected to network will be saved on
74 | # EXT_INTERFACE variaable and other awailable interface
75 | # will be saved on INT_INTERFACE variable.
76 | # ---------------------------------------------------------
77 | get_interfaces()
78 | {
79 | echo "Checking network interfaces ..."
80 | # Getting external interface name
81 | EXT_INTERFACE=`route -n | awk {'print $1 " " $8'} \
82 | | grep -w "0.0.0.0" | awk {'print $2'}`
83 | echo "External interface: $EXT_INTERFACE"
84 |
85 | # Getting internal interface name
86 | INT_INTERFACE=`ls /sys/class/net/ | \
87 | grep -w 'eth0\|eth1\|wlan0\|wlan1' | \
88 | grep -v '$EXT_INTERFACE' | sed -n '1p'`
89 | echo "Internal interface: $INT_INTERFACE"
90 | }
91 |
92 |
93 | # ---------------------------------------------------------
94 | # This functions configures hostname and static lookup
95 | # table
96 | # ---------------------------------------------------------
97 | configure_hosts()
98 | {
99 | echo "communitycube" > /etc/hostname
100 |
101 | cat << EOF > /etc/hosts
102 | #
103 | # /etc/hosts: static lookup table for host names
104 | #
105 |
106 | #
107 | 127.0.0.1 communitycube.localdomain localhost.localdomain communitycube localhost
108 | ::1 communitycube.localdomain localhost.localdomain communitycube localhost ip6-localhost ip6-loopback
109 | fe00::0 ip6-localnet
110 | ff00::0 ip6-mcastprefix
111 | ff02::1 ip6-allnodes
112 | ff02::2 ip6-allrouters
113 | EOF
114 | }
115 |
116 |
117 | # ---------------------------------------------------------
118 | # This function configures internal and external interfaces
119 | # ---------------------------------------------------------
120 | configure_interfaces()
121 | {
122 | # Network interfaces configuration for
123 | # Physical/Virtual machine
124 | if [ "$PROCESSOR" = "Intel" -o "$PROCESSOR" = "AMD" ]; then
125 | cat << EOF > /etc/network/interfaces
126 | # interfaces(5) file used by ifup(8) and ifdown(8)
127 | auto lo
128 | iface lo inet loopback
129 |
130 | #External network interface
131 | auto $EXT_INTERFACE
132 | allow-hotplug $EXT_INTERFACE
133 | iface $EXT_INTERFACE inet dhcp
134 |
135 | #Internal network interface
136 | auto $INT_INTERFACE
137 | allow-hotplug $INT_INTERFACE
138 | iface $INT_INTERFACE inet static
139 | address 10.0.0.1
140 | netmask 255.255.255.0
141 | network 10.0.0.0
142 |
143 | #Yacy
144 | auto $INT_INTERFACE:1
145 | allow-hotplug $INT_INTERFACE:1
146 | iface $INT_INTERFACE:1 inet static
147 | address 10.0.0.251
148 | netmask 255.255.255.0
149 |
150 | #Friendica
151 | auto $INT_INTERFACE:2
152 | allow-hotplug $INT_INTERFACE:2
153 | iface $INT_INTERFACE:2 inet static
154 | address 10.0.0.252
155 | netmask 255.255.255.0
156 |
157 | #OwnCloud
158 | auto $INT_INTERFACE:3
159 | allow-hotplug $INT_INTERFACE:3
160 | iface $INT_INTERFACE:3 inet static
161 | address 10.0.0.253
162 | netmask 255.255.255.0
163 |
164 | #Mailpile
165 | auto $INT_INTERFACE:4
166 | allow-hotplug $INT_INTERFACE:4
167 | iface $INT_INTERFACE:4 inet static
168 | address 10.0.0.254
169 | netmask 255.255.255.0
170 | EOF
171 | # Network interfaces configuration for board
172 | elif [ "$PROCESSOR" = "ARM" ]; then
173 | cat << EOF > /etc/network/interfaces
174 | # interfaces(5) file used by ifup(8) and ifdown(8)
175 | auto lo
176 | iface lo inet loopback
177 |
178 | #External network interface
179 | auto eth0
180 | allow-hotplug eth0
181 | iface eth0 inet dhcp
182 |
183 | #External network interface
184 | # wireless wlan0
185 | auto wlan0
186 | allow-hotplug wlan0
187 | iface wlan0 inet dhcp
188 |
189 | ##External Network Bridge
190 | #auto br0
191 | allow-hotplug br0
192 | iface br0 inet dhcp
193 | bridge_ports eth0 wlan0
194 |
195 | #Internal network interface
196 | auto eth1
197 | allow-hotplug eth1
198 | iface eth1 inet manual
199 |
200 | #Internal network interface
201 | # wireless wlan1
202 | auto wlan1
203 | allow-hotplug wlan1
204 | iface wlan1 inet manual
205 |
206 | #Internal network Bridge
207 | auto br1
208 | allow-hotplug br1
209 | # Setup bridge
210 | iface br1 inet static
211 | bridge_ports eth1 wlan1
212 | address 10.0.0.1
213 | netmask 255.255.255.0
214 | network 10.0.0.0
215 |
216 | #Yacy
217 | auto eth1:1
218 | allow-hotplug eth1:1
219 | iface eth1:1 inet static
220 | address 10.0.0.251
221 | netmask 255.255.255.0
222 |
223 | #Friendica
224 | auto eth1:2
225 | allow-hotplug eth1:2
226 | iface eth1:2 inet static
227 | address 10.0.0.252
228 | netmask 255.255.255.0
229 |
230 | #OwnCloud
231 | auto eth1:3
232 | allow-hotplug eth1:3
233 | iface eth1:3 inet static
234 | address 10.0.0.253
235 | netmask 255.255.255.0
236 |
237 | #Mailpile
238 | auto eth1:4
239 | allow-hotplug eth1:4
240 | iface eth1:4 inet static
241 | address 10.0.0.254
242 | netmask 255.255.255.0
243 | EOF
244 |
245 | fi
246 | }
247 |
248 |
249 | # ---------------------------------------------------------
250 | # Function to configure blacklists
251 | # ---------------------------------------------------------
252 | configre_blacklists()
253 | {
254 | mkdir -p /etc/blacklists
255 | cd /etc/blacklists
256 |
257 | cat << EOF > /etc/blacklists/update-blacklists.sh
258 | #!/bin/bash
259 |
260 | #squidguard DB
261 | mkdir -p /etc/blacklists/shallalist/tmp
262 | cd /etc/blacklists/shallalist/tmp
263 | wget http://www.shallalist.de/Downloads/shallalist.tar.gz
264 | tar xvzf shallalist.tar.gz ; res=\$?
265 | rm -f shallalist.tar.gz
266 | if [ "\$res" = 0 ]; then
267 | rm -fr /etc/blacklists/shallalist/ok
268 | mv /etc/blacklists/shallalist/tmp /etc/blacklists/shallalist/ok
269 | else
270 | rm -fr /etc/blacklists/shallalist/tmp
271 | fi
272 |
273 | mkdir -p /etc/blacklists/urlblacklist/tmp
274 | cd /etc/blacklists/urlblacklist/tmp
275 | wget http://urlblacklist.com/cgi-bin/commercialdownload.pl?type=download\\&file=bigblacklist -O urlblacklist.tar.gz
276 | tar xvzf urlblacklist.tar.gz ; res=\$?
277 | rm -f urlblacklist.tar.gz
278 | if [ "\$res" = 0 ]; then
279 | rm -fr /etc/blacklists/urlblacklist/ok
280 | mv /etc/blacklists/urlblacklist/tmp /etc/blacklists/urlblacklist/ok
281 | else
282 | rm -fr /etc/blacklists/urlblacklist/tmp
283 | fi
284 |
285 | mkdir -p /etc/blacklists/mesdk12/tmp
286 | cd /etc/blacklists/mesdk12/tmp
287 | wget http://squidguard.mesd.k12.or.us/blacklists.tgz
288 | tar xvzf blacklists.tgz ; res=\$?
289 | rm -f blacklists.tgz
290 | if [ "\$res" = 0 ]; then
291 | rm -fr /etc/blacklists/mesdk12/ok
292 | mv /etc/blacklists/mesdk12/tmp /etc/blacklists/mesdk12/ok
293 | else
294 | rm -fr /etc/blacklists/mesdk12/tmp
295 | fi
296 |
297 | mkdir -p /etc/blacklists/capitole/tmp
298 | cd /etc/blacklists/capitole/tmp
299 | wget ftp://ftp.ut-capitole.fr/pub/reseau/cache/squidguard_contrib/publicite.tar.gz
300 | tar xvzf publicite.tar.gz ; res=\$?
301 | rm -f publicite.tar.gz
302 | if [ "\$res" = 0 ]; then
303 | rm -fr /etc/blacklists/capitole/ok
304 | mv /etc/blacklists/capitole/tmp /etc/blacklists/capitole/ok
305 | else
306 | rm -fr /etc/blacklists/capitole/tmp
307 | fi
308 |
309 |
310 | # chown proxy:proxy -R /etc/blacklists/*
311 |
312 | EOF
313 |
314 | chmod +x /etc/blacklists/update-blacklists.sh
315 | /etc/blacklists/update-blacklists.sh
316 |
317 | cat << EOF > /etc/blacklists/blacklists-iptables.sh
318 | #ipset implementation for nat
319 | for i in \$(grep -iv [A-Z] /etc/blacklists/shallalist/ok/BL/adv/domains)
320 | do
321 | iptables -t nat -I PREROUTING -i br1 -s 10.0.0.0/16 -p tcp -d \$i -j DNAT --to-destination 5.5.5.5
322 | done
323 | EOF
324 |
325 | chmod +x /etc/blacklists/blacklists-iptables.sh
326 | }
327 |
328 |
329 | # ---------------------------------------------------------
330 | # Function to configure iptables
331 | # ---------------------------------------------------------
332 | configure_iptables()
333 | {
334 | cat << EOF > /etc/rc.local
335 | #!/bin/sh -e
336 | #
337 | # rc.local
338 | #
339 | # This script is executed at the end of each multiuser runlevel.
340 | # Make sure that the script will "exit 0" on success or any other
341 | # value on error.
342 | #
343 | # In order to enable or disable this script just change the execution
344 | # bits.
345 | #
346 | # By default this script does nothing.
347 |
348 |
349 | iptables -F
350 | iptables -F -t nat
351 |
352 | #Allow ssh from internal to Communitycube and allow SSH to external servers
353 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 22 -j ACCEPT
354 |
355 | #Allow internal access to
356 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 80 -j ACCEPT
357 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 443 -j ACCEPT
358 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 7000 -j ACCEPT
359 |
360 | # Redirect to Local Nginx server
361 | # Should be handled by Yacy
362 | iptables -t nat -I PREROUTING -i br1 -d 10.0.0.251 -p tcp -j DNAT --to 10.0.0.1:80
363 | # Should be handled by Friendica
364 | iptables -t nat -I PREROUTING -i br1 -d 10.0.0.252 -p tcp -j DNAT --to 10.0.0.1:80
365 | # Should be handled by Owncloud
366 | iptables -t nat -I PREROUTING -i br1 -d 10.0.0.253 -p tcp -j DNAT --to 10.0.0.1:80
367 | # Should be handled by Mailpile
368 | iptables -t nat -I PREROUTING -i br1 -d 10.0.0.254 -p tcp -j DNAT --to 10.0.0.1:80
369 |
370 | #i2p petitions
371 | iptables -t nat -A OUTPUT -d 10.191.0.1 -p tcp --dport 80 -j REDIRECT --to-port 3128
372 | iptables -t nat -A PREROUTING -d 10.191.0.1 -p tcp --dport 80 -j REDIRECT --to-port 3128
373 | iptables -t nat -A PREROUTING -i br1 -p tcp -m tcp --sport 80 -d 10.191.0.1 -j REDIRECT --to-ports 3128
374 | #Allow surf onion zone
375 | iptables -t nat -A PREROUTING -p tcp -d 10.192.0.0/16 -j REDIRECT --to-port 9040
376 | iptables -t nat -A OUTPUT -p tcp -d 10.192.0.0/16 -j REDIRECT --to-port 9040
377 |
378 | ###### WORK MODE 1 #####
379 | # use TOR for regular and TOR requests
380 |
381 | #iptables -t nat -A PREROUTING -i br1 -p tcp --syn -j REDIRECT --to-ports 9040
382 |
383 |
384 | ####### WORK MODE 2 #####
385 | # use TOR for TOR petitions
386 | # use Squid for the rest
387 |
388 | #regular 80 port traffic to squid
389 | iptables -t nat -A PREROUTING -i br1 -s 10.0.0.0/16 -p tcp --dport 80 -j REDIRECT --to-port 3129
390 |
391 | #rest for TOR
392 | iptables -t nat -A PREROUTING -i br1 -p tcp --syn -m multiport ! --dports 80 -j REDIRECT --to-ports 9040
393 | [ -e /etc/blacklists/blacklists-iptables.sh ] && /etc/blacklists/blacklists-iptables.sh &
394 |
395 | exit 0
396 | EOF
397 |
398 | chmod +x /etc/rc.local
399 |
400 | /etc/rc.local
401 | }
402 |
403 |
404 | # ---------------------------------------------------------
405 | # Function to configure TOR
406 | # ---------------------------------------------------------
407 | configure_tor()
408 | {
409 | echo "Configuring Tor server"
410 | tordir=/var/lib/tor/hidden_service
411 | for i in yacy owncloud prosody friendica mailpile
412 | do
413 |
414 | # Setting user and group to debian-tor
415 | mkdir -p $tordir/$i
416 | chown debian-tor:debian-tor $tordir/$i -R
417 | rm -f $tordir/$i/*
418 |
419 | # Setting permission to 2740 "rwxr-s---"
420 | chmod 2700 $tordir/*
421 |
422 | done
423 |
424 | # Setting RUN_DAEMON to yes
425 | # waitakey
426 | # $EDITOR /etc/default/tor
427 | sed "s~RUN_DAEMON=.*~RUN_DAEMON=\"yes\"~g" -i /etc/default/tor
428 |
429 |
430 | rm -f /etc/tor/torrc
431 | cp /usr/share/tor/tor-service-defaults-torrc /etc/tor/torrc
432 |
433 | echo "Configuring Tor hidden services"
434 |
435 | echo "
436 | HiddenServiceDir /var/lib/tor/hidden_service/yacy
437 | HiddenServicePort 80 127.0.0.1:8090
438 |
439 | HiddenServiceDir /var/lib/tor/hidden_service/owncloud
440 | HiddenServicePort 80 127.0.0.1:7070
441 | HiddenServicePort 443 127.0.0.1:443
442 |
443 | HiddenServiceDir /var/lib/tor/hidden_service/prosody
444 | HiddenServicePort 5222 127.0.0.1:5222
445 | HiddenServicePort 5269 127.0.0.1:5269
446 |
447 | HiddenServiceDir /var/lib/tor/hidden_service/friendica
448 | HiddenServicePort 80 127.0.0.1:8181
449 | HiddenServicePort 443 127.0.0.1:443
450 |
451 | HiddenServiceDir /var/lib/tor/hidden_service/mailpile
452 | HiddenServicePort 33411 127.0.0.1:33411
453 |
454 |
455 |
456 | DNSPort 9053
457 | DNSListenAddress 10.0.0.1
458 | VirtualAddrNetworkIPv4 10.192.0.0/16
459 | AutomapHostsOnResolve 1
460 | TransPort 9040
461 | TransListenAddress 10.0.0.1
462 | SocksPort 9050 # what port to open for local application connectio$
463 | SocksBindAddress 127.0.0.1 # accept connections only from localhost
464 | AllowUnverifiedNodes middle,rendezvous
465 | #Log notice syslog" >> /etc/tor/torrc
466 |
467 | service tor restart
468 | sleep 2
469 | }
470 |
471 |
472 | # ---------------------------------------------------------
473 | # Function to configure I2P services
474 | # ---------------------------------------------------------
475 | configure_i2p()
476 | {
477 | echo "Configuring i2p services ..."
478 | echo "Change RUN_DAEMON to true"
479 | # waitakey
480 | # $EDITOR /etc/default/i2p
481 | sed "s~RUN_DAEMON=.*~RUN_DAEMON=\"true\"~g" -i /etc/default/i2p
482 | service i2p restart
483 | }
484 |
485 |
486 | # ---------------------------------------------------------
487 | # Function to configure Unbound DNS server
488 | # ---------------------------------------------------------
489 | configure_unbound()
490 | {
491 | echo '# Unbound configuration file for Debian.
492 | #
493 | # See the unbound.conf(5) man page.
494 | #
495 | # See /usr/share/doc/unbound/examples/unbound.conf for a commented
496 | # reference config file.
497 |
498 | server:
499 | # The following line will configure unbound to perform cryptographic
500 | # DNSSEC validation using the root trust anchor.
501 |
502 | # Specify the interface to answer queries from by ip address.
503 | interface: 10.0.2.15
504 |
505 | # Port to answer queries
506 | port: 53
507 |
508 | # Serve ipv4 requests
509 | do-ipv4: yes
510 |
511 | # Serve ipv6 requests
512 | do-ipv6: no
513 |
514 | # Enable UDP
515 | do-udp: yes
516 |
517 | # Enable TCP
518 | do-tcp: yes
519 |
520 | # Not to answer id.server and hostname.bind queries
521 | hide-identity: yes
522 |
523 | # Not to answer version.server and version.bind queries
524 | hide-version: yes
525 |
526 | # Use 0x20-encoded random bits in the query
527 | use-cups-for-id: yes
528 |
529 | # Cache minimum time to live
530 | Cache-min-ttl: 3600
531 |
532 | # Cache maximum time to live
533 | cache-max-ttl: 86400
534 |
535 | # Perform prefetching
536 | prefetch: yes
537 |
538 | # Number of threads
539 | num-threads: 2
540 |
541 | ## Unbound optimization ##
542 |
543 | # Number od slabs
544 | msg-cache-slabs: 4
545 | rrset-cache-slabs: 4
546 | infra-cache-slabs: 4
547 | key-cache-slabs: 4
548 |
549 | # Size pf cache memory
550 | rrset-cache-size: 128m
551 | msg-cache-size: 64m
552 |
553 | # Buffer size for UDP port 53
554 | so-rcvbuf: 1m
555 |
556 | # Unwanted replies maximum number
557 | unwanted-reply-threshold: 10000
558 |
559 | # Define which network ips are allowed to make queries to this server.
560 | access-control: 10.0.0.0/8 allow
561 | access-control: 127.0.0.1/8 allow
562 | access-control: 0.0.0.0/0 refuse
563 |
564 |
565 | # auto-trust-anchor-file: "/var/lib/unbound/root.key"
566 | do-not-query-localhost: no
567 | #domain-insecure: "onion"
568 | #private-domain: "onion"
569 |
570 | #Local destinations
571 | local-zone: "local." static
572 | local-data: "communitycube.local. IN A 10.0.0.1"
573 | local-data: "i2p.local. IN A 10.0.0.1"
574 | local-data: "tahoe.local. IN A 10.0.0.1"' > /etc/unbound/unbound.conf
575 |
576 | for i in $(ls /var/lib/tor/hidden_service/)
577 | do
578 | cat << EOF >> /etc/unbound/unbound.conf
579 | local-data: "$i.local. IN A 10.0.0.1"
580 | EOF
581 | done
582 |
583 | for i in $(ls /var/lib/tor/hidden_service/)
584 | do
585 | hn="$(cat /var/lib/tor/hidden_service/$i/hostname 2>/dev/null )"
586 |
587 | if [ -n "$hn" ]; then
588 | cat << EOF >> /etc/unbound/unbound.conf
589 | local-zone: "$hn." static
590 | local-data: "$hn. IN A 10.0.0.1"
591 | EOF
592 | fi
593 | done
594 |
595 | echo '
596 | # I2P domains will be resolved us 10.191.0.1
597 | local-zone: "i2p" redirect
598 | local-data: "i2p A 10.191.0.1"
599 |
600 | # .ounin domains will be resolved by TOR DNS
601 | forward-zone:
602 | name: ".onion"
603 | forward-addr: 10.0.0.1@9053
604 |
605 | # Forward rest of zones to DjDNS
606 | forward-zone:
607 | name: "."
608 | forward-addr: 10.0.0.1@8053
609 | ' >> /etc/unbound/unbound.conf
610 |
611 | # There is a need to stop dnsmasq before starting unbound
612 | echo "Stoping dnsmasq ..."
613 | if ps aux | grep -w 'dnsmasq' | grep -v 'grep' > /dev/null; then
614 | kill -9 `ps aux | grep dnsmasq | awk {'print $2'} | sed -n '1p'`
615 | fi
616 | echo "kill -9 \`ps aux | grep dnsmasq | awk {'print $2'} | sed -n '1p'\`" \
617 | >> /etc/rc.local
618 | echo "service unbound restart" >> /etc/rc.local
619 |
620 | echo "Starting Unbound DNS server ..."
621 | service unbound restart
622 | if ps aux | grep -w 'unbound' | grep -v 'grep' > /dev/null; then
623 | echo "Unbound DNS server successfully started."
624 | else
625 | echo "Error: Unable to start unbound DNS server. Exiting"
626 | exit 3
627 | fi
628 | }
629 |
630 |
631 |
632 |
633 |
634 |
635 | # ---------------------------------------------------------
636 | # ************************ MAIN ***************************
637 | # This is the main function on this script
638 | # ---------------------------------------------------------
639 |
640 | # Block 1: Configuing Network Interfaces
641 |
642 | check_root # Checking user
643 | get_variables # Getting variables
644 | get_interfaces # Getting external and internal interfaces
645 | configure_hosts # Configurint hostname and /etc/hosts
646 | configure_interfaces # Configuring external and internal interfaces
647 |
648 |
649 |
650 | # Block 2: Configuring services
651 |
652 | configure_tor # Configuring TOR server
653 | configure_i2p # Configuring i2p services
654 | configure_unbound # Configuring unbound DNS server
655 |
656 |
657 | #configure_blacklists # Configuring blacklist to block some ip addresses
658 | #configure_iptables # Configuring iptables rules
659 |
660 |
661 |
--------------------------------------------------------------------------------
/bootstrap/boot/devices.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityCube/debian-autoscript/82dc58154dd8a32b8d16371dee928166536d37a2/bootstrap/boot/devices.tar.gz
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/breezy:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | default_mirror http://old-releases.ubuntu.com/ubuntu
3 | mirror_style release
4 | download_style apt
5 | finddebs_style from-indices
6 | variants - buildd
7 |
8 | case $ARCH in
9 | alpha|ia64) LIBC="libc6.1" ;;
10 | *) LIBC="libc6" ;;
11 | esac
12 |
13 | work_out_debs () {
14 | required="$(get_debs Priority: required)"
15 |
16 | if doing_variant -; then
17 | #required="$required $(get_debs Priority: important)"
18 | # ^^ should be getting debconf here somehow maybe
19 | base="$(get_debs Priority: important)"
20 | elif doing_variant buildd; then
21 | # TODO: add Build-Essential: yes extraoverrides
22 | #base="$(get_debs Build-Essential: yes)"
23 |
24 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
25 |
26 | base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 gcc-4.0-base ${LIBC}-dev libdb4.2 libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules"
27 |
28 | add ia64 base "libunwind7-dev"
29 | add sparc base "lib64gcc1"
30 | add sparc base "libc6-dev-sparc64"
31 | add sparc base "libc6-sparc64"
32 | fi
33 | }
34 |
35 | first_stage_install () {
36 | extract $required
37 |
38 | mkdir -p "$TARGET/var/lib/dpkg"
39 | : >"$TARGET/var/lib/dpkg/status"
40 | echo >"$TARGET/var/lib/dpkg/available"
41 |
42 | setup_etc
43 | if [ ! -e "$TARGET/etc/fstab" ]; then
44 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
45 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
46 | fi
47 |
48 | x_feign_install () {
49 | local pkg="$1"
50 | local deb="$(debfor $pkg)"
51 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
52 |
53 | mkdir -p "$TARGET/var/lib/dpkg/info"
54 |
55 | echo \
56 | "Package: $pkg
57 | Version: $ver
58 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
59 |
60 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
61 | }
62 |
63 | x_feign_install dpkg
64 | }
65 |
66 | second_stage_install () {
67 | x_core_install () {
68 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
69 | }
70 |
71 | p () {
72 | baseprog="$(($baseprog + ${1:-1}))"
73 | }
74 |
75 | setup_devices
76 | setup_proc
77 | umount_on_exit /dev/.static/dev
78 | umount_on_exit /dev
79 | in_target /sbin/ldconfig
80 |
81 | DEBIAN_FRONTEND=noninteractive
82 | DEBCONF_NONINTERACTIVE_SEEN=true
83 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
84 |
85 | baseprog=0
86 | bases=7
87 |
88 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
89 | info INSTCORE "Installing core packages..."
90 |
91 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
92 | ln -sf mawk "$TARGET/usr/bin/awk"
93 | x_core_install base-files base-passwd
94 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
95 | x_core_install dpkg
96 |
97 | if [ ! -e "$TARGET/etc/localtime" ]; then
98 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
99 | fi
100 |
101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
102 | x_core_install $LIBC
103 |
104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
105 | x_core_install perl-base
106 |
107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
108 | rm "$TARGET/usr/bin/awk"
109 | x_core_install mawk
110 |
111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
112 | if doing_variant -; then
113 | x_core_install debconf
114 | fi
115 |
116 | baseprog=0
117 | bases=$(set -- $required; echo $#)
118 |
119 | info UNPACKREQ "Unpacking required packages..."
120 |
121 | smallyes '' |
122 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
123 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
124 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
125 |
126 | info CONFREQ "Configuring required packages..."
127 |
128 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
129 | echo \
130 | "#!/bin/sh
131 | echo
132 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
133 | chmod 755 "$TARGET/sbin/start-stop-daemon"
134 |
135 | setup_dselect_method apt
136 |
137 | smallyes '' |
138 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
139 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
140 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
141 |
142 | baseprog=0
143 | bases="$(set -- $base; echo $#)"
144 |
145 | info UNPACKBASE "Unpacking the base system..."
146 |
147 | smallyes '' |
148 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
149 | dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
150 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
151 |
152 | info CONFBASE "Configuring the base system..."
153 |
154 | smallyes '' |
155 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
156 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
157 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
158 |
159 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
160 |
161 | progress $bases $bases CONFBASE "Configuring base system"
162 | info BASESUCCESS "Base system installed successfully."
163 | }
164 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/dapper:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | case $ARCH in
3 | amd64|i386|powerpc|sparc)
4 | default_mirror http://archive.ubuntu.com/ubuntu
5 | ;;
6 | *)
7 | default_mirror http://ports.ubuntu.com/ubuntu-ports
8 | ;;
9 | esac
10 | mirror_style release
11 | download_style apt
12 | finddebs_style from-indices
13 | variants - buildd
14 |
15 | case $ARCH in
16 | alpha|ia64) LIBC="libc6.1" ;;
17 | *) LIBC="libc6" ;;
18 | esac
19 |
20 | work_out_debs () {
21 | required="$(get_debs Priority: required)"
22 |
23 | if doing_variant -; then
24 | #required="$required $(get_debs Priority: important)"
25 | # ^^ should be getting debconf here somehow maybe
26 | base="$(get_debs Priority: important)"
27 | elif doing_variant buildd; then
28 | # TODO: add Build-Essential: yes extraoverrides
29 | #base="$(get_debs Build-Essential: yes)"
30 |
31 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
32 |
33 | base="apt binutils cpio cpp cpp-4.0 dpkg-dev g++ g++-4.0 gcc gcc-4.0 ${LIBC}-dev libgdbm3 libstdc++6 libstdc++6-4.0-dev linux-kernel-headers make patch perl perl-modules"
34 |
35 | add ia64 base "libunwind7-dev"
36 | add sparc base "lib64gcc1"
37 | add sparc base "libc6-dev-sparc64"
38 | add sparc base "libc6-sparc64"
39 | fi
40 | }
41 |
42 | first_stage_install () {
43 | extract $required
44 |
45 | mkdir -p "$TARGET/var/lib/dpkg"
46 | : >"$TARGET/var/lib/dpkg/status"
47 | : >"$TARGET/var/lib/dpkg/available"
48 |
49 | setup_etc
50 | if [ ! -e "$TARGET/etc/fstab" ]; then
51 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
52 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
53 | fi
54 |
55 | x_feign_install () {
56 | local pkg="$1"
57 | local deb="$(debfor $pkg)"
58 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
59 |
60 | mkdir -p "$TARGET/var/lib/dpkg/info"
61 |
62 | echo \
63 | "Package: $pkg
64 | Version: $ver
65 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
66 |
67 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
68 | }
69 |
70 | x_feign_install dpkg
71 | }
72 |
73 | second_stage_install () {
74 | x_core_install () {
75 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
76 | }
77 |
78 | p () {
79 | baseprog="$(($baseprog + ${1:-1}))"
80 | }
81 |
82 | setup_devices
83 | setup_proc
84 | in_target /sbin/ldconfig
85 |
86 | DEBIAN_FRONTEND=noninteractive
87 | DEBCONF_NONINTERACTIVE_SEEN=true
88 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
89 |
90 | baseprog=0
91 | bases=7
92 |
93 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
94 | info INSTCORE "Installing core packages..."
95 |
96 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
97 | ln -sf mawk "$TARGET/usr/bin/awk"
98 | x_core_install base-files base-passwd
99 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
100 | x_core_install dpkg
101 |
102 | if [ ! -e "$TARGET/etc/localtime" ]; then
103 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
104 | fi
105 |
106 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
107 | x_core_install $LIBC
108 |
109 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
110 | x_core_install perl-base
111 |
112 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
113 | rm "$TARGET/usr/bin/awk"
114 | x_core_install mawk
115 |
116 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
117 | if doing_variant -; then
118 | x_core_install debconf
119 | fi
120 |
121 | baseprog=0
122 | bases=$(set -- $required; echo $#)
123 |
124 | info UNPACKREQ "Unpacking required packages..."
125 |
126 | smallyes '' |
127 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
128 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
129 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
130 |
131 | info CONFREQ "Configuring required packages..."
132 |
133 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
134 | echo \
135 | "#!/bin/sh
136 | echo
137 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
138 | chmod 755 "$TARGET/sbin/start-stop-daemon"
139 |
140 | setup_dselect_method apt
141 |
142 | smallyes '' |
143 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
144 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
145 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
146 |
147 | baseprog=0
148 | bases="$(set -- $base; echo $#)"
149 |
150 | info UNPACKBASE "Unpacking the base system..."
151 |
152 | smallyes '' |
153 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
154 | dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
155 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
156 |
157 | info CONFBASE "Configuring the base system..."
158 |
159 | smallyes '' |
160 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
161 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
162 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
163 |
164 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
165 |
166 | progress $bases $bases CONFBASE "Configuring base system"
167 | info BASESUCCESS "Base system installed successfully."
168 | }
169 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/edgy:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | case $ARCH in
3 | amd64|i386|powerpc|sparc)
4 | default_mirror http://archive.ubuntu.com/ubuntu
5 | ;;
6 | *)
7 | default_mirror http://ports.ubuntu.com/ubuntu-ports
8 | ;;
9 | esac
10 | mirror_style release
11 | download_style apt
12 | finddebs_style from-indices
13 | variants - buildd fakechroot
14 |
15 | if doing_variant fakechroot; then
16 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
17 | fi
18 |
19 | case $ARCH in
20 | alpha|ia64) LIBC="libc6.1" ;;
21 | *) LIBC="libc6" ;;
22 | esac
23 |
24 | work_out_debs () {
25 | required="$(get_debs Priority: required)"
26 |
27 | if doing_variant -; then
28 | #required="$required $(get_debs Priority: important)"
29 | # ^^ should be getting debconf here somehow maybe
30 | base="$(get_debs Priority: important)"
31 | elif doing_variant buildd; then
32 | # TODO: add Build-Essential: yes extraoverrides
33 | #base="$(get_debs Build-Essential: yes)"
34 |
35 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
36 |
37 | base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules"
38 |
39 | add ia64 base "libunwind7-dev"
40 | add sparc base "lib64gcc1"
41 | add sparc base "libc6-dev-sparc64"
42 | add sparc base "libc6-sparc64"
43 | elif doing_variant fakechroot; then
44 | base="apt"
45 | fi
46 | }
47 |
48 | first_stage_install () {
49 | extract $required
50 |
51 | mkdir -p "$TARGET/var/lib/dpkg"
52 | : >"$TARGET/var/lib/dpkg/status"
53 | : >"$TARGET/var/lib/dpkg/available"
54 |
55 | setup_etc
56 | if [ ! -e "$TARGET/etc/fstab" ]; then
57 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
58 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
59 | fi
60 |
61 | x_feign_install () {
62 | local pkg="$1"
63 | local deb="$(debfor $pkg)"
64 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
65 |
66 | mkdir -p "$TARGET/var/lib/dpkg/info"
67 |
68 | echo \
69 | "Package: $pkg
70 | Version: $ver
71 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
72 |
73 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
74 | }
75 |
76 | x_feign_install dpkg
77 | }
78 |
79 | second_stage_install () {
80 | x_core_install () {
81 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
82 | }
83 |
84 | p () {
85 | baseprog="$(($baseprog + ${1:-1}))"
86 | }
87 |
88 | setup_devices
89 |
90 | if doing_variant fakechroot; then
91 | setup_proc_fakechroot
92 | else
93 | setup_proc
94 | in_target /sbin/ldconfig
95 | fi
96 |
97 | DEBIAN_FRONTEND=noninteractive
98 | DEBCONF_NONINTERACTIVE_SEEN=true
99 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
100 |
101 | baseprog=0
102 | bases=7
103 |
104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
105 | info INSTCORE "Installing core packages..."
106 |
107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
108 | ln -sf mawk "$TARGET/usr/bin/awk"
109 | x_core_install base-files base-passwd
110 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
111 | x_core_install dpkg
112 |
113 | if [ ! -e "$TARGET/etc/localtime" ]; then
114 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
115 | fi
116 |
117 | if doing_variant fakechroot; then
118 | install_fakechroot_tools
119 | fi
120 |
121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
122 | x_core_install $LIBC
123 |
124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
125 | x_core_install perl-base
126 |
127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
128 | rm "$TARGET/usr/bin/awk"
129 | x_core_install mawk
130 |
131 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
132 | if doing_variant -; then
133 | x_core_install debconf
134 | fi
135 |
136 | baseprog=0
137 | bases=$(set -- $required; echo $#)
138 |
139 | info UNPACKREQ "Unpacking required packages..."
140 |
141 | smallyes '' |
142 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
143 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
144 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
145 |
146 | info CONFREQ "Configuring required packages..."
147 |
148 | if doing_variant fakechroot; then
149 | # fix initscripts postinst (no mounting possible, and wrong if condition)
150 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst"
151 | fi
152 |
153 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
154 | echo \
155 | "#!/bin/sh
156 | echo
157 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
158 | chmod 755 "$TARGET/sbin/start-stop-daemon"
159 |
160 | setup_dselect_method apt
161 |
162 | smallyes '' |
163 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
164 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
165 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
166 |
167 | baseprog=0
168 | bases="$(set -- $base; echo $#)"
169 |
170 | info UNPACKBASE "Unpacking the base system..."
171 |
172 | smallyes '' |
173 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
174 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
175 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
176 |
177 | info CONFBASE "Configuring the base system..."
178 |
179 | smallyes '' |
180 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
181 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
182 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
183 |
184 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
185 |
186 | progress $bases $bases CONFBASE "Configuring base system"
187 | info BASESUCCESS "Base system installed successfully."
188 | }
189 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/etch:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/etch-m68k:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/feisty:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | case $ARCH in
3 | amd64|i386|powerpc|sparc)
4 | default_mirror http://archive.ubuntu.com/ubuntu
5 | ;;
6 | *)
7 | default_mirror http://ports.ubuntu.com/ubuntu-ports
8 | ;;
9 | esac
10 | mirror_style release
11 | download_style apt
12 | finddebs_style from-indices
13 | variants - buildd fakechroot
14 |
15 | if doing_variant fakechroot; then
16 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
17 | fi
18 |
19 | case $ARCH in
20 | alpha|ia64) LIBC="libc6.1" ;;
21 | *) LIBC="libc6" ;;
22 | esac
23 |
24 | work_out_debs () {
25 | required="$(get_debs Priority: required)"
26 |
27 | if doing_variant -; then
28 | #required="$required $(get_debs Priority: important)"
29 | # ^^ should be getting debconf here somehow maybe
30 | base="$(get_debs Priority: important)"
31 | elif doing_variant buildd; then
32 | # TODO: add Build-Essential: yes extraoverrides
33 | #base="$(get_debs Build-Essential: yes)"
34 |
35 | add () { if [ "$ARCH" = "$1" ]; then eval "$2=\"\$$2 $3\""; fi; }
36 |
37 | base="apt binutils cpio cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 ${LIBC}-dev libdb4.4 libgdbm3 libstdc++6 libstdc++6-4.1-dev linux-libc-dev make patch perl perl-modules"
38 |
39 | add ia64 base "libunwind7-dev"
40 | add sparc base "lib64gcc1"
41 | add sparc base "libc6-dev-sparc64"
42 | add sparc base "libc6-sparc64"
43 | elif doing_variant fakechroot; then
44 | base="apt"
45 | fi
46 | }
47 |
48 | first_stage_install () {
49 | extract $required
50 |
51 | mkdir -p "$TARGET/var/lib/dpkg"
52 | : >"$TARGET/var/lib/dpkg/status"
53 | : >"$TARGET/var/lib/dpkg/available"
54 |
55 | setup_etc
56 | if [ ! -e "$TARGET/etc/fstab" ]; then
57 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
58 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
59 | fi
60 |
61 | x_feign_install () {
62 | local pkg="$1"
63 | local deb="$(debfor $pkg)"
64 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
65 |
66 | mkdir -p "$TARGET/var/lib/dpkg/info"
67 |
68 | echo \
69 | "Package: $pkg
70 | Version: $ver
71 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
72 |
73 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
74 | }
75 |
76 | x_feign_install dpkg
77 | }
78 |
79 | second_stage_install () {
80 | x_core_install () {
81 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
82 | }
83 |
84 | p () {
85 | baseprog="$(($baseprog + ${1:-1}))"
86 | }
87 |
88 | setup_devices
89 |
90 | if doing_variant fakechroot; then
91 | setup_proc_fakechroot
92 | else
93 | setup_proc
94 | in_target /sbin/ldconfig
95 | fi
96 |
97 | DEBIAN_FRONTEND=noninteractive
98 | DEBCONF_NONINTERACTIVE_SEEN=true
99 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
100 |
101 | baseprog=0
102 | bases=7
103 |
104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
105 | info INSTCORE "Installing core packages..."
106 |
107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
108 | ln -sf mawk "$TARGET/usr/bin/awk"
109 | x_core_install base-files base-passwd
110 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
111 | x_core_install dpkg
112 |
113 | if [ ! -e "$TARGET/etc/localtime" ]; then
114 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
115 | fi
116 |
117 | if doing_variant fakechroot; then
118 | install_fakechroot_tools
119 | fi
120 |
121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
122 | x_core_install $LIBC
123 |
124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
125 | x_core_install perl-base
126 |
127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
128 | rm "$TARGET/usr/bin/awk"
129 | x_core_install mawk
130 |
131 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
132 | if doing_variant -; then
133 | x_core_install debconf
134 | fi
135 |
136 | baseprog=0
137 | bases=$(set -- $required; echo $#)
138 |
139 | info UNPACKREQ "Unpacking required packages..."
140 |
141 | smallyes '' |
142 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
143 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
144 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
145 |
146 | info CONFREQ "Configuring required packages..."
147 |
148 | if doing_variant fakechroot; then
149 | # fix initscripts postinst (no mounting possible, and wrong if condition)
150 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst"
151 |
152 | # kill libdevmapper postinst; it tries to create /dev/mapper/
153 | rm "$TARGET/var/lib/dpkg/info/libdevmapper1"*.postinst
154 | fi
155 |
156 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
157 | echo \
158 | "#!/bin/sh
159 | echo
160 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
161 | chmod 755 "$TARGET/sbin/start-stop-daemon"
162 |
163 | setup_dselect_method apt
164 |
165 | smallyes '' |
166 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
167 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
168 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
169 |
170 | baseprog=0
171 | bases="$(set -- $base; echo $#)"
172 |
173 | info UNPACKBASE "Unpacking the base system..."
174 |
175 | smallyes '' |
176 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
177 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
178 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
179 |
180 | info CONFBASE "Configuring the base system..."
181 |
182 | smallyes '' |
183 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" \
184 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
185 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
186 |
187 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
188 |
189 | progress $bases $bases CONFBASE "Configuring base system"
190 | info BASESUCCESS "Base system installed successfully."
191 | }
192 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/gutsy:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | case $ARCH in
3 | amd64|i386)
4 | default_mirror http://archive.ubuntu.com/ubuntu
5 | ;;
6 | sparc)
7 | case $SUITE in
8 | gutsy)
9 | default_mirror http://archive.ubuntu.com/ubuntu
10 | ;;
11 | *)
12 | default_mirror http://ports.ubuntu.com/ubuntu-ports
13 | ;;
14 | esac
15 | ;;
16 | *)
17 | default_mirror http://ports.ubuntu.com/ubuntu-ports
18 | ;;
19 | esac
20 | mirror_style release
21 | download_style apt
22 | finddebs_style from-indices
23 | variants - buildd fakechroot minbase
24 | keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg
25 |
26 | if doing_variant fakechroot; then
27 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
28 | fi
29 |
30 | case $ARCH in
31 | alpha|ia64) LIBC="libc6.1" ;;
32 | *) LIBC="libc6" ;;
33 | esac
34 |
35 | work_out_debs () {
36 | required="$(get_debs Priority: required)"
37 |
38 | if doing_variant -; then
39 | #required="$required $(get_debs Priority: important)"
40 | # ^^ should be getting debconf here somehow maybe
41 | base="$(get_debs Priority: important)"
42 | elif doing_variant buildd; then
43 | base="$(get_debs Build-Essential: yes)"
44 | elif doing_variant fakechroot || doing_variant minbase; then
45 | base="apt"
46 | fi
47 |
48 | case $MIRRORS in
49 | https://*)
50 | base="$base apt-transport-https ca-certificates"
51 | ;;
52 | esac
53 | }
54 |
55 | first_stage_install () {
56 | extract $required
57 |
58 | mkdir -p "$TARGET/var/lib/dpkg"
59 | : >"$TARGET/var/lib/dpkg/status"
60 | : >"$TARGET/var/lib/dpkg/available"
61 |
62 | setup_etc
63 | if [ ! -e "$TARGET/etc/fstab" ]; then
64 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
65 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
66 | fi
67 |
68 | x_feign_install () {
69 | local pkg="$1"
70 | local deb="$(debfor $pkg)"
71 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
72 |
73 | mkdir -p "$TARGET/var/lib/dpkg/info"
74 |
75 | echo \
76 | "Package: $pkg
77 | Version: $ver
78 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
79 |
80 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
81 | }
82 |
83 | x_feign_install dpkg
84 | }
85 |
86 | second_stage_install () {
87 | x_core_install () {
88 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
89 | }
90 |
91 | p () {
92 | baseprog="$(($baseprog + ${1:-1}))"
93 | }
94 |
95 | setup_devices
96 |
97 | if doing_variant fakechroot; then
98 | setup_proc_fakechroot
99 | else
100 | setup_proc
101 | in_target /sbin/ldconfig
102 | fi
103 |
104 | DEBIAN_FRONTEND=noninteractive
105 | DEBCONF_NONINTERACTIVE_SEEN=true
106 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
107 |
108 | baseprog=0
109 | bases=7
110 |
111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
112 | info INSTCORE "Installing core packages..."
113 |
114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
115 | ln -sf mawk "$TARGET/usr/bin/awk"
116 | x_core_install base-passwd
117 | x_core_install base-files
118 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
119 | x_core_install dpkg
120 |
121 | if [ ! -e "$TARGET/etc/localtime" ]; then
122 | ln -sf /usr/share/zoneinfo/Etc/UTC "$TARGET/etc/localtime"
123 | fi
124 |
125 | if doing_variant fakechroot; then
126 | install_fakechroot_tools
127 | fi
128 |
129 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
130 | x_core_install $LIBC
131 |
132 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
133 | x_core_install perl-base
134 |
135 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
136 | rm "$TARGET/usr/bin/awk"
137 | x_core_install mawk
138 |
139 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
140 | if doing_variant -; then
141 | x_core_install debconf
142 | fi
143 |
144 | baseprog=0
145 | bases=$(set -- $required; echo $#)
146 |
147 | info UNPACKREQ "Unpacking required packages..."
148 |
149 | smallyes '' |
150 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
151 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 |
152 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
153 |
154 | info CONFREQ "Configuring required packages..."
155 |
156 | if doing_variant fakechroot; then
157 | # fix initscripts postinst (no mounting possible, and wrong if condition)
158 | sed -i '/dpkg.*--compare-versions/ s/\/lt-nl/' "$TARGET/var/lib/dpkg/info/initscripts.postinst"
159 | fi
160 |
161 | echo \
162 | "#!/bin/sh
163 | exit 101" > "$TARGET/usr/sbin/policy-rc.d"
164 | chmod 755 "$TARGET/usr/sbin/policy-rc.d"
165 |
166 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
167 | echo \
168 | "#!/bin/sh
169 | echo
170 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
171 | chmod 755 "$TARGET/sbin/start-stop-daemon"
172 |
173 | if [ -x "$TARGET/sbin/initctl" ]; then
174 | mv "$TARGET/sbin/initctl" "$TARGET/sbin/initctl.REAL"
175 | echo \
176 | "#!/bin/sh
177 | if [ \"\$1\" = version ]; then exec /sbin/initctl.REAL \"\$@\"; fi
178 | echo
179 | echo \"Warning: Fake initctl called, doing nothing\"" > "$TARGET/sbin/initctl"
180 | chmod 755 "$TARGET/sbin/initctl"
181 | fi
182 |
183 | setup_dselect_method apt
184 |
185 | smallyes '' |
186 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
187 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 |
188 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
189 |
190 | baseprog=0
191 | bases="$(set -- $base; echo $#)"
192 |
193 | info UNPACKBASE "Unpacking the base system..."
194 |
195 | setup_available $required $base
196 | done_predeps=
197 | while predep=$(get_next_predep); do
198 | # We have to resolve dependencies of pre-dependencies manually because
199 | # dpkg --predep-package doesn't handle this.
200 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps")
201 | # XXX: progress is tricky due to how dpkg_progress works
202 | # -- cjwatson 2009-07-29
203 | p; smallyes '' |
204 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep)
205 | base=$(without "$base" "$predep")
206 | done_predeps="$done_predeps $predep"
207 | done
208 |
209 | smallyes '' |
210 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
211 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 |
212 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
213 |
214 | info CONFBASE "Configuring the base system..."
215 |
216 | smallyes '' |
217 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \
218 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 |
219 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
220 |
221 | if [ -x "$TARGET/sbin/initctl.REAL" ]; then
222 | mv "$TARGET/sbin/initctl.REAL" "$TARGET/sbin/initctl"
223 | fi
224 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
225 | rm -f "$TARGET/usr/sbin/policy-rc.d"
226 |
227 | progress $bases $bases CONFBASE "Configuring base system"
228 | info BASESUCCESS "Base system installed successfully."
229 | }
230 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/hardy:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/hoary:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | default_mirror http://old-releases.ubuntu.com/ubuntu
3 | mirror_style release
4 | download_style apt
5 |
6 | case $ARCH in
7 | ia64) LIBC="libc6.1" ;;
8 | *) LIBC="libc6" ;;
9 | esac
10 |
11 | work_out_debs () {
12 |
13 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-iconv-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libpopt0 login makedev mawk mount ncurses-base ncurses-bin passwd perl-base procps python-minimal python2.4-minimal sed slang1a-utf8 lsb-base initscripts sysvinit sysv-rc tar util-linux zlib1g whiptail libgcc1 gcc-3.3-base libstdc++5"
14 |
15 | base="adduser alsa-base alsa-utils apt apt-utils aptitude at base-config bind9-host bsdmainutils bzip2 console-common console-data console-tools cpio cramfsprogs cron dash dhcp3-client dhcp3-common discover1 discover1-data dmsetup dnsutils dosfstools ed eject ethtool evms evms-ncurses fdutils file ftp gettext-base gnupg grepmap groff-base hdparm hotplug ifrename ifupdown info initrd-tools iproute iptables iputils-arping iputils-ping iputils-tracepath jfsutils klogd less libasound2 libbz2-1.0 libconsole libdb4.2 libdevmapper1.00 libdiscover1 libdns16 libevms-2.5 libfribidi0 libgc1 libgcrypt11 libgdbm3 libgnutls11 libgpg-error0 libgpmg1 libidn11 libisc7 libiw27 libldap2 liblockfile1 liblwres1 liblzo1 libmagic1 libncursesw5 libopencdk8 libparted1.6-12 libpcap0.8 libreiserfs0.3-0 libsasl2 libsasl2-modules libsigc++-1.2-5c102 libssl0.9.7 libtasn1-2 libusb-0.1-4 libwrap0 locales logrotate lsb-release lshw lsof lvm-common lvm10 lvm2 mailx man-db manpages mdadm mii-diag mime-support module-init-tools mtr-tiny mutt nano net-tools netbase netcat netkit-inetd ntp ntpdate openssh-client parted pciutils popularity-contest postfix postfix-tls ppp pppconfig pppoeconf psmisc python python2.4 reiser4progs reiserfsprogs reportbug rsync strace sudo sysklogd tcpd tcpdump telnet time ubuntu-base ubuntu-keyring udev usbutils vim vim-common w3m wget wireless-tools xfsprogs"
16 |
17 | without_package () {
18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
19 | }
20 | subst_package () {
21 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
22 | }
23 |
24 | case $ARCH in
25 | "i386")
26 | required="$required libc6 libc6-i686"
27 | base="$base dmidecode libelfg0 ltrace memtest86+ libreadline4"
28 | ;;
29 | "powerpc")
30 | required="$required libc6 libreadline4"
31 | base="$base hfsplus hfsutils libelfg0 libhfsp0 ltrace mac-fdisk pmac-fdisk powerpc-utils"
32 | ;;
33 | "amd64")
34 | required="$required libc6"
35 | base="$base dmidecode libelfg0 ltrace memtest86+ libreadline4"
36 | ;;
37 | "ia64")
38 | required="$required libc6.1 libunwind7"
39 | base="$base dmidecode libreadline4"
40 | ;;
41 | "sparc")
42 | required="$required libc6"
43 | base="$base lib64gcc1 libc6-sparc64 libreadline4"
44 | ;;
45 | *)
46 | # who knows?
47 | ;;
48 | esac
49 | }
50 |
51 | install_debs () {
52 | first_stage_install
53 | second_stage_install
54 | }
55 |
56 | first_stage_install () {
57 | extract $required
58 |
59 | mkdir -p "$TARGET/var/lib/dpkg"
60 | : >"$TARGET/var/lib/dpkg/status"
61 | echo >"$TARGET/var/lib/dpkg/available"
62 |
63 | setup_etc
64 | if [ ! -e "$TARGET/etc/fstab" ]; then
65 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
66 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
67 | fi
68 |
69 | x_feign_install () {
70 | local pkg="$1"
71 | local deb="$(debfor $pkg)"
72 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
73 |
74 | mkdir -p "$TARGET/var/lib/dpkg/info"
75 |
76 | echo \
77 | "Package: $pkg
78 | Version: $ver
79 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
80 |
81 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
82 | }
83 |
84 | x_feign_install dpkg
85 | }
86 |
87 | second_stage_install () {
88 | x_core_install () {
89 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
90 | }
91 | p () {
92 | baseprog="$(($baseprog + ${1:-1}))"
93 | }
94 |
95 | DEBIAN_FRONTEND=noninteractive
96 | DEBCONF_NONINTERACTIVE_SEEN=true
97 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
98 |
99 | baseprog=0
100 | bases=7
101 |
102 | setup_devices
103 | setup_proc
104 | umount_on_exit /.dev
105 | umount_on_exit /dev
106 | in_target /sbin/ldconfig
107 |
108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
109 | info INSTCORE "Installing core packages..."
110 |
111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
112 | ln -sf mawk "$TARGET/usr/bin/awk"
113 | x_core_install base-files base-passwd
114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
115 | x_core_install dpkg
116 |
117 | if [ ! -e "$TARGET/etc/localtime" ]; then
118 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
119 | fi
120 |
121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
122 | x_core_install $LIBC
123 |
124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
125 | x_core_install perl-base
126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
127 | rm "$TARGET/usr/bin/awk"
128 | x_core_install mawk
129 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
130 | x_core_install debconf
131 |
132 | baseprog=0
133 | bases="$(set -- $required; echo $#)"
134 |
135 | info UNPACKREQ "Unpacking required packages..."
136 |
137 | smallyes '' | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
138 |
139 | baseprog=0
140 |
141 | info CONFREQ "Configuring required packages..."
142 |
143 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
144 | echo \
145 | "#!/bin/sh
146 | echo
147 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
148 | chmod 755 "$TARGET/sbin/start-stop-daemon"
149 |
150 | setup_dselect_method apt
151 | #on_exit "(in_target_nofail umount /dev/pts) || true"
152 |
153 | smallyes '' | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
154 |
155 | baseprog=0
156 | bases="$(set -- $base; echo $#)"
157 |
158 | info UNPACKBASE "Unpacking the base system..."
159 |
160 | smallyes '' | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
161 |
162 | baseprog=0
163 |
164 | info CONFBASE "Configuring the base system..."
165 |
166 | mv "$TARGET/usr/sbin/sendmail" "$TARGET/usr/sbin/sendmail.REAL"
167 | ln -s /bin/true "$TARGET/usr/sbin/sendmail"
168 |
169 | smallyes '' | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
170 |
171 | rm -f "$TARGET/usr/sbin/sendmail"
172 | mv "$TARGET/usr/sbin/sendmail.REAL" "$TARGET/usr/sbin/sendmail"
173 |
174 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
175 |
176 | progress $bases $bases CONFBASE "Configuring base system"
177 | info BASESUCCESS "Base system installed successfully."
178 | }
179 |
180 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/hoary.buildd:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | default_mirror http://old-releases.ubuntu.com/ubuntu
3 | mirror_style release
4 | download_style apt
5 |
6 | LIBC=libc6
7 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
8 | LIBC="libc6.1"
9 | fi
10 |
11 | work_out_debs () {
12 | required="base-files base-passwd bash bsdutils build-essential coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs fakeroot findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login lsb-base mawk mount ncurses-base ncurses-bin passwd perl-base pkgstriptranslations python-minimal python2.4-minimal sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
13 |
14 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules"
15 |
16 | without_package () {
17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
18 | }
19 | subst_package () {
20 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
21 | }
22 |
23 | case $ARCH in
24 | "amd64")
25 | ;;
26 | "i386")
27 | ;;
28 | "powerpc")
29 | ;;
30 | "ia64")
31 | required="$(subst_package "libc6" "libc6.1" "$required")"
32 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
33 | base="$base libunwind7 libunwind7-dev"
34 | ;;
35 |
36 | # Unsupported architectures:
37 | "alpha")
38 | required="$(subst_package "libc6" "libc6.1" "$required")"
39 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
40 | ;;
41 | *)
42 | # who knows?
43 | ;;
44 | esac
45 | }
46 |
47 | install_debs () {
48 | first_stage_install
49 | second_stage_install
50 | }
51 |
52 | first_stage_install () {
53 | extract $required
54 |
55 | mkdir -p "$TARGET/var/lib/dpkg"
56 | : >"$TARGET/var/lib/dpkg/status"
57 | echo >"$TARGET/var/lib/dpkg/available"
58 |
59 | setup_etc
60 | if [ ! -e "$TARGET/etc/fstab" ]; then
61 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
62 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
63 | fi
64 |
65 | x_feign_install () {
66 | local pkg="$1"
67 | local deb="$(debfor $pkg)"
68 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
69 |
70 | mkdir -p "$TARGET/var/lib/dpkg/info"
71 |
72 | echo \
73 | "Package: $pkg
74 | Version: $ver
75 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
76 |
77 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
78 | }
79 |
80 | x_feign_install dpkg
81 | }
82 |
83 | second_stage_install () {
84 | x_core_install () {
85 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
86 | }
87 | p () {
88 | baseprog="$(($baseprog + ${1:-1}))"
89 | }
90 |
91 | DEBIAN_FRONTEND=noninteractive
92 | export DEBIAN_FRONTEND
93 |
94 | baseprog=0
95 | bases=40
96 |
97 | setup_devices
98 | setup_proc
99 | in_target /sbin/ldconfig
100 |
101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
102 | info INSTCORE "Installing core packages..."
103 |
104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
105 | ln -sf mawk "$TARGET/usr/bin/awk"
106 | x_core_install base-files base-passwd
107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
108 | x_core_install dpkg
109 |
110 | if [ ! -e "$TARGET/etc/localtime" ]; then
111 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
112 | fi
113 |
114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
115 | x_core_install $LIBC
116 |
117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
118 | x_core_install perl-base
119 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
120 | rm "$TARGET/usr/bin/awk"
121 | x_core_install mawk
122 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
123 |
124 | info UNPACKREQ "Unpacking required packages..."
125 |
126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #8
127 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
128 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #18
129 |
130 | info CONFREQ "Configuring required packages..."
131 |
132 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
133 | echo \
134 | "#!/bin/sh
135 | echo
136 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
137 | chmod 755 "$TARGET/sbin/start-stop-daemon"
138 |
139 | setup_dselect_method apt
140 | #on_exit "in_target_nofail umount /dev/pts"
141 |
142 | p; progress $baseprog $bases INSTCORE "Installing core packages" #19
143 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
144 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #29
145 |
146 | info INSTCORE "Installing base packages..."
147 |
148 | p; progress $baseprog $bases INSTCORE "Installing core packages" #30
149 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
150 |
151 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
152 |
153 | p 9; progress $baseprog $bases INSTCORE "Installing core packages" #39
154 |
155 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
156 |
157 | progress $bases $bases INSTCORE "Installing core packages" #40
158 | info BASESUCCESS "Base system installed successfully."
159 | }
160 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/intrepid:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/jaunty:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/jessie:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/karmic:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/lenny:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/lucid:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/maverick:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/natty:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/oldstable:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/oneiric:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/potato:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | mirror_style release
3 | download_style apt var-state
4 | force_md5
5 |
6 | LIBC=libc6
7 | if [ "$ARCH" = alpha ]; then
8 | LIBC="libc6.1"
9 | fi
10 |
11 | work_out_debs () {
12 | required="base-files base-passwd bash bsdutils debconf-tiny debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname ldso libc6 libdb2 libgdbmg1 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libpopt0 libreadline4 libstdc++2.10 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-5.005-base perl-base procps sed shellutils slang1 sysklogd sysvinit tar textutils update util-linux whiptail"
13 |
14 | base="adduser ae apt base-config elvis-tiny fbset fdutils gettext-base console-data console-tools console-tools-libs libdb2 libwrap0 locales modconf netbase ftp ppp pppconfig pump tasksel tcpd textutils telnet xviddetect"
15 |
16 | without_package () {
17 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
18 | }
19 |
20 | case $ARCH in
21 | "alpha")
22 | required="$(without_package "libc6" "$required") libc6.1"
23 | ;;
24 | "i386")
25 | base="$base fdflush isapnptools lilo mbr pciutils pcmcia-cs psmisc setserial syslinux"
26 | ;;
27 | *)
28 | # other arches may have special needs not yet represented here
29 | # oh well, Potato is old
30 | esac
31 | }
32 |
33 | first_stage_install () {
34 | extract $required
35 |
36 | :> "$TARGET/var/lib/dpkg/status"
37 | echo > "$TARGET/var/lib/dpkg/available"
38 |
39 | setup_etc
40 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
41 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
42 |
43 | x_feign_install () {
44 | local pkg=$1
45 | local deb="$(debfor $pkg)"
46 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
47 |
48 | mkdir -p "$TARGET/var/lib/dpkg/info"
49 |
50 | echo \
51 | "Package: $pkg
52 | Version: $ver
53 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
54 |
55 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
56 | }
57 |
58 | x_feign_install dpkg
59 |
60 | if [ -e "$TARGET/usr/bin/perl-5.005.dist" ]; then
61 | mv "$TARGET/usr/bin/perl-5.005.dist" "$TARGET/usr/bin/perl-5.005"
62 | fi
63 | if [ ! -e "$TARGET/usr/bin/perl" ]; then
64 | ln -sf perl-5.005 "$TARGET/usr/bin/perl"
65 | fi
66 | }
67 |
68 | second_stage_install () {
69 | x_core_install () {
70 | in_target dpkg --force-depends --install $(debfor "$@")
71 | }
72 |
73 | export DEBIAN_FRONTEND=Noninteractive
74 |
75 | setup_devices
76 | setup_proc
77 | ln "$TARGET/sbin/ldconfig.new" "$TARGET/sbin/ldconfig"
78 | in_target /sbin/ldconfig
79 |
80 | x_core_install base-files base-passwd ldso
81 | x_core_install dpkg
82 |
83 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
84 | x_core_install $LIBC
85 |
86 | smallyes '' | x_core_install perl-5.005-base
87 | x_core_install mawk
88 | x_core_install debconf-tiny
89 |
90 | in_target dpkg-preconfigure $(debfor $required $base)
91 |
92 | repeatn 5 in_target dpkg --force-depends --unpack $(debfor $required)
93 |
94 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
95 | cp "$TARGET/bin/true" "$TARGET/sbin/start-stop-daemon"
96 |
97 | setup_dselect_method apt
98 |
99 | in_target dpkg --configure --pending --force-configure-any --force-depends
100 |
101 | smallyes '' | repeatn 5 in_target dpkg --force-auto-select --force-overwrite --skip-same-version --install $(debfor $base)
102 |
103 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
104 | }
105 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/precise:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/quantal:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/raring:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/sarge:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | mirror_style release
3 | download_style apt
4 | force_md5
5 |
6 | LIBC=libc6
7 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
8 | LIBC="libc6.1"
9 | fi
10 |
11 | work_out_debs () {
12 |
13 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libperl5.8 libpopt0 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 initscripts sysvinit sysv-rc tar util-linux whiptail libgcc1 gcc-3.3-base libstdc++5"
14 |
15 | base="adduser apt apt-utils libdb4.2 at base-config aptitude libsigc++-1.2-5c102 bsdmainutils console-common console-tools libconsole console-data cpio cron dhcp-client ed exim4 exim4-base exim4-config exim4-daemon-light libgcrypt11 libgnutls11 libgpg-error0 libopencdk8 libtasn1-2 fdutils gettext-base groff-base ifupdown info klogd libssl0.9.7 liblzo1 zlib1g liblockfile1 libpcre3 libwrap0 logrotate mailx man-db libgdbm3 manpages nano net-tools netbase netkit-inetd iputils-ping nvi ppp pppconfig pppoe pppoeconf libpcap0.7 sysklogd tasksel libtextwrap1 tcpd telnet libtext-iconv-perl wget"
16 |
17 | without_package () {
18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
19 | }
20 | subst_package () {
21 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
22 | }
23 |
24 | IPFWTOOL=iptables
25 |
26 | case $ARCH in
27 | "alpha")
28 | required="$(subst_package "libc6" "libc6.1" "$required")"
29 | base="$base pciutils"
30 | IPFWTOOL="ipchains"
31 | ;;
32 | "arm")
33 | base="$base libgpmg1"
34 | IPFWTOOL="ipchains iptables"
35 | ;;
36 | "i386")
37 | required="$(without_package "libperl5.8" "$required")"
38 | base="$base pciutils psmisc"
39 | IPFWTOOL="ipchains iptables"
40 | ;;
41 | "ia64")
42 | required="$(subst_package "libc6" "libc6.1" "$required") libreadline4"
43 | base="$base elilo efibootmgr dosfstools libparted1.6-12 parted"
44 | ;;
45 | "m68k")
46 | required="$required libreadline4"
47 | base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross vmelilo"
48 | IPFWTOOL="ipchains"
49 | ;;
50 | "powerpc")
51 | required="$required libreadline4"
52 | base="$base mac-fdisk amiga-fdisk psmisc powerpc-utils pciutils hfsutils"
53 | IPFWTOOL="ipchains iptables"
54 | ;;
55 | "sparc")
56 | base="$base silo eject pciutils sparc-utils"
57 | IPFWTOOL="ipchains iptables"
58 | ;;
59 | "mips")
60 | base="$base dvhtool pciutils"
61 | ;;
62 | "mipsel")
63 | base="$base pciutils"
64 | ;;
65 | "hppa")
66 | base="$base palo pciutils"
67 | required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
68 | ;;
69 | s390|s390x)
70 | # base-config depends on console-tools and console-data
71 | # so we can't exclude them although they are useless on s390
72 | base="$base s390-tools telnetd devfsd"
73 | base="$(without_package "console-tools-libs" "$base")"
74 | base="$(without_package "fdutils" "$base")"
75 | base="$(without_package "ppp" "$base")"
76 | base="$(without_package "pppconfig" "$base")"
77 | base="$(without_package "pppoe" "$base")"
78 | base="$(without_package "pppoeconf" "$base")"
79 | ;;
80 | sh*)
81 | base="$base libstdc++3 gcc-3.0-base"
82 | base="$(without_package "fdutils" "$base")"
83 | required="$required libgcc1"
84 | required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
85 | ;;
86 | "amd64")
87 | base="$base pciutils psmisc"
88 | IPFWTOOL="iptables"
89 | ;;
90 | *)
91 | # who knows?
92 | ;;
93 | esac
94 |
95 | base="$base $IPFWTOOL"
96 | }
97 |
98 | first_stage_install () {
99 | extract $required
100 |
101 | mkdir -p "$TARGET/var/lib/dpkg"
102 | : >"$TARGET/var/lib/dpkg/status"
103 | echo >"$TARGET/var/lib/dpkg/available"
104 |
105 | setup_etc
106 | if [ ! -e "$TARGET/etc/fstab" ]; then
107 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
108 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
109 | fi
110 |
111 | x_feign_install () {
112 | local pkg="$1"
113 | local deb="$(debfor $pkg)"
114 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
115 |
116 | mkdir -p "$TARGET/var/lib/dpkg/info"
117 |
118 | echo \
119 | "Package: $pkg
120 | Version: $ver
121 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
122 |
123 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
124 | }
125 |
126 | x_feign_install dpkg
127 | }
128 |
129 | second_stage_install () {
130 | x_core_install () {
131 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
132 | }
133 |
134 | p () {
135 | baseprog="$(($baseprog + ${1:-1}))"
136 | }
137 |
138 | setup_devices
139 | setup_proc
140 | in_target /sbin/ldconfig
141 |
142 | DEBIAN_FRONTEND=noninteractive
143 | DEBCONF_NONINTERACTIVE_SEEN=true
144 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
145 |
146 | baseprog=0
147 | bases=40
148 |
149 | p; progress $baseprog $bases INSTBASE "Installing base system" #1
150 | info INSTCORE "Installing core packages..."
151 |
152 | p; progress $baseprog $bases INSTBASE "Installing base system" #2
153 | ln -sf mawk "$TARGET/usr/bin/awk"
154 | x_core_install base-files base-passwd
155 | p; progress $baseprog $bases INSTBASE "Installing base system" #3
156 | x_core_install dpkg
157 |
158 | if [ ! -e "$TARGET/etc/localtime" ]; then
159 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
160 | fi
161 |
162 | p; progress $baseprog $bases INSTBASE "Installing base system" #4
163 | x_core_install $LIBC
164 |
165 | p; progress $baseprog $bases INSTBASE "Installing base system" #5
166 | x_core_install perl-base
167 | p; progress $baseprog $bases INSTBASE "Installing base system" #6
168 | rm "$TARGET/usr/bin/awk"
169 | x_core_install mawk
170 | p; progress $baseprog $bases INSTBASE "Installing base system" #7
171 | x_core_install debconf
172 |
173 | info UNPACKREQ "Unpacking required packages..."
174 |
175 | p; progress $baseprog $bases INSTBASE "Installing base system" #8
176 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
177 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
178 |
179 | info CONFREQ "Configuring required packages..."
180 |
181 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
182 | echo \
183 | "#!/bin/sh
184 | echo
185 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
186 | chmod 755 "$TARGET/sbin/start-stop-daemon"
187 |
188 | setup_dselect_method apt
189 |
190 | p; progress $baseprog $bases INSTBASE "Installing base system" #19
191 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
192 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
193 |
194 | # if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then
195 | # mkdir -p "$TARGET/etc/exim"
196 | # touch "$TARGET/etc/exim/exim.conf"
197 | # fi
198 |
199 | info INSTBASE "Installing base packages..."
200 |
201 | p; progress $baseprog $bases INSTBASE "Installing base system" #30
202 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
203 |
204 | rm -f "$TARGET/usr/sbin/sendmail"
205 | ln -sf /bin/true "$TARGET/usr/sbin/sendmail"
206 |
207 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
208 |
209 | rm -f "$TARGET/usr/sbin/sendmail"
210 | ln -sf exim4 "$TARGET/usr/sbin/sendmail"
211 |
212 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
213 |
214 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
215 |
216 | progress $bases $bases INSTBASE "Installing base system" #40
217 | info BASESUCCESS "Base system installed successfully."
218 | }
219 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/sarge.buildd:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | mirror_style release
3 | download_style apt
4 | force_md5
5 |
6 | LIBC=libc6
7 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
8 | LIBC="libc6.1"
9 | fi
10 |
11 | work_out_debs () {
12 |
13 | required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
14 |
15 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules"
16 |
17 | without_package () {
18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
19 | }
20 | subst_package () {
21 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
22 | }
23 |
24 | case $ARCH in
25 | "alpha")
26 | required="$(subst_package "libc6" "libc6.1" "$required")"
27 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
28 | ;;
29 | "arm")
30 | ;;
31 | "i386")
32 | ;;
33 | "ia64")
34 | required="$(subst_package "libc6" "libc6.1" "$required")"
35 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
36 | ;;
37 | "m68k")
38 | ;;
39 | "powerpc")
40 | ;;
41 | "sparc")
42 | ;;
43 | "mips")
44 | ;;
45 | "mipsel")
46 | ;;
47 | "hppa")
48 | ;;
49 | s390|s390x)
50 | ;;
51 | sh*)
52 | ;;
53 | *)
54 | # who knows?
55 | ;;
56 | esac
57 | }
58 |
59 | first_stage_install () {
60 | extract $required
61 |
62 | mkdir -p "$TARGET/var/lib/dpkg"
63 | : >"$TARGET/var/lib/dpkg/status"
64 | echo >"$TARGET/var/lib/dpkg/available"
65 |
66 | setup_etc
67 | if [ ! -e "$TARGET/etc/fstab" ]; then
68 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
69 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
70 | fi
71 |
72 | x_feign_install () {
73 | local pkg="$1"
74 | local deb="$(debfor $pkg)"
75 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
76 |
77 | mkdir -p "$TARGET/var/lib/dpkg/info"
78 |
79 | echo \
80 | "Package: $pkg
81 | Version: $ver
82 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
83 |
84 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
85 | }
86 |
87 | x_feign_install dpkg
88 | }
89 |
90 | second_stage_install () {
91 | x_core_install () {
92 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
93 | }
94 |
95 | p () {
96 | baseprog="$(($baseprog + ${1:-1}))"
97 | }
98 |
99 | setup_devices
100 | setup_proc
101 | in_target /sbin/ldconfig
102 |
103 | DEBIAN_FRONTEND=noninteractive
104 | export DEBIAN_FRONTEND
105 |
106 | baseprog=0
107 | bases=40
108 |
109 | p; progress $baseprog $bases INSTBASE "Installing base system" #1
110 | info INSTCORE "Installing core packages..."
111 |
112 | p; progress $baseprog $bases INSTBASE "Installing base system" #2
113 | ln -sf mawk "$TARGET/usr/bin/awk"
114 | x_core_install base-files base-passwd
115 | p; progress $baseprog $bases INSTBASE "Installing base system" #3
116 | x_core_install dpkg
117 |
118 | if [ ! -e "$TARGET/etc/localtime" ]; then
119 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
120 | fi
121 |
122 | p; progress $baseprog $bases INSTBASE "Installing base system" #4
123 | x_core_install $LIBC
124 |
125 | p; progress $baseprog $bases INSTBASE "Installing base system" #5
126 | x_core_install perl-base
127 | p; progress $baseprog $bases INSTBASE "Installing base system" #6
128 | rm "$TARGET/usr/bin/awk"
129 | x_core_install mawk
130 | p; progress $baseprog $bases INSTBASE "Installing base system" #7
131 |
132 | info UNPACKREQ "Unpacking required packages..."
133 |
134 | p; progress $baseprog $bases INSTBASE "Installing base system" #8
135 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
136 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
137 |
138 | info CONFREQ "Configuring required packages..."
139 |
140 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
141 | echo \
142 | "#!/bin/sh
143 | echo
144 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
145 | chmod 755 "$TARGET/sbin/start-stop-daemon"
146 |
147 | setup_dselect_method apt
148 |
149 | p; progress $baseprog $bases INSTBASE "Installing base system" #19
150 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
151 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
152 |
153 | info INSTBASE "Installing base packages..."
154 |
155 | p; progress $baseprog $bases INSTBASE "Installing base system" #30
156 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
157 |
158 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
159 |
160 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
161 |
162 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
163 |
164 | progress $bases $bases INSTBASE "Installing base system" #40
165 | info BASESUCCESS "Base system installed successfully."
166 | }
167 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/sarge.fakechroot:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
3 |
4 | mirror_style release
5 | download_style apt
6 | force_md5
7 |
8 | LIBC=libc6
9 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
10 | LIBC="libc6.1"
11 | fi
12 |
13 | work_out_debs () {
14 |
15 | required="base-files base-passwd bash bsdutils coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login mawk mount ncurses-base ncurses-bin passwd perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
16 |
17 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules"
18 |
19 | without_package () {
20 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
21 | }
22 | subst_package () {
23 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
24 | }
25 |
26 | required="$required binutils fakechroot"
27 | base="$(without_package "binutils" "$base")"
28 |
29 | case $ARCH in
30 | "alpha")
31 | required="$(subst_package "libc6" "libc6.1" "$required")"
32 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
33 | ;;
34 | "arm")
35 | ;;
36 | "i386")
37 | ;;
38 | "ia64")
39 | required="$(subst_package "libc6" "libc6.1" "$required")"
40 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
41 | ;;
42 | "m68k")
43 | ;;
44 | "powerpc")
45 | ;;
46 | "sparc")
47 | ;;
48 | "mips")
49 | ;;
50 | "mipsel")
51 | ;;
52 | "hppa")
53 | ;;
54 | s390|s390x)
55 | ;;
56 | sh*)
57 | ;;
58 | *)
59 | # who knows?
60 | ;;
61 | esac
62 | }
63 |
64 | first_stage_install () {
65 | extract $required
66 |
67 | mkdir -p "$TARGET/var/lib/dpkg"
68 | : >"$TARGET/var/lib/dpkg/status"
69 | : >"$TARGET/var/lib/dpkg/available"
70 |
71 | setup_etc
72 | if [ ! -e "$TARGET/etc/fstab" ]; then
73 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
74 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
75 | fi
76 |
77 | x_feign_install () {
78 | local pkg="$1"
79 | local deb="$(debfor $pkg)"
80 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
81 |
82 | mkdir -p "$TARGET/var/lib/dpkg/info"
83 |
84 | echo \
85 | "Package: $pkg
86 | Version: $ver
87 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
88 |
89 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
90 | }
91 |
92 | x_feign_install dpkg
93 | }
94 |
95 | second_stage_install () {
96 | x_core_install () {
97 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
98 | }
99 |
100 | p () {
101 | baseprog="$(($baseprog + ${1:-1}))"
102 | }
103 |
104 | setup_devices_fakechroot
105 | setup_proc_fakechroot
106 |
107 | DEBIAN_FRONTEND=noninteractive
108 | export DEBIAN_FRONTEND
109 |
110 | baseprog=0
111 | bases=40
112 |
113 | p; progress $baseprog $bases INSTBASE "Installing base system" #1
114 | info INSTCORE "Installing core packages..."
115 |
116 | p; progress $baseprog $bases INSTBASE "Installing base system" #2
117 | ln -sf mawk "$TARGET/usr/bin/awk"
118 | x_core_install base-files base-passwd
119 | p; progress $baseprog $bases INSTBASE "Installing base system" #3
120 | x_core_install dpkg
121 |
122 | if [ ! -e "$TARGET/etc/localtime" ]; then
123 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
124 | fi
125 |
126 | install_fakechroot_tools
127 |
128 | p; progress $baseprog $bases INSTBASE "Installing base system" #4
129 | x_core_install $LIBC
130 |
131 | p; progress $baseprog $bases INSTBASE "Installing base system" #5
132 | x_core_install perl-base
133 | p; progress $baseprog $bases INSTBASE "Installing base system" #6
134 | rm "$TARGET/usr/bin/awk"
135 | x_core_install mawk
136 | p; progress $baseprog $bases INSTBASE "Installing base system" #7
137 |
138 | info UNPACKREQ "Unpacking required packages..."
139 |
140 | p; progress $baseprog $bases INSTBASE "Installing base system" #8
141 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
142 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
143 |
144 | info CONFREQ "Configuring required packages..."
145 |
146 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
147 | echo \
148 | "#!/bin/sh
149 | echo
150 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
151 | chmod 755 "$TARGET/sbin/start-stop-daemon"
152 |
153 | setup_dselect_method apt
154 |
155 | p; progress $baseprog $bases INSTBASE "Installing base system" #19
156 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
157 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
158 |
159 | info INSTBASE "Installing base packages..."
160 |
161 | p; progress $baseprog $bases INSTBASE "Installing base system" #30
162 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
163 |
164 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
165 |
166 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
167 |
168 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
169 |
170 | progress $bases $bases INSTBASE "Installing base system" #40
171 | info BASESUCCESS "Base system installed successfully."
172 | }
173 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/saucy:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/sid:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | mirror_style release
3 | download_style apt
4 | finddebs_style from-indices
5 | variants - buildd fakechroot minbase scratchbox
6 | keyring /usr/share/keyrings/debian-archive-keyring.gpg
7 |
8 | if doing_variant fakechroot; then
9 | test "$FAKECHROOT" = "true" || error 1 FAKECHROOTREQ "This variant requires fakechroot environment to be started"
10 | fi
11 |
12 | case $ARCH in
13 | alpha|ia64) LIBC="libc6.1" ;;
14 | kfreebsd-*) LIBC="libc0.1" ;;
15 | hurd-*) LIBC="libc0.3" ;;
16 | *) LIBC="libc6" ;;
17 | esac
18 |
19 | work_out_debs () {
20 | required="$(get_debs Priority: required)"
21 |
22 | if doing_variant - || doing_variant fakechroot; then
23 | #required="$required $(get_debs Priority: important)"
24 | # ^^ should be getting debconf here somehow maybe
25 | base="$(get_debs Priority: important)"
26 | elif doing_variant buildd || doing_variant scratchbox; then
27 | base="apt build-essential"
28 | elif doing_variant minbase; then
29 | base="apt"
30 | fi
31 |
32 | if doing_variant fakechroot; then
33 | # ldd.fake needs binutils
34 | required="$required binutils"
35 | fi
36 |
37 | case $MIRRORS in
38 | https://*)
39 | base="$base apt-transport-https ca-certificates"
40 | ;;
41 | esac
42 | }
43 |
44 | first_stage_install () {
45 | extract $required
46 |
47 | mkdir -p "$TARGET/var/lib/dpkg"
48 | : >"$TARGET/var/lib/dpkg/status"
49 | : >"$TARGET/var/lib/dpkg/available"
50 |
51 | setup_etc
52 | if [ ! -e "$TARGET/etc/fstab" ]; then
53 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
54 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
55 | fi
56 |
57 | x_feign_install () {
58 | local pkg="$1"
59 | local deb="$(debfor $pkg)"
60 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
61 |
62 | mkdir -p "$TARGET/var/lib/dpkg/info"
63 |
64 | echo \
65 | "Package: $pkg
66 | Version: $ver
67 | Maintainer: unknown
68 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
69 |
70 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
71 | }
72 |
73 | x_feign_install dpkg
74 | }
75 |
76 | second_stage_install () {
77 | setup_devices
78 |
79 | x_core_install () {
80 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
81 | }
82 |
83 | p () {
84 | baseprog="$(($baseprog + ${1:-1}))"
85 | }
86 |
87 | if doing_variant fakechroot; then
88 | setup_proc_fakechroot
89 | elif doing_variant scratchbox; then
90 | true
91 | else
92 | setup_proc
93 | in_target /sbin/ldconfig
94 | fi
95 |
96 | DEBIAN_FRONTEND=noninteractive
97 | DEBCONF_NONINTERACTIVE_SEEN=true
98 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
99 |
100 | baseprog=0
101 | bases=7
102 |
103 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
104 | info INSTCORE "Installing core packages..."
105 |
106 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
107 | ln -sf mawk "$TARGET/usr/bin/awk"
108 | x_core_install base-passwd
109 | x_core_install base-files
110 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
111 | x_core_install dpkg
112 |
113 | if [ ! -e "$TARGET/etc/localtime" ]; then
114 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
115 | fi
116 |
117 | if doing_variant fakechroot; then
118 | install_fakechroot_tools
119 | fi
120 |
121 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
122 | x_core_install $LIBC
123 |
124 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
125 | x_core_install perl-base
126 |
127 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
128 | rm "$TARGET/usr/bin/awk"
129 | x_core_install mawk
130 |
131 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
132 | if doing_variant -; then
133 | x_core_install debconf
134 | fi
135 |
136 | baseprog=0
137 | bases=$(set -- $required; echo $#)
138 |
139 | info UNPACKREQ "Unpacking required packages..."
140 |
141 | exec 7>&1
142 |
143 | smallyes '' |
144 | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" \
145 | dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 || echo EXITCODE $?) |
146 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING
147 |
148 | info CONFREQ "Configuring required packages..."
149 |
150 | echo \
151 | "#!/bin/sh
152 | exit 101" > "$TARGET/usr/sbin/policy-rc.d"
153 | chmod 755 "$TARGET/usr/sbin/policy-rc.d"
154 |
155 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
156 | echo \
157 | "#!/bin/sh
158 | echo
159 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
160 | chmod 755 "$TARGET/sbin/start-stop-daemon"
161 |
162 | setup_dselect_method apt
163 |
164 | smallyes '' |
165 | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" \
166 | dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 || echo EXITCODE $?) |
167 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING
168 |
169 | baseprog=0
170 | bases="$(set -- $base; echo $#)"
171 |
172 | info UNPACKBASE "Unpacking the base system..."
173 |
174 | setup_available $required $base
175 | done_predeps=
176 | while predep=$(get_next_predep); do
177 | # We have to resolve dependencies of pre-dependencies manually because
178 | # dpkg --predep-package doesn't handle this.
179 | predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps")
180 | # XXX: progress is tricky due to how dpkg_progress works
181 | # -- cjwatson 2009-07-29
182 | p; smallyes '' |
183 | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep)
184 | base=$(without "$base" "$predep")
185 | done_predeps="$done_predeps $predep"
186 | done
187 |
188 | smallyes '' |
189 | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" \
190 | dpkg --status-fd 8 --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 || echo EXITCODE $?) |
191 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING
192 |
193 | info CONFBASE "Configuring the base system..."
194 |
195 | smallyes '' |
196 | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \
197 | dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) |
198 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING
199 |
200 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
201 | rm -f "$TARGET/usr/sbin/policy-rc.d"
202 |
203 | progress $bases $bases CONFBASE "Configuring base system"
204 | info BASESUCCESS "Base system installed successfully."
205 | }
206 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/squeeze:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/stable:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/testing:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/trusty:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/unstable:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/utopic:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/vivid:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/warty:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | default_mirror http://old-releases.ubuntu.com/ubuntu
3 | mirror_style release
4 | download_style apt
5 |
6 | LIBC=libc6
7 |
8 | work_out_debs () {
9 |
10 | required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-iconv-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libpopt0 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 lsb-base initscripts sysvinit sysv-rc tar util-linux zlib1g whiptail libgcc1 gcc-3.3-base libstdc++5"
11 |
12 | base="adduser alsa-base alsa-utils apt apt-utils aptitude at base-config bind9-host bsdmainutils bzip2 console-common console-data console-tools cpio cramfsprogs cron dash dbus-1 dhcp3-client dhcp3-common discover1 discover1-data dmsetup dnsutils dosfstools ed eject evms evms-ncurses fdutils file ftp gettext-base gnupg groff-base hdparm hotplug ifrename ifupdown info initrd-tools iproute iptables iputils-arping iputils-ping iputils-tracepath jfsutils klogd less libasound2 libatm1 libbz2-1.0 libconsole libdb4.2 libdevmapper1.00 libdiscover1 libdns16 libevms-2.3 libexpat1 libfribidi0 libgc1 libgcrypt7 libgdbm3 libgnutls10 libgpg-error0 libgpmg1 libidn11 libisc7 libiw27 libldap2 liblockfile1 liblwres1 liblzo1 libmagic1 libncursesw5 libopencdk8 libparted1.6-0 libpcap0.7 libpcap0.8 libreiserfs0.3-0 libsasl2 libsigc++-1.2-5c102 libssl0.9.7 libtasn1-2 libusb-0.1-4 libwrap0 locales logrotate lshw lsof ltrace lvm-common lvm10 lvm2 mailx man-db manpages mdadm mii-diag mime-support module-init-tools mtr-tiny mutt nano net-tools netbase netcat netkit-inetd ntp ntpdate openssh-client parted pciutils popularity-contest postfix postfix-tls ppp pppconfig pppoeconf psmisc python python2.3 reiser4progs reiserfsprogs reportbug rsync strace sudo sysklogd tcpd tcpdump telnet time ubuntu-base udev usbutils vim vim-common w3m wget wireless-tools xfsprogs"
13 |
14 | without_package () {
15 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
16 | }
17 | subst_package () {
18 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
19 | }
20 |
21 | case $ARCH in
22 | "i386")
23 | required="$required libc6-i686"
24 | base="$base dmidecode memtest86+ libreadline4"
25 | ;;
26 | "powerpc")
27 | required="$required libreadline4"
28 | base="$base hfsplus hfsutils libhfsp0 mac-fdisk pmac-fdisk powerpc-utils"
29 | ;;
30 | "amd64")
31 | base="$base dmidecode libreadline4"
32 | ;;
33 | *)
34 | # who knows?
35 | ;;
36 | esac
37 | }
38 |
39 | install_debs () {
40 | first_stage_install
41 | second_stage_install
42 | }
43 |
44 | first_stage_install () {
45 | extract $required
46 |
47 | mkdir -p "$TARGET/var/lib/dpkg"
48 | : >"$TARGET/var/lib/dpkg/status"
49 | echo >"$TARGET/var/lib/dpkg/available"
50 |
51 | setup_etc
52 | if [ ! -e "$TARGET/etc/fstab" ]; then
53 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
54 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
55 | fi
56 |
57 | x_feign_install () {
58 | local pkg="$1"
59 | local deb="$(debfor $pkg)"
60 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
61 |
62 | mkdir -p "$TARGET/var/lib/dpkg/info"
63 |
64 | echo \
65 | "Package: $pkg
66 | Version: $ver
67 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
68 |
69 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
70 | }
71 |
72 | x_feign_install dpkg
73 | }
74 |
75 | second_stage_install () {
76 | x_core_install () {
77 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
78 | }
79 |
80 | p () {
81 | baseprog="$(($baseprog + ${1:-1}))"
82 | }
83 |
84 | DEBIAN_FRONTEND=noninteractive
85 | DEBCONF_NONINTERACTIVE_SEEN=true
86 | export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN
87 |
88 | setup_devices
89 | setup_proc
90 | in_target /sbin/ldconfig
91 |
92 | baseprog=0
93 | bases=7
94 |
95 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
96 | info INSTCORE "Installing core packages..."
97 |
98 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
99 | ln -sf mawk "$TARGET/usr/bin/awk"
100 | x_core_install base-files base-passwd
101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
102 | x_core_install dpkg
103 |
104 | if [ ! -e "$TARGET/etc/localtime" ]; then
105 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
106 | fi
107 |
108 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
109 | x_core_install $LIBC
110 |
111 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
112 | x_core_install perl-base
113 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
114 | rm "$TARGET/usr/bin/awk"
115 | x_core_install mawk
116 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
117 | x_core_install debconf
118 |
119 | baseprog=0
120 | bases="$(set -- $required; echo $#)"
121 |
122 | info UNPACKREQ "Unpacking required packages..."
123 |
124 | smallyes '' | (repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --status-fd 8 --force-depends --unpack $(debfor $required) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKREQ "Unpacking required packages" UNPACKING) 7>&1
125 |
126 | baseprog=0
127 |
128 | info CONFREQ "Configuring required packages..."
129 |
130 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
131 | echo \
132 | "#!/bin/sh
133 | echo
134 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
135 | chmod 755 "$TARGET/sbin/start-stop-daemon"
136 |
137 | setup_dselect_method apt
138 | #on_exit "(in_target_nofail umount /dev/pts) || true"
139 |
140 | smallyes '' | (in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --status-fd 8 --configure --pending --force-configure-any --force-depends 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFREQ "Configuring required packages" CONFIGURING) 7>&1
141 |
142 | baseprog=0
143 | bases="$(set -- $base; echo $#)"
144 |
145 | info UNPACKBASE "Unpacking the base system..."
146 |
147 | smallyes '' | (repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --status-fd 8 --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base) 8>&1 1>&7 | dpkg_progress $baseprog $bases UNPACKBASE "Unpacking base system" UNPACKING) 7>&1
148 |
149 | baseprog=0
150 |
151 | info CONFBASE "Configuring the base system..."
152 |
153 | mv "$TARGET/usr/sbin/sendmail" "$TARGET/usr/sbin/sendmail.REAL"
154 | ln -s /bin/true "$TARGET/usr/sbin/sendmail"
155 |
156 | smallyes '' | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 | dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING) 7>&1
157 |
158 | rm -f "$TARGET/usr/sbin/sendmail"
159 | mv "$TARGET/usr/sbin/sendmail.REAL" "$TARGET/usr/sbin/sendmail"
160 |
161 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
162 |
163 | progress $bases $bases CONFBASE "Configuring base system"
164 | info BASESUCCESS "Base system installed successfully."
165 | }
166 |
167 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/warty.buildd:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | default_mirror http://old-releases.ubuntu.com/ubuntu
3 | mirror_style release
4 | download_style apt
5 |
6 | LIBC=libc6
7 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
8 | LIBC="libc6.1"
9 | fi
10 |
11 | work_out_debs () {
12 |
13 | required="base-files base-passwd bash bsdutils build-essential coreutils debianutils diff dpkg dselect e2fslibs e2fsprogs fakeroot findutils gcc-3.3-base grep gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdb1-compat libdb3 libgcc1 libncurses5 libpam-modules libpam-runtime libpam0g libss2 libstdc++5 libuuid1 login lsb-base mawk mount ncurses-base ncurses-bin perl-base sed slang1a-utf8 sysv-rc sysvinit tar util-linux zlib1g"
14 |
15 | base="apt binutils cpio cpp cpp-3.3 dpkg-dev g++ g++-3.3 gcc gcc-3.3 libc6-dev libdb4.2 libgdbm3 libstdc++5-3.3-dev linux-kernel-headers make patch perl perl-modules"
16 |
17 | without_package () {
18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
19 | }
20 | subst_package () {
21 | echo "$3" | tr ' ' '\n' | sed "s/^$1$/$2/" | tr '\n' ' '
22 | }
23 |
24 | case $ARCH in
25 | "amd64")
26 | ;;
27 | "i386")
28 | ;;
29 | "powerpc")
30 | ;;
31 |
32 | # Unsupported architectures:
33 | "alpha")
34 | required="$(subst_package "libc6" "libc6.1" "$required")"
35 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
36 | ;;
37 | "ia64")
38 | required="$(subst_package "libc6" "libc6.1" "$required")"
39 | base="$(subst_package "libc6-dev" "libc6.1-dev" "$base")"
40 | ;;
41 | *)
42 | # who knows?
43 | ;;
44 | esac
45 | }
46 |
47 | install_debs () {
48 | first_stage_install
49 | second_stage_install
50 | }
51 |
52 | first_stage_install () {
53 | extract $required
54 |
55 | mkdir -p "$TARGET/var/lib/dpkg"
56 | : >"$TARGET/var/lib/dpkg/status"
57 | echo >"$TARGET/var/lib/dpkg/available"
58 |
59 | setup_etc
60 | if [ ! -e "$TARGET/etc/fstab" ]; then
61 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
62 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
63 | fi
64 |
65 | x_feign_install () {
66 | local pkg="$1"
67 | local deb="$(debfor $pkg)"
68 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
69 |
70 | mkdir -p "$TARGET/var/lib/dpkg/info"
71 |
72 | echo \
73 | "Package: $pkg
74 | Version: $ver
75 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
76 |
77 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
78 | }
79 |
80 | x_feign_install dpkg
81 | }
82 |
83 | second_stage_install () {
84 | x_core_install () {
85 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
86 | }
87 | p () {
88 | baseprog="$(($baseprog + ${1:-1}))"
89 | }
90 |
91 | DEBIAN_FRONTEND=noninteractive
92 | export DEBIAN_FRONTEND
93 |
94 | baseprog=0
95 | bases=40
96 |
97 | setup_devices
98 | setup_proc
99 | in_target /sbin/ldconfig
100 |
101 | p; progress $baseprog $bases INSTCORE "Installing core packages" #1
102 | info INSTCORE "Installing core packages..."
103 |
104 | p; progress $baseprog $bases INSTCORE "Installing core packages" #2
105 | ln -sf mawk "$TARGET/usr/bin/awk"
106 | x_core_install base-files base-passwd
107 | p; progress $baseprog $bases INSTCORE "Installing core packages" #3
108 | x_core_install dpkg
109 |
110 | if [ ! -e "$TARGET/etc/localtime" ]; then
111 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
112 | fi
113 |
114 | p; progress $baseprog $bases INSTCORE "Installing core packages" #4
115 | x_core_install $LIBC
116 |
117 | p; progress $baseprog $bases INSTCORE "Installing core packages" #5
118 | x_core_install perl-base
119 | p; progress $baseprog $bases INSTCORE "Installing core packages" #6
120 | rm "$TARGET/usr/bin/awk"
121 | x_core_install mawk
122 | p; progress $baseprog $bases INSTCORE "Installing core packages" #7
123 |
124 | info UNPACKREQ "Unpacking required packages..."
125 |
126 | p; progress $baseprog $bases INSTCORE "Installing core packages" #8
127 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
128 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #18
129 |
130 | info CONFREQ "Configuring required packages..."
131 |
132 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
133 | echo \
134 | "#!/bin/sh
135 | echo
136 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
137 | chmod 755 "$TARGET/sbin/start-stop-daemon"
138 |
139 | setup_dselect_method apt
140 | #on_exit "in_target_nofail umount /dev/pts"
141 |
142 | p; progress $baseprog $bases INSTCORE "Installing core packages" #19
143 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
144 | p 10; progress $baseprog $bases INSTCORE "Installing core packages" #29
145 |
146 | info INSTCORE "Installing base packages..."
147 |
148 | p; progress $baseprog $bases INSTCORE "Installing core packages" #30
149 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
150 |
151 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
152 |
153 | p 9; progress $baseprog $bases INSTCORE "Installing core packages" #39
154 |
155 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
156 |
157 | progress $bases $bases INSTCORE "Installing core packages" #40
158 | info BASESUCCESS "Base system installed successfully."
159 | }
160 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/wheezy:
--------------------------------------------------------------------------------
1 | sid
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/wily:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/woody:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | mirror_style release
3 | download_style apt
4 | force_md5
5 |
6 | LIBC=libc6
7 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
8 | LIBC="libc6.1"
9 | fi
10 |
11 | work_out_debs () {
12 |
13 | required="base-files base-passwd bash bsdutils debconf debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libcap1 libc6 libdb2 libdb3 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libperl5.6 libpopt0 libreadline4 libstdc++2.10-glibc2.2 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed shellutils slang1 sysvinit tar textutils util-linux whiptail"
14 |
15 | base="adduser apt apt-utils at base-config bsdmainutils console-common console-tools console-tools-libs console-data cpio cron dhcp-client ed exim fdutils gettext-base groff-base ifupdown info klogd libident libldap2 liblockfile1 libpcre3 libsasl7 libwrap0 logrotate mailx man-db manpages modconf nano net-tools netbase netkit-inetd netkit-ping nvi ppp pppconfig pppoe pppoeconf libpcap0 sysklogd tasksel tcpd telnet"
16 |
17 | without_package () {
18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
19 | }
20 |
21 | IPFWTOOL=iptables
22 |
23 | case $ARCH in
24 | "alpha")
25 | required="$(without_package "libc6" "$required") libc6.1"
26 | base="$base setserial aboot pciutils"
27 | IPFWTOOL="ipchains"
28 | ;;
29 | "arm")
30 | base="$base setserial libgpmg1"
31 | IPFWTOOL="ipchains iptables"
32 | ;;
33 | "i386")
34 | required="$(without_package "libperl5.6" "$required") mbr"
35 | base="$base lilo pciutils setserial syslinux psmisc pcmcia-cs"
36 | IPFWTOOL="ipchains iptables"
37 | ;;
38 | "ia64")
39 | required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base"
40 | base="$base elilo efibootmgr dosfstools libparted1.4 parted"
41 | ;;
42 | "m68k")
43 | base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross setserial vmelilo"
44 | IPFWTOOL="ipchains"
45 | ;;
46 | "powerpc")
47 | base="$base quik mac-fdisk amiga-fdisk psmisc powerpc-utils setserial pciutils hfsutils yaboot pcmcia-cs"
48 | IPFWTOOL="ipchains iptables"
49 | ;;
50 | "sparc")
51 | base="$base silo eject pciutils sparc-utils"
52 | IPFWTOOL="ipchains iptables"
53 | ;;
54 | "mips")
55 | base="$base dvhtool pciutils setserial" # pcmcia-cs
56 | ;;
57 | "mipsel")
58 | base="$base delo pciutils setserial" # pcmcia-cs
59 | ;;
60 | "hppa")
61 | base="$base palo libstdc++3 gcc-3.0-base"
62 | required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
63 | ;;
64 | s390|s390x)
65 | # base-config depends on console-data and console-common
66 | # so we can't exclude them although they are useless on s390
67 | base="$base s390-tools telnetd devfsd"
68 | base="$(without_package "console-tools" "$base")"
69 | base="$(without_package "console-tools-libs" "$base")"
70 | base="$(without_package "fdutils" "$base")"
71 | base="$(without_package "ppp" "$base")"
72 | base="$(without_package "pppconfig" "$base")"
73 | base="$(without_package "pppoe" "$base")"
74 | base="$(without_package "pppoeconf" "$base")"
75 | ;;
76 | *)
77 | # who knows?
78 | ;;
79 | esac
80 |
81 | base="$base $IPFWTOOL"
82 | }
83 |
84 | first_stage_install () {
85 | extract $required
86 |
87 | mkdir -p "$TARGET/var/lib/dpkg"
88 | : >"$TARGET/var/lib/dpkg/status"
89 | echo >"$TARGET/var/lib/dpkg/available"
90 |
91 | setup_etc
92 | if [ ! -e "$TARGET/etc/fstab" ]; then
93 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
94 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
95 | fi
96 |
97 | x_feign_install () {
98 | local pkg="$1"
99 | local deb="$(debfor $pkg)"
100 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
101 |
102 | mkdir -p "$TARGET/var/lib/dpkg/info"
103 |
104 | echo \
105 | "Package: $pkg
106 | Version: $ver
107 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
108 |
109 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
110 | }
111 |
112 | x_feign_install dpkg
113 | }
114 |
115 | second_stage_install () {
116 | x_core_install () {
117 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
118 | }
119 |
120 | p () {
121 | baseprog="$(($baseprog + ${1:-1}))"
122 | }
123 |
124 | setup_devices
125 | setup_proc
126 | in_target /sbin/ldconfig
127 |
128 | DEBIAN_FRONTEND=Noninteractive
129 | export DEBIAN_FRONTEND
130 |
131 | baseprog=0
132 | bases=40
133 |
134 | p; progress $baseprog $bases INSTBASE "Installing base system" #1
135 | info INSTCORE "Installing core packages..."
136 |
137 | p; progress $baseprog $bases INSTBASE "Installing base system" #2
138 | ln -sf mawk "$TARGET/usr/bin/awk"
139 | x_core_install base-files base-passwd
140 | p; progress $baseprog $bases INSTBASE "Installing base system" #3
141 | x_core_install dpkg
142 |
143 | if [ ! -e "$TARGET/etc/localtime" ]; then
144 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
145 | fi
146 |
147 | p; progress $baseprog $bases INSTBASE "Installing base system" #4
148 | x_core_install $LIBC
149 |
150 | p; progress $baseprog $bases INSTBASE "Installing base system" #5
151 | x_core_install perl-base
152 | p; progress $baseprog $bases INSTBASE "Installing base system" #6
153 | rm "$TARGET/usr/bin/awk"
154 | x_core_install mawk
155 | p; progress $baseprog $bases INSTBASE "Installing base system" #7
156 | x_core_install debconf
157 |
158 | info UNPACKREQ "Unpacking required packages..."
159 |
160 | p; progress $baseprog $bases INSTBASE "Installing base system" #8
161 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
162 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
163 |
164 | info CONFREQ "Configuring required packages..."
165 |
166 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
167 | echo \
168 | "#!/bin/sh
169 | echo
170 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
171 | chmod 755 "$TARGET/sbin/start-stop-daemon"
172 |
173 | setup_dselect_method apt
174 |
175 | p; progress $baseprog $bases INSTBASE "Installing base system" #19
176 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
177 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
178 |
179 | if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then
180 | mkdir -p "$TARGET/etc/exim"
181 | touch "$TARGET/etc/exim/exim.conf"
182 | fi
183 |
184 | info INSTBASE "Installing base packages..."
185 |
186 | p; progress $baseprog $bases INSTBASE "Installing base system" #30
187 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
188 |
189 | rm -f "$TARGET/usr/sbin/sendmail"
190 | ln -sf /bin/true "$TARGET/usr/sbin/sendmail"
191 |
192 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
193 |
194 | rm -f "$TARGET/usr/sbin/sendmail"
195 | ln -sf exim "$TARGET/usr/sbin/sendmail"
196 |
197 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
198 |
199 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
200 |
201 | progress $bases $bases INSTBASE "Installing base system" #40
202 | info BASESUCCESS "Base system installed successfully."
203 | }
204 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/woody.buildd:
--------------------------------------------------------------------------------
1 | # -*- shell-script -*-
2 | mirror_style release
3 | download_style apt
4 | force_md5
5 |
6 | LIBC=libc6
7 | if [ "$ARCH" = "alpha" ] || [ "$ARCH" = "ia64" ]; then
8 | LIBC="libc6.1"
9 | fi
10 |
11 | work_out_debs () {
12 |
13 | required="base-files base-passwd bash bsdutils debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libc6 libcap1 libdb3 libgdbmg1 libncurses5 libpam-modules libpam-runtime libpam0g libperl5.6 libstdc++2.10-glibc2.2 login mawk mount ncurses-base ncurses-bin perl-base sed shellutils slang1 sysvinit tar textutils util-linux"
14 |
15 | base="apt binutils cpio cpp cpp-2.95 debconf dpkg-dev g++ g++-2.95 gcc gcc-2.95 libc6-dev libdb2 libstdc++2.10-dev make patch perl perl-modules"
16 |
17 | without_package () {
18 | echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
19 | }
20 |
21 | case $ARCH in
22 | "alpha")
23 | required="$(without_package "libc6" "$required") libc6.1"
24 | base="$(without_package "libc6-dev" "$base") libc6.1-dev"
25 | ;;
26 | "arm")
27 | ;;
28 | "i386")
29 | ;;
30 | "ia64")
31 | required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base libreadline4"
32 | base="$(without_package "cpp-2.95" "$base") cpp-2.96"
33 | base="$(without_package "gcc-2.95" "$base") gcc-2.96"
34 | base="$(without_package "g++-2.95" "$base") g++-2.96"
35 | base="$(without_package "libc6-dev" "$base") libc6.1-dev elilo efibootmgr dosfstools libparted1.4 parted"
36 | ;;
37 | "m68k")
38 | ;;
39 | "powerpc")
40 | ;;
41 | "sparc")
42 | ;;
43 | "mips")
44 | ;;
45 | "mipsel")
46 | ;;
47 | "hppa")
48 | ;;
49 | s390|s390x)
50 | ;;
51 | sh*)
52 | ;;
53 | *)
54 | # who knows?
55 | ;;
56 | esac
57 | }
58 |
59 | first_stage_install () {
60 | extract $required
61 |
62 | mkdir -p "$TARGET/var/lib/dpkg"
63 | : >"$TARGET/var/lib/dpkg/status"
64 | echo >"$TARGET/var/lib/dpkg/available"
65 |
66 | setup_etc
67 | if [ ! -e "$TARGET/etc/fstab" ]; then
68 | echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
69 | chown 0:0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
70 | fi
71 |
72 | x_feign_install () {
73 | local pkg="$1"
74 | local deb="$(debfor $pkg)"
75 | local ver="$(extract_deb_field "$TARGET/$deb" Version)"
76 |
77 | mkdir -p "$TARGET/var/lib/dpkg/info"
78 |
79 | echo \
80 | "Package: $pkg
81 | Version: $ver
82 | Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
83 |
84 | touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
85 | }
86 |
87 | x_feign_install dpkg
88 | }
89 |
90 | second_stage_install () {
91 | x_core_install () {
92 | smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
93 | }
94 |
95 | p () {
96 | baseprog="$(($baseprog + ${1:-1}))"
97 | }
98 |
99 | setup_devices
100 | setup_proc
101 | in_target /sbin/ldconfig
102 |
103 | DEBIAN_FRONTEND=noninteractive
104 | export DEBIAN_FRONTEND
105 |
106 | baseprog=0
107 | bases=40
108 |
109 | p; progress $baseprog $bases INSTBASE "Installing base system" #1
110 | info INSTCORE "Installing core packages..."
111 |
112 | p; progress $baseprog $bases INSTBASE "Installing base system" #2
113 | ln -sf mawk "$TARGET/usr/bin/awk"
114 | x_core_install base-files base-passwd
115 | p; progress $baseprog $bases INSTBASE "Installing base system" #3
116 | x_core_install dpkg
117 |
118 | if [ ! -e "$TARGET/etc/localtime" ]; then
119 | ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
120 | fi
121 |
122 | p; progress $baseprog $bases INSTBASE "Installing base system" #4
123 | x_core_install $LIBC
124 |
125 | p; progress $baseprog $bases INSTBASE "Installing base system" #5
126 | x_core_install perl-base
127 | p; progress $baseprog $bases INSTBASE "Installing base system" #6
128 | rm "$TARGET/usr/bin/awk"
129 | x_core_install mawk
130 | p; progress $baseprog $bases INSTBASE "Installing base system" #7
131 |
132 | info UNPACKREQ "Unpacking required packages..."
133 |
134 | p; progress $baseprog $bases INSTBASE "Installing base system" #8
135 | smallyes '' | repeatn 5 in_target_failmsg UNPACK_REQ_FAIL_FIVE "Failure while unpacking required packages. This will be attempted up to five times." "" dpkg --force-depends --unpack $(debfor $required)
136 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #18
137 |
138 | info CONFREQ "Configuring required packages..."
139 |
140 | mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
141 | echo \
142 | "#!/bin/sh
143 | echo
144 | echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
145 | chmod 755 "$TARGET/sbin/start-stop-daemon"
146 |
147 | setup_dselect_method apt
148 |
149 | p; progress $baseprog $bases INSTBASE "Installing base system" #19
150 | smallyes '' | in_target_failmsg CONF_REQ_FAIL "Failure while configuring required packages." "" dpkg --configure --pending --force-configure-any --force-depends
151 | p 10; progress $baseprog $bases INSTBASE "Installing base system" #29
152 |
153 | info INSTBASE "Installing base packages..."
154 |
155 | p; progress $baseprog $bases INSTBASE "Installing base system" #30
156 | smallyes '' | repeatn 5 in_target_failmsg INST_BASE_FAIL_FIVE "Failure while installing base packages. This will be re-attempted up to five times." "" dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
157 |
158 | smallyes '' | repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be attempted 5 times." "" dpkg --force-confold --skip-same-version --configure -a
159 |
160 | p 9; progress $baseprog $bases INSTBASE "Installing base system" #39
161 |
162 | mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
163 |
164 | progress $bases $bases INSTBASE "Installing base system" #40
165 | info BASESUCCESS "Base system installed successfully."
166 | }
167 |
--------------------------------------------------------------------------------
/bootstrap/boot/scripts/xenial:
--------------------------------------------------------------------------------
1 | gutsy
--------------------------------------------------------------------------------
/bootstrap/build:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 | ##
3 | ## Build the bootstrap target system. Currently it's verified with QEMU.
4 | ##
5 | ## By Duzy Chan .
6 | ##
7 | VERSION='0.0.0.1'
8 |
9 | if [ "$(whoami)" == "root" ]; then
10 | echo "You don't need to run as root. I will ask you to if needed."
11 | exit 1
12 | fi
13 |
14 | if [[ ! -f bootstrap/sink || ! -f bootstrap/build ]]; then
15 | echo "You must do this bootstrap from the top project directory!"
16 | exit 2
17 | fi
18 |
19 | #base=ftp.cn.debian.org
20 | base=ftp.debian.org
21 | arch=amd64
22 | release=jessie
23 | dest=bootstrap/debian/$release/$arch
24 |
25 | mkdir -p "$dest" || {
26 | echo "Creating directory '$dest' failed!"
27 | exit 10
28 | }
29 |
30 | sudo bootstrap/sink --foreign --arch $arch $release $dest "http://$base/debian/" || {
31 | echo "Failed to sink '$dest'!"
32 | exit 11
33 | }
34 |
--------------------------------------------------------------------------------
/bootstrap/prepare:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | apt-get install binfmt-support qemu qemu-user-static
4 |
5 |
--------------------------------------------------------------------------------
/doc/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CommunityCube/debian-autoscript/82dc58154dd8a32b8d16371dee928166536d37a2/doc/.gitkeep
--------------------------------------------------------------------------------
/mode-bridge-script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # ----------------------------------------------
4 | # valid_ip
5 | # ----------------------------------------------
6 | function valid_ip()
7 | {
8 | local ip=$1
9 | local stat=1
10 |
11 | if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
12 | OIFS=$IFS
13 | IFS='.'
14 | ip=($ip)
15 | IFS=$OIFS
16 | [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
17 | && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
18 | stat=$?
19 | fi
20 | return $stat
21 | }
22 |
23 | # ----------------------------------------------
24 | # valid_netmask
25 | # ----------------------------------------------
26 | function valid_netmask()
27 | {
28 | local netmask=$1
29 | local netmask_binary
30 | local octet
31 | local stat
32 |
33 | if [[ $netmask =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
34 | stat=0
35 | for ((i=0; i<4; i++))
36 | do
37 | octet=${netmask%%.*}
38 | netmask=${netmask#*.}
39 | [[ $octet -gt 255 ]] && { stat=1; break; }
40 | netmask_binary=$netmask_binary$( echo "obase=2; $octet" | bc )
41 | [[ $netmask_binary =~ 01 ]] && { stat=1; break; }
42 | done
43 | else
44 | stat=1
45 | fi
46 | return $stat
47 | }
48 |
49 | # MODE SELECTION
50 | echo "" ;
51 | echo "CommunityCube initial wizard, please select an option: "
52 | echo " [1] Protect privacy"
53 | echo " [2] CommunityCube Services"
54 | echo -n "Enter your selection: "
55 | read -n 1 MODE
56 | echo
57 | while [ "$MODE" != "1" ] && [ "$MODE" != "2" ]; do
58 | echo -n "Option $MODE not available, please choose 1 or 2: "
59 | read -n 1 MODE
60 | echo
61 | done
62 | echo " Selection $MODE"
63 |
64 | # -----------------
65 | # ------ WAN ------
66 | # -----------------
67 |
68 | # INTERNET SELECTION
69 | echo "" ;
70 | echo "How will you access to Internet: "
71 | echo " [1] Ethernet (wired)"
72 | echo " [2] WiFi (wireless)"
73 | echo -n "Enter your selection: "
74 | read -n 1 ACCESS
75 | echo
76 | while [ "$ACCESS" != "1" ] && [ "$ACCESS" != "2" ]; do
77 | echo -n "Option $ACCESS not available, please choose 1 or 2: "
78 | read -n 1 ACCESS
79 | echo
80 | done
81 | echo "Selection $ACCESS"
82 |
83 | # WAN Interface
84 | if [ "$ACCESS" == "1" ]
85 | then
86 | NET_INTERFACE="eth0"
87 | else
88 | NET_INTERFACE="wlan0"
89 | fi
90 |
91 | # WIFI SELECTION
92 | if [ "$ACCESS" == "2" ]
93 | then
94 | echo -n "Enter SSID name and press [ENTER]: "
95 | read SSID_NAME
96 | echo -n "Enter SSID password and press [ENTER]: "
97 | read SSID_PASSWORD
98 | echo "Enter SSID encryption method: "
99 | echo " [1] WEP "
100 | echo " [2] WPA-PSK"
101 | echo " [3] WPA2-PSK"
102 | echo -n "Enter your selection: "
103 | read -n 1 SSID_METHOD
104 | echo
105 | while [ "$SSID_METHOD" != "1" ] && [ "$SSID_METHOD" != "2" ] && [ "$SSID_METHOD" != "3" ]; do
106 | echo -n "Option $ACCESS not available, please choose 1, 2 o 3: "
107 | read -n 1 ACCESS
108 | echo
109 | done
110 | echo "Selection $SSID_METHOD"
111 | fi
112 |
113 | # FIXED ADDRESS OR DHCP SELECTION
114 | echo "" ;
115 | echo "IP configuration:"
116 | echo " [1] Fixed address"
117 | echo " [2] DHCP"
118 | echo -n "Enter your selection: "
119 | read -n 1 IP_CONF
120 | echo
121 | while [ "$IP_CONF" != "1" ] && [ "$IP_CONF" != "2" ]; do
122 | echo -n "Option $IP_CONF not available, please choose 1 or 2: "
123 | read -n 1 IP_CONF
124 | echo
125 | done
126 | echo "Selection $IP_CONF"
127 |
128 | # FIXED ADDRESS SELECTION
129 | if [ "$IP_CONF" == "1" ]
130 | then
131 | echo -n "Enter IP address and press [ENTER]: "
132 | read IP_ADDRESS
133 | while ! valid_ip $IP_ADDRESS; do
134 | echo -n "IP $IP_ADDRESS is not valid, please enter a valid IP address and press [ENTER]: "
135 | read IP_ADDRESS
136 | done
137 | echo -n "Enter net mask and press [ENTER]: "
138 | read IP_NETMASK
139 | while ! valid_netmask $IP_NETMASK; do
140 | echo -n "Netmask $IP_NETMASK is not valid, please enter a valid net mask address and press [ENTER]: "
141 | read IP_NETMASK
142 | done
143 | echo -n "Enter gateway and press [ENTER]: "
144 | read IP_GATEWAY
145 | while ! valid_ip $IP_GATEWAY; do
146 | echo -n "Gateway $IP_GATEWAY is not valid, please enter a gateway address and press [ENTER]: "
147 | read IP_GATEWAY
148 | done
149 | echo -n "Enter DNS and press [ENTER]: "
150 | read IP_DNS
151 | while ! valid_ip $IP_DNS; do
152 | echo -n "DNS $IP_DNS is not valid, please enter a valid IP address and press [ENTER]: "
153 | read IP_DNS
154 | done
155 |
156 | # Fix address net file
157 | cat << EOF > /etc/network/interfaces
158 | # The loopback network interface
159 | auto lo
160 | iface lo inet loopback
161 | # The primary network interface
162 | auto $NET_INTERFACE
163 | iface $NET_INTERFACE inet static
164 | address $IP_ADDRESS
165 | netmask $IP_NETMASK
166 | gateway $IP_GATEWAY
167 | dns-nameservers $IP_DNS
168 | EOF
169 |
170 | else
171 | # DHCP net file
172 | cat << EOF > /etc/network/interfaces
173 | # The loopback network interface
174 | auto lo
175 | iface lo inet loopback
176 | # The primary network interface
177 | auto $NET_INTERFACE
178 | iface $NET_INTERFACE inet dhcp
179 |
180 | EOF
181 |
182 | fi
183 |
184 | echo "Configuring interfaces ..."
185 |
186 | ifdown $NET_INTERFACE
187 | sleep 2
188 | ifup $NET_INTERFACE
189 |
190 | echo "Checking Internet access ..."
191 | if ping -c1 www.communitycube.net >/dev/null 2>/dev/null; then
192 | echo "You need internet to proceed. Exiting"
193 | exit
194 | fi
195 |
196 |
197 |
198 | exit;
199 |
--------------------------------------------------------------------------------
/scripts/old/autoscript-network:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | EDITOR=nano
4 |
5 | internet=$(ping -c1 www.google.es >/dev/null 2>/dev/null ; echo $?)
6 |
7 | if [ "$internet" != "0" ]; then
8 | echo "You need internet to proceed. Exiting"
9 | exit 7
10 | fi
11 |
12 | if [ "$(whoami)" != "root" ]; then
13 | echo "You need to be root to proceed. Exiting"
14 | exit 8
15 | fi
16 |
17 |
18 | # linux=$(lsb_release -s -i | tr [A-Z] [a-z])
19 | # if [ "$linux" = "ubuntu" ]; then
20 | # apt-get install -y ubuntu-extras-keyring ubuntu-keyring
21 | # fi
22 |
23 | waitakey() {
24 | echo
25 | echo "press a key"
26 | read key
27 | }
28 |
29 |
30 | #Privoxy
31 | apt-get install -y privoxy
32 |
33 | /etc/init.d/privoxy stop
34 | rm -f /etc/rc?.d/*privoxy*
35 |
36 |
37 | #Privoxy I2P
38 |
39 | cat << EOF > /etc/privoxy/config-i2p
40 | user-manual /usr/share/doc/privoxy/user-manual
41 | confdir /etc/privoxy
42 | logdir /var/log/privoxy
43 | filterfile default.filter
44 | #logfile logfile #it's said produces fails cause errors logging I2P ipv6 ips
45 | listen-address 127.0.0.1:8118
46 | #debug 1 # Log the destination for each request Privoxy let through. See also debug 1024.
47 | #debug 2 # show each connection status
48 | #debug 4 # show I/O status
49 | #debug 8 # show header parsing
50 | #debug 16 # log all data written to the network
51 | #debug 32 # debug force feature
52 | #debug 64 # debug regular expression filters
53 | #debug 128 # debug redirects
54 | #debug 256 # debug GIF de-animation
55 | #debug 512 # Common Log Format
56 | #debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
57 | #debug 2048 # CGI user interface
58 | #debug 4096 # Startup banner and warnings.
59 | #debug 8192 # Non-fatal errors
60 | #debug 32768 # log all data read from the network
61 | #debug 65536 # Log the applying actions
62 | toggle 1
63 | enable-remote-toggle 0
64 | enable-remote-http-toggle 0
65 | enable-edit-actions 0
66 | enforce-blocks 0
67 | buffer-limit 4096
68 | forwarded-connect-retries 0
69 | accept-intercepted-requests 1
70 | allow-cgi-request-crunching 0
71 | split-large-forms 0
72 | keep-alive-timeout 5
73 | socket-timeout 300
74 |
75 | forward .i2p 127.0.0.1:4444
76 | EOF
77 |
78 | cp /etc/init.d/privoxy /etc/init.d/privoxy-i2p
79 |
80 | sed "s~Provides:.*~Provides: privoxy-i2p~g" -i /etc/init.d/privoxy-i2p
81 | sed "s~PIDFILE=.*~PIDFILE=/var/run/\$NAME-i2p.pid~g" -i /etc/init.d/privoxy-i2p
82 | sed "s~CONFIGFILE=.*~CONFIGFILE=/etc/privoxy/config-i2p~g" -i /etc/init.d/privoxy-i2p
83 | sed "s~SCRIPTNAME=.*~SCRIPTNAME=/etc/init.d/\$NAME-i2p~g" -i /etc/init.d/privoxy-i2p
84 |
85 |
86 | update-rc.d privoxy-i2p defaults
87 | service privoxy-i2p restart
88 |
89 |
90 | #Privoxy TOR
91 |
92 | cat << EOF > /etc/privoxy/config-tor
93 | forward-socks4a / 127.0.0.1:9050 .
94 | confdir /etc/privoxy
95 | logdir /var/log/privoxy
96 | actionsfile default.action # Main actions file
97 | actionsfile user.action # User customizations
98 | filterfile default.filter
99 |
100 | logfile logfile
101 |
102 | debug 4096 # Startup banner and warnings
103 | debug 8192 # Errors - *we highly recommended enabling this*
104 |
105 | user-manual /usr/share/doc/privoxy/user-manual
106 | listen-address 127.0.0.1:8119
107 | toggle 1
108 | enable-remote-toggle 0
109 | enable-edit-actions 0
110 | enable-remote-http-toggle 0
111 | buffer-limit 4096
112 | EOF
113 |
114 |
115 | cp /etc/init.d/privoxy /etc/init.d/privoxy-tor
116 | sed "s~Provides:.*~Provides: privoxy-tor~g" -i /etc/init.d/privoxy-tor
117 | sed "s~PIDFILE=.*~PIDFILE=/var/run/\$NAME-tor.pid~g" -i /etc/init.d/privoxy-tor
118 | sed "s~CONFIGFILE=.*~CONFIGFILE=/etc/privoxy/config-tor~g" -i /etc/init.d/privoxy-tor
119 | sed "s~SCRIPTNAME=.*~SCRIPTNAME=/etc/init.d/\$NAME-tor~g" -i /etc/init.d/privoxy-tor
120 |
121 |
122 | update-rc.d privoxy-tor defaults
123 | service privoxy-tor restart
124 |
125 |
126 | # Squid
127 | apt-get install -y squid3
128 | rm -f /etc/rc?.d/*squid*
129 | /etc/init.d/squid3 stop
130 |
131 | # squid TOR
132 |
133 | cat << EOF > /etc/squid3/squid-tor.conf
134 | cache_peer 127.0.0.1 parent 8119 7 no-query no-digest
135 |
136 | acl manager proto cache_object
137 | acl localhost src 127.0.0.1/32 ::1
138 | acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
139 |
140 | acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
141 |
142 | acl SSL_ports port 443
143 | acl Safe_ports port 80 # http
144 | acl Safe_ports port 21 # ftp
145 | acl Safe_ports port 443 # https
146 | acl Safe_ports port 70 # gopher
147 | acl Safe_ports port 210 # wais
148 | acl Safe_ports port 1025-65535 # unregistered ports
149 | acl Safe_ports port 280 # http-mgmt
150 | acl Safe_ports port 488 # gss-http
151 | acl Safe_ports port 591 # filemaker
152 | acl Safe_ports port 777 # multiling http
153 | acl CONNECT method CONNECT
154 |
155 | http_access allow localnet
156 | http_access allow localhost
157 | http_access allow all
158 | http_access deny all
159 |
160 | http_access deny manager
161 |
162 | http_access deny !Safe_ports
163 |
164 | http_access deny CONNECT !SSL_ports
165 |
166 | http_access deny all
167 |
168 | http_port 3129 transparent
169 |
170 | hierarchy_stoplist cgi-bin ?
171 |
172 | never_direct allow all
173 |
174 | cache_store_log none
175 |
176 | pid_filename /var/run/squid3-tor.pid
177 |
178 | cache_log /var/log/squid3/cache.log
179 |
180 | coredump_dir /var/spool/squid3
181 |
182 | #url_rewrite_program /usr/bin/squidGuard
183 |
184 | no_cache deny all
185 | EOF
186 |
187 | cp /etc/init.d/squid3 /etc/init.d/squid3-tor
188 | sed "s~Provides:.*~Provides: squid3-tor~g" -i /etc/init.d/squid3-tor
189 | sed "s~PIDFILE=.*~PIDFILE=/var/run/squid3-tor.pid~g" -i /etc/init.d/squid3-tor
190 | sed "s~CONFIG=.*~CONFIG=/etc/squid3/squid-tor.conf~g" -i /etc/init.d/squid3-tor
191 |
192 | update-rc.d squid3-tor start defaults
193 | service squid3-tor restart
194 |
195 |
196 |
197 | #Squid I2P
198 |
199 | cat << EOF > /etc/squid3/squid-i2p.conf
200 | cache_peer 127.0.0.1 parent 8118 7 no-query no-digest
201 |
202 | acl manager proto cache_object
203 | acl localhost src 127.0.0.1/32 ::1
204 | acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
205 |
206 | acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
207 |
208 | acl SSL_ports port 443
209 | acl Safe_ports port 80 # http
210 | acl Safe_ports port 21 # ftp
211 | acl Safe_ports port 443 # https
212 | acl Safe_ports port 70 # gopher
213 | acl Safe_ports port 210 # wais
214 | acl Safe_ports port 1025-65535 # unregistered ports
215 | acl Safe_ports port 280 # http-mgmt
216 | acl Safe_ports port 488 # gss-http
217 | acl Safe_ports port 591 # filemaker
218 | acl Safe_ports port 777 # multiling http
219 | acl CONNECT method CONNECT
220 |
221 | http_access allow localnet
222 | http_access allow localhost
223 | http_access allow all
224 | http_access deny all
225 |
226 | http_access deny manager
227 |
228 | http_access deny !Safe_ports
229 |
230 | http_access deny CONNECT !SSL_ports
231 |
232 | http_access deny all
233 |
234 | http_port 3128 transparent
235 |
236 | hierarchy_stoplist cgi-bin ?
237 |
238 | never_direct allow all
239 |
240 | cache_store_log none
241 |
242 | pid_filename /var/run/squid3-i2p.pid
243 |
244 | cache_log /var/log/squid3/cache.log
245 |
246 | coredump_dir /var/spool/squid3
247 |
248 | #url_rewrite_program /usr/bin/squidGuard
249 |
250 | no_cache deny all
251 |
252 | EOF
253 |
254 | cp /etc/init.d/squid3 /etc/init.d/squid3-i2p
255 |
256 | cp /etc/init.d/squid3 /etc/init.d/squid3-i2p
257 | sed "s~Provides:.*~Provides: squid3-i2p~g" -i /etc/init.d/squid3-i2p
258 | sed "s~PIDFILE=.*~PIDFILE=/var/run/squid3-i2p.pid~g" -i /etc/init.d/squid3-i2p
259 | sed "s~CONFIG=.*~CONFIG=/etc/squid3/squid-i2p.conf~g" -i /etc/init.d/squid3-i2p
260 |
261 | update-rc.d squid3-i2p start defaults
262 | service squid3-i2p restart
263 |
264 |
265 | #Squidguard
266 |
267 | echo "Squidguard will NOT be installed"
268 | waitakey
269 |
270 | mkdir -p /etc/blacklists
271 | cd /etc/blacklists
272 |
273 | cat << EOF > /etc/blacklists/update-blacklists.sh
274 | #!/bin/bash
275 |
276 | #squidguard DB
277 | mkdir -p /etc/blacklists/shallalist/tmp
278 | cd /etc/blacklists/shallalist/tmp
279 | wget http://www.shallalist.de/Downloads/shallalist.tar.gz
280 | tar xvzf shallalist.tar.gz ; res=\$?
281 | rm -f shallalist.tar.gz
282 | if [ "\$res" = 0 ]; then
283 | rm -fr /etc/blacklists/shallalist/ok
284 | mv /etc/blacklists/shallalist/tmp /etc/blacklists/shallalist/ok
285 | else
286 | rm -fr /etc/blacklists/shallalist/tmp
287 | fi
288 |
289 | mkdir -p /etc/blacklists/urlblacklist/tmp
290 | cd /etc/blacklists/urlblacklist/tmp
291 | wget http://urlblacklist.com/cgi-bin/commercialdownload.pl?type=download\\&file=bigblacklist -O urlblacklist.tar.gz
292 | tar xvzf urlblacklist.tar.gz ; res=\$?
293 | rm -f urlblacklist.tar.gz
294 | if [ "\$res" = 0 ]; then
295 | rm -fr /etc/blacklists/urlblacklist/ok
296 | mv /etc/blacklists/urlblacklist/tmp /etc/blacklists/urlblacklist/ok
297 | else
298 | rm -fr /etc/blacklists/urlblacklist/tmp
299 | fi
300 |
301 |
302 | mkdir -p /etc/blacklists/mesdk12/tmp
303 | cd /etc/blacklists/mesdk12/tmp
304 | wget http://squidguard.mesd.k12.or.us/blacklists.tgz
305 | tar xvzf blacklists.tgz ; res=\$?
306 | rm -f blacklists.tgz
307 | if [ "\$res" = 0 ]; then
308 | rm -fr /etc/blacklists/mesdk12/ok
309 | mv /etc/blacklists/mesdk12/tmp /etc/blacklists/mesdk12/ok
310 | else
311 | rm -fr /etc/blacklists/mesdk12/tmp
312 | fi
313 |
314 | mkdir -p /etc/blacklists/capitole/tmp
315 | cd /etc/blacklists/capitole/tmp
316 | wget ftp://ftp.ut-capitole.fr/pub/reseau/cache/squidguard_contrib/publicite.tar.gz
317 | tar xvzf publicite.tar.gz ; res=\$?
318 | rm -f publicite.tar.gz
319 | if [ "\$res" = 0 ]; then
320 | rm -fr /etc/blacklists/capitole/ok
321 | mv /etc/blacklists/capitole/tmp /etc/blacklists/capitole/ok
322 | else
323 | rm -fr /etc/blacklists/capitole/tmp
324 | fi
325 |
326 |
327 | # chown proxy:proxy -R /etc/blacklists/*
328 |
329 | EOF
330 |
331 | chmod +x /etc/blacklists/update-blacklists.sh
332 | /etc/blacklists/update-blacklists.sh
333 |
334 |
335 | cat << EOF > /etc/blacklists/blacklists-iptables.sh
336 | #ipset implementation for nat
337 | for i in \$(grep -iv [A-Z] /etc/blacklists/shallalist/ok/BL/adv/domains)
338 | do
339 | iptables -t nat -I PREROUTING -i br1 -s 10.0.0.0/16 -p tcp -d \$i -j DNAT --to-destination 5.5.5.5
340 | done
341 | EOF
342 |
343 | chmod +x /etc/blacklists/blacklists-iptables.sh
344 |
345 | #Iptables
346 | cat << EOF > /etc/rc.local
347 | #!/bin/sh -e
348 | #
349 | # rc.local
350 | #
351 | # This script is executed at the end of each multiuser runlevel.
352 | # Make sure that the script will "exit 0" on success or any other
353 | # value on error.
354 | #
355 | # In order to enable or disable this script just change the execution
356 | # bits.
357 | #
358 | # By default this script does nothing.
359 |
360 |
361 | iptables -F
362 | iptables -F -tnat
363 |
364 | #Allow ssh from internal to Communitycube and allow SSH to external servers
365 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 22 -j REDIRECT --to-ports 22
366 |
367 | #Allow internal access to
368 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 80 -j REDIRECT --to-ports 80
369 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 443 -j REDIRECT --to-ports 443
370 | iptables -t nat -A PREROUTING -i br1 -p tcp -d 10.0.0.1 --dport 7000 -j REDIRECT --to-ports 7000
371 |
372 |
373 | #i2p petitions
374 | iptables -t nat -A OUTPUT -d 10.191.0.1 -p tcp --dport 80 -j REDIRECT --to-port 3128
375 | iptables -t nat -A PREROUTING -d 10.191.0.1 -p tcp --dport 80 -j REDIRECT --to-port 3128
376 | iptables -t nat -A PREROUTING -i br1 -p tcp -m tcp --sport 80 -d 10.191.0.1 -j REDIRECT --to-ports 3128
377 |
378 | #Allow surf onion zone
379 | iptables -t nat -A PREROUTING -p tcp -d 10.192.0.0/16 -j REDIRECT --to-port 9040
380 | iptables -t nat -A OUTPUT -p tcp -d 10.192.0.0/16 -j REDIRECT --to-port 9040
381 |
382 | ###### WORK MODE 1 #####
383 | # use TOR for regular and TOR requests
384 |
385 | #iptables -t nat -A PREROUTING -i br1 -p tcp --syn -j REDIRECT --to-ports 9040
386 |
387 |
388 | ####### WORK MODE 2 #####
389 | # use TOR for TOR petitions
390 | # use Squid for the rest
391 |
392 | #regular 80 port traffic to squid
393 | iptables -t nat -A PREROUTING -i br1 -s 10.0.0.0/16 -p tcp --dport 80 -j REDIRECT --to-port 3129
394 |
395 | #rest for TOR
396 | iptables -t nat -A PREROUTING -i br1 -p tcp --syn -m multiport ! --dports 80 -j REDIRECT --to-ports 9040
397 |
398 |
399 | [ -e /etc/blacklists/blacklists-iptables.sh ] && /etc/blacklists/blacklists-iptables.sh &
400 |
401 | exit 0
402 | EOF
403 |
404 | chmod +x /etc/rc.local
405 |
406 | /etc/rc.local
407 |
--------------------------------------------------------------------------------
/scripts/old/autoscript-services:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | EDITOR=nano
4 |
5 | internet=$(ping -c1 www.communitycube.net >/dev/null 2>/dev/null ; echo $?)
6 | if [ "$internet" != "0" ]; then
7 | echo "You need internet to proceed. Exiting"
8 | exit 7
9 | fi
10 |
11 |
12 | if [ "$(whoami)" != "root" ]; then
13 | echo "You need to be root to proceed. Exiting"
14 | exit 8
15 | fi
16 |
17 |
18 | waitakey() {
19 | echo
20 | echo "press a key"
21 | read key
22 | }
23 |
24 | apt-get install -y nginx
25 | apt-get install -y php5-common php5-fpm php5-cli php5-json php5-mysql php5-curl php5-intl php5-mcrypt php5-memcache php-xml-parser php-pear
26 | mkdir -p /etc/ssl/nginx/
27 |
28 | echo "upstream php-handler {
29 | server 127.0.0.1:9000;
30 | #server unix:/var/run/php5-fpm.sock;
31 | }" > /etc/nginx/sites-enabled/php-fpm
32 |
33 | echo "server {
34 | listen 80 default_server;
35 | return 301 http://communitycube.local;
36 | }
37 |
38 | server {
39 | listen 80;
40 | server_name box.local;
41 | return 301 http://communitycube.local;
42 | }" > /etc/nginx/sites-enabled/default
43 |
44 |
45 | echo "server {
46 | listen 80;
47 | server_name communitycube.local 10.0.0.1;
48 | root /var/www/html;
49 | index index.html;
50 |
51 | location /phpmyadmin {
52 | root /usr/share/;
53 | index index.php index.html index.htm;
54 | location ~ ^/phpmyadmin/(.+\.php)$ {
55 | try_files \$uri =404;
56 | root /usr/share/;
57 | fastcgi_pass 127.0.0.1:9000;
58 | fastcgi_index index.php;
59 | fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
60 | include /etc/nginx/fastcgi_params;
61 | }
62 | location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
63 | root /usr/share/;
64 | }
65 | }
66 | location /phpMyAdmin {
67 | rewrite ^/* /phpmyadmin last;
68 | }
69 | }" > /etc/nginx/sites-enabled/communitycube
70 |
71 | service nginx restart
72 |
73 | #TOR
74 | apt-get install -y tor
75 | service tor stop
76 | tordir=/var/lib/tor/hidden_service
77 | for i in yacy owncloud prosody friendica mailpile box
78 | do
79 |
80 | mkdir -p $tordir/$i
81 | chown debian-tor:debian-tor $tordir/$i -R
82 | rm -f $tordir/$i/*
83 |
84 | done
85 |
86 | echo "Change RUN_DAEMON to yes"
87 | # waitakey
88 | # $EDITOR /etc/default/tor
89 | sed "s~RUN_DAEMON=.*~RUN_DAEMON=\"yes\"~g" -i /etc/default/tor
90 |
91 |
92 | rm -f /etc/tor/torrc
93 | cp /usr/share/tor/tor-service-defaults-torrc /etc/tor/torrc
94 |
95 | echo "
96 | HiddenServiceDir /var/lib/tor/hidden_service/yacy
97 | HiddenServicePort 80 127.0.0.1:8090
98 |
99 | HiddenServiceDir /var/lib/tor/hidden_service/owncloud
100 | HiddenServicePort 80 127.0.0.1:7070
101 | HiddenServicePort 443 127.0.0.1:443
102 |
103 | HiddenServiceDir /var/lib/tor/hidden_service/friendica
104 | HiddenServicePort 80 127.0.0.1:8181
105 | HiddenServicePort 443 127.0.0.1:443
106 |
107 | HiddenServiceDir /var/lib/tor/hidden_service/prosody
108 | HiddenServicePort 5222 127.0.0.1:5222
109 | HiddenServicePort 5269 127.0.0.1:5269
110 |
111 |
112 | DNSPort 9053
113 | DNSListenAddress 10.0.0.1
114 | VirtualAddrNetworkIPv4 10.192.0.0/16
115 | AutomapHostsOnResolve 1
116 | TransPort 9040
117 | TransListenAddress 10.0.0.1
118 | SocksPort 9050 # what port to open for local application connectio$
119 | SocksBindAddress 127.0.0.1 # accept connections only from localhost
120 | AllowUnverifiedNodes middle,rendezvous
121 | #Log notice syslog" >> /etc/tor/torrc
122 |
123 |
124 | service tor start
125 |
126 | sleep 5
127 |
128 | found=no
129 | for i in 1 2 3 4 5 6 7 8 9 10
130 | do
131 | if [ -e "$tordir/owncloud/hostname" ]; then
132 | echo "Tor configuration OK"
133 | break
134 | else
135 | sleep 10
136 | fi
137 | done
138 |
139 | #i2p
140 | apt-get install -y i2p
141 |
142 | echo "Change RUN_DAEMON to true"
143 | # waitakey
144 | # $EDITOR /etc/default/i2p
145 | sed "s~RUN_DAEMON=.*~RUN_DAEMON=\"true\"~g" -i /etc/default/i2p
146 |
147 |
148 | service i2p restart
149 |
150 |
151 | cat << EOF > /etc/nginx/sites-enabled/i2p
152 | server {
153 | listen 80;
154 | server_name i2p.local;
155 |
156 |
157 | location / {
158 | proxy_pass http://127.0.0.1:7657;
159 | proxy_set_header Host \$host;
160 | proxy_set_header X-Real-IP \$remote_addr;
161 | }
162 |
163 | }
164 | EOF
165 |
166 | service nginx restart
167 |
168 |
169 |
170 | #unbound
171 | apt-get install -y unbound
172 |
173 | echo '# Unbound configuration file for Debian.
174 | #
175 | # See the unbound.conf(5) man page.
176 | #
177 | # See /usr/share/doc/unbound/examples/unbound.conf for a commented
178 | # reference config file.
179 |
180 | server:
181 | # The following line will configure unbound to perform cryptographic
182 | # DNSSEC validation using the root trust anchor.
183 | interface: 0.0.0.0
184 | access-control: 10.0.0.0/8 allow
185 | access-control: 127.0.0.1/8 allow
186 | access-control: 0.0.0.0/0 refuse
187 | # access-control
188 | # auto-trust-anchor-file: "/var/lib/unbound/root.key"
189 | do-not-query-localhost: no
190 | #domain-insecure: "onion"
191 | #private-domain: "onion"
192 |
193 | #Local destinations
194 | local-zone: "local." static
195 | local-data: "communitycube.local. IN A 10.0.0.1"
196 | local-data: "i2p.local. IN A 10.0.0.1"
197 | local-data: "tahoe.local. IN A 10.0.0.1"' > /etc/unbound/unbound.conf-static
198 |
199 | for i in $(ls /var/lib/tor/hidden_service/)
200 | do
201 |
202 | cat << EOF >> /etc/unbound/unbound.conf-static
203 | local-data: "$i.local. IN A 10.0.0.1"
204 | EOF
205 |
206 | done
207 |
208 | for i in $(ls /var/lib/tor/hidden_service/)
209 | do
210 |
211 | hn="$(cat /var/lib/tor/hidden_service/$i/hostname 2>/dev/null)"
212 |
213 | if [ -n "$hn" ]; then
214 | cat << EOF >> /etc/unbound/unbound.conf-static
215 |
216 | local-zone: "$hn." static
217 | local-data: "$hn. IN A 10.0.0.1"
218 | EOF
219 |
220 | fi
221 |
222 | done
223 |
224 | echo '
225 | #I2P domains
226 | local-zone: "i2p" redirect
227 | local-data: "i2p A 10.191.0.1"' >> /etc/unbound/unbound.conf-static
228 |
229 | echo '#Forward rest of zones to TOR
230 | forward-zone:
231 | name: "."
232 | forward-addr: 10.0.0.1@9053' > /etc/unbound/forward.conf
233 |
234 | cat /etc/unbound/unbound.conf-static > /etc/unbound/unbound.conf
235 | echo "include: /etc/unbound/forward.conf" >> /etc/unbound/unbound.conf
236 |
237 | service unbound restart
238 |
239 | #owncloud
240 | apt-get install -y owncloud apache2-mpm-prefork- apache2-utils- apache2.2-bin- apache2.2-common-
241 |
242 | echo "Change to"
243 | echo " listen = localhost:9000"
244 | sed "s~listen =.*~listen = localhost:9000~g" -i /etc/php5/fpm/pool.d/www.conf
245 | # waitakey
246 | # $EDITOR /etc/php5/fpm/pool.d/www.conf
247 |
248 | echo "Change upload_max_filesize and post_max_size to 2000M"
249 | # waitakey
250 | sed "s~upload_max_filesize =.*~upload_max_filesize = 2000M~g" -i /etc/php5/fpm/php.ini
251 | sed "s~upload_max_filesize =.*~upload_max_filesize = 2000M~g" -i /etc/php5/cli/php.ini
252 | sed "s~post_max_size =.*~post_max_size = 2000M~g" -i /etc/php5/fpm/php.ini
253 | sed "s~post_max_size =.*~post_max_size = 2000M~g" -i /etc/php5/cli/php.ini
254 | # $EDITOR /etc/php5/fpm/php.ini /etc/php5/cli/php.ini
255 |
256 | hn=`cat /var/lib/tor/hidden_service/owncloud/hostname`
257 |
258 | cat << EOF > /etc/nginx/sites-enabled/owncloud
259 | server {
260 | listen 80;
261 | server_name $hn;
262 | return 301 https://\$server_name\$request_uri;
263 | }
264 |
265 | server {
266 | listen 10.0.0.253;
267 | server_name _;
268 | return 301 https://$hn;
269 | }
270 |
271 |
272 | server {
273 | listen 80;
274 | server_name owncloud.local;
275 | return 301 https://$hn\$request_uri;
276 | }
277 |
278 | server {
279 | listen 7070;
280 | server_name $hn;
281 | return 301 https://\$server_name\$request_uri;
282 | }
283 |
284 | server {
285 | listen 443;
286 | ssl on;
287 | server_name $hn;
288 | ssl_certificate /etc/ssl/nginx/$hn.crt;
289 | ssl_certificate_key /etc/ssl/nginx/$hn.key;
290 |
291 | # Path to the root of your installation
292 | root /var/www/owncloud/;
293 | # set max upload size
294 | client_max_body_size 10G;
295 | fastcgi_buffers 64 4K;
296 |
297 | rewrite ^/caldav(.*)\$ /remote.php/caldav\$1 redirect;
298 | rewrite ^/carddav(.*)\$ /remote.php/carddav\$1 redirect;
299 | rewrite ^/webdav(.*)\$ /remote.php/webdav\$1 redirect;
300 |
301 | index index.php;
302 | error_page 403 /core/templates/403.php;
303 | error_page 404 /core/templates/404.php;
304 |
305 | location = /robots.txt {
306 | allow all;
307 | log_not_found off;
308 | access_log off;
309 | }
310 |
311 | location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
312 | deny all;
313 | }
314 |
315 | location / {
316 | # The following 2 rules are only needed with webfinger
317 | rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
318 | rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
319 |
320 | rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
321 | rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
322 |
323 | rewrite ^(/core/doc/[^\/]+/)\$ \$1/index.html;
324 |
325 | try_files \$uri \$uri/ /index.php;
326 | }
327 |
328 | location ~ \.php(?:\$|/) {
329 | fastcgi_split_path_info ^(.+\.php)(/.+)\$;
330 | include fastcgi_params;
331 | fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
332 | fastcgi_param PATH_INFO \$fastcgi_path_info;
333 | fastcgi_param HTTPS on;
334 | fastcgi_pass php-handler;
335 | }
336 |
337 | # Optional: set long EXPIRES header on static assets
338 | location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)\$ {
339 | expires 30d;
340 | # Optional: Don't log access to assets
341 | access_log off;
342 | }
343 |
344 | }
345 | EOF
346 |
347 | if [ ! -e /etc/ssl/nginx/$hn.key -o ! -e /etc/ssl/nginx/$h.csr -o ! -e /etc/ssl/nginx/$hn.crt ]; then
348 | openssl genrsa -des3 -out /etc/ssl/nginx/$hn.key 2048
349 | openssl req -new -key /etc/ssl/nginx/$hn.key -out /etc/ssl/nginx/$hn.csr
350 | cp /etc/ssl/nginx/$hn.key /etc/ssl/nginx/$hn.key.org
351 | openssl rsa -in /etc/ssl/nginx/$hn.key.org -out /etc/ssl/nginx/$hn.key
352 | openssl x509 -req -days 365 -in /etc/ssl/nginx/$hn.csr -signkey /etc/ssl/nginx/$hn.key -out /etc/ssl/nginx/$hn.crt
353 | fi
354 |
355 | service php5-fpm restart
356 | service nginx restart
357 |
358 | #Java
359 | apt-get install -y openjdk-7-jre-headless
360 | apt-get remove -y openjdk-6-jre-headless
361 | apt-get remove -y openjdk-6-jre-lib
362 |
363 |
364 | #Yacy
365 | echo "On ask, maximum 300Mb"
366 | waitakey
367 | apt-get install -y yacy
368 |
369 |
370 | hn="$(cat /var/lib/tor/hidden_service/yacy/hostname 2>/dev/null)"
371 | echo "server {
372 | listen 80;
373 | server_name yacy.local;
374 | return 301 http://$hn\$request_uri;
375 | }
376 |
377 | server {
378 | listen 10.0.0.251;
379 | server_name _;
380 | return 301 http://$hn;
381 | }
382 |
383 | server {
384 | listen 80;
385 | server_name $hn;
386 |
387 | location / {
388 | proxy_pass http://127.0.0.1:8090;
389 | proxy_set_header Host \$host;
390 | proxy_set_header X-Real-IP \$remote_addr;
391 | }
392 |
393 | }" > /etc/nginx/sites-enabled/yacy
394 |
395 | #tahoe
396 | apt-get install -y i2p-tahoe-lafs
397 |
398 | service tahoe-lafs stop
399 |
400 |
401 | echo 'AUTOSTART="i2p"' > /etc/default/tahoe-lafs
402 |
403 | mkdir /var/lib/tahoe-lafs/ -p
404 |
405 | [ -z "$(grep tahoelafs /etc/group)" ] && addgroup --system tahoelafs
406 | [ -z "$(grep tahoelafs /etc/passwd)" ] && adduser --disabled-login --system --home /var/lib/tahoe-lafs --shell /bin/bash --no-create-home --ingroup tahoelafs tahoelafs
407 |
408 |
409 | chown tahoelafs:tahoelafs /var/lib/tahoe-lafs -R
410 | tahoe create-node /var/lib/tahoe-lafs/i2p/
411 |
412 | echo 'pb://c6w5ernw7y7rp3uwmdyu5clujyt2y4m4@w2zrwz5gplkkufix7cb4gmxfbrkwg2abnsgk62bm5iifzlahe7kq.b32.i2p/introducer
413 | pb://exupps5kk3amc5iq4q6f5ahggkm4s5fl@oj7cffq5fnk46iw3i3h2sdgncxrqbxm7wh6i4h2cbpmqsydygkcq.b32.i2p/introducer
414 | pb://md2tltfmdjvzptg4mznha5zktaxatpmz@5nrsgknvztikjxnpvidlokquojjlsudf7xlnrnyobj7e7trdmuta.b32.i2p/introducer
415 | pb://fmcbgy7zd6ubrbphilmrlocvb7f327z5@gdr3tt5uewgnm7r7xn54k2qikf2kuwwegjjsnkz44pjticcacsua.b32.i2p/introducer
416 | pb://tq7rx35yopkvodmsxkqra4qqkbho3yaa@6ga2r2h2fyq6tzcyh6bf3hpio3i7r4edadbq7l4wnh4y62taj6ia.b32.i2p/introducer
417 | pb://cys5w43lvx3oi5lbgk6liet6rbguekuo@sagljtwlctcoktizkmyv3nyjsuygty6tpkn5riwxlruh3f2oze2q.b32.i2p/introducer
418 | pb://r3bs6joub24gtsofe7ohnnjcnwfmo2jy@qaihdh5z7osn7tc3326ahv3z46badiuaulff43wchmap7skg7euq.b32.i2p/42mrbm7zxmjemz6hzejo3i7aunx4eoun' > /var/lib/tahoe-lafs/i2p/introducers
419 |
420 |
421 |
422 | echo "Point your browser to http://i2p.local/i2ptunnel/wizard"
423 | echo " Server Tunnel > Standard > tahoe/tahoe > 127.0.0.1:3459 > autostart"
424 | echo
425 | echo "Then point to http://i2p.local/i2ptunnelmgr"
426 | echo " and get base32 URL to put in tub.location ="
427 | echo "This process can be 5 minutes long. Wait"
428 | echo
429 | waitakey
430 |
431 | echo "Change config"
432 | echo "[node]
433 | nickname = yourpreferednick
434 | web.port = tcp:3456:interface=127.0.0.1
435 | web.static = public_html
436 | http_proxy = 127.0.0.1:4444
437 | tub.port = 3459
438 | tub.location= %base32TUB.LOCATION%
439 | [storage]
440 | enabled = true
441 | reserved_space = 20G
442 | [helper]
443 | enabled = true"
444 |
445 | waitakey
446 |
447 | nano /var/lib/tahoe-lafs/i2p/tahoe.cfg
448 |
449 | chown tahoelafs:tahoelafs /var/lib/tahoe-lafs -R
450 |
451 | service tahoe-lafs restart
452 |
453 | echo 'server {
454 | listen 80;
455 | server_name tahoe.local;
456 |
457 |
458 | location / {
459 | proxy_pass http://127.0.0.1:3456;
460 | proxy_set_header Host $host;
461 | proxy_set_header X-Real-IP $remote_addr;
462 | }
463 |
464 | }' > /etc/nginx/sites-enabled/tahoe
465 |
466 |
467 | service nginx restart
468 |
469 | #phpmyadmin
470 | echo "If it's asked for a webserver, do not mark any"
471 | waitakey
472 | apt-get install -y phpmyadmin
473 |
474 | #service nginx restart
475 |
476 | #friendica
477 | apt-get install -y php5 mysql-server php5-curl php5-gd php5-mysql php5-imap smarty3 git
478 |
479 | if [ ! -e /var/lib/mysql/frndc ]; then
480 | echo "Enter root mysql password"
481 | echo "CREATE DATABASE frndc;
482 | grant all privileges on frndc.* to friendica@localhost identified by 'SuperPass8Wor1_2';" | mysql -u root -p
483 | fi
484 |
485 | if [ ! -e /var/www/friendica ]; then
486 |
487 | cd /var/www
488 | git clone https://github.com/friendica/friendica.git
489 | cd friendica
490 | git clone https://github.com/friendica/friendica-addons.git addon
491 |
492 | chown -R www-data:www-data /var/www/friendica/view/smarty3
493 | chmod g+w /var/www/friendica/view/smarty3
494 | touch /var/www/friendica/.htconfig.php
495 | chown www-data:www-data /var/www/friendica/.htconfig.php
496 | chmod g+rwx /var/www/friendica/.htconfig.php
497 |
498 | fi
499 |
500 | if [ -z "$(grep "friendica/include/poller" /etc/crontab)" ]; then
501 | echo '*/10 * * * * /usr/bin/php /var/www/friendica/include/poller.php' >> /etc/crontab
502 | fi
503 |
504 | onion="$(cat /var/lib/tor/hidden_service/friendica/hostname 2>/dev/null)"
505 | if [ ! -e /etc/ssl/nginx/$onion.key -o ! -e /etc/ssl/nginx/$onion.csr -o ! -e /etc/ssl/nginx/$onion.crt ]; then
506 | openssl genrsa -des3 -out /etc/ssl/nginx/$onion.key 2048
507 | openssl req -new -key /etc/ssl/nginx/$onion.key -out /etc/ssl/nginx/$onion.csr
508 | cp /etc/ssl/nginx/$onion.key /etc/ssl/nginx/$onion.key.org
509 | openssl rsa -in /etc/ssl/nginx/$onion.key.org -out /etc/ssl/nginx/$onion.key
510 | openssl x509 -req -days 365 -in /etc/ssl/nginx/$onion.csr -signkey /etc/ssl/nginx/$onion.key -out /etc/ssl/nginx/$onion.crt
511 | fi
512 |
513 | cat << EOF > /etc/nginx/sites-enabled/friendica
514 | server {
515 | listen 8181;
516 | server_name $onion;
517 | index index.php;
518 | root /var/www/friendica;
519 | rewrite ^ https://$onion\$request_uri? permanent;
520 | }
521 |
522 | server {
523 | listen 80;
524 | server_name $onion;
525 | index index.php;
526 | root /var/www/friendica;
527 | rewrite ^ https://$onion\$request_uri? permanent;
528 | }
529 |
530 | server {
531 | listen 10.0.0.252;
532 | server_name _;
533 | return 301 https://$onion;
534 | }
535 |
536 | server {
537 | listen 80;
538 | server_name friendica.local;
539 | index index.php;
540 | root /var/www/friendica;
541 | rewrite ^ https://$onion\$request_uri? permanent;
542 | }
543 |
544 | server {
545 | listen 443;
546 | ssl on;
547 | server_name $onion;
548 | ssl_certificate /etc/ssl/nginx/$onion.crt;
549 | ssl_certificate_key /etc/ssl/nginx/$onion.key;
550 | ssl_session_timeout 5m;
551 | ssl_protocols SSLv3 TLSv1;
552 | ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
553 | ssl_prefer_server_ciphers on;
554 |
555 | index index.php;
556 | charset utf-8;
557 | root /var/www/friendica;
558 | access_log /var/log/nginx/friendica.log;
559 | # allow uploads up to 20MB in size
560 | client_max_body_size 20m;
561 | client_body_buffer_size 128k;
562 |
563 |
564 | # rewrite to front controller as default rule
565 | location / {
566 | rewrite ^/(.*) /index.php?q=\$uri&\$args last;
567 | }
568 |
569 | # make sure webfinger and other well known services aren't blocked
570 | # by denying dot files and rewrite request to the front controller
571 | location ^~ /.well-known/ {
572 | allow all;
573 | rewrite ^/(.*) /index.php?q=\$uri&\$args last;
574 | }
575 |
576 | # statically serve these file types when possible
577 | # otherwise fall back to front controller
578 | # allow browser to cache them
579 | # added .htm for advanced source code editor library
580 | location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|ttf|woff|svg)$ {
581 | expires 30d;
582 | try_files \$uri /index.php?q=\$uri&\$args;
583 | }
584 |
585 | # block these file types
586 | location ~* \.(tpl|md|tgz|log|out)$ {
587 | deny all;
588 | }
589 |
590 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
591 | # or a unix socket
592 | location ~* \.php$ {
593 | # Zero-day exploit defense.
594 | # http://forum.nginx.org/read.php?2,88845,page=3
595 | # Won't work properly (404 error) if the file is not stored on this
596 | # server, which is entirely possible with php-fpm/php-fcgi.
597 | # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on
598 | # another machine. And then cross your fingers that you won't get hacked.
599 | try_files \$uri =404;
600 |
601 | # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
602 | fastcgi_split_path_info ^(.+\.php)(/.+)$;
603 |
604 | # With php5-cgi alone:
605 | fastcgi_pass 127.0.0.1:9000;
606 |
607 | # With php5-fpm:
608 | #fastcgi_pass unix:/var/run/php5-fpm.sock;
609 |
610 | include fastcgi_params;
611 | fastcgi_index index.php;
612 | fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
613 | }
614 |
615 | # deny access to all dot files
616 | location ~ /\. {
617 | deny all;
618 | }
619 | }
620 |
621 |
622 | EOF
623 |
624 | service nginx restart
625 |
626 | #html
627 | mkdir -p /var/www/html
628 | rm -f /var/www/html/index.html
629 | for i in $(ls /var/lib/tor/hidden_service/ --ignore=box)
630 | do
631 |
632 | hn="$(cat /var/lib/tor/hidden_service/$i/hostname 2>/dev/null)"
633 |
634 | cat << EOF >> /var/www/html/index.html
635 | $i
636 | EOF
637 | done
638 |
639 |
640 | if [ -z "$(grep apache_get_modules /var/www/friendica/mod/install.php | grep -i function_exists | grep -i '/\*')" ]; then
641 | sed "s~if(function_exists('apache_get_modules')).*~/*if(function_exists('apache_get_modules'))~g" -i /var/www/friendica/mod/install.php
642 | sed "s~if(! function_exists('curl_init')){.*~*/ if(! function_exists('curl_init')){~g" -i /var/www/friendica/mod/install.php
643 | fi
644 |
645 |
646 | echo 'tahoe' >> /var/www/html/index.html
647 | echo 'i2p' >> /var/www/html/index.html
648 | echo 'phpmyadmin' >> /var/www/html/index.html
649 |
--------------------------------------------------------------------------------
/scripts/old/autoscript-system:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | EDITOR=nano
4 |
5 | internet=$(ping -c1 www.communitycube.net >/dev/null 2>/dev/null ; echo $?)
6 |
7 | if [ "$internet" != "0" ]; then
8 | echo "You need internet to proceed. Exiting"
9 | exit 7
10 | fi
11 |
12 | if [ "$(whoami)" != "root" ]; then
13 | echo "You need to be root to proceed. Exiting"
14 | exit 8
15 | fi
16 |
17 | dpkg-reconfigure locales
18 |
19 |
20 | echo "communitycube" > /etc/hostname
21 |
22 | cat << EOF > /etc/hosts
23 | #
24 | # /etc/hosts: static lookup table for host names
25 | #
26 |
27 | #
28 | 127.0.0.1 communitycube.localdomain localhost.localdomain communitycube localhost
29 | ::1 communitycube.localdomain localhost.localdomain communitycube localhost ip6-localhost ip6-loopback
30 | fe00::0 ip6-localnet
31 | ff00::0 ip6-mcastprefix
32 | ff02::1 ip6-allnodes
33 | ff02::2 ip6-allrouters
34 | EOF
35 |
36 |
37 | mv /etc/apt/sources.list /etc/apt/sources.list.back
38 | cat << EOF > /etc/apt/sources.list
39 | deb http://ftp.us.debian.org/debian wheezy main non-free contrib
40 | deb-src http://ftp.us.debian.org/debian wheezy main non-free contrib
41 |
42 | deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
43 | deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
44 |
45 | deb http://security.debian.org/ wheezy/updates main contrib non-free
46 | deb-src http://security.debian.org/ wheezy/updates main contrib non-free
47 |
48 | EOF
49 |
50 |
51 | #prepare system
52 | apt-get update
53 | apt-get install -y aptitude
54 | aptitude install -y --without-recommends debian-keyring uboot-mkimage console-tools subversion build-essential git libncurses5-dev bc sudo lsb-release dnsutils ca-certificates-java openssh-server ssh wireless-tools usbutils apt-transport-https unzip
55 |
56 |
57 | #APTGET
58 | echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /' > /etc/apt/sources.list.d/owncloud.list
59 | wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key
60 | apt-key add - < Release.key
61 | rm -f Release.key
62 |
63 | echo "deb http://packages.prosody.im/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/prosody.list
64 | wget https://prosody.im/files/prosody-debian-packages.key -O- | apt-key add -
65 |
66 | echo "deb https://dl.dropboxusercontent.com/u/18621288/debian wheezy main" > /etc/apt/sources.list.d/tahoei2p.list
67 |
68 | echo 'deb http://debian.yacy.net ./' > /etc/apt/sources.list.d/yacy.list
69 | apt-key advanced --keyserver pgp.net.nz --recv-keys 03D886E7
70 |
71 | echo 'deb http://deb.i2p2.no/ stable main
72 | #deb-src http://deb.i2p2.no/ stable main' > /etc/apt/sources.list.d/i2p.list
73 | wget --no-check-certificate https://geti2p.net/_static/i2p-debian-repo.key.asc
74 | apt-key add i2p-debian-repo.key.asc
75 | rm -f i2p-debian-repo.key.asc
76 |
77 | echo "deb http://deb.torproject.org/torproject.org wheezy main" > /etc/apt/sources.list.d/tor.list
78 | gpg --keyserver keys.gnupg.net --recv 886DDD89
79 | gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
80 |
81 | linux=$(lsb_release -s -i | tr [A-Z] [a-z])
82 | if [ "$linux" = "ubuntu" ]; then
83 | echo "deb http://deb.torproject.org/torproject.org $(lsb_release -c -s) main" > /etc/apt/sources.list.d/tor.list
84 | echo "deb http://ppa.launchpad.net/i2p.packages/i2p/ubuntu $(lsb_release -c -s) main
85 | #deb-src http://ppa.launchpad.net/i2p.packages/i2p/ubuntu $(lsb_release -c -s) main" > /etc/apt/sources.list.d/tahoei2p.list
86 | apt-key advanced --keyserver keyserver.ubuntu.com --recv-keys 251E524A4F9AB45202F53A45D1386E5F3FC3365C
87 | fi
88 |
89 |
90 | apt-get update
91 | apt-get install -y i2p-keyring deb.torproject.org-keyring killyourtv-keyring
92 | apt-get update
93 |
94 |
95 |
96 | rm -f /etc/ssh/ssh_host_*
97 | if [ ! -e /etc/ssh/ssh_host_dsa_key ]; then
98 | echo "Regenerating SSH keys"
99 | dpkg-reconfigure openssh-server
100 | fi
101 |
102 | linux=$(lsb_release -s -i | tr [A-Z] [a-z])
103 | if [ "$linux" = "ubuntu" ]; then
104 | apt-get install -y ubuntu-extras-keyring ubuntu-keyring
105 | fi
106 |
107 | waitakey() {
108 | echo
109 | echo "press a key"
110 | read key
111 | }
112 |
113 |
114 | cat << EOF > /etc/network/interfaces
115 | # interfaces(5) file used by ifup(8) and ifdown(8)
116 | auto lo
117 | iface lo inet loopback
118 |
119 | #External network interface
120 | auto eth0
121 | allow-hotplug eth0
122 | iface eth0 inet dhcp
123 |
124 | #External network interface
125 | # wireless wlan0
126 | auto wlan0
127 | allow-hotplug wlan0
128 | iface wlan0 inet manual
129 |
130 | ##External Network Bridge
131 | #auto br0
132 | #allow-hotplug br0
133 | #iface br0 inet dhcp
134 | # bridge_ports eth0 wlan0
135 |
136 | #Internal network interface
137 | auto eth1
138 | allow-hotplug eth1
139 | iface eth1 inet manual
140 |
141 | #Internal network interface
142 | # wireless wlan1
143 | auto wlan1
144 | allow-hotplug wlan1
145 | iface wlan1 inet manual
146 |
147 | #Internal network Bridge
148 | auto br1
149 | allow-hotplug br1
150 | # Setup bridge
151 | iface br1 inet static
152 | bridge_ports eth1 wlan1
153 | address 10.0.0.1
154 | netmask 255.255.255.0
155 | network 10.0.0.0
156 |
157 |
158 | #Yacy
159 | auto eth1:1
160 | allow-hotplug eth1:1
161 | iface eth1:1 inet static
162 | address 10.0.0.251
163 | netmask 255.255.255.0
164 |
165 | #Friendica
166 | auto eth1:2
167 | allow-hotplug eth1:2
168 | iface eth1:2 inet static
169 | address 10.0.0.252
170 | netmask 255.255.255.0
171 |
172 | #OwnCloud
173 | auto eth1:3
174 | allow-hotplug eth1:3
175 | iface eth1:3 inet static
176 | address 10.0.0.253
177 | netmask 255.255.255.0
178 |
179 | #Mailpile
180 | auto eth1:4
181 | allow-hotplug eth1:4
182 | iface eth1:4 inet static
183 | address 10.0.0.254
184 | netmask 255.255.255.0
185 | EOF
186 |
187 |
188 |
189 |
190 | apt-get install -y isc-dhcp-server
191 | sed "s~INTERFACES=.*~INTERFACES=\"br1\"~g" -i /etc/default/isc-dhcp-server
192 |
193 |
194 | cat << EOF > /etc/dhcp/dhcpd.conf
195 | ddns-update-style interim;
196 | ignore client-updates;
197 |
198 | subnet 10.0.0.0 netmask 255.255.255.0 {
199 |
200 | # --- default gateway
201 | option routers 10.0.0.1;
202 | option subnet-mask 255.255.255.0;
203 |
204 | # option nis-domain "domain.org";
205 | option domain-name "communitycube.local";
206 | option domain-name-servers 10.0.0.1;
207 |
208 | # option time-offset -18000; # Eastern Standard Time
209 | # option ntp-servers 192.168.1.1;
210 | # option netbios-name-servers 192.168.1.1;
211 | # --- Selects point-to-point node (default is hybrid). Don't change this unless
212 | # -- you understand Netbios very well
213 | # option netbios-node-type 2;
214 |
215 | range dynamic-bootp 10.0.0.100 10.0.0.254;
216 | default-lease-time 21600;
217 | max-lease-time 43200;
218 |
219 | }
220 | EOF
221 | service isc-dhcp-server restart
222 |
223 |
224 | #HOSTAP
225 | apt-get install -y hostapd
226 | sed "s~DAEMON_CONF=.*~DAEMON_CONF=\"/etc/hostapd/hostapd.conf\"~g" -i /etc/default/hostapd
227 |
228 | cat << EOF > /etc/hostapd/hostapd.conf
229 | ### Wireless network name ###
230 | interface=wlan1
231 | ### Set your bridge name ###
232 | bridge=br1
233 | driver=nl80211
234 | country_code=DE
235 | ssid=AnnonWLAN
236 | hw_mode=g
237 | channel=6
238 | wpa=2
239 | wpa_passphrase=MyWifiPassword
240 | ## Key management algorithms ##
241 | wpa_key_mgmt=WPA-PSK
242 | ## Set cipher suites (encryption algorithms) ##
243 | ## TKIP = Temporal Key Integrity Protocol
244 | ## CCMP = AES in Counter mode with CBC-MAC
245 | wpa_pairwise=TKIP
246 | rsn_pairwise=CCMP
247 | ## Shared Key Authentication ##
248 | auth_algs=1
249 | ## Accept all MAC address ###
250 | macaddr_acl=0
251 | EOF
252 |
253 | apt-get install -y bridge-utils
254 |
255 |
256 |
257 | # Macchanger
258 |
259 | apt-get install -y macchanger
260 |
261 | cat << EOF > /etc/init.d/macchanger.sh
262 | #!/bin/sh
263 | ### BEGIN INIT INFO
264 | # Provides: macchanger
265 | # Required-Start: mountall-bootclean
266 | # Required-Stop:
267 | # X-Start-Before: networking
268 | # Should-Start: glibc
269 | # Default-Start: S
270 | # Default-Stop:
271 | # Short-Description: Randomize the wlan0 and eth0 mac addresses.
272 | # Description: Randomize the wlan0 and eth0 mac addresses.
273 | ### END INIT INFO
274 | #
275 | # Written by Someone
276 | #
277 | ## INSTALLING
278 | # sudo cp macchanger.sh /etc/init.d/macchanger.sh
279 | # sudo chmod u+x /etc/init.d/macchanger.sh
280 | # sudo update-rc.d macchanger.sh start defaults
281 |
282 |
283 |
284 | PATH=/sbin:/bin
285 |
286 | . /lib/init/vars.sh
287 | . /lib/lsb/init-functions
288 |
289 | do_start () {
290 | for i in `ls /sys/class/net --ignore=lo --ignore=br*`
291 | do
292 | /usr/bin/macchanger -r \$i
293 | done
294 | exit 0
295 | }
296 |
297 | case "\$1" in
298 | start|"")
299 | do_start
300 | ;;
301 | restart|reload|force-reload)
302 | echo "Error: argument '\$1' not supported." >&2
303 | exit 3
304 | ;;
305 | stop)
306 | # No-Op
307 | ;;
308 | *)
309 | echo "Usage: macchanger.sh [start|stop]" >&2
310 | exit 3
311 | ;;
312 | esac
313 | EOF
314 |
315 | chmod +x /etc/init.d/macchanger.sh
316 |
317 | update-rc.d macchanger.sh start defaults
318 |
319 |
320 | #NTPDATE
321 | apt-get install -y ntpdate
322 |
323 | sed "s~NTPSERVERS=.*~NTPSERVERS=\"188.174.253.163 195.186.1.101 91.240.0.5 130.60.204.10 0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org\"~g" -i /etc/default/ntpdate
324 |
325 |
326 | cat << EOF > /etc/init.d/ntpdate
327 | #!/bin/sh
328 | ### BEGIN INIT INFO
329 | # Provides: ntpdate
330 | # Required-Start: networking
331 | # Required-Stop:
332 | # X-Start-Before: tor
333 | # Should-Start: glibc
334 | # Default-Start: S
335 | # Default-Stop:
336 | # Short-Description: Syncronize clock
337 | # Description: Syncronize clock
338 | ### END INIT INFO
339 | #
340 | # Written by Someone
341 | #
342 |
343 |
344 | PATH=/sbin:/bin
345 |
346 | . /lib/init/vars.sh
347 | . /lib/lsb/init-functions
348 |
349 | if [ -r /etc/default/ntpdate ]; then
350 | . /etc/default/ntpdate
351 | fi
352 |
353 | do_start () {
354 | for i in 1 2 3
355 | do
356 | adate=$(date +D%)
357 | /usr/sbin/ntpdate \$NTPSERVERS
358 | udate=$(date +D%)
359 | if [ "$udate" = "$adate" ]; then
360 | break
361 | fi
362 | sleep 3
363 | done
364 | exit 0
365 | }
366 |
367 | case "\$1" in
368 | start|"")
369 | do_start
370 | ;;
371 | restart|reload|force-reload)
372 | echo "Error: argument '\$1' not supported." >&2
373 | exit 3
374 | ;;
375 | stop)
376 | # No-Op
377 | ;;
378 | *)
379 | echo "Usage: ntpdate [start|stop]" >&2
380 | exit 3
381 | ;;
382 | esac
383 | EOF
384 |
385 | chmod +x /etc/init.d/ntpdate
386 | update-rc.d ntpdate start defaults
387 |
388 |
389 |
390 |
391 | #tor as DNS
392 | apt-get install -y tor
393 | cat << EOF > /etc/tor/torrc
394 | DNSPort 9053
395 | DNSListenAddress 10.0.0.1
396 | VirtualAddrNetworkIPv4 10.192.0.0/16
397 | AutomapHostsOnResolve 1
398 | TransPort 9040
399 | TransListenAddress 10.0.0.1
400 | SocksPort 9050 # what port to open for local application connectio$
401 | SocksBindAddress 127.0.0.1 # accept connections only from localhost
402 | AllowUnverifiedNodes middle,rendezvous
403 | #Log notice syslog
404 | EOF
405 | service tor restart
406 |
407 |
408 | #unbound
409 | apt-get install -y unbound
410 |
411 | echo '# Unbound configuration file for Debian.
412 | #
413 | # See the unbound.conf(5) man page.
414 | #
415 | # See /usr/share/doc/unbound/examples/unbound.conf for a commented
416 | # reference config file.
417 |
418 | server:
419 | # The following line will configure unbound to perform cryptographic
420 | # DNSSEC validation using the root trust anchor.
421 | interface: 0.0.0.0
422 | access-control: 10.0.0.0/8 allow
423 | access-control: 127.0.0.1/8 allow
424 | access-control: 0.0.0.0/0 refuse
425 | # access-control
426 | # auto-trust-anchor-file: "/var/lib/unbound/root.key"
427 | do-not-query-localhost: no
428 | #domain-insecure: "onion"
429 | #private-domain: "onion"
430 |
431 | #Local destinations
432 | local-zone: "local." static
433 | local-data: "communitycube.local. IN A 10.0.0.1"
434 | local-data: "i2p.local. IN A 10.0.0.1"
435 | local-data: "tahoe.local. IN A 10.0.0.1"
436 |
437 | #Forward rest of zones to TOR
438 | forward-zone:
439 | name: "."
440 | forward-addr: 10.0.0.1@9053' > /etc/unbound/unbound.conf
441 |
442 | service unbound restart
443 |
444 |
445 |
446 | echo "nameserver 127.0.0.1" > /etc/resolv.conf
447 |
448 | chattr +i /etc/resolv.conf
449 |
--------------------------------------------------------------------------------