Import Upstream version 3.0~a57

This commit is contained in:
openKylinBot 2022-05-25 18:21:59 +08:00
commit d8804ddb7a
278 changed files with 35179 additions and 0 deletions

674
COPYING Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

104
Makefile Normal file
View File

@ -0,0 +1,104 @@
# Makefile
SHELL := sh -e
LANGUAGES = $(shell cd manpages/po && ls)
SCRIPTS = bin/* frontends/cgi/live-build-cgi frontends/cgi/live-build-cgi.cron functions/* examples/auto/* examples/hooks/* scripts/*.sh scripts/*/* share/bin/* share/hooks/*
all: build
test:
@echo -n "Checking for syntax errors"
@for SCRIPT in $(SCRIPTS); \
do \
sh -n $${SCRIPT}; \
echo -n "."; \
done
@echo " done."
@echo -n "Checking for bashisms"
@if [ -x /usr/bin/checkbashisms ]; \
then \
for SCRIPT in $(SCRIPTS); \
do \
checkbashisms -f -x $${SCRIPT}; \
echo -n "."; \
done; \
else \
echo "WARNING: skipping bashism test - you need to install devscripts."; \
fi
@echo " done."
build:
@echo "Nothing to build."
install:
# Installing shared data
mkdir -p $(DESTDIR)/usr/share/live/build
cp -r frontends/cgi data functions templates VERSION $(DESTDIR)/usr/share/live/build
cp -r share/* $(DESTDIR)/usr/share/live/build
# Installing executables
mkdir -p $(DESTDIR)/usr/bin
cp -a bin/* $(DESTDIR)/usr/bin
mkdir -p $(DESTDIR)/usr/lib/live
cp -a scripts/* $(DESTDIR)/usr/lib/live
# Installing documentation
mkdir -p $(DESTDIR)/usr/share/doc/live-build
cp -r COPYING docs/* examples $(DESTDIR)/usr/share/doc/live-build
# Installing manpages
for MANPAGE in manpages/en/*; \
do \
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
done
for LANGUAGE in $(LANGUAGES); \
do \
for MANPAGE in manpages/$${LANGUAGE}/*; \
do \
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
done; \
done
uninstall:
# Uninstalling shared data
rm -rf $(DESTDIR)/usr/share/live/build
rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/live > /dev/null 2>&1 || true
# Uninstalling executables
rm -f $(DESTDIR)/usr/bin/lb $(DESTDIR)/usr/bin/live-build
# Uninstalling documentation
rm -rf $(DESTDIR)/usr/share/doc/live-build
# Uninstalling manpages
for MANPAGE in manpages/en/*; \
do \
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$2 }')"; \
rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
done
for LANGUAGE in $(LANGUAGES); \
do \
for MANPAGE in manpages/$${LANGUAGE}/*; \
do \
SECTION="$$(basename $${MANPAGE} | awk -F. '{ print $$3 }')"; \
rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
done; \
done
clean:
distclean:
reinstall: uninstall install

1
VERSION Normal file
View File

@ -0,0 +1 @@
3.0~a57-1

73
bin/lb Executable file
View File

@ -0,0 +1,73 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
set -e
# Including common functions
( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
# Setting static variables
DESCRIPTION="$(Echo 'utility to build Debian Live systems')"
HELP="FIXME"
USAGE="FIXME"
case "${1}" in
-h|--help)
if [ -x "$(which man 2>/dev/null)" ]
then
man lb
exit 0
else
${0} --usage
exit 0
fi
;;
""|-u|--usage)
Usage
;;
-v|--version)
echo "${VERSION}"
exit 0
;;
*)
COMMAND="lb_${1}"
shift
ENV=""
for _FILE in config/environment config/environment.binary
do
if [ -e "${_FILE}" ]
then
ENV="${ENV} $(grep -v '^#' ${_FILE})"
fi
done
if [ -x "${LIVE_BUILD}/scripts/build/${COMMAND}" ]
then
SCRIPT="${LIVE_BUILD}/scripts/build/${COMMAND}"
elif [ -x /usr/lib/live/build/${COMMAND} ]
then
SCRIPT=/usr/lib/live/build/"${COMMAND}"
elif [ -x "$(which ${COMMAND} 2>/dev/null)" ]
then
SCRIPT="${COMMAND}"
else
Echo_error "no such script: ${COMMAND}"
exit 1
fi
Echo "[%s] %s" "$(date +'%F %T')" "${COMMAND} ${*}"
LB=1 ${ENV} exec "${SCRIPT}" "${@}"
;;
esac

39
bin/live-build Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
## The complete text of the GNU General Public License
## can be found in /usr/share/common-licenses/GPL-3 file.
set -e
# Including common functions
( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
if [ -x "$(which man 2>/dev/null)" ]
then
man live-build
exit 0
else
Echo "live-build is a set of scripts to build Debian Live system images."
echo
Echo "The idea behind live-build is a framework that uses a configuration directory to completely automate and customize all aspects of building a Live image."
echo
Echo "An introduction to live-build can be found in the live-build(7) manpage."
exit 0
fi

View File

@ -0,0 +1,26 @@
The grub splash for Debian Live was made by Daniel Baumann <daniel@debian.org>
based on the original work of Mark Riedesel.
The contribution of Daniel is hereby placed in the public domain (no rights
reserved).
---------------
http://dugnet.com/klown/pics/klowner_debboot.png
by Mark Riedesel, license same as open use logo
To create klowner.rle:
1. convert klowner.png klowner.bmp
2. bmptoppm < klowner.bmp | ppmtolss16 #FBFDFA=7 > klowner.rle
(FBFDFA is the color used for the inside of the "n" in Debian.)
---------------
Debian Open Use Logo License
Copyright (c) 1999 Software in the Public Interest
This logo or a modified version may be used by anyone to refer to the Debian
project, but does not indicate endorsement by the project.
Note: we would appreciate that you make the image a link to
http://www.debian.org/ if you use it on a web page.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

1
data/debian-cd/hardy Symbolic link
View File

@ -0,0 +1 @@
maverick

1
data/debian-cd/lucid Symbolic link
View File

@ -0,0 +1 @@
maverick

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1 @@
kernel-image-*

View File

@ -0,0 +1,5 @@
choose-mirror
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
choose-mirror
netcfg
ethdetect
wireless-tools-udeb

View File

@ -0,0 +1,3 @@
netcfg
ethdetect
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

View File

@ -0,0 +1,4 @@
netcfg
ethdetect
pcmcia-cs-udeb
wireless-tools-udeb

1
data/debian-cd/natty Symbolic link
View File

@ -0,0 +1 @@
maverick

1
data/debian-cd/oneiric Symbolic link
View File

@ -0,0 +1 @@
maverick

1
data/debian-cd/sid Symbolic link
View File

@ -0,0 +1 @@
squeeze

View File

@ -0,0 +1,4 @@
choose-mirror
netcfg
ethdetect
pcmciautils-udeb

View File

@ -0,0 +1,3 @@
netcfg
ethdetect
pcmciautils-udeb

View File

@ -0,0 +1,3 @@
netcfg
ethdetect
pcmciautils-udeb

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,139 @@
# These udebs build the d-i cdrom initrd. As such, there is no reason
# to keep another copy of them on the CD in udeb form.
#
# This duplicates data found in the file build/pkg-lists/kernel, in d-i svn
kernel-image-*
# build/pkg-lists/base in d-i svn
archdetect
rootskel
main-menu
cdebconf-udeb
udpkg
anna
di-utils
di-utils-shell
di-utils-reboot
lowmemcheck
# build/pkg-lists/cdrom/common, in d-i svn (also included in the
# root+cd-drivers floppies)
busybox-udeb
installation-locale
localechooser
iso-3166-udeb
hw-detect
cdrom-detect
cdrom-retriever
load-cdrom
cdrom-checker
bogl-bterm-udeb
di-utils-terminfo
cdebconf-priority
cdebconf-newt-udeb
usb-discover
preseed-common
initrd-preseed
file-preseed
nano-udeb
floppy-retriever
libfribidi0-udeb
# Already on the initrd as dependencies
libdebconfclient0-udeb
libdebian-installer4-udeb
libdebian-installer-extra4-udeb
# These udebs are only useful in building the boot floppy image
busybox-floppy-udeb
rootskel-bootfloppy
# Graphical installer: common udebs included in initrd
rootskel-gtk
cdebconf-gtk-udeb
fontconfig-udeb
gtk2-engines-udeb
libatk1.0-udeb
libexpat1-udeb
libfreetype6-udeb
libglib2.0-udeb
libgtk2-engines-udeb
libpango1.0-udeb
libpcre3-udeb
libpixman-1-0-udeb
libpng12-0-udeb
libsdl1.2debian-udeb
mouse-modules-*
ttf-*
fbset-udeb
# Graphical installer: udebs for directfb
libdirectfb-*-udeb
libcairo-directfb2-udeb
libgtk-directfb-2.0-0-udeb
# Graphical installer: udebs for X.Org
xserver-xorg-core-udeb
xserver-xorg-input-evdev-udeb
xserver-xorg-video-fbdev-udeb
x11-xkb-utils-udeb
xkb-data-udeb
libcairo2-udeb
libdrm2-udeb
libfontenc1-udeb
libgtk-x11-udeb
libpciaccess0-udeb
libx11-6-udeb
libxau6-udeb
libxcb1-udeb
libxcursor1-udeb
libxdmcp6-udeb
libxext6-udeb
libxfixes3-udeb
libxfont1-udeb
libxft2-udeb
libxi6-udeb
libxinerama1-udeb
libxkbfile1-udeb
libxrender1-udeb
# Graphical installer: terminal support is included in initrd
cdebconf-gtk-terminal
libvte9-udeb
# Not currently used
cdebootstrap-udeb
hdparm-udeb
dhcp-client-udeb
# This package is only useful in the d-i-demo
di-utils-exit-installer
# No need for these loaders.
download-installer
load-floppy
# Only useful in the hd-media initrd
iso-scan
load-iso
# Nothing currently depends on this, and it seems not useful on its own
reiserfsprogs-udeb
# These are not really needed, the regular netcfg subsumes them
netcfg-static
# skolelinux stuff, not for the stock CDs
debian-edu-install-udeb
debian-edu-profile-udeb
debian-edu-archive-keyring-udeb
ltsp-client-builder
autopartkit
# live CD stuff
live-installer
simple-cdd-profiles
# If needed, will be on the initrd already
module-init-tools-udeb
env-preseed
rescue-check
cdebconf-text-udeb
brltty-udeb
klibc-utils-udeb
libklibc-udeb
udev-udeb
udev-gtk-udeb
ai-choosers
auto-install
libslang2-udeb
kbd-chooser
kbd-udeb
# Currently unused
nbd-client-udeb
pwgen-udeb
# Eh?
gnumach-udeb

View File

@ -0,0 +1,43 @@
# These udebs are in the d-i cdrom initrd and the hd-media initrd.
# As such, there is no reason to keep another copy of them on the CD
# in udeb form.
console-keymaps-at
console-keymaps-usb
kbd-chooser
acpi-modules-*
ata-modules-*
cdrom-core-modules-*
core-modules-*
fat-modules-*
fb-modules-*
ide-core-modules-*
ide-modules-*
input-modules-*
isofs-modules-*
mmc-modules-*
nls-core-modules-*
parport-modules-*
pcmcia-modules-*
sata-modules-*
scsi-common-modules-*
scsi-core-modules-*
scsi-modules-*
serial-modules-*
speakup-modules-*
usb-modules-*
usb-serial-modules-*
usb-storage-modules-*
zlib-modules-*
# Not used on amd64
console-keymaps-acorn
console-keymaps-amiga
console-keymaps-atari
console-keymaps-dec
console-keymaps-sun
# Not needed with the 2.6 kernel on amd64.
userdevfs
# Only needed on arches that use partconf or autopartkit.
partconf-mkfstab
# Not needed on arches that use partman
mdcfg
lvmcfg

View File

@ -0,0 +1,45 @@
# These udebs are in the d-i cdrom initrd and the cd-drivers+root floppies.
# As such, there is no reason to keep another copy of them on the CD
# in udeb form.
console-keymaps-at
console-keymaps-usb
kbd-chooser
acpi-modules-*
ata-modules-*
cdrom-core-modules-*
core-modules-*
fat-modules-*
fb-modules-*
ide-core-modules-*
ide-modules-*
input-modules-*
isofs-modules-*
mmc-modules-*
nls-core-modules-*
parport-modules-*
pcmcia-modules-*
sata-modules-*
scsi-common-modules-*
scsi-core-modules-*
scsi-modules-*
serial-modules-*
speakup-modules-*
usb-modules-*
usb-serial-modules-*
usb-storage-modules-*
zlib-modules-*
# 686-bigmem kernel udebs are only used for the Xen netboot image
*-686-bigmem-di !xen
# Not used on i386
console-keymaps-acorn
console-keymaps-amiga
console-keymaps-atari
console-keymaps-dec
console-keymaps-sun
# Not needed with the 2.4 kernel on i386.
userdevfs
# Only needed on arches that use partconf or autopartkit.
partconf-mkfstab
# Not needed on arches that use partman
mdcfg
lvmcfg

View File

@ -0,0 +1,28 @@
# These udebs build the d-i cdrom initrd. As such, there is no reason
# to keep another copy of them on the CD in udeb form.
#
# This duplicates data found in the file build/pkg-lists/cdrom/powerpc,
# in d-i Subversion.
cdrom-core-modules-*
console-keymaps-at
console-keymaps-usb
eject-udeb
firewire-core-modules-*
fs-common-modules-*
ide-modules-*
input-modules-*
kbd-chooser
scsi-common-modules-*
scsi-core-modules-*
scsi-modules-*
socket-modules-*
usb-modules-*
usb-storage-modules-*
# Not needed with the 2.4 kernel on powerpc.
userdevfs
# Only needed on arches that use partconf or autopartkit.
partconf-mkfstab
# Not needed on arches that use partman
mdcfg
lvmcfg

View File

@ -0,0 +1,3 @@
# S/390 does not support loading udebs off the CD image,
# so we can exclude all udebs from it
*

View File

@ -0,0 +1,5 @@
# Only needed on arches that use partconf or autopartkit.
partconf-mkfstab
# Not needed on arches that use partman
mdcfg
lvmcfg

View File

@ -0,0 +1,4 @@
choose-mirror
netcfg
ethdetect
pcmciautils-udeb

View File

@ -0,0 +1,3 @@
netcfg
ethdetect
pcmciautils-udeb

View File

@ -0,0 +1,3 @@
netcfg
ethdetect
pcmciautils-udeb

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,3 @@
netcfg
ethdetect
pcmciautils-udeb

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,3 @@
choose-mirror
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1,2 @@
netcfg
ethdetect

View File

@ -0,0 +1 @@

1
data/debian-cd/wheezy Symbolic link
View File

@ -0,0 +1 @@
squeeze

9
docs/AUTHORS Normal file
View File

@ -0,0 +1,9 @@
Main Author:
* Daniel Baumann <daniel@debian.org>
Main Contributors:
* Chris Lamb <lamby@debian.org>
* Otavio Salvador <otavio@debian.org>
* Richard Nelson <unixabg@gmail.com>

64
docs/CREDITS Normal file
View File

@ -0,0 +1,64 @@
Patches (alphabetical order):
* Alex Owen <r.a.owen@qmul.ac.uk>
* An-Cheng Huang <ancheng@vyatta.com>
* Antonio Amorim <Antonio.Amorim@sim.fc.ul.pt>
* Antonio Terceiro <terceiro@softwarelivre.org>
* Bas Wijnen <wijnen@debian.org>
* Ben Armstrong <synrg@debian.org>
* Cedric Lucantis <omer@no-log.org>
* Chris Lamb <lamby@debian.org>
* Cody A.W. Somerville <cody.somerville@canonical.com>
* Cyril Brulebois <cyril.brulebois@kerlabs.com>
* David Madore <david.madore@ens.fr>
* Erwan Le Gall <elegall@linagora.com>
* Fathi Boudra <fabo@debian.org>
* Franklin Piat <fpiat@bigfoot.com>
* Frederic Daniel Luc Lehobey <Frederic@Lehobey.net>
* Guerkan Senguen <gurkan@linuks.mine.nu>
* Hadar Weiss <whadar@gmail.com>
* Inigo Tejedor Arrondo <inigo@navarrux.org>
* Jason D. Clinton <me@jasonclinton.com>
* Jean Pierre LeJacq <jp.lejacq@quoininc.com>
* Jesse Hathaway <jesse@mbuki-mvuki.org>
* Justin Pryzby <pryzbyj@justinpryzby.com>
* Kai Hendry <hendry@webconverger.com>
* Kel Modderman <kel@otaku42.de>
* Maarten ter Huurne <maarten@treewalker.org>
* Marcelo D. Re <mdre@rectorado.unl.edu.ar>
* Marco Amadori <marco.amadori@gmail.com>
* Markus Bauer <bauer-markus@web.de>
* Mathieu Geli <mathieu.geli@gmail.com>
* Otavio Salvador <otavio@debian.org>
* Peter Holik <peter@holik.at>
* Peter Skogstroem <peter.skogstrom@bitrunner.com>
* Rene Merou <ochominutosdearco@gmail.com>
* Richard Nelson <unixabg@gmail.com>
* Scott Edwards <debian@foss.daxal.com>
* Sebastian Raveau <sebastien.raveau@epita.fr>
* Thomas Lange <lange@informatik.uni-koeln.de>
* Tiago Bortoletto Vaz <tiago@debian-ba.org>
* Trent Buck <trentbuck@gmail.com>
* Tzafrir Cohen <tzafrir.cohen@xorcom.com>
* Vladimir Stavrinov <vs@inist.ru>
Donations (alphabetical order):
* Gracie <gracie@bithawk.net>
Special thanks (alphabetical order):
* Ben Armstrong <synrg@debian.org> for his IRC support and tremendous work on
documentation.
* Jason D. Clinton <me@jasonclinton.com> for his work on netboot type.
* Otavio Salvador <otavio@debian.org> for his QA patches.
* Richard Nelson <rjent@rjent.pair.com> for live-webhelper.
* Sebastian Raveau <sebastien.raveau@epita.fr> for his work on encryption
support.
* Scott Edwards <debian@foss.daxal.com> for his work on d-i/g-i integration.
* Michael Dorrington <mike@zen.co.uk> for distracting Luk Claes on DebConf 7,
so that Luk couldn't disturb me all the time and I could finally do some
work.
...and countless other people showed up on the #debian-live IRC channel since
February 2006: thanks for all your help, ideas, and wishes.

1560
docs/ChangeLog Normal file

File diff suppressed because it is too large Load Diff

474
docs/ChangeLog.live-package Normal file
View File

@ -0,0 +1,474 @@
2007-03-10 Daniel Baumann <daniel@debian.org>
* Added knoppix and knoppix-dvd package lists.
2007-03-09 Daniel Baumann <daniel@debian.org>
* Getting free loopdevice from inside the chroot, not outside.
2007-03-09 Daniel Baumann <daniel@debian.org>
* Added kbd to all !minimal lists.
* Uploaded 0.99.25.
2007-03-08 Otavio Salvador <otavio@debian.org>
* helpers/lh_configapt: Fix aptitude configuration to really avoid
recommended packages to get installed.
* src/scripts/02defaults.sh: Export LIVE_ISOLINUX_SPLASH.
2007-03-04 Daniel Baumann <daniel@debian.org>
* Replaced removal of kernel on minimal flavours with excludes on the
mksquashfs call.
* Added LIVE_INCLUDE_CHROOT to the manual exported variables as reported
by Mathieu Geli <mathieu.geli@gmail.com>.
* Exported CODENAME_* manually as reported by Cédric Lucantis
<omer@no-log.org>.
* Fixed typo s/aptiude/aptitude/ as reported by Kai Hendry
<hendry@iki.fi>.
* Uploaded 0.99.24.
2007-02-22 Daniel Baumann <daniel@debian.org>
* Added xresprobe to all x11 lists.
2007-02-22 Daniel Baumann <daniel@debian.org>
* Applied patches from Otavio Salvador <otavio@debian.org>:
- add and cleanup variable exporting in defaults.
- add LIVE_BOOTSTRAP_CONFIG to lh_debootstrap.
* Uploaded 0.99.23.
2007-02-21 Daniel Baumann <daniel@debian.org>
* Added gnome-junior, kde-junior and xfce-junior lists.
* Uploaded 0.99.22.
2007-02-19 Daniel Baumann <daniel@debian.org>
* Fixed manifest.
2007-02-15 Daniel Baumann <daniel@debian.org>
* Applied patch from Sebastian Raveau <sebastien.raveau@epita.fr> to
add support for filesystem images encrypted with loop-aes.
2007-02-13 Daniel Baumann <daniel@debian.org>
* Broken out scripts into modularized lh_* subscripts.
2007-02-12 Daniel Baumann <daniel@debian.org>
* Added some code as suggested by Alex Owen <r.a.owen@qmul.ac.uk> to
check if the depends (syslinux, memtest etc.) are intentionally
installed in the chroot, and hence, don't remove them.
* Moved some depends into the chroot.
* Uploaded 0.99.21.
2007-02-11 Daniel Baumann <daniel@debian.org>
* Added mini flavour.
2007-02-10 Daniel Baumann <daniel@debian.org>
* Added legacy code for genisoimage.
* Uploaded 0.99.20.
2007-02-09 Daniel Baumann <daniel@debian.org>
* Added usb type.
2007-02-08 Daniel Baumann <daniel@debian.org>
* Added desktop task to the *-desktop flavours.
2007-02-07 Daniel Baumann <daniel@debian.org>
* Extended cron job a bit.
* Fixed manual pruning in minimal flavour as suggested by Bas Wijnen
<wijnen@debian.org>
2007-02-02 Daniel Baumann <daniel@debian.org>
* Added "--without-daemons".
2007-02-01 Daniel Baumann <daniel@debian.org>
* Added "--tasks".
* Added desktop-base to all desktop package lists.
2007-01-31 Daniel Baumann <daniel@debian.org>
* Changed vars in autobuilding script to be able to source
make-live.conf.
* Uploaded 0.99.19.
2007-01-30 Daniel Baumann <daniel@debian.org>
* Added cron job for autobuilding images.
2007-01-25 Daniel Baumann <daniel@debian.org>
* Added additional pruning to minimal flavour.
* Using interactive frontend while processing --hook.
* Uploaded 0.99.18.
2007-01-24 Daniel Baumann <daniel@debian.org>
* Applied patches from Otavio Salvador <otavio@debian.org>:
- adding "--keyring" flag.
- adding LIVE_DISK_VOLUME.
- adding start-stop-daemon wrapper to avoid daemons to be started.
- adding workaround to prevent binfmt locking /proc.
- adding LIVE_ISOLINUX_SPLASH.
* Uploaded 0.99.17.
2007-01-19 Daniel Baumann <daniel@debian.org>
* Replacing mkisofs with genisoimage.
2007-01-18 Daniel Baumann <daniel@debian.org>
* Cleanups.
* Uploaded 0.99.16.
2007-01-16 Daniel Baumann <daniel@debian.org>
* Switched default distribution back to unstable, as unstable is usable
again from the kernel point of view.
* Added file to the minimal package list.
* Uploaded 0.99.15.
2007-01-04 Daniel Baumann <daniel@debian.org>
* Added workaround for new xorg packages by including
xserver-xorg-input-all and xserver-xorg-video-all in all X11 package
lists. See #405639 for more information.
* Added xdebconfigurator to all X11 package lists.
* Adding workaround for initrd backup files.
2006-11-06 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.14.
2006-11-05 Daniel Baumann <daniel@debian.org>
* Applied patch from Markus Bauer <bauer-markus@web.de>:
- fixing script sourcing to exclude files in .svn
2006-11-03 Daniel Baumann <daniel@debian.org>
* Fixed typo in the policy-rc.d hack.
2006-11-02 Daniel Baumann <daniel@debian.org>
* Using aptitude instead of apt-get.
* Added '--with-recommends' and '--without-recommends'.
2006-11-01 Daniel Baumann <daniel@debian.org>
* Fixed regression when using -d ${CODENAME} wrt/ kernel packages.
2006-10-30 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.13.
2006-10-29 Daniel Baumann <daniel@debian.org>
* Added minimal-net flavour.
2006-10-28 Daniel Baumann <daniel@debian.org>
* Added console-common to standard selection.
2006-10-27 Daniel Baumann <daniel@debian.org>
* Added patch from Otavio Salvador <otavio@debian.org>:
- fixing preseeding error-handling.
2006-10-26 Daniel Baumann <daniel@debian.org>
* Added gnustep package selection based on the suggestion of
Guerkan Senguen <gurkan@linuks.mine.nu>.
2006-10-25 Daniel Baumann <daniel@debian.org>
* Applied patch from Marcelo D. Re <mdre@rectorado.unl.edu.ar>:
- skip deb-src source-list entries when building images with
--without-source.
* Applied patches from Otavio Salvador <otavio@debian.org>:
- adding '--bootstrap-config' to support cdebootstraps
'--suite-config'.
- allowing override of ${BASE}.
- adjust sourcing of scripts, so that only the real scripts are
sourced and not other (backup) files.
- allowing override of kernel-packages.
* Reverted mangling of LIVE_DISTRIBUTION for sources.list generation.
2006-10-23 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.12.
2006-10-18 Daniel Baumann <daniel@debian.org>
* Autodetecting proxy now.
2006-10-16 Daniel Baumann <daniel@debian.org>
* Readded and slightly changed --clone and --preseed.
* Uploaded 0.99.11.
2006-10-09 Daniel Baumann <daniel@debian.org>
* Cleanups.
* Uploaded 0.99.10.
2006-10-02 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.9.
2006-10-01 Daniel Baumann <daniel@debian.org>
* Added multiple repositories.
* Using LIVE_PROXY_* also for bootstraping.
2006-09-27 Daniel Baumann <daniel@debian.org>
* Changing manpage section.
2006-09-26 Daniel Baumann <daniel@debian.org>
* Added default flavour hooks.
* minimal flavour does not install debian-archive-keyring to save space.
* Adjusted network patch.
2006-09-25 Daniel Baumann <daniel@debian.org>
* Removed now unused initramfs-tools hack.
* Simplified xorg check based on distribution rather than version.
* Added fix from Bas Wijnen <wijnen@debian.org> for space handling in
arguments.
* Fixed package list handling similar to the fix suggested by Alex Owen
<r.alex.owen@gmail.com>.
* Uploaded 0.99.8.
2006-09-24 Marco Amadori <marco.amadori@gmail.com>
* 13hack.sh: initramfs-tools hack, check added for xorg.
2006-09-18 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.7.
2006-09-15 Daniel Baumann <daniel@debian.org>
* Added eject to minimal package selection.
2006-09-14 Daniel Baumann <daniel@debian.org>
* Adjustements for linux 2.6.17 testing propagation.
2006-09-11 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.6.
2006-09-08 Marco Amadori <marco.amadori@gmail.com>
* 23net.sh: Fixed binary missing directory creation.
* templates/iso: Moved common files to templates/common.
2006-09-07 Daniel Baumann <daniel@debian.org>
* Minor cleanups.
* Fixed dist target.
2006-09-06 Marco Amadori <marco.amadori@gmail.com>
* 14chroot.sh, main.sh: Added manifest support.
* 23net.sh: Added 2 variables for basenames to ease readability.
* main.sh, 02default.sh: Modified Usage() uses.
2006-09-04 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.5.
2006-09-03 Daniel Baumann <daniel@debian.org>
* Added dist parameter to easily pull images for live.debian.net.
* Added "--output" to specify the image name prefix.
* Exclude iso templates for minimal flavour.
2006-09-02 Daniel Baumann <daniel@debian.org>
* Added experimental as distribution.
* Added source image generation.
* Using dpkg instead of dpkg-architecture, removed dpkg-dev dependency.
2006-08-31 Daniel Baumann <daniel@debian.org>
* Added "--disable-generic-indices" and "--enable-generic-indices".
* Fixed i18n lists.
* Rewritten all lists, comments are now possible.
* Lists must be now explicitly given with --package-list, no longer as
last argument of the make-live call.
* Setting default sources.list while the image generation, restoring
customized ones afterwards.
2006-08-30 Daniel Baumann <daniel@debian.org>
* Cleanups:
- moved 14patch_packages.sh to 13hack.sh.
- simplified 13hack.sh.
2006-08-29 Marco Amadori <marco.amadori@gmail.com>
* pxelinux.cfg: Updated to right defaults, first cifs then nfs or
select your favorite way. Rationale: /dev/nfs is for kernel
discovering, not for initramfs discover, casper will be just fine
with "netboot".
* 13chroot.sh, 14patch_packages.sh: Added a simple system for patching
packages, mainly for xserver-xorg so far.
2006-08-28 Daniel Baumann <daniel@debian.org>
* Updated documentation.
* Added patch from Alex Owen <r.a.owen@qmul.ac.uk> to update
pxelinux.cfg for NFS root in casper.
* Uploaded 0.99.4.
2006-08-27 Daniel Baumann <daniel@debian.org>
* Cleanups.
2006-08-27 Marco Amadori <marco.amadori@gmail.com>
* Added sysv init blocking policy.
2006-08-22 Daniel Baumann <daniel@debian.org>
* Reorganised sources.
* Added staging support.
* Cleaned up parameter names.
* testing is now supported.
2006-08-21 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.3.
2006-08-02 Marco Amadori <marco.amadori@gmail.com>
* Rewrote netboot support.
* Added support for pure directory rootfs images.
2006-07-31 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.2.
2006-07-28 Daniel Baumann <daniel@debian.org>
* Added DEBIAN_FRONTEND to chroots(), now completely non-interactive.
* Fixed wrong chroot patch.
2006-07-27 Marco Amadori <marco.amadori@gmail.com>
* Changed amd64 kernel naming scheme.
2006-07-24 Daniel Baumann <daniel@debian.org>
* Uploaded 0.99.1.
2006-07-19 Daniel Baumann <daniel@debian.org>
* Bugfixes.
2006-07-18 Daniel Baumann <daniel@debian.org>
* Added iso templates.
2006-07-17 Daniel Baumann <daniel@debian.org>
* Added chroot to 01-patch.sh.
* Added "--logfile".
* Uploaded 0.99.
2006-07-01 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Added "--flavour".
2006-06-28 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Added "--debug" and "--verbose".
2006-06-23 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Rewritten manpages.
2006-06-19 Marco Amadori <marco.amadori@gmail.com>
* Added "--templates" options.
* Fixed some typos.
2006-06-15 Daniel Baumann <daniel.baumann@panthera-systems.net>
* General fixes.
2006-06-18 Marco Amadori <marco.amadori@gmail.com>
* Added "-a|--architecture" and "-p|--package-list" options.
* Reworked how lists works.
2006-06-15 Daniel Baumann <daniel.baumann@panthera-systems.net>
* General cleanup.
2006-06-14 Marco Amadori <marco.amadori@gmail.com>
* Re-added "-f|--filesystem".
2006-06-12 Marco Amadori <marco.amadori@gmail.com>
* Added "--conffile", "--preseed", "--clone", and "--rootfs" options.
2006-06-12 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Added new splash.rle.
* Added memtest86+.
* Added "--distribution", and "--section" options.
* Moved /etc/default/make-live to /etc/make-live.conf.
2006-06-11 Marco Amadori <marco.amadori@gmail.com>
* Added handling of md5sums.
2006-06-09 Marco Amadori <marco.amadori@gmail.com>
* Added splashy support.
* Added ext2 rootfs support.
* Added external hook and path support.
* Swiched to getopt.
2006-06-02 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Added patch from Jason D. Clinton <me@jasonclinton.com>:
- Added netboot flavour.
- Thanks to SafeDesk Solutions <http://www.safedesk.com/>.
2006-06-01 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Moved syslinux inside the chroot.
2006-05-31 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Added kde-*i18n and standard-i18n lists.
2006-05-28 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Added patch from Frederic Lehobey <Frederic.Lehobey@free.fr>:
- Added locales to LIVE_PACKAGES.
- Added LIVE_MIRROR_KEY, LIVE_REPOSITORY, LIVE_REPOSITORY_KEY, and
LIVE_BOOTAPPEND.
2006-05-27 Daniel Baumann <daniel.baumann@panthera-systems.net>
* Initial release.

View File

@ -0,0 +1,182 @@
commit 1f4cf146edbd72a2d61ac2e60324d392569c9f24
Author: Daniel Baumann <daniel@debian.org>
Date: Wed Oct 14 13:35:25 2009 +0200
Updating vcs fields.
commit d1ab019de29691407e3bde1af2ff5efe9a284380
Author: Richard Nelson <unixabg@gmail.com>
Date: Wed May 27 09:42:55 2009 -0500
Update quoting on variables for safety.
commit 601b25634d291706fc477342b712554a54c42016
Author: Richard Nelson <unixabg@gmail.com>
Date: Sat Mar 14 22:19:41 2009 -0500
update copyright years
commit fed4e5adfd49b339bec16b0338b73f9f90ca40ce
Author: Richard Nelson <unixabg@gmail.com>
Date: Sat Mar 14 21:47:27 2009 -0500
Set lenny as defualt build
commit 083a14f46cc1298b33908991dea145cf4ec7415d
Author: Richard Nelson <unixabg@gmail.com>
Date: Sun Nov 30 16:41:15 2008 -0600
Bug fix on usb-hdd builds.
commit 7742576d3a9b84807c6456007ad3bc0147ca3024
Author: Richard Nelson <unixabg@gmail.com>
Date: Thu Nov 27 22:44:51 2008 -0600
Remove -x flag left on cron during debug operations.
commit 6817dca69fd0c53578c1e14c9c5333d5be94419d
Author: Richard Nelson <unixabg@gmail.com>
Date: Thu Nov 27 22:42:58 2008 -0600
Update to start using more live-helper functions.
commit 649fc3a0fac8eae1b8a239a9ba250e89f4b89dfd
Author: Richard Nelson <unixabg@gmail.com>
Date: Wed Nov 26 22:13:57 2008 -0600
Update Copyright (C) to 2007-2008
commit 5449c921111b2f300006cc41d7b6582270959a82
Author: Daniel Baumann <daniel@debian.org>
Date: Fri Nov 7 18:08:01 2008 +0100
Replacing obsolete dh_clean -k with dh_prep.
commit cd7a4a353ae652a45057da5726467e23401be52d
Author: Richard Nelson <unixabg@gmail.com>
Date: Tue Nov 4 18:40:06 2008 -0600
Bug fix on custom bootstrap and custom binary.
commit fc227fc32f06ba8e5af8c9ebdcd147f98790b6ea
Author: Richard Nelson <unixabg@gmail.com>
Date: Thu Oct 2 17:24:37 2008 -0500
Bug fix in netboot server and path.
commit 446a99439bfee38c89615e1e24bb4729b2223e9e
Author: Richard Nelson <unixabg@gmail.com>
Date: Mon Sep 8 21:39:37 2008 -0500
Include common functions from live-helper for code reuse.
commit 359e51591318966e97128b00bff38c62d07c6827
Author: Richard Nelson <unixabg@gmail.com>
Date: Mon Sep 8 21:35:52 2008 -0500
Added test for unmounting devpts-live.
commit 3fdcc59654986d57f014b6c6721b2a3abde2f722
Author: Richard Nelson <unixabg@gmail.com>
Date: Mon Sep 8 21:29:41 2008 -0500
Local variable prefix with _ on VAR i.e. _VAR
commit 4bbf10e31754f290d3aa0e158a45d09316487544
Author: Richard Nelson <unixabg@gmail.com>
Date: Mon Sep 8 16:12:22 2008 -0500
Local variable LH_ removal/cleanup.
commit 472a6a0825656fbc16f4df6cb19bb16e1df8605f
Author: Richard Nelson <unixabg@gmail.com>
Date: Mon Sep 8 16:02:36 2008 -0500
Minor local variable confusion for LH_ prefix cleanup.
commit df23442fca1c727dd43ca1ea464b277e3617cb0f
Author: Richard Nelson <unixabg@gmail.com>
Date: Mon Sep 8 15:59:08 2008 -0500
Upgrade variables to have the LH_ prefix for LH_* variable, to work with the current live-helper version.
commit f00e0cb212e0c84268e099ca35ca386982e4d82b
Author: Daniel Baumann <daniel@debian.org>
Date: Sun Sep 7 21:57:51 2008 +0200
Removing currently unused Upstream-Depends field in control.
commit 4c85494fa2907a54dd99eaf17816a4d403ddb5bc
Author: Daniel Baumann <daniel@debian.org>
Date: Sun Sep 7 21:57:41 2008 +0200
Updating vcs fields in control file.
commit eaf87ebd9f828740430cc60d3e9f201d88c67c25
Author: Daniel Baumann <daniel@debian.org>
Date: Thu Aug 28 23:40:35 2008 +0200
Setting project email address to the new debian-live@lists.debian.org.
commit 6fbca8e14be271dc62988d5555bba9f453ddbaa7
Author: Daniel Baumann <daniel@debian.org>
Date: Wed Apr 23 18:50:17 2008 +0200
Updating Richards email address.
commit 25e1e7bc4f6a095aaf248a80aeaa3795f4a3e3a9
Author: Daniel Baumann <daniel@debian.org>
Date: Tue Oct 30 11:04:42 2007 +0100
Correcting vcs fields.
commit c49d9ff77bd5be73d5367fd567a9e39fccf78410
Author: Daniel Baumann <daniel@debian.org>
Date: Wed Oct 3 09:11:29 2007 +0200
Fixing wrong homepage field.
commit 8e01ba16a737d04a0367ecf1d4f3d7f80437fe97
Author: Daniel Baumann <daniel@debian.org>
Date: Sun Sep 23 16:04:04 2007 +0200
Using new Homepage field now.
commit 49ca83a4d57051b2b4b4b950178063c6df25e222
Author: Daniel Baumann <daniel@debian.org>
Date: Sun Sep 23 16:04:04 2007 +0200
Adding Upstream-Depends field.
commit 39a9d3e82c71451734f0d4ddb630b67c9d55541a
Author: Daniel Baumann <daniel@debian.org>
Date: Sun Sep 23 16:04:04 2007 +0200
Moving from svn to git.
commit 7e823babbe815bdf520becbfd6f4ccec814aa7e2
Author: Daniel Baumann <daniel@debian.org>
Date: Sun Sep 23 16:04:03 2007 +0200
Removing not uploaded versions.
commit 46e8777246485a15fc6d5a202a361662f4e724b5
Author: Daniel Baumann <daniel@debian.org>
Date: Sun Sep 23 16:03:52 2007 +0200
Adding live-webhelper trunk 20070911.
2007-07-19 Daniel Baumann <daniel@debian.org>
* Introducing build modes.
2007-07-14 Daniel Baumann <daniel@debian.org>
* scripts/cgi:
- Quick fix in EMAIL.
2007-06-04 Daniel Baumann <daniel@debian.org>
* templates/form.html:
- Set default source image to 'generic'.
* Starting live-webhelper.

3
examples/auto/build Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
lb build noauto "${@}" 2>&1 | tee build.log

6
examples/auto/clean Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
lb clean noauto "${@}"
rm -f config/binary config/bootstrap config/chroot config/common config/source
rm -f build.log

4
examples/auto/config Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
lb config noauto \
"${@}"

33
examples/hooks/minimal.chroot Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
set -e
# Removing unused packages
for PACKAGE in apt-utils aptitude man-db manpages info wget
do
if ! apt-get remove --purge --yes "${PACKAGE}"
then
echo "WARNING: ${PACKAGE} isn't installed"
fi
done
apt-get autoremove --yes || true
# Removing unused files
find . -name *~ -print0 | xargs -0 rm -f
rm -rf /var/cache/man/*
# Truncating logs
for FILE in $(find /var/log/ -type f)
do
: > ${FILE}
done

52
examples/hooks/stripped.chroot Executable file
View File

@ -0,0 +1,52 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
set -e
# WARNING: Using this hook will result in a stripped system, means,
# it may very well be possible that other packages are depending
# on certain files that get removed here.
# Therefore, this hooks is merely an inspiration for what could be
# removed and not a generic nor recommendet solution to get the
# image filesize down. In any event, using this hook can lead to
# unforseen bugs and breakages in other packages and you should
# be prepared to find and fix it for your own images.
# Removing unused packages
for PACKAGE in apt-utils aptitude man-db manpages info wget dselect
do
if ! apt-get remove --purge --yes "${PACKAGE}"
then
echo "WARNING: ${PACKAGE} isn't installed"
fi
done
apt-get autoremove --yes || true
# Removing unused files
find . -name *~ | xargs rm -f
rm -rf /usr/include/*
#rm -rf /usr/share/groff/*
rm -rf /usr/share/doc/*
rm -rf /usr/share/locale/*
rm -rf /usr/share/man/*
rm -rf /usr/share/i18n/*
rm -rf /usr/share/info/*
rm -rf /usr/share/lintian/*
rm -rf /usr/share/linda/*
rm -rf /usr/share/zoneinfo/*
rm -rf /var/cache/man/*
# Truncating logs
for FILE in $(find /var/log/ -type f)
do
: > ${FILE}
done

22
examples/hooks/symlinks.chroot Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
# This is a hook for live-build(7) to install localepurge.
# To enable it, copy or symlink this hook into your config/chroot_local-hooks
# directory.
#
_PURGE=""
if [ ! -x "$(which symlinks 2>/dev/null)" ]
then
_PURGE="true"
apt-get install symlinks
fi
symlinks -c -r -s /
if [ "${_PURGE}" = "true" ]
then
apt-get remove --purge symlinks
fi

21
frontends/cgi/Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile
install:
install -D -m 0755 live-build-cgi $(DESTDIR)/usr/lib/cgi-bin/live-build
install -D -m 0755 live-build-cgi.cron $(DESTDIR)/etc/cron.hourly/live-build-cgi
install -D -m 0644 live-build-cgi.crontab $(DESTDIR)/etc/cron.d/live-build-cgi
install -D -m 0644 live-build-cgi.default $(DESTDIR)/etc/default/live-build-cgi
install -D -m 0644 live-build-cgi.logrotate $(DESTDIR)/etc/logrotate.d/live-build-cgi
install -d -m 0755 $(DESTDIR)/var/log
touch $(DESTDIR)/var/log/live
chown www-data:www-data $(DESTDIR)/var/log/live
uninstall:
rm -f $(DESTDIR)/usr/lib/cgi-bin/live-build
rm -f $(DESTDIR)/etc/cron.d/live-build-cgi
rm -f $(DESTDIR)/etc/cron.hourly/live-build-cgi
rm -f $(DESTDIR)/etc/default/live-build-cgi
rm -f $(DESTDIR)/etc/logrotate.d/live-build-cgi
reinstall: uninstall install

221
frontends/cgi/live-build-cgi Executable file
View File

@ -0,0 +1,221 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
# Including common functions
( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
# Reading defaults
if [ -r /etc/default/live-build-cgi ]
then
. /etc/default/live-build-cgi
else
echo "E: /etc/default/live-build-cgi missing"
exit 1
fi
_HOSTNAME="$(hostname -f)"
# Turn on debug if enabled
if [ "${_DEBUG}" = "enabled" ]
then
set -x
fi
# Sending http header
echo "Content-type: text/html"
echo
# Sending html header
cat "${_TEMPLATES}"/header.html
# CGI
if [ -z "${QUERY_STRING}" ]
then
# Sending html form
sed -e "s/VERSION/${VERSION}/" \
-e "s/DATE/`date +%Y%m%d-%H:%M`/" \
"${_TEMPLATES}"/form.html
else
# Converting spaces: sed 's/+/ /g'
# Converting '@': sed 's/%40/@/g'
# Converting ':': sed 's/%3A/:/g'
# Converting ';': sed 's/%3B/\;/g'
# Converting '/': sed 's/%2F/\//g'
# Converting '~': sed 's/%7E/\~/g'
# Converting '=': sed 's/%3D/=/g'
# Converting '+': sed 's/%2B/+/g'
# Translate parameters
QUERY_STRING=$(echo "${QUERY_STRING}" | sed -e 's/%2F/\//g' -e 's/+/ /g' -e 's/%3B/;/g' -e 's/%7E/~/g' -e 's/%3A/:/g' -e 's/%40/@/g' -e 's/%3D/=/g' -e 's/%2B/+/g')
# Debug the filtering string
# echo ${QUERY_STRING}
# Email
_EMAIL=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])email=[-0-9a-zA-Z._@]+' | cut -f 2 -d '=' | head -n1)
# CGI Packages List
_LB_CGIPACKAGES=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])cgipackages=[-0-9a-zA-Z. _+]+' | cut -f 2 -d '=' | head -n1)
# CGI Config for git
_LB_CONFIG=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])config=[-a-z.]+' | cut -f 2 -d '=' | head -n1)
_LB_CONFIG="git://live.debian.net/git/${_LB_CONFIG}"
# Standard options
LB_BINARY_IMAGES=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])binary_images=[-a-z]+' | cut -f 2 -d '=' | head -n1)
LB_DISTRIBUTION=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])distribution=[a-z]+' | cut -f 2 -d '=' | head -n1)
# Advanced bootstrap options
LB_ARCHITECTURES=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])architectures=[0-9a-z]+' | cut -f 2 -d '=' | head -n1)
LB_BOOTSTRAP_FLAVOUR=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])bootstrap_flavour=[a-z]+' | cut -f 2 -d '=' | head -n1)
LB_ARCHIVE_AREAS=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])archive_areas=[a-z]+' | cut -f 2 -d '=' | head -n1)
# Advanced chroot options
LB_CHROOT_FILESYSTEM=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])chroot_filesystem=[0-9a-z]+' | cut -f 2 -d '=' | head -n1)
LB_LINUX_FLAVOURS=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])linux_flavours=[-0-9a-z]+' | cut -f 2 -d '=' | head -n1)
LB_SECURITY=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])security=[a-z]+' | cut -f 2 -d '=' | head -n1)
# Advanced binary options
LB_BINARY_INDICES=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])binary_indices=[a-z]+' | cut -f 2 -d '=' | head -n1)
LB_BOOTAPPEND_INSTALL=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])bootappend_install=[-0-9a-zA-Z. _+=:/]+' | cut -f2- -d '=' | head -n1)
LB_BOOTAPPEND_LIVE=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])bootappend_live=[-0-9a-zA-Z. _+=:/]+' | cut -f2- -d '=' | head -n1)
LB_BOOTLOADER=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])bootloader=[a-z]+' | cut -f 2 -d '=' | head -n1)
LB_DEBIAN_INSTALLER=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])debian_installer=[a-z]+' | cut -f 2 -d '=' | head -n1)
LB_ISO_APPLICATION=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])iso_application=[-0-9a-zA-Z. ~;:/_]+' | cut -f 2 -d '=' | head -n1)
LB_ISO_PREPARER=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])iso_preparer=[-0-9a-zA-Z. ~;:/_]+' | cut -f 2 -d '=' | head -n1)
LB_ISO_PUBLISHER=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])iso_publisher=[-0-9a-zA-Z. ~;:/_@]+' | cut -f 2 -d '=' | head -n1)
LB_ISO_VOLUME=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])iso_volume=[-0-9a-zA-Z. ~;:/_]+' | cut -f 2 -d '=' | head -n1)
LB_MEMTEST=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])memtest=[0-9a-z+]+' | cut -f 2 -d '=' | head -n1)
LB_NET_ROOT_PATH=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])net_path=[-0-9a-zA-Z._/]+' | cut -f 2 -d '=' | head -n1)
LB_NET_ROOT_SERVER=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])net_server=[0-9.]+' | cut -f 2 -d '=' | head -n1)
# Advanced source options
LB_SOURCE=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])source=[a-z]+' | cut -f 2 -d '=' | head -n1)
LB_SOURCE_IMAGES=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])source_images=[a-z]+' | cut -f 2 -d '=' | head -n1)
# Unofficial options
_CUSTOM_BOOTSTRAP=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])custom_bootstrap=[-0-9a-zA-Z.~:/_]+' | cut -f 2 -d '=' | head -n1)
_CUSTOM_BINARY=$(echo "${QUERY_STRING}" | grep -oE '(^|[?&])custom_binary=[-0-9a-zA-Z.~:/_]+' | cut -f 2 -d '=' | head -n1)
# FIXME: filter invalid options
unset QUERY_STRING
if [ -z "${_EMAIL}" ]
then
echo "<h2><div style='color: red;'>Error: No email address specified.</div></h2>"
sed -e "s/VERSION/${VERSION}/" \
-e "s/DATE/`date +%Y%m%d-%H:%M`/" \
"${_TEMPLATES}"/form.html
exit
fi
# Getting build identifier
_BUILD=$(date +%Y%m%d.%H%M%S.%N)
# Getting number of builds pending.
_QUEUENUM=$(ls "${_TEMPDIR}"/*.build | wc -l)
#echo "${QUERY_STRING}"
# Sending html confirmation
# Note: On each string remember to use a delimeter that is not in the string.
sed -e "s/BUILD/${_BUILD}/g" \
-e "s/EMAIL/${_EMAIL}/" \
-e "s/QUEUENUM/${_QUEUENUM}/" \
-e "s/LB_BINARY_IMAGES/${LB_BINARY_IMAGES}/" \
-e "s/LB_DISTRIBUTION/${LB_DISTRIBUTION}/" \
-e "s#_LB_CONFIG#${_LB_CONFIG}#" \
-e "s/_LB_CGIPACKAGES/${_LB_CGIPACKAGES}/" \
-e "s/LB_ARCHITECTURES/${LB_ARCHITECTURES}/" \
-e "s/LB_BOOTSTRAP_FLAVOUR/${LB_BOOTSTRAP_FLAVOUR}/" \
-e "s/LB_ARCHIVE_AREAS/${LB_ARCHIVE_AREAS}/" \
-e "s/LB_CHROOT_FILESYSTEM/${LB_CHROOT_FILESYSTEM}/" \
-e "s/LB_LINUX_FLAVOURS/${LB_LINUX_FLAVOURS}/" \
-e "s/LB_SECURITY/${LB_SECURITY}/" \
-e "s/LB_BINARY_INDICES/${LB_BINARY_INDICES}/" \
-e "s#LB_BOOTAPPEND_INSTALL#${LB_BOOTAPPEND_INSTALL}#" \
-e "s#LB_BOOTAPPEND_LIVE#${LB_BOOTAPPEND_LIVE}#" \
-e "s/LB_BOOTLOADER/${LB_BOOTLOADER}/" \
-e "s/LB_DEBIAN_INSTALLER/${LB_DEBIAN_INSTALLER}/" \
-e "s#LB_ISO_APPLICATION#${LB_ISO_APPLICATION}#" \
-e "s#LB_ISO_PREPARER#${LB_ISO_PREPARER}#" \
-e "s#LB_ISO_PUBLISHER#${LB_ISO_PUBLISHER}#" \
-e "s#LB_ISO_VOLUME#${LB_ISO_VOLUME}#" \
-e "s/LB_MEMTEST/${LB_MEMTEST}/" \
-e "s#LB_NET_ROOT_PATH#${LB_NET_ROOT_PATH}#" \
-e "s/LB_NET_ROOT_SERVER/${LB_NET_ROOT_SERVER}/" \
-e "s#SERVER#${_SERVER}#g" \
-e "s/LB_SOURCE_IMAGES/${LB_SOURCE_IMAGES}/" \
-e "s/LB_SOURCE/${LB_SOURCE}/" \
-e "s#CUSTOM_BOOTSTRAP#${_CUSTOM_BOOTSTRAP}#" \
-e "s#CUSTOM_BINARY#${_CUSTOM_BINARY}#" \
"${_TEMPLATES}"/build.html
# Creating temporary directory
mkdir -p "${_TEMPDIR}"
# Writing build file
cat > "${_TEMPDIR}"/"${_BUILD}".build << EOF
# live-build-cgi "${VERSION}" build file
# `date -R`
_BUILD="${_BUILD}"
_EMAIL="${_EMAIL}"
REMOTE_ADDR="${REMOTE_ADDR}"
# CGI Packages List
_LB_CGIPACKAGES="${_LB_CGIPACKAGES}"
# CGI Config for git
_LB_CONFIG="${_LB_CONFIG}"
# Standard options
LB_BINARY_IMAGES="${LB_BINARY_IMAGES}"
LB_DISTRIBUTION="${LB_DISTRIBUTION}"
# Advanced bootstrap options
LB_ARCHITECTURES="${LB_ARCHITECTURES}"
LB_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS}"
# Advanced chroot options
LB_CHROOT_FILESYSTEM="${LB_CHROOT_FILESYSTEM}"
LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS}"
LB_SECURITY="${LB_SECURITY}"
# Advanced binary options
LB_BINARY_INDICES="${LB_BINARY_INDICES}"
LB_BOOTAPPEND_INSTALL="${LB_BOOTAPPEND_INSTALL}"
LB_BOOTAPPEND_LIVE="${LB_BOOTAPPEND_LIVE}"
LB_BOOTLOADER="${LB_BOOTLOADER}"
LB_DEBIAN_INSTALLER="${LB_DEBIAN_INSTALLER}"
LB_ISO_APPLICATION="${LB_ISO_APPLICATION}"
LB_ISO_PREPARER="${LB_ISO_PREPARER}"
LB_ISO_PUBLISHER="${LB_ISO_PUBLISHER}"
LB_ISO_VOLUME="${LB_ISO_VOLUME}"
LB_MEMTEST="${LB_MEMTEST}"
LB_NET_ROOT_PATH="${LB_NET_ROOT_PATH}"
LB_NET_ROOT_SERVER="${LB_NET_ROOT_SERVER}"
# Advanced source options
LB_SOURCE_IMAGES="${LB_SOURCE_IMAGES}"
LB_SOURCE="${LB_SOURCE}"
# Unofficial options
_CUSTOM_BOOTSTRAP="${_CUSTOM_BOOTSTRAP}"
_CUSTOM_BINARY="${_CUSTOM_BINARY}"
EOF
echo "$(date +%b\ %d\ %H:%M:%S) ${_HOSTNAME} live-build-cgi: add web build (${_BUILD}) from ${REMOTE_ADDR}." >> /var/log/live
echo "$(date +%b\ %d\ %H:%M:%S) ${_HOSTNAME} live-build-cgi: options ${_BUILD} |email ${_EMAIL}|binary_images ${LB_BINARY_IMAGES}|distribution ${LB_DISTRIBUTION}|config ${_LB_CONFIG}|cgipackages ${_LB_CGIPACKAGES}|architectures ${LB_ARCHITECTURES}|archive_areas ${LB_ARCHIVE_AREAS}|chroot_filesystem ${LB_CHROOT_FILESYSTEM}|linux_flavours ${LB_LINUX_FLAVOURS}|security ${LB_SECURITY}|binary_indices ${LB_BINARY_INDICES}|bootappend_install ${LB_BOOTAPPEND_INSTALL}|bootappend_live ${LB_BOOTAPPEND_LIVE}|bootloader ${LB_BOOTLOADER}|debian_installer ${LB_DEBIAN_INSTALLER}|iso_application ${LB_ISO_APPLICATION}|iso_preparer ${LB_ISO_PREPARER}|iso_publisher ${LB_ISO_PUBLISHER}|iso_volume ${LB_ISO_VOLUME}|memtest ${LB_MEMTEST}|net_path ${LB_NET_ROOT_PATH}|net_server ${LB_NET_ROOT_SERVER}|source_images ${LB_SOURCE_IMAGES}|sources ${LB_SOURCE}|custom_bootstrap ${_CUSTOM_BOOTSTRAP}|custom_binary ${_CUSTOM_BINARY}" >> /var/log/live
fi
sed -e "s/VERSION/${VERSION}/" "${_TEMPLATES}"/footer.html

211
frontends/cgi/live-build-cgi.cron Executable file
View File

@ -0,0 +1,211 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
# Including common functions
( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
# Reading defaults
if [ -r /etc/default/live-build-cgi ]
then
. /etc/default/live-build-cgi
else
echo "E: /etc/default/live-build-cgi missing"
exit 1
fi
# Exit if disabled
if [ "${_WEBBUILD}" != "enabled" ]
then
exit 0
fi
_HOSTNAME="$(hostname -f)"
# Turn on debug if enabled
if [ "${_DEBUG}" = "enabled" ]
then
set -x
fi
# Checking lock file
if [ -f /var/lock/live-build-cgi.lock ]
then
echo "E: live-build-cgi already/still running."
exit 1
fi
# Creating lock trap
trap "test -f /var/lock/live-build-cgi.lock && rm -f /var/lock/live-build-cgi.lock; exit 0" 0 1 2 3 9 15
# Creating lock file
touch /var/lock/live-build-cgi.lock
# Cleanup old builds: cron should be run at least once per hour to take effect
if ls "${_DESTDIR}"/`date -d yesterday +%Y%m%d.%H`* > /dev/null 2>&1
then
rm -rf "${_DESTDIR}"/`date -d yesterday +%Y%m%d.%H`*
echo "`date +%b\ %d\ %H:%M:%S` ${_HOSTNAME} live-build-cgi: remove web build (`date -d yesterday +%Y%m%d.%H`*)." >> /var/log/live
fi
# Ok from here spin through the live-build-cgi files we have waiting to build
#if ls "${_TEMPDIR}"/*.build > /dev/null 2>&1
if Find_files ${_TEMPDIR}/*.build
then
for _FILE in "${_TEMPDIR}"/*.build
do
# Pull in the variables we want from the config file.
# Pul in the build number
_BUILD=`awk -F\" '/^_BUILD=/{print $2}' ${_FILE}`
# Pull in the email address
_EMAIL=`awk -F\" '/^_EMAIL=/{print $2}' ${_FILE}`
# Pull in cgipackages for config/package-lists/cgipackages.list.chroot
_LB_CGIPACKAGES=`awk -F\" '/^_LB_CGIPACKAGES=/{print $2}' ${_FILE}`
# Pull in config for git clone
_LB_CONFIG=`awk -F\" '/^_LB_CONFIG=/{print $2}' ${_FILE}`
# Pull in the remote address, atchitecture, distribution, and package-lists.
_REMOTE_ADDR=`awk -F\" '/^REMOTE_ADDR=/{print $2}' ${_FILE}`
_LB_ARCHITECTURES=`awk -F\" '/^LB_ARCHITECTURES=/{print $2}' ${_FILE}`
_LB_DISTRIBUTION=`awk -F\" '/^LB_DISTRIBUTION=/{print $2}' ${_FILE}`
# Pull in the custom bootstrap
_CUSTOM_BOOTSTRAP=`awk -F\" '/^_CUSTOM_BOOTSTRAP=/{print $2}' ${_FILE}`
# Pull in the custom binary
_CUSTOM_BINARY=`awk -F\" '/^_CUSTOM_BINARY=/{print $2}' ${_FILE}`
# Drop out some build data for information if something goes wrong.
echo "`date +%b\ %d\ %H:%M:%S` ${_HOSTNAME} live-build-cgi: begin web build (${_BUILD})." >> /var/log/live
# Clone the git config to target build directory
git clone ${_LB_CONFIG} "${_TEMPDIR}"/"${_BUILD}" >> /var/log/live
_ERRORGIT="${?}"
# Creating build directory and the config/package-lists
mkdir -p "${_TEMPDIR}"/"${_BUILD}"/config/package-lists
# The next two tests are for unofficial third party archives
if [ -n "${_LB_CGIPACKAGES}" ]
then
echo "${_LB_CGIPACKAGES}" > "${_TEMPDIR}"/"${_BUILD}"/config/package-lists/cgipackages.list.chroot
fi
# Creating the config/chroot_sources folder
mkdir -p "${_TEMPDIR}"/"${_BUILD}"/config/chroot_sources
# The next two tests are for unofficial third party archives
if [ -n "${_CUSTOM_BOOTSTRAP}" ]
then
echo "${_CUSTOM_BOOTSTRAP}" > "${_TEMPDIR}"/"${_BUILD}"/config/chroot_sources/custom.bootstrap
fi
if [ -n "${_CUSTOM_BINARY}" ]
then
echo "${_CUSTOM_BINARY}" > "${_TEMPDIR}"/"${_BUILD}"/config/chroot_sources/custom.binary
fi
_DATE_START="`date -R`"
echo "Begin: ${_DATE_START}" > "${_TEMPDIR}"/"${_BUILD}"/log
# Generating image here
cd "${_TEMPDIR}"/"${_BUILD}"
# Stack on config file params to build dir
lb config -c ${_FILE} >> "${_TEMPDIR}"/"${_BUILD}"/log 2>&1
_ERRORCONFIG="${?}"
# Run build
lb build >> "${_TEMPDIR}"/"${_BUILD}"/log 2>&1
_ERRORBUILD="${?}"
_DATE_END="`date -R`"
echo "End: ${_DATE_END}" >> "${_TEMPDIR}"/"${_BUILD}"/log
# Creating image directory
mkdir -p "${_DESTDIR}"/"${_BUILD}"
# Creating mail and logging.
if [ "${_ERRORGIT}" -eq "0" ] && [ "${_ERRORCONFIG}" -eq "0" ] && [ "${_ERRORBUILD}" -eq "0" ]
then
_STATUS="maybe-successful"
echo "${_REMOTE_ADDR} - - `date +[%d/%b/%Y:%H:%m:%S\ %z]` \"${_BUILD} ${_LB_ARCHITECTURES}/${_LB_DISTRIBUTION}/${_LB_CGIPACKAGES}\" 200 - \"-\" \"\"">>/var/log/live-cgi.builds
else
_STATUS="maybe-failed"
echo "${_REMOTE_ADDR} - - `date +[%d/%b/%Y:%H:%m:%S\ %z]` \"${_BUILD} ${_LB_ARCHITECTURES}/${_LB_DISTRIBUTION}/${_LB_CGIPACKAGES}\" 404 - \"-\" \"\"">>/var/log/live-cgi.builds
fi
sed -e "s/BUILD/${_BUILD}/g" \
-e "s/EMAIL/${_EMAIL}/" \
-e "s/VERSION/${VERSION}/" \
-e "s/DATE_START/${_DATE_START}/" \
-e "s/DATE_END/${_DATE_END}/" \
-e "s/STATUS/${_STATUS}/" \
-e "s#SERVER#${_SERVER}#" \
"${_TEMPLATES}"/mail.txt > "${_DESTDIR}"/"${_BUILD}"/mail
cat >> "${_DESTDIR}"/"${_BUILD}"/mail << EOF
---
Here's a list of all build-options that were used to build your image:
EOF
cat "${_TEMPDIR}"/"${_BUILD}".build >> "${_DESTDIR}"/"${_BUILD}"/mail
# Moving binary image
#if ls "${_TEMPDIR}"/"${_BUILD}"/binary*.* > /dev/null 2>&1
if Find_files ${_TEMPDIR}/${_BUILD}/binary*.*
then
mv "${_TEMPDIR}"/"${_BUILD}"/binary*.* "${_DESTDIR}"/"${_BUILD}"
fi
# Moving source image
#if ls "${_TEMPDIR}"/"${_BUILD}"/source.* > /dev/null 2>&1
if Find_files ${_TEMPDIR}/${_BUILD}/source.*
then
mv "${_TEMPDIR}"/"${_BUILD}"/source.* "${_DESTDIR}"/"${_BUILD}"
fi
# Moving build
mv "${_TEMPDIR}"/"${_BUILD}".build "${_DESTDIR}"/"${_BUILD}"/build
# Moving log
mv "${_TEMPDIR}"/"${_BUILD}"/log "${_DESTDIR}"/"${_BUILD}"
# Generating md5sum
cd "${_DESTDIR}"/"${_BUILD}"
md5sum * > md5sum
cd "${OLDPWD}"
# Sending mail
cat "${_DESTDIR}"/"${_BUILD}"/mail | /usr/sbin/sendmail -t
# Unmounting devpts-live
#if ls "${_TEMPDIR}"/"${_BUILD}"/chroot/dev/pts/* > /dev/null 2>&1
if Find_files ${_TEMPDIR}/${_BUILD}/chroot/dev/pts/*
then
umount "${_TEMPDIR}"/${_BUILD}/chroot/dev/pts
fi
# Unmounting proc
if [ -f "${_TEMPDIR}"/"${_BUILD}"/chroot/proc/version ]
then
umount "${_TEMPDIR}"/"${_BUILD}"/chroot/proc
fi
# Unmounting sysfs
if [ -d "${_TEMPDIR}"/"${_BUILD}"/chroot/sys/kernel ]
then
umount "${_TEMPDIR}"/${_BUILD}/chroot/sys
fi
# Removing build directory
rm -rf "${_TEMPDIR}"/"${_BUILD}"
echo "`date +%b\ %d\ %H:%M:%S` ${_HOSTNAME} live-build-cgi: end web build (${_BUILD}: ${_STATUS})." >> /var/log/live
done
fi

View File

@ -0,0 +1,7 @@
# /etc/crontab - system-wide crontab
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
*/1 * * * * root /etc/cron.hourly/live-build-cgi > /dev/null 2>&1

View File

@ -0,0 +1,13 @@
# Defaults for /etc/cron.daily/live-build-cgi
_WEBBUILD="disabled"
_MODE="debian"
_DEBUG="disabled"
_DESTDIR="/srv/debian-live/build/www"
_TEMPLATES="/usr/share/live/build/templates/cgi/${_MODE}"
_TEMPDIR="/srv/debian-live/build/tmp"
_SERVER="http://live.debian.net/build"

View File

@ -0,0 +1,11 @@
# /etc/logrotate.d/live-build
/var/log/live
{
compress
copytruncate
missingok
monthly
notifempty
rotate 24
}

41
functions/aliases.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Find_files ()
{
(ls "${@}" | grep -qs .) > /dev/null 2>&1
}
In_list ()
{
NEEDLES="${1}"
shift
for ITEM in ${@}
do
for NEEDLE in ${NEEDLES}
do
if [ "${NEEDLE}" = "${ITEM}" ]
then
return 0
fi
done
done
return 1
}
Truncate ()
{
for FILE in ${@}
do
: > ${FILE}
done
}

124
functions/architectures.sh Executable file
View File

@ -0,0 +1,124 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Check_architectures ()
{
ARCHITECTURES="${@}"
VALID="false"
for ARCHITECTURE in ${ARCHITECTURES}
do
if [ "$(echo ${LB_ARCHITECTURES} | grep ${ARCHITECTURE})" ]
then
VALID="true"
break
fi
done
if [ "${ARCHITECTURES}" = "${LB_BOOTSTRAP_QEMU_ARCHITECTURES}" ]
then
VALID="true"
if [ ! -e "${LB_BOOTSTRAP_QEMU_STATIC}" ]
then
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_ARCHITECTURES} was not found"
VALID="false"
fi
if [ ! -x "${LB_BOOTSTRAP_QEMU_STATIC}" ]
then
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_STATIC} is not executable"
VALID="false"
fi
fi
if [ "${VALID}" = "false" ]
then
Echo_warning "skipping %s, foreign architecture(s)." "${0}"
exit 0
fi
}
Check_crossarchitectures ()
{
if [ -x /usr/bin/dpkg ]
then
HOST="$(dpkg --print-architecture)"
else
HOST="$(uname -m)"
fi
case "${HOST}" in
amd64|i386|x86_64)
CROSS="amd64 i386"
;;
powerpc|ppc64)
CROSS="powerpc ppc64"
;;
*)
CROSS="${HOST}"
;;
esac
if [ "${LB_ARCHITECTURES}" = "${LB_BOOTSTRAP_QEMU_ARCHITECTURES}" ]
then
if [ ! -e "${LB_BOOTSTRAP_QEMU_STATIC}" ]
then
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_ARCHITECTURES} was not found"
exit 0
fi
if [ ! -x "${LB_BOOTSTRAP_QEMU_STATIC}" ]
then
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_STATIC} is not executable"
exit 0
fi
return
fi
Check_architectures "${CROSS}"
}
Check_multiarchitectures ()
{
if [ "$(echo ${LB_ARCHITECTURES} | wc -w)" -gt "1" ]
then
# First, only support multiarch on iso
case "${LB_BINARY_IMAGES}" in
iso*)
# Assemble multi-arch
case "${LB_CURRENT_ARCHITECTURE}" in
amd64)
DESTDIR="${DESTDIR}.amd"
DESTDIR_LIVE="${DESTDIR_LIVE}.amd"
DESTDIR_INSTALL="${DESTDIR_INSTALL}.amd"
;;
i386)
DESTDIR="${DESTDIR}.386"
DESTDIR_LIVE="${DESTDIR_LIVE}.386"
DESTDIR_INSTALL="${DESTDIR_INSTALL}.386"
;;
powerpc)
DESTDIR="${DESTDIR}.ppc"
DESTDIR_LIVE="${DESTDIR_LIVE}.ppc"
DESTDIR_INSTALL="${DESTDIR_INSTALL}.ppc"
;;
esac
;;
esac
fi
}

82
functions/arguments.sh Executable file
View File

@ -0,0 +1,82 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Arguments ()
{
ARGUMENTS="$(getopt --longoptions breakpoints,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options c:huv --shell sh -- "${@}")"
if [ "${?}" != "0" ]
then
Echo_error "terminating" >&2
exit 1
fi
eval set -- "${ARGUMENTS}"
while true
do
case "${1}" in
--breakpoints)
_BREAKPOINTS="true"
shift
;;
-c|--conffile)
_CONFFILE="${2}"
shift 2
;;
--debug)
_DEBUG="true"
shift
;;
--force)
_FORCE="true"
shift
;;
-h|--help)
Man
shift
;;
--quiet)
_QUIET="true"
shift
;;
-u|--usage)
Usage
shift
;;
--verbose)
_VERBOSE="true"
shift
;;
-v|--version)
echo "${VERSION}"
exit 0
;;
--)
shift
break
;;
*)
Echo_error "internal error %s" "${0}"
exit 1
;;
esac
done
}

20
functions/breakpoints.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Breakpoint ()
{
NAME="${1}"
if [ "${_BREAKPOINTS}" = "true" ]
then
Echo_message "Waiting at %s" "${NAME}"
read WAIT
fi
}

63
functions/cache.sh Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Restore_cache ()
{
DIRECTORY="${1}"
if [ "${LB_CACHE}" = "true" ] && [ "${LB_CACHE_PACKAGES}" = "true" ]
then
if [ -d "${DIRECTORY}" ]
then
# Restore old cache
if [ "$(stat --printf %d ${DIRECTORY})" = "$(stat --printf %d chroot/var/cache/apt/archives)" ]
then
# with hardlinks
cp -fl "${DIRECTORY}"/*.deb chroot/var/cache/apt/archives
else
# without hardlinks
cp "${DIRECTORY}"/*.deb chroot/var/cache/apt/archives
fi
fi
fi
}
Save_cache ()
{
DIRECTORY="${1}"
if [ "${LB_CACHE}" = "true" ] && [ "${LB_CACHE_PACKAGES}" = "true" ]
then
# Cleaning current cache
# In case of interrupted or incomplete builds, this may return an error,
# but we still do want to save the cache.
Chroot chroot "apt-get autoclean" || true
if ls chroot/var/cache/apt/archives/*.deb > /dev/null 2>&1
then
# Creating cache directory
mkdir -p "${DIRECTORY}"
# Saving new cache
for PACKAGE in chroot/var/cache/apt/archives/*.deb
do
if [ -e "${DIRECTORY}"/"$(basename ${PACKAGE})" ]
then
rm -f "${PACKAGE}"
else
mv "${PACKAGE}" "${DIRECTORY}"
fi
done
fi
else
# Purging current cache
rm -f chroot/var/cache/apt/archives/*.deb
fi
}

38
functions/chroot.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Chroot ()
{
CHROOT="${1}"; shift
COMMANDS="${@}"
# Executing commands in chroot
Echo_debug "Executing: %s" "${COMMANDS}"
ENV=""
for _FILE in config/environment config/environment.chroot
do
if [ -e "${_FILE}" ]
then
ENV="${ENV} $(grep -v '^#' ${_FILE})"
fi
done
if [ "${LB_USE_FAKEROOT}" != "true" ]
then
${LB_ROOT_COMMAND} ${_LINUX32} chroot "${CHROOT}" /usr/bin/env -i HOME="/root" PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" TERM="${TERM}" DEBIAN_FRONTEND="${LB_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LB_DEBCONF_PRIORITY}" DEBCONF_NOWARNINGS="${LB_DEBCONF_NOWARNINGS}" ${ENV} ${COMMANDS}
else
# Building with fakeroot/fakechroot
${LB_ROOT_COMMAND} ${_LINUX32} chroot "${CHROOT}" ${ENV} ${COMMANDS}
fi
return "${?}"
}

38
functions/color.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
NO_COLOR="\033[0m"
UNDERSCORE="\033[4m"
BLINK="\033[5m"
BLACK="\033[0;30m"
DARK_GRAY="\033[1;30m"
RED="\033[0;31m"
LIGHT_RED="\033[1;31m"
GREEN="\033[0;32m"
LIGHT_GREEN="\033[1;32m"
BROWN="\033[0;33m"
YELLOW="\033[1;33m"
BLUE="\033[0;34m"
LIGHT_BLUE="\033[1;34m"
PURPLE="\033[0;35m"
LIGHT_PURPLE="\033[1;35m"
CYAN="\033[0;36m"
LIGHT_CYAN="\033[1;36m"
GRAY="\033[0;37m"
WHITE="\033[1;37m"

15
functions/common.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
PROGRAM="live-build"
VERSION="$(if [ -e ${LIVE_BUILD}/VERSION ]; then cat ${LIVE_BUILD}/VERSION; else cat /usr/share/live/build/VERSION; fi)"
CONFIG_VERSION="$(echo ${VERSION} | awk -F- '{ print $1 }')"
PATH="${PWD}/local/scripts:${PATH}"

55
functions/conffile.sh Executable file
View File

@ -0,0 +1,55 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Get_conffiles ()
{
if [ -n "${LB_CONFIG}" ]
then
FILES="${LB_CONFIG}"
else
for FILE in ${@}
do
FILES="${FILES} ${FILE} ${FILE}.${LB_ARCHITECTURES} ${FILE}.${DISTRIBUTION}"
FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||')"
FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||').${ARCHITECTURE}"
FILES="${FILES} config/$(echo ${PROGRAM} | sed -e 's|^lb_||').${DISTRIBUTION}"
done
fi
echo ${FILES}
}
Read_conffiles ()
{
for CONFFILE in Get_conffiles "${@}"
do
if [ -f "${CONFFILE}" ]
then
if [ -r "${CONFFILE}" ]
then
Echo_debug "Reading configuration file %s" "${CONFFILE}"
. "${CONFFILE}"
else
Echo_warning "Failed to read configuration file %s" "${CONFFILE}"
fi
fi
done
}
Print_conffiles ()
{
for CONFFILE in Get_conffiles "${@}"
do
if [ -f "${CONFFILE}" ]
then
Echo_file "${CONFFILE}"
fi
done
}

74
functions/cursor.sh Executable file
View File

@ -0,0 +1,74 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Cursor_goto_position ()
{
__LINE="${1}"
__COLUMN="${2}"
#echo -e "[${__LINE};${__COLUMN};H\c"
printf "[${__LINE};${__COLUMN};H"
}
Cursor_save_position ()
{
#echo -e "\c"
printf ""
}
Cursor_restore_position ()
{
#echo -e "\c"
printf ""
}
Cursor_line_up ()
{
__LINES="${1}"
#echo -e "[${__LINES}A\c"
printf "[${__LINES}A"
}
Cursor_line_down ()
{
__LINES="${1}"
#echo -e "[${__LINES}B\c"
printf "[${__LINES}B"
}
Cursor_columns_forward ()
{
__COLUMNS="${1}"
#echo -e "[${__COLUMNS}C\c"
printf "[${__COLUMNS}C"
}
Cursor_columns_backward ()
{
__COLUMNS="${1}"
#echo -e "[${__COLUMNS}D\c"
printf "[${__COLUMNS}D"
}
Cursor_clear_screen ()
{
#echo -e "\c"
printf ""
}
Cursor_erase_EOL ()
{
#echo -e "\c"
printf ""
}

1338
functions/defaults.sh Executable file

File diff suppressed because it is too large Load Diff

206
functions/echo.sh Executable file
View File

@ -0,0 +1,206 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Echo ()
{
STRING="${1}"
shift
printf "${STRING}\n" "${@}"
}
Echo_debug ()
{
if [ "${_DEBUG}" = "true" ]
then
STRING="${1}"
shift
printf "D: ${STRING}\n" "${@}"
fi
}
Echo_debug_running ()
{
if [ "${_DEBUG}" = "true" ]
then
STRING="${1}"
shift
printf "D: ${STRING}" "${@}"
if [ "${_COLOR}" = "false" ]
then
printf "..."
else
printf "... ${YELLOW}${BLINK}running${NO_COLOR}"
fi
fi
}
Echo_error ()
{
STRING="${1}"
shift
if [ "${_COLOR}" = "false" ]
then
printf "E:"
else
printf "${RED}E${NO_COLOR}:"
fi
printf " ${STRING}\n" "${@}" >&2
}
Echo_message ()
{
if [ "${_QUIET}" != "true" ]
then
STRING="${1}"
shift
if [ "${_COLOR}" = "false" ]
then
printf "P:"
else
printf "${WHITE}P${NO_COLOR}:"
fi
printf " ${STRING}\n" "${@}"
fi
}
Echo_message_running ()
{
if [ "${_QUIET}" != "true" ]
then
STRING="${1}"
shift
if [ "${_COLOR}" = "false" ]
then
printf "P:"
else
printf "${WHITE}P${NO_COLOR}:"
fi
printf " ${STRING}" "${@}"
if [ "${_COLOR}" = "true" ]
then
printf "... ${YELLOW}${BLINK}running${NO_COLOR}"
else
printf "..."
fi
fi
}
Echo_verbose ()
{
if [ "${_VERBOSE}" = "true" ]
then
STRING="${1}"
shift
printf "I: ${STRING}\n" "${@}"
fi
}
Echo_verbose_running ()
{
if [ "${_VERBOSE}" != "true" ]
then
STRING="${1}"
shift
printf "I: ${STRING}" "${@}"
if [ "${_COLOR}" = "true" ]
then
printf "... ${YELLOW}${BLINK}running${NO_COLOR}"
else
printf "..."
fi
fi
}
Echo_warning ()
{
STRING="${1}"
shift
if [ "${_COLOR}" = "false" ]
then
printf "W:"
else
printf "${YELLOW}W${NO_COLOR}:"
fi
printf " ${STRING}\n" "${@}"
}
Echo_status ()
{
__RETURN="${?}"
if [ "${_COLOR}" = "false" ]
then
if [ "${__RETURN}" = "0" ]
then
printf " done.\n"
else
printf " failed.\n"
fi
else
Cursor_columns_backward 8
if [ "${__RETURN}" = "0" ]
then
printf " ${GREEN}done${NO_COLOR}. \n"
else
printf " ${RED}failed${NO_COLOR}.\n"
fi
fi
}
Echo_done ()
{
if [ "${_COLOR}" = "false" ]
then
printf " already done.\n"
else
Cursor_columns_backward 8
printf " ${GREEN}already done${NO_COLOR}.\n"
fi
}
Echo_file ()
{
while read LINE
do
echo "${1}: ${LINE}"
done < "${1}"
}
Echo_breakage ()
{
case "${LB_PARENT_DISTRIBUTION}" in
sid)
Echo_message "If the following stage fails, the most likely cause of the problem is with your mirror configuration, a caching proxy or the sid distribution."
;;
*)
Echo_message "If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy."
;;
esac
Echo_message "${@}"
}

63
functions/exit.sh Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Exit ()
{
VALUE="${?}"
if [ "${_DEBUG}" = "true" ]
then
# Dump variables
set | grep -e ^LB
fi
# Always exit true in case we are not able to unmount
# (e.g. due to running processes in chroot from user customizations)
Echo_message "Begin unmounting filesystems..."
if [ -e /proc/mounts ]
then
for DIRECTORY in $(awk -v dir="${PWD}/chroot/" '$2 ~ dir { print $2 }' /proc/mounts | sort -r)
do
umount ${DIRECTORY} > /dev/null 2>&1 || true
done
else
for DIRECTORY in /dev/shm /dev/pts /dev /proc /selinux /sys /root/config
do
umount -f chroot/${DIRECTORY} > /dev/null 2>&1 || true
done
fi
rm -f .build/chroot_devpts
rm -f .build/chroot_proc
rm -f .build/chroot_selinuxfs
rm -f .build/chroot_sysfs
Echo_message "Saving caches..."
# We can't really know at which part we're failing,
# but let's assume that if there's any binary stage file arround
# we are in binary stage.
if ls .build/binary* > /dev/null 2>&1
then
Save_cache cache/packages_binary
else
Save_cache cache/packages_chroot
fi
return ${VALUE}
}
Setup_cleanup ()
{
Echo_message "Setting up cleanup function"
trap 'Exit' EXIT HUP INT QUIT TERM
}

36
functions/help.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Help ()
{
Echo "%s - %s" "${PROGRAM}" "${DESCRIPTION}"
echo
Echo "Usage:"
echo
if [ -n "${USAGE}" ]
then
Echo "${USAGE}"
echo
fi
Echo " %s [-h|--help]" "${PROGRAM}"
Echo " %s [-u|--usage]" "${PROGRAM}"
Echo " %s [-v|--version]" "${PROGRAM}"
echo
if [ -n "${HELP}" ]
then
Echo "${HELP}"
echo
fi
Echo "Report bugs to Debian Live project <http://live.debian.net/>."
exit 0
}

47
functions/lockfile.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Check_lockfile ()
{
FILE="${1}"
if [ -z "${FILE}" ]
then
FILE="/var/lock/${PROGRAM}.lock"
fi
# Checking lock file
if [ -f "${FILE}" ]
then
Echo_error "${PROGRAM} locked"
exit 1
fi
}
Create_lockfile ()
{
FILE="${1}"
if [ -z "${FILE}" ]
then
FILE="/var/lock/${PROGRAM}.lock"
fi
DIRECTORY="$(dirname ${FILE})"
# Creating lock directory
mkdir -p "${DIRECTORY}"
# Creating lock trap
trap 'ret=${?}; '"rm -f \"${FILE}\";"' exit ${ret}' EXIT HUP INT QUIT TERM
# Creating lock file
touch "${FILE}"
}

79
functions/losetup.sh Executable file
View File

@ -0,0 +1,79 @@
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
Lodetach ()
{
DEVICE="${1}"
ATTEMPT="${2:-1}"
if [ "${ATTEMPT}" -gt 3 ]
then
Echo_error "Failed to detach loop device '${DEVICE}'."
exit 1
fi
# Changes to block devices result in uevents which trigger rules which in
# turn access the loop device (ex. udisks-part-id, blkid) which can cause
# a race condition. We call 'udevadm settle' to help avoid this.
if [ -x "$(which udevadm 2>/dev/null)" ]
then
${LB_ROOT_COMMAND} udevadm settle
fi
# Loop back devices aren't the most reliable when it comes to writes.
# We sleep and sync for good measure - better than build failure.
sync
sleep 1
${LB_ROOT_COMMAND} ${LB_LOSETUP} -d "${DEVICE}" || Lodetach "${DEVICE}" "$(expr ${ATTEMPT} + 1)"
}
Losetup ()
{
DEVICE="${1}"
FILE="${2}"
PARTITION="${3:-1}"
${LB_ROOT_COMMAND} ${LB_LOSETUP} --read-only "${DEVICE}" "${FILE}"
FDISK_OUT="$(${LB_FDISK} -l -u ${DEVICE} 2>&1)"
Lodetach "${DEVICE}"
LOOPDEVICE="$(echo ${DEVICE}p${PARTITION})"
if [ "${PARTITION}" = "0" ]
then
Echo_message "Mounting %s with offset 0" "${DEVICE}"
${LB_ROOT_COMMAND} ${LB_LOSETUP} "${DEVICE}" "${FILE}"
else
SECTORS="$(echo "$FDISK_OUT" | sed -ne "s|^$LOOPDEVICE[ *]*\([0-9]*\).*|\1|p")"
OFFSET="$(expr ${SECTORS} '*' 512)"
Echo_message "Mounting %s with offset %s" "${DEVICE}" "${OFFSET}"
${LB_ROOT_COMMAND} ${LB_LOSETUP} -o "${OFFSET}" "${DEVICE}" "${FILE}"
fi
}
Calculate_partition_size ()
{
ORIGINAL_SIZE="${1}"
FILESYSTEM="${2}"
case "${FILESYSTEM}" in
ext2|ext3|ext4)
PERCENT="5"
;;
*)
PERCENT="3"
;;
esac
echo $(expr ${ORIGINAL_SIZE} + ${ORIGINAL_SIZE} \* ${PERCENT} / 100 + 1)
}

Some files were not shown because too many files have changed in this diff Show More