Merge Mainline

Signed-off-by: Tianling Shen <cnsztl@project-openwrt.eu.org>
This commit is contained in:
Tianling Shen 2021-02-16 14:49:07 +08:00
commit 6049f2576e
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
115 changed files with 14793 additions and 10946 deletions

12
COPYING Normal file
View File

@ -0,0 +1,12 @@
OpenWrt is provided under:
SPDX-License-Identifier: GPL-2.0-only
Being under the terms of the GNU General Public License version 2 only,
according with:
LICENSES/GPL-2.0
In addition, other licenses may also apply.
All contributions to OpenWrt are subject to this COPYING file.

32
LICENSES/BSD-2-Clause Normal file
View File

@ -0,0 +1,32 @@
Valid-License-Identifier: BSD-2-Clause
SPDX-URL: https://spdx.org/licenses/BSD-2-Clause.html
Usage-Guide:
To use the BSD 2-clause "Simplified" License put the following SPDX
tag/value pair into a comment according to the placement guidelines in
the licensing rules documentation:
SPDX-License-Identifier: BSD-2-Clause
License-Text:
Copyright (c) <year> <owner> . All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

36
LICENSES/BSD-3-Clause Normal file
View File

@ -0,0 +1,36 @@
Valid-License-Identifier: BSD-3-Clause
SPDX-URL: https://spdx.org/licenses/BSD-3-Clause.html
Usage-Guide:
To use the BSD 3-clause "New" or "Revised" License put the following SPDX
tag/value pair into a comment according to the placement guidelines in
the licensing rules documentation:
SPDX-License-Identifier: BSD-3-Clause
License-Text:
Copyright (c) <year> <owner> . All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

261
LICENSES/GPL-1.0 Normal file
View File

@ -0,0 +1,261 @@
Valid-License-Identifier: GPL-1.0-or-later
Valid-License-Identifier: GPL-1.0+
SPDX-URL: https://spdx.org/licenses/GPL-1.0.html
Usage-Guide:
The GNU General Public License (GPL) version 1 should not be used in new
code. For existing kernel code the 'or any later version' option is
required to be compatible with the general license of the project: GPLv2.
To use the license in source code, put the following SPDX tag/value pair
into a comment according to the placement guidelines in the licensing
rules documentation:
SPDX-License-Identifier: GPL-1.0-or-later
License-Text:
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <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 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!

419
LICENSES/GPL-2.0 Normal file
View File

@ -0,0 +1,419 @@
Valid-License-Identifier: GPL-2.0-only
Valid-License-Identifier: GPL-2.0
Valid-License-Identifier: GPL-2.0-or-later
Valid-License-Identifier: GPL-2.0+
SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
Usage-Guide:
To use this license in source code, put one of the following SPDX
tag/value pairs into a comment according to the placement
guidelines in the licensing rules documentation.
For 'GNU General Public License (GPL) version 2 only' use:
SPDX-License-Identifier: GPL-2.0-only
For 'GNU General Public License (GPL) version 2 or any later version' use:
SPDX-License-Identifier: GPL-2.0-or-later
License-Text:
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
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.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
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, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

24
LICENSES/ISC Normal file
View File

@ -0,0 +1,24 @@
Valid-License-Identifier: ISC
SPDX-URL: https://spdx.org/licenses/ISC.html
Usage-Guide:
To use the ISC License put the following SPDX tag/value pair into a
comment according to the placement guidelines in the licensing rules
documentation:
SPDX-License-Identifier: ISC
License-Text:
ISC License
Copyright (c) <year> <copyright holders>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -0,0 +1,25 @@
SPDX-Exception-Identifier: Linux-syscall-note
SPDX-URL: https://spdx.org/licenses/Linux-syscall-note.html
SPDX-Licenses: GPL-2.0-only, GPL-2.0, GPL-2.0-or-later, GPL-2.0+, GPL-1.0-or-later, GPL-1.0+, LGPL-2.0, LGPL-2.0+, LGPL-2.1, LGPL-2.1+
Usage-Guide:
This exception is used together with one of the above SPDX-Licenses
to mark user space API (uapi) header files so they can be included
into non GPL compliant user space application code.
To use this exception add it with the keyword WITH to one of the
identifiers in the SPDX-Licenses tag:
SPDX-License-Identifier: <SPDX-License> WITH Linux-syscall-note
License-Text:
NOTE! This copyright does *not* cover user programs that use kernel
services by normal system calls - this is merely considered normal use
of the kernel, and does *not* fall under the heading of "derived work".
Also note that the GPL below is copyrighted by the Free Software
Foundation, but the instance of code that it refers to (the Linux
kernel) is copyrighted by me and others who actually wrote it.
Also note that the only valid version of the GPL as far as the kernel
is concerned is _this_ particular version of the license (ie v2, not
v2.2 or v3.x or whatever), unless explicitly otherwise stated.
Linus Torvalds

30
LICENSES/MIT Normal file
View File

@ -0,0 +1,30 @@
Valid-License-Identifier: MIT
SPDX-URL: https://spdx.org/licenses/MIT.html
Usage-Guide:
To use the MIT License put the following SPDX tag/value pair into a
comment according to the placement guidelines in the licensing rules
documentation:
SPDX-License-Identifier: MIT
License-Text:
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -46,4 +46,4 @@ Default login address: 192.168.1.1, username is **root** and password is **passw
### See [CONTRIBUTED.md](https://github.com/immortalwrt/immortalwrt/blob/openwrt-18.06/CONTRIBUTED.md).
# License
### [GNU General Public License v3.0](https://github.com/immortalwrt/immortalwrt/blob/openwrt-18.06/LICENSE).
### [GNU General Public License v3.0](https://github.com/immortalwrt/immortalwrt/blob/openwrt-18.06/LICENSES/GPL-3.0).

View File

@ -62,6 +62,12 @@ define patch_libtool
);
endef
define set_libtool_abiver
sed -i \
-e 's,^soname_spec=.*,soname_spec="\\$$$${libname}\\$$$${shared_ext}.$(PKG_ABI_VERSION)",' \
-e 's,^library_names_spec=.*,library_names_spec="\\$$$${libname}\\$$$${shared_ext}.$(PKG_ABI_VERSION) \\$$$${libname}\\$$$${shared_ext}",' \
$(PKG_BUILD_DIR)/libtool
endef
PKG_LIBTOOL_PATHS?=$(CONFIGURE_PATH)
PKG_AUTOMAKE_PATHS?=$(CONFIGURE_PATH)
@ -110,6 +116,10 @@ ifneq ($(filter libtool,$(PKG_FIXUP)),)
endif
endif
ifneq ($(filter libtool-abiver,$(PKG_FIXUP)),)
Hooks/Configure/Post += set_libtool_abiver
endif
ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),)
PKG_BUILD_DEPENDS += libtool gettext libiconv
ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),)

View File

@ -43,5 +43,5 @@ endef
# 1: package name
define GetABISuffix
$(if $(filter-out kmod-%,$(1)),$(if $(Package/$(1)/abiversion),$(if $(filter %0 %1 %2 %3 %4 %5 %6 %7 %8 %9,$(1)),-)$(Package/$(1)/abiversion)))
$(if $(filter-out kmod-%,$(1)),$(if $(ABIV_$(1)),$(ABIV_$(1)),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
endef

View File

@ -21,8 +21,7 @@ $(if $(MENU),Menu: $(MENU)
)$(if $(DEFAULT),Default: $(DEFAULT)
)$(if $(findstring $(PREREQ_CHECK),1),Prereq-Check: 1
)Version: $(VERSION)
$(if $(ABI_VERSION),ABIVersion: $(ABI_VERSION)
)Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
Conflicts: $(CONFLICTS)
Menu-Depends: $(MDEPENDS)
Provides: $(PROVIDES)

View File

@ -99,7 +99,7 @@ _endef=endef
ifeq ($(DUMP),)
define BuildTarget/ipkg
ABIV_$(1):=$(call GetABISuffix,$(1))
ABIV_$(1):=$(if $(filter-out kmod-%,$(1)),$(ABI_VERSION))
PDIR_$(1):=$(call FeedPackageDir,$(1))
IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
@ -156,7 +156,12 @@ ifeq ($(DUMP),)
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
mkdir -p $(STAGING_DIR_ROOT)/stamp
$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version)
$(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || { \
echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version; \
$(foreach pkg,$(filter-out $(1),$(PROVIDES)), \
cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version; \
) \
} )
$(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
touch $$@

View File

@ -58,7 +58,7 @@ include $(INCLUDE_DIR)/quilt.mk
find_library_dependencies = \
$(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
$(sort $(foreach dep4, \
$(filter-out $(BUILD_PACKAGES), $(sort $(foreach dep4, \
$(sort $(foreach dep3, \
$(sort $(foreach dep2, \
$(sort $(foreach dep1, \
@ -73,7 +73,7 @@ find_library_dependencies = \
$(Package/$(dep3)/depends) $(dep3) \
)), \
$(Package/$(dep4)/depends) $(dep4) \
)), \
))) \
))

View File

@ -11,8 +11,8 @@ PKG_NAME:=Build dependency
# Required for the toolchain
$(eval $(call TestHostCommand,working-make, \
Please install GNU make v3.82 or later. (This version has bugs), \
$(MAKE) -v | grep -E 'Make (3\.8[2-9]|3\.9[0-9]|[4-9]\.)'))
Please install GNU make v4.1 or later., \
$(MAKE) -v | grep -E 'Make (4\.[1-9]|[5-9]\.)'))
$(eval $(call TestHostCommand,case-sensitive-fs, \
OpenWrt can only be built on a case-sensitive filesystem, \

View File

@ -4,7 +4,7 @@
PREP_MK= OPENWRT_BUILD= QUIET=0
export IS_TTY=$(shell tty -s && echo 1 || echo 0)
export IS_TTY=$(if $(MAKE_TERMOUT),1,0)
include $(TOPDIR)/include/verbose.mk

View File

@ -27,7 +27,7 @@ system_config() {
ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
# apply timezone to kernel
busybox date -k
hwclock -u --systz
}
reload_service() {

View File

@ -9,16 +9,16 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=chinadns-ng
PKG_VERSION:=1.0-beta.23
PKG_VERSION:=1.0-beta.24
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/zfl9/chinadns-ng.git
PKG_SOURCE_DATE:=2019-08-30
PKG_SOURCE_VERSION:=748a043dd7fb7ec71efbb7306f9dd21db5ce560f
PKG_MIRROR_HASH:=c36b8f45e332f95279c67e3c367c5dd92edacd47759ab7be1ab52c325a21821b
PKG_SOURCE_DATE:=2021-02-11
PKG_SOURCE_VERSION:=df3bb7c6310df9b3c0f874b7a0c38ea5ce0996cb
PKG_MIRROR_HASH:=4b0a159e1ecd81392a67b31528b0430afa991bfceef5dd60d2d843edfccb6b12
PKG_LICENSE:=GPLv3
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=pexcn <i@pexcn.me>

View File

@ -14,7 +14,7 @@ entry({"admin", "services", "AdGuardHome", "getlog"}, call("get_log"))
entry({"admin", "services", "AdGuardHome", "dodellog"}, call("do_dellog"))
entry({"admin", "services", "AdGuardHome", "reloadconfig"}, call("reload_config"))
entry({"admin", "services", "AdGuardHome", "gettemplateconfig"}, call("get_template_config"))
end
end
function get_template_config()
local b
local d=""

View File

@ -5,7 +5,7 @@ local m,s,o,o1
local fs=require"nixio.fs"
local uci=require"luci.model.uci".cursor()
local configpath=uci:get("AdGuardHome","AdGuardHome","configpath") or "/etc/AdGuardHome.yaml"
local binpath=uci:get("AdGuardHome","AdGuardHome","binpath") or "/usr/bin/AdGuardHome/AdGuardHome"
local binpath=uci:get("AdGuardHome","AdGuardHome","binpath") or "/usr/bin/AdGuardHome"
httpport=uci:get("AdGuardHome","AdGuardHome","httpport") or "3000"
m = Map("AdGuardHome", "AdGuard Home")
m.description = translate("Free and open source, powerful network-wide ads & trackers blocking DNS server.")
@ -65,7 +65,7 @@ o.default = "none"
o.optional = true
---- bin path
o = s:option(Value, "binpath", translate("Bin Path"), translate("AdGuardHome Bin path if no bin will auto download"))
o.default = "/usr/bin/AdGuardHome/AdGuardHome"
o.default = "/usr/bin/AdGuardHome"
o.datatype = "string"
o.optional = false
o.rmempty=false
@ -81,7 +81,7 @@ if fs.stat(value,"type")=="dir" then
m.message ="error!bin path is a dir"
end
return nil
end
end
return value
end
--- upx
@ -113,12 +113,12 @@ if fs.stat(value,"type")=="dir" then
m.message ="error!config path is a dir"
end
return nil
end
end
return value
end
---- work dir
o = s:option(Value, "workdir", translate("Work dir"), translate("AdGuardHome work dir include rules,audit log and database"))
o.default = "/usr/bin/AdGuardHome"
o.default = "/etc/AdGuardHome"
o.datatype = "string"
o.optional = false
o.rmempty=false
@ -131,7 +131,7 @@ if fs.stat(value,"type")=="reg" then
m.message ="error!work dir is a file"
end
return nil
end
end
if string.sub(value, -1)=="/" then
return string.sub(value, 1, -2)
else
@ -153,14 +153,14 @@ if fs.stat(value,"type")=="dir" then
m.message ="error!log file is a dir"
end
return nil
end
end
return value
end
---- debug
o = s:option(Flag, "verbose", translate("Verbose log"))
o.default = 0
o.optional = true
---- gfwlist
---- gfwlist
local a=luci.sys.call("grep -m 1 -q programadd "..configpath)
if (a==0) then
a="Added"
@ -208,7 +208,7 @@ o = s:option(Flag, "waitonboot", translate("On boot when network ok restart"))
o.default = 1
o.optional = true
---- backup workdir on shutdown
local workdir=uci:get("AdGuardHome","AdGuardHome","workdir") or "/usr/bin/AdGuardHome"
local workdir=uci:get("AdGuardHome","AdGuardHome","workdir") or "/etc/AdGuardHome"
o = s:option(MultiValue, "backupfile", translate("Backup workdir files when shutdown"))
o1 = s:option(Value, "backupwdpath", translate("Backup workdir path"))
local name
@ -234,7 +234,7 @@ o.optional=false
o.description=translate("Will be restore when workdir/data is empty")
----backup workdir path
o1.default = "/usr/bin/AdGuardHome"
o1.default = "/etc/AdGuardHome"
o1.datatype = "string"
o1.optional = false
o1.validate=function(self, value)
@ -245,7 +245,7 @@ if fs.stat(value,"type")=="reg" then
m.message ="error!backup dir is a file"
end
return nil
end
end
if string.sub(value,-1)=="/" then
return string.sub(value, 1, -2)
else

View File

@ -70,7 +70,7 @@ o.template = "AdGuardHome/yamleditor"
if not fs.access(binpath) then
o.description=translate("WARNING!!! no bin found apply config will not be test")
end
--- log
--- log
if (fs.access("/tmp/AdGuardHometmpconfig.yaml")) then
local c=fs.readfile("/tmp/AdGuardHometest.log")
if (c~="") then

View File

@ -62,7 +62,7 @@ set_iptable()
local ipv6_server=$1
local tcp_server=$2
uci -q batch <<-EOF >/dev/null 2>&1
delete firewall.AdGuardHome
delete firewall.AdGuardHome
set firewall.AdGuardHome=include
set firewall.AdGuardHome.type=script
set firewall.AdGuardHome.path=/usr/share/AdGuardHome/firewall.start
@ -91,13 +91,12 @@ EOF
fi
ip6tables -t nat -A PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-ports $AdGuardHome_PORT >/dev/null 2>&1
done
}
clear_iptable()
{
uci -q batch <<-EOF >/dev/null 2>&1
delete firewall.AdGuardHome
delete firewall.AdGuardHome
commit firewall
EOF
local OLD_PORT="$1"
@ -119,30 +118,33 @@ EOF
ip6tables -t nat -D PREROUTING -p udp -d $IP --dport 53 -j REDIRECT --to-ports $OLD_PORT >/dev/null 2>&1
ip6tables -t nat -D PREROUTING -p tcp -d $IP --dport 53 -j REDIRECT --to-ports $OLD_PORT >/dev/null 2>&1
done
}
service_triggers() {
procd_add_reload_trigger "$CONFIGURATION"
[ "$(uci get AdGuardHome.AdGuardHome.redirect)" == "redirect" ] && procd_add_reload_trigger firewall
}
isrunning(){
config_load "${CONFIGURATION}"
_isrunning
local r=$?
([ "$r" == "0" ] && echo "running") || ([ "$r" == "1" ] && echo "not run" ) || echo "no bin"
return $r
config_load "${CONFIGURATION}"
_isrunning
local r=$?
([ "$r" == "0" ] && echo "running") || ([ "$r" == "1" ] && echo "not run" ) || echo "no bin"
return $r
}
_isrunning(){
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome"
[ ! -f "$binpath" ] && return 2
pgrep $binpath 2>&1 >/dev/null && return 0
return 1
}
force_reload(){
config_load "${CONFIGURATION}"
_isrunning && procd_send_signal "$CONFIGURATION" || start
}
get_tz()
{
SET_TZ=""
@ -206,11 +208,13 @@ use_port53()
uci commit dhcp
/etc/init.d/dnsmasq reload
}
do_redirect()
{
config_load "${CONFIGURATION}"
_do_redirect $1
}
_do_redirect()
{
local section="$CONFIGURATION"
@ -271,6 +275,7 @@ _do_redirect()
use_port53
fi
}
get_filesystem()
{
# print out path filesystem
@ -340,7 +345,7 @@ boot_service() {
config_load "${CONFIGURATION}"
config_get waitonboot $CONFIGURATION waitonboot "0"
config_get_bool enabled $CONFIGURATION enabled 0
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome"
[ -f "$binpath" ] && start_service
if [ "$enabled" == "1" ] && [ "$waitonboot" == "1" ]; then
procd_open_instance "waitnet"
@ -358,16 +363,18 @@ testbackup(){
restore
fi
}
restore()
{
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get backupwdpath $CONFIGURATION backupwdpath "/usr/bin/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get backupwdpath $CONFIGURATION backupwdpath "/etc/AdGuardHome"
cp -u -r -f $backupwdpath/data $workdir
}
backup() {
config_get backupwdpath $CONFIGURATION backupwdpath "/usr/bin/AdGuardHome"
config_get backupwdpath $CONFIGURATION backupwdpath "/etc/AdGuardHome"
mkdir -p $backupwdpath/data
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get backupfile $CONFIGURATION backupfile ""
for one in $backupfile;
do
@ -391,6 +398,7 @@ backup() {
done
done
}
start_service() {
# Reading config
rm /var/run/AdGserverdis >/dev/null 2>&1
@ -411,7 +419,7 @@ start_service() {
return
fi
#what need to do before reload
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get backupfile $CONFIGURATION backupfile ""
mkdir -p $workdir/data
@ -436,7 +444,7 @@ start_service() {
fi
fi
local ADDITIONAL_ARGS=""
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome/AdGuardHome"
config_get binpath $CONFIGURATION binpath "/usr/bin/AdGuardHome"
mkdir -p ${binpath%/*}
ADDITIONAL_ARGS="$ADDITIONAL_ARGS -c $configpath"
@ -448,7 +456,7 @@ start_service() {
config_get upprotect $CONFIGURATION upprotect ""
eval upprotect=${upprotect// /\\\\n}
echo -e "$upprotect">/lib/upgrade/keep.d/luci-app-adguardhome
config_get logfile $CONFIGURATION logfile ""
if [ -n "$logfile" ]; then
ADDITIONAL_ARGS="$ADDITIONAL_ARGS -l $logfile"
@ -492,6 +500,7 @@ start_service() {
echo "luci enable switch=$enabled"
(sleep 10 && [ -z "$(pgrep $binpath)" ] && logger "AdGuardHome" "no process in 10s cancel redirect" && _do_redirect 0 )&
}
reload_service()
{
rm /var/run/AdGlucitest >/dev/null 2>&1
@ -500,22 +509,23 @@ reload_service()
}
del_querylog(){
local btarget=$(ls $backupwdpath/data | grep -F "querylog.json" | sort -r | head -n 1)
local wtarget=$(ls $workdir/data | grep -F "querylog.json" | sort -r | head -n 1)
if [ "$btarget"x == "$wtarget"x ]; then
[ -z "$btarget" ] && return 1
rm -f $workdir/data/$wtarget
rm -f $backupwdpath/data/$btarget
return 0
fi
if [ "$btarget" \> "$wtarget" ]; then
rm -f $backupwdpath/data/$btarget
return 0
else
rm -f $workdir/data/$wtarget
return 0
fi
local btarget=$(ls $backupwdpath/data | grep -F "querylog.json" | sort -r | head -n 1)
local wtarget=$(ls $workdir/data | grep -F "querylog.json" | sort -r | head -n 1)
if [ "$btarget"x == "$wtarget"x ]; then
[ -z "$btarget" ] && return 1
rm -f $workdir/data/$wtarget
rm -f $backupwdpath/data/$btarget
return 0
fi
if [ "$btarget" \> "$wtarget" ]; then
rm -f $backupwdpath/data/$btarget
return 0
else
rm -f $workdir/data/$wtarget
return 0
fi
}
stop_service()
{
config_load "${CONFIGURATION}"
@ -530,16 +540,19 @@ stop_service()
echo "AdGuardHome service disabled"
touch /var/run/AdGserverdis
}
boot() {
rc_procd boot_service "$@"
if eval "type service_started" 2>/dev/null >/dev/null; then
service_started
fi
}
test_crontab(){
config_load "${CONFIGURATION}"
do_crontab
config_load "${CONFIGURATION}"
do_crontab
}
do_crontab(){
config_get_bool enabled $CONFIGURATION enabled 0
config_get crontab $CONFIGURATION crontab ""
@ -550,16 +563,16 @@ do_crontab(){
default="30 3 * * * /usr/share/AdGuardHome/update_core.sh 2>&1"
[ "$enabled" == "0" ] || [ "${crontab//autoupdate/}" == "$crontab" ] && cronenable=0 || cronenable=1
crontab_editor
config_get workdir $CONFIGURATION workdir "/usr/bin/AdGuardHome"
config_get lastworkdir $CONFIGURATION lastworkdir "/usr/bin/AdGuardHome"
config_get workdir $CONFIGURATION workdir "/etc/AdGuardHome"
config_get lastworkdir $CONFIGURATION lastworkdir "/etc/AdGuardHome"
findstr="/usr/share/AdGuardHome/tailto.sh [0-9]* \$(uci get AdGuardHome.AdGuardHome.workdir)/data/querylog.json"
#[ -n "$lastworkdir" ] && findstr="/usr/share/AdGuardHome/tailto.sh [0-9]* $lastworkdir/data/querylog.json" && [ "$lastworkdir" != "$workdir" ] && replace="${lastworkdir//\//\\/}/${workdir//\//\\/}"
default="0 * * * * /usr/share/AdGuardHome/tailto.sh 2000 \$(uci get AdGuardHome.AdGuardHome.workdir)/data/querylog.json"
[ "$enabled" == "0" ] || [ "${crontab//cutquerylog/}" == "$crontab" ] && cronenable=0 || cronenable=1
crontab_editor
#[ "$lastworkdir" != "$workdir" ] && uci set AdGuardHome.AdGuardHome.lastworkdir="$workdir" && commit=1
config_get logfile $CONFIGURATION logfile ""
config_get lastlogfile $CONFIGURATION lastlogfile ""
findstr="/usr/share/AdGuardHome/tailto.sh [0-9]* \$(uci get AdGuardHome.AdGuardHome.logfile)"
@ -568,7 +581,7 @@ do_crontab(){
[ "$logfile" == "syslog" ] || [ "$logfile" == "" ] || [ "$enabled" == "0" ] || [ "${crontab//cutruntimelog/}" == "$crontab" ] && cronenable=0 || cronenable=1
crontab_editor
#[ -n "$logfile" ] && [ "$lastlogfile" != "$logfile" ] && uci set AdGuardHome.AdGuardHome.lastlogfile="$logfile" && commit=1
findstr="/usr/share/AdGuardHome/addhost.sh"
default="0 * * * * /usr/share/AdGuardHome/addhost.sh"
[ "$enabled" == "0" ] || [ "${crontab//autohost/}" == "$crontab" ] && cronenable=0 || cronenable=1
@ -582,6 +595,7 @@ do_crontab(){
[ "$cronreload" -gt 0 ] && /etc/init.d/cron restart
#[ "$commit" -gt 0 ] && uci commit AdGuardHome
}
crontab_editor(){
#usage input:
#findstr=
@ -591,7 +605,7 @@ crontab_editor(){
#output:cronreload:if >1 please /etc/init.d/cron restart manual
local testline reload
local line="$(grep "$findstr" $CRON_FILE)"
[ -n "$replace" ] && [ -n "$line" ] && eval testline="\${line//$replace}" && [ "$testline" != "$line" ] && line="$testline" && reload="1" && replace=""
[ -n "$replace" ] && [ -n "$line" ] && eval testline="\${line//$replace}" && [ "$testline" != "$line" ] && line="$testline" && reload="1" && replace=""
if [ "${line:0:1}" != "#" ]; then
if [ $cronenable -eq 1 ]; then
[ -z "$line" ] && line="$default" && reload="1"
@ -615,5 +629,4 @@ crontab_editor(){
echo "$line" >> $CRON_FILE
fi
fi
}

View File

@ -1,4 +1,5 @@
#!/bin/sh
checkmd5(){
local nowmd5=$(md5sum /etc/hosts)
nowmd5=${nowmd5%% *}
@ -9,6 +10,7 @@ if [ "$nowmd5" != "$lastmd5" ]; then
[ "$1" == "noreload" ] || /etc/init.d/AdGuardHome reload
fi
}
[ "$1" == "del" ] && sed -i '/programaddstart/,/programaddend/d' /etc/hosts && checkmd5 "$2" && exit 0
/usr/bin/awk 'BEGIN{
while ((getline < "/tmp/dhcp.leases") > 0)
@ -30,4 +32,4 @@ else
cat /tmp/tmphost >> /etc/hosts
fi
rm /tmp/tmphost
checkmd5 "$2"
checkmd5 "$2"

View File

@ -1,4 +1,5 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
logread -e AdGuardHome > /tmp/AdGuardHometmp.log
logread -e AdGuardHome -f >> /tmp/AdGuardHometmp.log &
@ -16,4 +17,4 @@ do
else
echo "0">/var/run/AdGuardHomesyslog
fi
done
done

View File

@ -1,5 +1,7 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
checkmd5(){
local nowmd5=$(md5sum /tmp/adguard.list 2>/dev/null)
nowmd5=${nowmd5%% *}
@ -10,6 +12,7 @@ if [ "$nowmd5" != "$lastmd5" ]; then
[ "$1" == "noreload" ] || /etc/init.d/AdGuardHome reload
fi
}
configpath=$(uci get AdGuardHome.AdGuardHome.configpath 2>/dev/null)
[ "$1" == "del" ] && sed -i '/programaddstart/,/programaddend/d' $configpath && checkmd5 "$2" && exit 0
gfwupstream=$(uci get AdGuardHome.AdGuardHome.gfwupstream 2>/dev/null)
@ -83,4 +86,4 @@ else
sed -i '/upstream_dns:/'r/tmp/adguard.list $configpath
fi
checkmd5 "$2"
rm -f /tmp/gfwlist.txt /tmp/adguard.list
rm -f /tmp/gfwlist.txt /tmp/adguard.list

View File

@ -1,4 +1,5 @@
#!/bin/sh
tail -n $1 "$2" > /var/run/tailtmp
cat /var/run/tailtmp > "$2"
rm /var/run/tailtmp
rm /var/run/tailtmp

View File

@ -1,4 +1,5 @@
#!/bin/bash
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
binpath=$(uci get AdGuardHome.AdGuardHome.binpath)
if [ -z "$binpath" ]; then
@ -21,6 +22,7 @@ check_wgetcurl(){
[ "$1" == "1" ] && (opkg install curl ; check_wgetcurl 2 ; return)
echo error curl and wget && EXIT 1
}
check_latest_version(){
check_wgetcurl
latest_ver="$($downloader - https://api.github.com/repos/AdguardTeam/AdGuardHome/releases/latest 2>/dev/null|grep -E 'tag_name' |grep -E 'v[0-9.]+' -o 2>/dev/null)"
@ -29,78 +31,79 @@ check_latest_version(){
fi
now_ver="$($binpath -c /dev/null --check-config 2>&1| grep -m 1 -E 'v[0-9.]+' -o)"
if [ "${latest_ver}"x != "${now_ver}"x ] || [ "$1" == "force" ]; then
echo -e "Local version: ${now_ver}., cloud version: ${latest_ver}."
echo -e "Local version: ${now_ver}., cloud version: ${latest_ver}."
doupdate_core
else
echo -e "\nLocal version: ${now_ver}, cloud version: ${latest_ver}."
echo -e "You're already using the latest version."
if [ ! -z "$upxflag" ]; then
filesize=$(ls -l $binpath | awk '{ print $5 }')
if [ $filesize -gt 8000000 ]; then
echo -e "start upx may take a long time"
doupx
mkdir -p "/tmp/AdGuardHomeupdate/AdGuardHome" >/dev/null 2>&1
rm -fr /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx $upxflag $binpath -o /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
rm -rf /tmp/upx-${upx_latest_ver}-${Arch}_linux
/etc/init.d/AdGuardHome stop nobackup
rm $binpath
mv -f /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/} $binpath
/etc/init.d/AdGuardHome start
echo -e "finished"
fi
echo -e "\nLocal version: ${now_ver}, cloud version: ${latest_ver}."
echo -e "You're already using the latest version."
if [ ! -z "$upxflag" ]; then
filesize=$(ls -l $binpath | awk '{ print $5 }')
if [ $filesize -gt 8000000 ]; then
echo -e "start upx may take a long time"
doupx
mkdir -p "/tmp/AdGuardHomeupdate/AdGuardHome" >/dev/null 2>&1
rm -fr /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx $upxflag $binpath -o /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/}
rm -rf /tmp/upx-${upx_latest_ver}-${Arch}_linux
/etc/init.d/AdGuardHome stop nobackup
rm $binpath
mv -f /tmp/AdGuardHomeupdate/AdGuardHome/${binpath##*/} $binpath
/etc/init.d/AdGuardHome start
echo -e "finished"
fi
EXIT 0
fi
EXIT 0
fi
}
doupx(){
Archt="$(opkg info kernel | grep Architecture | awk -F "[ _]" '{print($2)}')"
case $Archt in
"i386")
Arch="i386"
;;
Arch="i386"
;;
"i686")
Arch="i386"
echo -e "i686 use $Arch may have bug"
;;
Arch="i386"
echo -e "i686 use $Arch may have bug"
;;
"x86")
Arch="amd64"
;;
Arch="amd64"
;;
"mipsel")
Arch="mipsel"
;;
Arch="mipsel"
;;
"mips64el")
Arch="mips64el"
Arch="mipsel"
echo -e "mips64el use $Arch may have bug"
;;
Arch="mips64el"
Arch="mipsel"
echo -e "mips64el use $Arch may have bug"
;;
"mips")
Arch="mips"
;;
Arch="mips"
;;
"mips64")
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
"arm")
Arch="arm"
;;
Arch="arm"
;;
"armeb")
Arch="armeb"
;;
Arch="armeb"
;;
"aarch64")
Arch="arm64"
;;
Arch="arm64"
;;
"powerpc")
Arch="powerpc"
;;
Arch="powerpc"
;;
"powerpc64")
Arch="powerpc64"
;;
Arch="powerpc64"
;;
*)
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
esac
upx_latest_ver="$($downloader - https://api.github.com/repos/upx/upx/releases/latest 2>/dev/null|grep -E 'tag_name' |grep -E '[0-9.]+' -o 2>/dev/null)"
$downloader /tmp/upx-${upx_latest_ver}-${Arch}_linux.tar.xz "https://github.com/upx/upx/releases/download/v${upx_latest_ver}/upx-${upx_latest_ver}-${Arch}_linux.tar.xz" 2>&1
@ -109,64 +112,65 @@ doupx(){
mkdir -p /tmp/upx-${upx_latest_ver}-${Arch}_linux
xz -d -c /tmp/upx-${upx_latest_ver}-${Arch}_linux.tar.xz| tar -x -C "/tmp" >/dev/null 2>&1
if [ ! -e "/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx" ]; then
echo -e "Failed to download upx."
echo -e "Failed to download upx."
EXIT 1
fi
rm /tmp/upx-${upx_latest_ver}-${Arch}_linux.tar.xz
}
doupdate_core(){
echo -e "Updating core..."
echo -e "Updating core..."
mkdir -p "/tmp/AdGuardHomeupdate"
rm -rf /tmp/AdGuardHomeupdate/* >/dev/null 2>&1
Archt="$(opkg info kernel | grep Architecture | awk -F "[ _]" '{print($2)}')"
case $Archt in
"i386")
Arch="386"
;;
Arch="386"
;;
"i686")
Arch="386"
;;
Arch="386"
;;
"x86")
Arch="amd64"
;;
Arch="amd64"
;;
"mipsel")
Arch="mipsle"
;;
Arch="mipsle"
;;
"mips64el")
Arch="mips64le"
Arch="mipsle"
echo -e "mips64el use $Arch may have bug"
;;
Arch="mips64le"
Arch="mipsle"
echo -e "mips64el use $Arch may have bug"
;;
"mips")
Arch="mips"
;;
Arch="mips"
;;
"mips64")
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
Arch="mips64"
Arch="mips"
echo -e "mips64 use $Arch may have bug"
;;
"arm")
Arch="arm"
;;
Arch="arm"
;;
"aarch64")
Arch="arm64"
;;
Arch="arm64"
;;
"powerpc")
Arch="ppc"
echo -e "error not support $Archt"
EXIT 1
;;
Arch="ppc"
echo -e "error not support $Archt"
EXIT 1
;;
"powerpc64")
Arch="ppc64"
echo -e "error not support $Archt"
EXIT 1
;;
Arch="ppc64"
echo -e "error not support $Archt"
EXIT 1
;;
*)
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
echo -e "error not support $Archt if you can use offical release please issue a bug"
EXIT 1
;;
esac
echo -e "start download"
echo -e "start download"
grep -v "^#" /usr/share/AdGuardHome/links.txt >/tmp/run/AdHlinks.txt
while read link
do
@ -178,14 +182,14 @@ doupdate_core(){
else
local success="1"
break
fi
fi
done < "/tmp/run/AdHlinks.txt"
rm /tmp/run/AdHlinks.txt
[ -z "$success" ] && echo "no download success" && EXIT 1
if [ "${link##*.}" == "gz" ]; then
tar -zxf "/tmp/AdGuardHomeupdate/${link##*/}" -C "/tmp/AdGuardHomeupdate/"
if [ ! -e "/tmp/AdGuardHomeupdate/AdGuardHome" ]; then
echo -e "Failed to download core."
echo -e "Failed to download core."
rm -rf "/tmp/AdGuardHomeupdate" >/dev/null 2>&1
EXIT 1
fi
@ -194,34 +198,35 @@ doupdate_core(){
downloadbin="/tmp/AdGuardHomeupdate/${link##*/}"
fi
chmod 755 $downloadbin
echo -e "download success start copy"
echo -e "download success start copy"
if [ -n "$upxflag" ]; then
echo -e "start upx may take a long time"
echo -e "start upx may take a long time"
doupx
/tmp/upx-${upx_latest_ver}-${Arch}_linux/upx $upxflag $downloadbin
rm -rf /tmp/upx-${upx_latest_ver}-${Arch}_linux
fi
echo -e "start copy"
echo -e "start copy"
/etc/init.d/AdGuardHome stop nobackup
rm "$binpath"
mv -f "$downloadbin" "$binpath"
if [ "$?" == "1" ]; then
echo "mv failed maybe not enough space please use upx or change bin to /tmp/AdGuardHome"
echo "mv failed maybe not enough space please use upx or change bin to /tmp/AdGuardHome"
EXIT 1
fi
/etc/init.d/AdGuardHome start
rm -rf "/tmp/AdGuardHomeupdate" >/dev/null 2>&1
echo -e "Succeeded in updating core."
echo -e "Local version: ${latest_ver}, cloud version: ${latest_ver}.\n"
echo -e "Succeeded in updating core."
echo -e "Local version: ${latest_ver}, cloud version: ${latest_ver}.\n"
EXIT 0
}
EXIT(){
rm /var/run/update_core 2>/dev/null
[ "$1" != "0" ] && touch /var/run/update_core_error
exit $1
}
main(){
check_if_already_running
check_latest_version $1
}

View File

@ -1,4 +1,5 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
count=0
while :
@ -31,4 +32,4 @@ do
break
fi
done
return 0
return 0

View File

@ -1,4 +1,5 @@
#!/bin/sh
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
configpath=$(uci get AdGuardHome.AdGuardHome.configpath)
while :
@ -9,4 +10,4 @@ do
break
fi
done
return 0
return 0

View File

@ -1,12 +0,0 @@
INSTALL = install
PREFIX = /usr/bin
po2lmo: src/po2lmo.o src/template_lmo.o
$(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o
install:
$(INSTALL) -m 755 src/po2lmo $(PREFIX)
clean:
$(RM) src/po2lmo src/*.o

View File

@ -1,247 +0,0 @@
/*
* lmo - Lua Machine Objects - PO to LMO conversion tool
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
static void die(const char *msg)
{
fprintf(stderr, "Error: %s\n", msg);
exit(1);
}
static void usage(const char *name)
{
fprintf(stderr, "Usage: %s input.po output.lmo\n", name);
exit(1);
}
static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
if( fwrite(ptr, size, nmemb, stream) == 0 )
die("Failed to write stdout");
}
static int extract_string(const char *src, char *dest, int len)
{
int pos = 0;
int esc = 0;
int off = -1;
for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ )
{
if( (off == -1) && (src[pos] == '"') )
{
off = pos + 1;
}
else if( off >= 0 )
{
if( esc == 1 )
{
switch (src[pos])
{
case '"':
case '\\':
off++;
break;
}
dest[pos-off] = src[pos];
esc = 0;
}
else if( src[pos] == '\\' )
{
dest[pos-off] = src[pos];
esc = 1;
}
else if( src[pos] != '"' )
{
dest[pos-off] = src[pos];
}
else
{
dest[pos-off] = '\0';
break;
}
}
}
return (off > -1) ? strlen(dest) : -1;
}
static int cmp_index(const void *a, const void *b)
{
uint32_t x = ((const lmo_entry_t *)a)->key_id;
uint32_t y = ((const lmo_entry_t *)b)->key_id;
if (x < y)
return -1;
else if (x > y)
return 1;
return 0;
}
static void print_uint32(uint32_t x, FILE *out)
{
uint32_t y = htonl(x);
print(&y, sizeof(uint32_t), 1, out);
}
static void print_index(void *array, int n, FILE *out)
{
lmo_entry_t *e;
qsort(array, n, sizeof(*e), cmp_index);
for (e = array; n > 0; n--, e++)
{
print_uint32(e->key_id, out);
print_uint32(e->val_id, out);
print_uint32(e->offset, out);
print_uint32(e->length, out);
}
}
int main(int argc, char *argv[])
{
char line[4096];
char key[4096];
char val[4096];
char tmp[4096];
int state = 0;
int offset = 0;
int length = 0;
int n_entries = 0;
void *array = NULL;
lmo_entry_t *entry = NULL;
uint32_t key_id, val_id;
FILE *in;
FILE *out;
if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) )
usage(argv[0]);
memset(line, 0, sizeof(key));
memset(key, 0, sizeof(val));
memset(val, 0, sizeof(val));
while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) )
{
if( state == 0 && strstr(line, "msgid \"") == line )
{
switch(extract_string(line, key, sizeof(key)))
{
case -1:
die("Syntax error in msgid");
case 0:
state = 1;
break;
default:
state = 2;
}
}
else if( state == 1 || state == 2 )
{
if( strstr(line, "msgstr \"") == line || state == 2 )
{
switch(extract_string(line, val, sizeof(val)))
{
case -1:
state = 4;
break;
default:
state = 3;
}
}
else
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 2;
break;
default:
strcat(key, tmp);
}
}
}
else if( state == 3 )
{
switch(extract_string(line, tmp, sizeof(tmp)))
{
case -1:
state = 4;
break;
default:
strcat(val, tmp);
}
}
if( state == 4 )
{
if( strlen(key) > 0 && strlen(val) > 0 )
{
key_id = sfh_hash(key, strlen(key));
val_id = sfh_hash(val, strlen(val));
if( key_id != val_id )
{
n_entries++;
array = realloc(array, n_entries * sizeof(lmo_entry_t));
entry = (lmo_entry_t *)array + n_entries - 1;
if (!array)
die("Out of memory");
entry->key_id = key_id;
entry->val_id = val_id;
entry->offset = offset;
entry->length = strlen(val);
length = strlen(val) + ((4 - (strlen(val) % 4)) % 4);
print(val, length, 1, out);
offset += length;
}
}
state = 0;
memset(key, 0, sizeof(key));
memset(val, 0, sizeof(val));
}
memset(line, 0, sizeof(line));
}
print_index(array, n_entries, out);
if( offset > 0 )
{
print_uint32(offset, out);
fsync(fileno(out));
fclose(out);
}
else
{
fclose(out);
unlink(argv[2]);
}
fclose(in);
return(0);
}

View File

@ -1,328 +0,0 @@
/*
* lmo - Lua Machine Objects - Base functions
*
* Copyright (C) 2009-2010 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "template_lmo.h"
/*
* Hash function from http://www.azillionmonkeys.com/qed/hash.html
* Copyright (C) 2004-2008 by Paul Hsieh
*/
uint32_t sfh_hash(const char *data, int len)
{
uint32_t hash = len, tmp;
int rem;
if (len <= 0 || data == NULL) return 0;
rem = len & 3;
len >>= 2;
/* Main loop */
for (;len > 0; len--) {
hash += sfh_get16(data);
tmp = (sfh_get16(data+2) << 11) ^ hash;
hash = (hash << 16) ^ tmp;
data += 2*sizeof(uint16_t);
hash += hash >> 11;
}
/* Handle end cases */
switch (rem) {
case 3: hash += sfh_get16(data);
hash ^= hash << 16;
hash ^= data[sizeof(uint16_t)] << 18;
hash += hash >> 11;
break;
case 2: hash += sfh_get16(data);
hash ^= hash << 11;
hash += hash >> 17;
break;
case 1: hash += *data;
hash ^= hash << 10;
hash += hash >> 1;
}
/* Force "avalanching" of final 127 bits */
hash ^= hash << 3;
hash += hash >> 5;
hash ^= hash << 4;
hash += hash >> 17;
hash ^= hash << 25;
hash += hash >> 6;
return hash;
}
uint32_t lmo_canon_hash(const char *str, int len)
{
char res[4096];
char *ptr, prev;
int off;
if (!str || len >= sizeof(res))
return 0;
for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++)
{
if (isspace(*str))
{
if (!isspace(prev))
*ptr++ = ' ';
}
else
{
*ptr++ = *str;
}
}
if ((ptr > res) && isspace(*(ptr-1)))
ptr--;
return sfh_hash(res, ptr - res);
}
lmo_archive_t * lmo_open(const char *file)
{
int in = -1;
uint32_t idx_offset = 0;
struct stat s;
lmo_archive_t *ar = NULL;
if (stat(file, &s) == -1)
goto err;
if ((in = open(file, O_RDONLY)) == -1)
goto err;
if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL)
{
memset(ar, 0, sizeof(*ar));
ar->fd = in;
ar->size = s.st_size;
fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC);
if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED)
goto err;
idx_offset = ntohl(*((const uint32_t *)
(ar->mmap + ar->size - sizeof(uint32_t))));
if (idx_offset >= ar->size)
goto err;
ar->index = (lmo_entry_t *)(ar->mmap + idx_offset);
ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t);
ar->end = ar->mmap + ar->size;
return ar;
}
err:
if (in > -1)
close(in);
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
free(ar);
}
return NULL;
}
void lmo_close(lmo_archive_t *ar)
{
if (ar != NULL)
{
if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED))
munmap(ar->mmap, ar->size);
close(ar->fd);
free(ar);
ar = NULL;
}
}
lmo_catalog_t *_lmo_catalogs = NULL;
lmo_catalog_t *_lmo_active_catalog = NULL;
int lmo_load_catalog(const char *lang, const char *dir)
{
DIR *dh = NULL;
char pattern[16];
char path[PATH_MAX];
struct dirent *de = NULL;
lmo_archive_t *ar = NULL;
lmo_catalog_t *cat = NULL;
if (!lmo_change_catalog(lang))
return 0;
if (!dir || !(dh = opendir(dir)))
goto err;
if (!(cat = malloc(sizeof(*cat))))
goto err;
memset(cat, 0, sizeof(*cat));
snprintf(cat->lang, sizeof(cat->lang), "%s", lang);
snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang);
while ((de = readdir(dh)) != NULL)
{
if (!fnmatch(pattern, de->d_name, 0))
{
snprintf(path, sizeof(path), "%s/%s", dir, de->d_name);
ar = lmo_open(path);
if (ar)
{
ar->next = cat->archives;
cat->archives = ar;
}
}
}
closedir(dh);
cat->next = _lmo_catalogs;
_lmo_catalogs = cat;
if (!_lmo_active_catalog)
_lmo_active_catalog = cat;
return 0;
err:
if (dh) closedir(dh);
if (cat) free(cat);
return -1;
}
int lmo_change_catalog(const char *lang)
{
lmo_catalog_t *cat;
for (cat = _lmo_catalogs; cat; cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
_lmo_active_catalog = cat;
return 0;
}
}
return -1;
}
static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash)
{
unsigned int m, l, r;
uint32_t k;
l = 0;
r = ar->length - 1;
while (1)
{
m = l + ((r - l) / 2);
if (r < l)
break;
k = ntohl(ar->index[m].key_id);
if (k == hash)
return &ar->index[m];
if (k > hash)
{
if (!m)
break;
r = m - 1;
}
else
{
l = m + 1;
}
}
return NULL;
}
int lmo_translate(const char *key, int keylen, char **out, int *outlen)
{
uint32_t hash;
lmo_entry_t *e;
lmo_archive_t *ar;
if (!key || !_lmo_active_catalog)
return -2;
hash = lmo_canon_hash(key, keylen);
for (ar = _lmo_active_catalog->archives; ar; ar = ar->next)
{
if ((e = lmo_find_entry(ar, hash)) != NULL)
{
*out = ar->mmap + ntohl(e->offset);
*outlen = ntohl(e->length);
return 0;
}
}
return -1;
}
void lmo_close_catalog(const char *lang)
{
lmo_archive_t *ar, *next;
lmo_catalog_t *cat, *prev;
for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next)
{
if (!strncmp(cat->lang, lang, sizeof(cat->lang)))
{
if (prev)
prev->next = cat->next;
else
_lmo_catalogs = cat->next;
for (ar = cat->archives; ar; ar = next)
{
next = ar->next;
lmo_close(ar);
}
free(cat);
break;
}
}
}

View File

@ -1,92 +0,0 @@
/*
* lmo - Lua Machine Objects - General header
*
* Copyright (C) 2009-2012 Jo-Philipp Wich <xm@subsignal.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _TEMPLATE_LMO_H_
#define _TEMPLATE_LMO_H_
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <fnmatch.h>
#include <dirent.h>
#include <ctype.h>
#include <limits.h>
#if (defined(__GNUC__) && defined(__i386__))
#define sfh_get16(d) (*((const uint16_t *) (d)))
#else
#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
struct lmo_entry {
uint32_t key_id;
uint32_t val_id;
uint32_t offset;
uint32_t length;
} __attribute__((packed));
typedef struct lmo_entry lmo_entry_t;
struct lmo_archive {
int fd;
int length;
uint32_t size;
lmo_entry_t *index;
char *mmap;
char *end;
struct lmo_archive *next;
};
typedef struct lmo_archive lmo_archive_t;
struct lmo_catalog {
char lang[6];
struct lmo_archive *archives;
struct lmo_catalog *next;
};
typedef struct lmo_catalog lmo_catalog_t;
uint32_t sfh_hash(const char *data, int len);
uint32_t lmo_canon_hash(const char *data, int len);
lmo_archive_t * lmo_open(const char *file);
void lmo_close(lmo_archive_t *ar);
extern lmo_catalog_t *_lmo_catalogs;
extern lmo_catalog_t *_lmo_active_catalog;
int lmo_load_catalog(const char *lang, const char *dir);
int lmo_change_catalog(const char *lang);
int lmo_translate(const char *key, int keylen, char **out, int *outlen);
void lmo_close_catalog(const char *lang);
#endif

View File

@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=Argon Theme
LUCI_DEPENDS:=
PKG_VERSION:=1.7.0
PKG_RELEASE:=20200909
PKG_VERSION:=1.7.1
PKG_RELEASE:=20210215
include $(TOPDIR)/feeds/luci/luci.mk

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -1,4 +1,4 @@
// compress: true
// compress: false
/**
* Argon is a clean HTML5 theme for LuCI. It is based on luci-theme-material and Argon Template
*
@ -40,17 +40,26 @@
@import url("pure-min.css?v=1");
:root {
/** general **/
--primary: #5e72e4;
--dark-primary: #483d8b;
--background-color: #f4f5f7;
--font-color: #525f7f;
/** login form **/
--login-form-background-color: #ffffff;
--login-form-bg-color: rgba(244, 245, 247, 0.8);
--blur-radius: 10px;
--blur-opacity: 0.5;
--white: #fff;
--darker: black;
--default: #525461;
--background-color: #f4f5f7;
--warning: #fb6340;
--footer-color:#aaa;
--menubar-background:#fff;
--menubar-scrollbar-thumb:#f6f9fc;
--menubar-text-color:#4c4c4c;
--footer-color: #aaa;
--menubar-background: #fff;
--menubar-scrollbar-thumb: #f6f9fc;
--menubar-text-color: #4c4c4c;
--blue: #5e72e4;
--indigo: #5603ad;
--purple: #8965e0;
@ -74,15 +83,58 @@
--dark: #212529;
--neutral: #fff;
--login-form-bg-color: rgba(244, 245, 247, 0.8);
--breakpoint-xs: 0;
--breakpoint-sm: 576px;
--breakpoint-md: 768px;
--breakpoint-lg: 992px;
--breakpoint-xl: 1200px;
--blur-radius:10px;
--blur-opacity:0.5;
--blur-radius-dark:10px;
--blur-opacity-dark:0.5;
--blur-radius: 10px;
--blur-opacity: 0.5;
--blur-radius-dark: 10px;
--blur-opacity-dark: 0.5;
--font-family-sans-serif: "Google Sans", "Microsoft Yahei", "WenQuanYi Micro Hei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB";
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
--font-family-normal: Open Sans, PingFangSC-Regular, Microsoft Yahei, WenQuanYi Micro Hei, "Helvetica Neue", Helvetica, Hiragino Sans GB, sans-serif;
}
[data-theme="dark"] {
--primary: #483d8b;
--dark-primary: #483d8b;
--background-color: #1e1e1e;
--font-color: #cccccc;
--white: #fff;
--darker: black;
--default: #525461;
--warning: #fb6340;
--footer-color: #aaa;
--menubar-background: #fff;
--menubar-scrollbar-thumb: #f6f9fc;
--menubar-text-color: #4c4c4c;
--blue: #5e72e4;
--indigo: #5603ad;
--purple: #8965e0;
--pink: #f3a4b5;
--red: #f5365c;
--orange: #fb6340;
--yellow: #ffd600;
--green: #2dce89;
--teal: #11cdef;
--cyan: #2bffc6;
--white: #fff;
--gray: #8898aa;
--gray-dark: #32325d;
--light: #ced4da;
--lighter: #e9ecef;
--secondary: #f7fafc;
--success: #2dce89;
--info: #11cdef;
--danger: #f5365c;
--light: #adb5bd;
--dark: #212529;
--neutral: #fff;
--login-form-bg-color: rgba(244, 245, 247, 0.8);
--blur-radius: 10px;
--blur-opacity: 0.5;
--blur-radius-dark: 10px;
--blur-opacity-dark: 0.5;
--font-family-sans-serif: "Google Sans", "Microsoft Yahei", "WenQuanYi Micro Hei", "sans-serif", "Helvetica Neue", "Helvetica", "Hiragino Sans GB";
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
--font-family-normal: Open Sans, PingFangSC-Regular, Microsoft Yahei, WenQuanYi Micro Hei, "Helvetica Neue", Helvetica, Hiragino Sans GB, sans-serif;
@ -107,6 +159,8 @@ body {
font-size: 0.875rem;
background-color: #f4f5f7;
background-color: var(--background-color);
color: #525f7f;
color: var(--font-color);
}
@ -114,7 +168,7 @@ body {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color:transparent;
-webkit-tap-highlight-color: transparent;
}
@ -141,6 +195,45 @@ li {
list-style-type: none;
}
@-webkit-keyframes sparkle {
from {
background-position: 0 0;
}
to {
background-position: 0 -64px;
}
}
@-moz-keyframes sparkle {
from {
background-position: 0 0;
}
to {
background-position: 0 -64px;
}
}
@-o-keyframes sparkle {
from {
background-position: 0 0;
}
to {
background-position: 0 -64px;
}
}
@keyframes sparkle {
from {
background-position: 0 0;
}
to {
background-position: 0 -64px;
}
}
/***********************
*
@ -161,13 +254,14 @@ li {
background-color: #000;
background-color: var(--darker);
overflow: hidden;
video {
width: 100%;
height: auto;
}
}
.volume-control{
.volume-control {
position: fixed;
right: 1rem;
top: 1rem;
@ -177,13 +271,14 @@ li {
cursor: pointer;
background-size: contain;
background-image: url(../img/volume_high.svg);
&.mute{
&.mute {
background-image: url(../img/volume_off.svg);
}
}
.main-bg{
position: absolute;
.main-bg {
position: fixed;
width: 100%;
height: 100%;
left: 0;
@ -260,7 +355,6 @@ li {
text-align: center;
color: #fb6340;
color: var(--warning);
padding-bottom: 2rem;
}
.input-group {
@ -306,7 +400,7 @@ li {
box-sizing: border-box;
transition: all .3s cubic-bezier(.68, -.55, .265, 1.55);
color: #525461;
color:var(--default);
color: var(--default);
border: 0;
border-radius: 0;
border-bottom: 1px solid #fff;
@ -382,7 +476,8 @@ li {
color: var(--default);
position: absolute;
bottom: 0;
.ftc{
.ftc {
position: absolute;
bottom: 30px;
width: 100%;
@ -427,7 +522,7 @@ header {
position: relative;
.container {
margin-top: 0.5rem;
margin-top: rem;
padding: 0.5rem 1rem 0 1rem;
.pull-right>* {
@ -485,16 +580,16 @@ header {
***************************/
footer {
text-align: right;
padding: 1rem;
color: #aaa;
color:var(--footer-color);
color: var(--footer-color);
font-size: 0.8rem;
a {
color: #aaa;
color:var(--footer-color);
color: var(--footer-color);
text-decoration: none;
}
}
@ -550,7 +645,7 @@ footer {
&::-webkit-scrollbar-thumb {
background-color: #f6f9fc;
background-color: var(--menubar-scrollbar-thumb);
}
&::-webkit-scrollbar-track {
@ -630,7 +725,7 @@ footer {
&:hover {
&::after {
color: #000;
color:var(--darker);
color: var(--darker);
width: 100%;
}
}
@ -829,10 +924,11 @@ footer {
}
}
&:last-child>.menu::after {
content: "";
}
}
}
}
}
@ -1486,6 +1582,9 @@ input[name="nslookup"] {
height: 100% !important;
background-color: #5e72e4 !important;
background-color: var(--primary) !important;
background-image: url(../img/trafficbar.png);
background-position: left top;
animation: sparkle 1500ms linear infinite;
}
/* fix multiple table */
@ -2114,8 +2213,8 @@ div>.table>.tbody>.tr:nth-of-type(2n) {
.errorbox,
.alert-message {
margin: 2rem 0 0 0;
padding: 2rem;
margin: 0 0 0 0;
padding: 1rem 2rem;
border: 0;
font-weight: normal;
font-style: normal;
@ -2133,7 +2232,9 @@ div>.table>.tbody>.tr:nth-of-type(2n) {
background-color: #f0ad4e;
border-color: #eea236;
}
.alert-message.warning{
margin-bottom: 1rem;
}
.error {
color: red;
}
@ -3351,9 +3452,7 @@ input[name="nslookup"] {
padding: 0.3rem 0.6rem;
}
select {
min-width: 15rem;
}
}
@ -3501,6 +3600,7 @@ input[name="nslookup"] {
float: right;
margin-top: 0rem !important;
}
.login-page .video {
video {
width: auto !important;
@ -3513,6 +3613,8 @@ input[name="nslookup"] {
width: 100%;
.login-form {
max-width: 480px;
.form-login {
.input-group {
&::before {
@ -3539,10 +3641,6 @@ input[name="nslookup"] {
margin: 1rem 0 0 0;
}
.tabs {
margin: 0.5rem 0rem
}
.toggle {
margin: 0;
}
@ -3573,6 +3671,7 @@ input[name="nslookup"] {
top: 0.9rem;
}
#ethinfo td {
padding: 0.75rem 0.2rem !important;
@ -3593,18 +3692,27 @@ input[name="nslookup"] {
min-width: 15rem;
}
select {
width: 15rem;
select,
input {
width: 100% !important;
min-width: auto;
margin: 0.25rem 0;
}
input {
box-sizing: border-box;
}
.cbi-value>.cbi-value-field>div>input {
width: calc(100% - 1.5rem) !important;
}
.cbi-value>.cbi-value-field {
display: inline-block;
width: 100%;
position: relative;
}
.cbi-value-field .cbi-input-checkbox,
.cbi-value-field .cbi-input-radio {
margin: 0rem 0.25rem 0 0.25rem;
@ -3637,7 +3745,7 @@ input[name="nslookup"] {
}
.mobile-hide {
display: none;
display: none !important;
}
@ -3706,6 +3814,34 @@ input[name="nslookup"] {
width: 10rem !important;
}
.cbi-button-add {
margin-left: 0.5rem;
}
.node-network-network {
.cbi-section-table {
tr,
td {
display: block;
}
td {
width: 100% !important;
text-align: center !important;
padding: 0.8rem 1.5rem !important;
}
.cbi-section-table-titles {
display: flex;
.cbi-section-table-cell {
flex: 1 !important;
}
}
}
}
.node-services-vssr {
.status-info {
font-size: 0.75rem;

View File

@ -249,7 +249,8 @@ table>thead>tr>td {
#membuff>div>div,
#conns>div>div,
#memtotal>div>div {
background-color: #32325d !important;
background-color: #483d8b !important;
background-color: var(--dark-primary) !important;
}
#swaptotal>div>div>div>small,

View File

@ -39,7 +39,7 @@
local categories = disp.node_childs(tree)
%>
</div>
<footer class="mobile-hide">
<footer>
<div class="ftc">
<a class="luci-link" href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %>
(<%= ver.luciversion %>)</a> /
@ -70,6 +70,15 @@
var keyboradHeight = newHeight - winHeight;
$(".ftc").css("bottom", keyboradHeight + 30);
}
if($(document.body).height() < 525 ){
if($(".ftc").css('display') != 'none'){
$(".ftc").hide()
}
}else{
if($(".ftc").css('display') == 'none'){
$(".ftc").show()
}
}
})
</script>

View File

@ -32,7 +32,6 @@
local uci = require 'luci.model.uci'.cursor()
local boardinfo = util.ubus("system", "board")
local request = disp.context.path
local request2 = disp.context.request
@ -52,7 +51,6 @@
math.randomseed(tonumber(tostring(os.time()):reverse():sub(1, 9)))
-- Custom settings
local mode = 'normal'
local dark_css = fs.readfile('/www/luci-static/argon/css/dark.css')
local bar_color = '#5e72e4'

View File

@ -82,25 +82,23 @@
}
})
</script>
<% else %>
<div class="main-bg" id="main-bg"
<%
<% else
local bg_url = media .. "/img/bg1.jpg"
local bing = "123"
if (bgcount == 0 ) then
local http = require "luci.sys"
local sys = require "luci.sys"
local json = require "luci.jsonc"
local bg_url = media .. "/img/bg1.jpg"
local bing = http.httpget("http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US")
local remote_bg_url="http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US"
--bing = sys.httpget(remote_bg_url)
bing = sys.exec("wget --timeout=0.5 -qO- '%s'" %remote_bg_url)
if (bing and bing ~= '') then
local bingjson = json.parse(bing)
bg_url = "https://www.bing.com" .. bingjson.images[1].url
bg_url = "https://www.bing.com" .. json.parse(bing).images[1].url
end
elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then
bg_url = currentBg.url
end
%>
style="background-image:url(<%=bg_url%>)"
<% elseif (bgcount > 0 and currentBg["type"] ~= "mp4") then %>
style="background-image:url(<%=currentBg.url%>)"
<% end %>
></div>
<div class="main-bg" id="main-bg" style="background-image:url(<%=bg_url%>)"></div>
<% end %>
<div class="login-container">
<div class="login-form">

View File

@ -10,9 +10,9 @@ m:section(SimpleSection).template = "shadowsocksr/status"
local server_table = {}
uci:foreach("shadowsocksr", "servers", function(s)
if s.alias then
server_table[s[".name"]] = "[%s]:%s" % {string.upper(s.type), s.alias}
server_table[s[".name"]] = "[%s]:%s" % {string.upper(s.v2ray_protocol or s.type), s.alias}
elseif s.server and s.server_port then
server_table[s[".name"]] = "[%s]:%s:%s" % {string.upper(s.type), s.server, s.server_port}
server_table[s[".name"]] = "[%s]:%s:%s" % {string.upper(s.v2ray_protocol or s.type), s.server, s.server_port}
end
end)

View File

@ -4128,6 +4128,7 @@
103.162.10.0/23
103.162.32.0/23
103.162.38.0/23
103.162.116.0/23
103.192.0.0/22
103.192.4.0/22
103.192.8.0/22

File diff suppressed because it is too large Load Diff

View File

@ -232,7 +232,7 @@ local function processData(szType, content)
local userinfo = hostInfo[1]
local password = userinfo
result.alias = UrlDecode(alias)
result.type = "v2ray"
result.type = "trojan"
result.v2ray_protocol = "trojan"
result.server = host[1]
-- 按照官方的建议 默认验证ssl证书

View File

@ -8,17 +8,17 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gmp
PKG_VERSION:=6.1.2
PKG_RELEASE:=2
PKG_VERSION:=6.2.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_REVISION).tar.xz
PKG_SOURCE_URL:=@GNU/gmp/
PKG_HASH:=87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
PKG_HASH:=fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE:=GPL-2.0-or-later
PKG_USE_MIPS16:=0

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libevent2
PKG_VERSION:=2.1.11
PKG_RELEASE:=2
PKG_VERSION:=2.1.12
PKG_RELEASE:=1
PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz
PKG_SOURCE_URL:=https://github.com/libevent/libevent/releases/download/release-$(PKG_VERSION)-stable
PKG_HASH:=a65bac6202ea8c5609fd5c7e480e6d25de467ea1917c08290c521752f147283d
PKG_HASH:=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
PKG_BUILD_DIR:=$(BUILD_DIR)/libevent-$(PKG_VERSION)-stable
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>

View File

@ -1,45 +0,0 @@
From 9c2d9d2c8f65d7c6bb268c0e9795bac296661ca8 Mon Sep 17 00:00:00 2001
From: Daniel Engberg <daniel.engberg.lists@pyret.net>
Date: Wed, 7 Aug 2019 00:56:39 +0200
Subject: [PATCH] Add missing file Uninstall.cmake.in
Needed to fix compilation
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
---
cmake/Uninstall.cmake.in | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 cmake/Uninstall.cmake.in
diff --git a/cmake/Uninstall.cmake.in b/cmake/Uninstall.cmake.in
new file mode 100644
index 0000000..c6dc09e
--- /dev/null
+++ b/cmake/Uninstall.cmake.in
@@ -0,0 +1,23 @@
+# https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake
+
+if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
+endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
+
+file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+foreach(file ${files})
+ message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
+ if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+ exec_program(
+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval
+ )
+ if(NOT "${rm_retval}" STREQUAL 0)
+ message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
+ endif(NOT "${rm_retval}" STREQUAL 0)
+ else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+ message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
+ endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
--
2.22.0

View File

@ -1,25 +0,0 @@
From f05ba671931e2b4e38459899f6f63f79f99869fe Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Sat, 3 Aug 2019 14:32:21 +0300
Subject: [PATCH] Add Uninstall.cmake.in into dist archive
Fixes: #863
---
Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile.am b/Makefile.am
index af75a963..92f9433c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -127,6 +127,7 @@ CMAKE_FILES = \
cmake/LibeventConfig.cmake.in \
cmake/LibeventConfigVersion.cmake.in \
cmake/VersionViaGit.cmake \
+ cmake/Uninstall.cmake.in \
event-config.h.cmake \
evconfig-private.h.cmake \
CMakeLists.txt
--
2.22.0

View File

@ -8,18 +8,19 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libnftnl
PKG_VERSION:=1.1.7
PKG_RELEASE:=2
PKG_VERSION:=1.1.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
PKG_HASH:=20dbc13f11004aea2c9e479cfb90359cb11fe3446c3140811c18e4ec1648ed8f
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
PKG_LICENSE:=GPL-2.0+
PKG_HASH:=04a3fa5b08b736268f7e65836b9f05d9d5f438181467bee3c76c3c4a4f3ab711
PKG_FIXUP:=autoreconf
PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
@ -31,7 +32,7 @@ define Package/libnftnl
DEPENDS:=+libmnl
TITLE:=Low-level netlink library for the nf_tables subsystem
URL:=http://www.netfilter.org/projects/libnftnl
ABI_VERSION:=12
ABI_VERSION:=11
endef
define Package/libnftnl/description

View File

@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=readline
PKG_VERSION:=8.0
PKG_VERSION:=8.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/readline
PKG_HASH:=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461
PKG_HASH:=f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02
PKG_LICENSE:=GPL-3.0
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:gnu:readline

View File

@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=4
PKG_RELEASE:=14
PKG_DATE:=20210209
PKG_RELEASE:=15
PKG_DATE:=20210213
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
@ -101,6 +101,7 @@ define Package/$(PKG_NAME)
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR:shadowsocksr-libev-ssr-local \
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-ssr-server \
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-core \
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-geodata \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Plus:trojan-plus \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_GO:trojan-go \
+PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \

View File

@ -162,6 +162,24 @@ function is_finded(e)
return luci.sys.exec('type -t -p "/bin/%s" -p "%s" "%s"' % {e, get_customed_path(e), e}) ~= "" and true or false
end
function clone(org)
local function copy(org, res)
for k,v in pairs(org) do
if type(v) ~= "table" then
res[k] = v;
else
res[k] = {};
copy(v, res[k])
end
end
end
local res = {}
copy(org, res)
return res
end
function get_xray_path()
local path = uci_get_type("global_app", "xray_file")
return path

View File

@ -25,7 +25,7 @@ local new_port
local ucursor = require"luci.model.uci".cursor()
local sys = require "luci.sys"
local json = require "luci.jsonc"
local appname = "passwall"
local appname = api.appname
local dns = nil
local inbounds = {}
local outbounds = {}
@ -40,31 +40,48 @@ local function get_new_port()
return new_port
end
function gen_outbound(node, tag, relay_port)
function gen_outbound(node, tag, is_proxy)
local result = nil
if node then
if node and node ~= "nil" then
local node_id = node[".name"]
if tag == nil then
tag = node_id
end
if is_proxy and is_proxy == "1" then
new_port = get_new_port()
table.insert(inbounds, {
tag = "proxy_" .. tag,
listen = "127.0.0.1",
port = new_port,
protocol = "dokodemo-door",
settings = {network = "tcp,udp", address = node.address, port = tonumber(node.port)}
})
if node.tls_serverName == nil then
node.tls_serverName = node.address
end
node.address = "127.0.0.1"
node.port = new_port
end
if node.type ~= "Xray" and node.type ~= "V2ray" then
if node.type == "Socks" then
node.protocol = "socks"
node.transport = "tcp"
else
local node_type = proto or "socks"
local relay_port = node.port
new_port = get_new_port()
node.port = new_port
sys.call(string.format('/usr/share/%s/app.sh run_socks "%s" "%s" "%s" "%s" "%s" "%s" "%s" "%s"> /dev/null',
appname,
new_port,
node_id,
"127.0.0.1",
new_port,
string.format("/var/etc/%s/v2_%s_%s.json", appname, node_type, node_id),
"0",
"nil",
relay_port and tostring(relay_port) or ""
sys.call(string.format('/usr/share/%s/app.sh run_socks "%s" "%s" "%s" "%s" "%s" "%s" "%s" "%s"> /dev/null', appname,
new_port, --flag
node_id, --node
"127.0.0.1", --bind
new_port, --socks port
string.format("/var/etc/%s/v2_%s_%s_%s.json", appname, node_type, node_id, new_port), --config file
"0", --http port
"nil", -- http config file
(is_proxy and is_proxy == "1" and relay_port) and tostring(relay_port) or "" --relay port
)
)
node.protocol = "socks"
@ -86,6 +103,8 @@ function gen_outbound(node, tag, relay_port)
end
result = {
_flag_tag = node_id,
_flag_is_proxy = (is_proxy and is_proxy == "1") and "1" or "0",
tag = tag,
protocol = node.protocol,
mux = (node.stream_security ~= "xtls") and {
@ -222,11 +241,29 @@ if node_section then
end
end
local up_trust_doh = ucursor:get(appname, "@global[0]", "up_trust_doh")
if up_trust_doh then
local t = {}
string.gsub(up_trust_doh, '[^' .. "," .. ']+', function (w)
table.insert(t, w)
end)
if #t > 1 then
local host = sys.exec("echo -n $(echo " .. t[1] .. " | sed 's/https:\\/\\///g' | awk -F ':' '{print $1}' | awk -F '/' '{print $1}')")
dns = {
hosts = {
[host] = t[2]
}
}
end
end
if node.protocol == "_shunt" then
local rules = {}
ucursor:foreach(appname, "shunt_rules", function(e)
local name = e[".name"]
local _node_id = node[name] or "nil"
local is_proxy = node[name .. "_proxy"] or "0"
local outboundTag
if _node_id == "_direct" then
outboundTag = "direct"
@ -234,36 +271,31 @@ if node_section then
outboundTag = "blackhole"
else
if _node_id ~= "nil" then
local _node = ucursor:get_all(appname, _node_id)
local is_proxy = node[name .. "_proxy"]
local relay_port
if is_proxy and is_proxy == "1" then
new_port = get_new_port()
relay_port = new_port
table.insert(inbounds, {
tag = "proxy_" .. name,
listen = "127.0.0.1",
port = new_port,
protocol = "dokodemo-door",
settings = {network = "tcp,udp", address = _node.address, port = tonumber(_node.port)}
})
if _node.tls_serverName == nil then
_node.tls_serverName = _node.address
local has_outbound
for index, value in ipairs(outbounds) do
if value["_flag_tag"] == _node_id and value["_flag_is_proxy"] == is_proxy then
has_outbound = api.clone(value)
break
end
_node.address = "127.0.0.1"
_node.port = new_port
end
local _outbound = gen_outbound(_node, name, relay_port)
if _outbound then
table.insert(outbounds, _outbound)
if is_proxy and is_proxy == "1" then
table.insert(rules, {
type = "field",
inboundTag = {"proxy_" .. name},
outboundTag = "default"
})
end
if has_outbound then
has_outbound["tag"] = name
table.insert(outbounds, has_outbound)
outboundTag = name
else
local _node = ucursor:get_all(appname, _node_id)
local _outbound = gen_outbound(_node, name, is_proxy)
if _outbound then
if is_proxy == "1" then
table.insert(rules, 1, {
type = "field",
inboundTag = {"proxy_" .. name},
outboundTag = "default"
})
end
table.insert(outbounds, _outbound)
outboundTag = name
end
end
end
end
@ -292,59 +324,62 @@ if node_section then
end
end
end)
local default_node_id = node.default_node or nil
if default_node_id and default_node_id ~= "nil" then
local default_node_id = node.default_node or "_direct"
local outboundTag
if default_node_id == "_direct" then
outboundTag = "direct"
elseif default_node_id == "_blackhole" then
outboundTag = "blackhole"
else
local default_node = ucursor:get_all(appname, default_node_id)
if "1" == node.default_proxy then
local node_id = node.main_node or nil
if node_id and node_id ~= "nil" then
if node_id == default_node_id then
else
new_port = get_new_port()
table.insert(inbounds, {
tag = "proxy_default",
listen = "127.0.0.1",
port = new_port,
protocol = "dokodemo-door",
settings = {network = "tcp,udp", address = default_node.address, port = tonumber(default_node.port)}
local main_node_id = node.main_node or "nil"
if main_node_id ~= "nil" then
if main_node_id == default_node_id then
else
new_port = get_new_port()
table.insert(inbounds, {
tag = "proxy_default",
listen = "127.0.0.1",
port = new_port,
protocol = "dokodemo-door",
settings = {network = "tcp,udp", address = default_node.address, port = tonumber(default_node.port)}
})
if default_node.tls_serverName == nil then
default_node.tls_serverName = default_node.address
end
default_node.address = "127.0.0.1"
default_node.port = new_port
local node = ucursor:get_all(appname, main_node_id)
local outbound = gen_outbound(node, "main")
if outbound then
table.insert(outbounds, outbound)
table.insert(rules, 1, {
type = "field",
inboundTag = {"proxy_default"},
outboundTag = "main"
})
if default_node.tls_serverName == nil then
default_node.tls_serverName = default_node.address
end
default_node.address = "127.0.0.1"
default_node.port = new_port
local node = ucursor:get_all(appname, node_id)
local outbound = gen_outbound(node, "main")
if outbound then
table.insert(outbounds, outbound)
local rule = {
type = "field",
inboundTag = {"proxy_default"},
outboundTag = "main"
}
table.insert(rules, rule)
end
end
end
end
local default_outbound = gen_outbound(default_node, "default")
if default_outbound then
table.insert(outbounds, default_outbound)
local rule = {
type = "field",
outboundTag = "default",
network = network
}
table.insert(rules, rule)
outboundTag = "default"
end
end
if outboundTag then
table.insert(rules, {
type = "field",
outboundTag = outboundTag,
network = network
})
end
routing = {
domainStrategy = node.domainStrategy or "AsIs",
rules = rules
}
elseif node.protocol == "_balancing" then
if node.balancing_node then
local nodes = node.balancing_node
@ -456,7 +491,14 @@ if inbounds or outbounds then
table.insert(outbounds, {
protocol = "freedom",
tag = "direct",
settings = {domainStrategy = "UseIPv4"}
settings = {
domainStrategy = "UseIPv4"
},
streamSettings = {
sockopt = {
mark = 255
}
}
})
table.insert(outbounds, {
protocol = "blackhole",
@ -465,7 +507,7 @@ if inbounds or outbounds then
local xray = {
log = {
-- error = string.format("/var/etc/passwall/%s.log", node[".name"]),
-- error = string.format("/var/etc/%s/%s.log", appname, node[".name"]),
loglevel = loglevel
},
-- DNS

View File

@ -3,10 +3,7 @@ local appname = api.appname
local nodes_table = {}
for k, e in ipairs(api.get_valid_nodes()) do
nodes_table[#nodes_table + 1] = {
id = e[".name"],
remarks = e.remarks_name
}
nodes_table[#nodes_table + 1] = e
end
m = Map(appname)
@ -26,7 +23,9 @@ o.default = "1"
o = s:option(DynamicList, "tcp_node", "TCP " .. translate("List of backup nodes"))
for k, v in pairs(nodes_table) do
o:value(v.id, v.remarks)
if v.node_type == "normal" then
o:value(v.id, v.remarks_name)
end
end
o = s:option(Flag, "restore_switch", "TCP " .. translate("Restore Switch"), translate("When detects main node is available, switch back to the main node."))

View File

@ -120,11 +120,11 @@ if has_xray and #nodes_table > 0 then
local id = e[".name"]
o = s:taboption("Main", ListValue, v.id .. "." .. id .. "_node", string.format('* <a href="%s" target="_blank">%s</a>', api.url("shunt_rules", id), translate(e.remarks)))
o:depends("tcp_node", v.id)
o:value("nil", translate("Close"))
o:value("nil", translate("Default"))
o:value("_direct", translate("Direct Connection"))
o:value("_blackhole", translate("Blackhole"))
for k, v in pairs(normal_list) do
o:value(v.id, v.remarks_name)
for k1, v1 in pairs(normal_list) do
o:value(v1.id, v1.remarks_name)
end
o.cfgvalue = function(self, section)
return m:get(v.id, id) or "nil"
@ -137,9 +137,10 @@ if has_xray and #nodes_table > 0 then
local id = "default_node"
o = s:taboption("Main", ListValue, v.id .. "." .. id, "* " .. translate("Default"))
o:depends("tcp_node", v.id)
o:value("nil", translate("Close"))
for k, v in pairs(normal_list) do
o:value(v.id, v.remarks_name)
o:value("_direct", translate("Direct Connection"))
o:value("_blackhole", translate("Blackhole"))
for k1, v1 in pairs(normal_list) do
o:value(v1.id, v1.remarks_name)
end
o.cfgvalue = function(self, section)
return m:get(v.id, id) or "nil"
@ -152,8 +153,8 @@ if has_xray and #nodes_table > 0 then
o = s:taboption("Main", ListValue, v.id .. "." .. id, "* " .. translate("Default") .. translate("Preproxy"))
o:depends("tcp_node", v.id)
o:value("nil", translate("Close"))
for k, v in pairs(normal_list) do
o:value(v.id, v.remarks_name)
for k1, v1 in pairs(normal_list) do
o:value(v1.id, v1.remarks_name)
end
o.cfgvalue = function(self, section)
return m:get(v.id, id) or "nil"
@ -274,7 +275,9 @@ o:depends({dns_mode = "pdnsd"})
o = s:taboption("DNS", Button, "clear_ipset", translate("Clear IPSET"), translate("Try this feature if the rule modification does not take effect."))
o.inputstyle = "remove"
function o.write(e, e)
luci.sys.call("/etc/init.d/" .. appname .. " stop && /usr/share/" .. appname .. "/iptables.sh flush_ipset && /etc/init.d/" .. appname .. " restart")
luci.sys.call("/etc/init.d/" .. appname .. " stop")
luci.sys.call("/usr/share/" .. appname .. "/iptables.sh flush_ipset")
luci.sys.call("/etc/init.d/" .. appname .. " restart")
end
s:tab("Proxy", translate("Mode"))

View File

@ -129,7 +129,7 @@ balancing_node:depends("protocol", "_balancing")
-- 分流
uci:foreach(appname, "shunt_rules", function(e)
o = s:option(ListValue, e[".name"], string.format('* <a href="%s" target="_blank">%s</a>', api.url("shunt_rules", e[".name"]), translate(e.remarks)))
o:value("nil", translate("Close"))
o:value("nil", translate("Default"))
o:value("_direct", translate("Direct Connection"))
o:value("_blackhole", translate("Blackhole"))
o:depends("protocol", "_shunt")
@ -153,17 +153,19 @@ end
shunt_tips:depends("protocol", "_shunt")
default_node = s:option(ListValue, "default_node", translate("Default") .. " " .. translate("Node"))
default_node:value("nil", translate("Close"))
default_node:value("_direct", translate("Direct Connection"))
default_node:value("_blackhole", translate("Blackhole"))
for k, v in pairs(nodes_table) do default_node:value(v.id, v.remarks) end
default_node:depends("protocol", "_shunt")
default_proxy = s:option(Flag, "default_proxy", translate("Default") .. translate("Node") .. translate("Preproxy"), translate("Use the under node for the transit."))
default_proxy.default = 0
default_proxy:depends("protocol", "_shunt")
o = s:option(ListValue, "main_node", " ")
for k, v in pairs(nodes_table) do o:value(v.id, v.remarks) end
o:depends("default_proxy", "1")
if #nodes_table > 0 then
o = s:option(ListValue, "main_node", translate("Default") .. " " .. translate("Node") .. translate("Preproxy"), translate("Use this node proxy to forward the default node."))
o:value("nil", translate("Close"))
for k, v in pairs(nodes_table) do
o:value(v.id, v.remarks)
o:depends("default_node", v.id)
end
end
domainStrategy = s:option(ListValue, "domainStrategy", translate("Domain Strategy"))
domainStrategy:value("AsIs")

View File

@ -28,6 +28,9 @@ o = s:option(Value, "chnroute6_url", translate("China IPv6s(chnroute6) Update UR
o:value("https://ispip.clang.cn/all_cn_ipv6.txt", translate("Clang.CN.IPv6"))
o.default = "https://ispip.clang.cn/all_cn_ipv6.txt"
----chnlist URL
o = s:option(DynamicList, "chnlist_url", translate("China List(Chnlist) Update URL"))
s:append(Template(appname .. "/rule/rule_version"))
---- Auto Update
@ -57,6 +60,7 @@ s = m:section(TypedSection, "shunt_rules", "Xray" .. translate("Shunt") .. trans
s.template = "cbi/tblsection"
s.anonymous = false
s.addremove = true
s.sortable = true
s.extedit = api.url("shunt_rules", "%s")
function s.create(e, t)
TypedSection.create(e, t)

View File

@ -57,7 +57,7 @@ ip_list.validate = function(self, value)
if ipmask:find("geoip:") and ipmask:find("geoip:") == 1 then
elseif ipmask:find("ext:") and ipmask:find("ext:") == 1 then
else
if not datatypes.ipmask4(ipmask) then
if not (datatypes.ipmask4(ipmask) or datatypes.ipmask6(ipmask)) then
return nil, ipmask .. " " .. translate("Not valid IP format, please re-enter!")
end
end

View File

@ -5,6 +5,8 @@ local gfwlist_update = api.uci_get_type("global_rules", "gfwlist_update", "1") =
local chnroute_update = api.uci_get_type("global_rules", "chnroute_update", "1") == "1" and "checked='checked'" or ""
local chnroute6_update = api.uci_get_type("global_rules", "chnroute6_update", "1") == "1" and "checked='checked'" or ""
local chnlist_update = api.uci_get_type("global_rules", "chnlist_update", "1") == "1" and "checked='checked'" or ""
local geoip_update = api.uci_get_type("global_rules", "geoip_update", "1") == "1" and "checked='checked'" or ""
local geosite_update = api.uci_get_type("global_rules", "geosite_update", "1") == "1" and "checked='checked'" or ""
-%>
<script type="text/javascript">
@ -62,6 +64,14 @@ local chnlist_update = api.uci_get_type("global_rules", "chnlist_update", "1") =
<input class="cbi-input-checkbox" type="checkbox" name="chnlist" value="1" <%=chnlist_update%> />
chnlist
</label>
<label>
<input class="cbi-input-checkbox" type="checkbox" name="geoip" value="1" <%=geoip_update%> />
geoip
</label>
<label>
<input class="cbi-input-checkbox" type="checkbox" name="geosite" value="1" <%=geosite_update%> />
geosite
</label>
<input class="cbi-button cbi-input-apply" type="button" id="update_rules_btn" onclick="update_rules(this)" value="<%:Manually update%>" />
</div>
</div>

View File

@ -724,6 +724,9 @@ msgstr "中国IP段(chnroute)更新URL"
msgid "China IPv6s(chnroute6) Update URL"
msgstr "中国IPv6段(chnroute6)更新URL"
msgid "China List(Chnlist) Update URL"
msgstr "中国域名列表(Chnlist)更新URL"
msgid "Rule status"
msgstr "规则版本"

View File

@ -47,6 +47,12 @@ config global_rules
option gfwlist_url 'https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt'
option chnroute_url 'https://ispip.clang.cn/all_cn.txt'
option chnroute6_url 'https://ispip.clang.cn/all_cn_ipv6.txt'
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf'
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf'
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf'
option xray_location_asset '/usr/share/xray/'
option geosite_update '1'
option geoip_update '1'
config global_app
option xray_file '/usr/bin/xray'
@ -80,6 +86,15 @@ config nodes '696cd32c1d5149ee95fd1b3accbad6df'
option default_proxy '0'
option domainStrategy 'IPIfNonMatch'
config shunt_rules 'ads'
option remarks '广告'
option domain_list 'geosite:category-ads'
config shunt_rules 'China'
option remarks 'China'
option domain_list 'geosite:cn'
option ip_list 'geoip:cn'
config shunt_rules 'Telegram'
option remarks 'Telegram'
option ip_list '149.154.160.0/20

View File

@ -347,7 +347,7 @@ run_socks() {
msg="某种原因,此 Socks 服务的相关配置已失联,启动中止!"
fi
if [ "$type" == "xray" ] && ([ -n "$(config_n_get $node balancing_node)" ] || [ "$(config_n_get $node default_node)" != "nil" ]); then
if [ "$type" == "xray" ] && ([ -n "$(config_n_get $node balancing_node)" ] || [ "$(config_n_get $node default_node)" != "_direct" -a "$(config_n_get $node default_node)" != "_blackhole" ]); then
unset msg
fi
@ -939,7 +939,7 @@ add_dnsmasq() {
#分流规则
[ "$(config_n_get $TCP_NODE protocol)" = "_shunt" ] && {
fwd_dns="${TUN_DNS}"
local default_node_id=$(config_n_get $TCP_NODE default_node nil)
local default_node_id=$(config_n_get $TCP_NODE default_node _direct)
local shunt_ids=$(uci show $CONFIG | grep "=shunt_rules" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}')
for shunt_id in $shunt_ids; do
local shunt_node_id=$(config_n_get $TCP_NODE ${shunt_id} nil)

View File

@ -294,7 +294,11 @@ load_acl() {
# 加载UDP默认代理模式
if [ "$UDP_PROXY_MODE" != "disable" ]; then
[ "$UDP_NO_REDIR_PORTS" != "disable" ] && $ipt_m -A PSW $(comment "默认") -p udp -m multiport --dport $UDP_NO_REDIR_PORTS -j RETURN
[ "$UDP_NO_REDIR_PORTS" != "disable" ] && {
$ipt_m -A PSW $(comment "默认") -p udp -m multiport --dport $UDP_NO_REDIR_PORTS -j RETURN
$ip6t_m -A PSW $(comment "默认") -p udp -m multiport --dport $UDP_NO_REDIR_PORTS -j RETURN
}
[ "$UDP_NODE" != "nil" ] && {
msg="UDP默认代理使用UDP节点 [$(get_action_chain_name $UDP_PROXY_MODE)](TPROXY:${UDP_REDIR_PORT})代理"
[ "$UDP_NO_REDIR_PORTS" != "disable" ] && msg="${msg}${UDP_NO_REDIR_PORTS}外的"
@ -306,7 +310,7 @@ load_acl() {
if [ "$PROXY_IPV6" == "1" ]; then
$ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST_6) $(REDIRECT $UDP_REDIR_PORT TPROXY)
$ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST_6) $(REDIRECT $UDP_REDIR_PORT TPROXY)
$ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $UDP_PROXY_MODE/6 $UDP_REDIR_PORT TPROXY)
$ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $UDP_PROXY_MODE $UDP_REDIR_PORT TPROXY)
fi
echolog "${msg}"
@ -348,7 +352,7 @@ filter_node() {
local address=$(config_n_get $node address)
local port=$(config_n_get $node port)
ipt_tmp=$ipt_n
ip6t_tmp=$ip6t_n
ip6t_tmp=$ip6t_m
[ "$stream" == "udp" ] && is_tproxy=1
[ "$type" == "brook" ] && [ "$(config_n_get $node protocol client)" == "client" ] && is_tproxy=1
#[ "$type" == "trojan-go" ] && is_tproxy=1
@ -402,13 +406,14 @@ filter_node() {
done
elif [ "$proxy_protocol" == "_shunt" ]; then
#echolog " - 按请求目的地址分流(${proxy_type}..."
local default_node=$(config_n_get $proxy_node default_node nil)
local default_proxy=$(config_n_get $proxy_node default_proxy 0)
if [ "$default_proxy" == 1 ]; then
local main_node=$(config_n_get $proxy_node main_node nil)
local default_node=$(config_n_get $proxy_node default_node _direct)
local main_node=$(config_n_get $proxy_node main_node nil)
if [ "$main_node" != "nil" ]; then
filter_rules $main_node $stream
else
filter_rules $default_node $stream
if [ "$default_node" != "_direct" ] && [ "$default_node" != "_blackhole" ]; then
filter_rules $default_node $stream
fi
fi
:<<!
local default_node_address=$(get_host_ip ipv4 $(config_n_get $default_node address) 1)
@ -465,9 +470,15 @@ add_firewall_rule() {
ipset -! create $IPSET_WHITELIST_6 nethash family inet6
local shunt_ids=$(uci show $CONFIG | grep "=shunt_rules" | awk -F '.' '{print $2}' | awk -F '=' '{print $1}')
for shunt_id in $shunt_ids; do
config_n_get $shunt_id ip_list | tr -s "\r\n" "\n" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_SHUNTLIST &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
config_n_get $shunt_id ip_list | tr -s "\r\n" "\n" | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}" | sed -e "s/^/add $IPSET_SHUNTLIST &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
done
for shunt_id in $shunt_ids; do
config_n_get $shunt_id ip_list | tr -s "\r\n" "\n" | sed -e "/^$/d" | grep -E "([A-Fa-f0-9]{0,4}::?){1,7}[A-Fa-f0-9]{1,4}" | sed -e "s/^/add $IPSET_SHUNTLIST_6 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
done
cat $RULES_PATH/chnroute | sed -e "/^$/d" | sed -e "s/^/add $IPSET_CHN &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
cat $RULES_PATH/proxy_ip | sed -e "/^$/d" | grep -E "(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}" | sed -e "s/^/add $IPSET_BLACKLIST &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
[ -f "$RULES_PATH/proxy_ip2" ] && cat $RULES_PATH/proxy_ip2 | grep -E "(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}" | sed -e "/^$/d" | sed -e "s/^/add $IPSET_BLACKLIST2 &/g" | awk '{print $0} END{print "COMMIT"}' | ipset -! -R
@ -540,21 +551,25 @@ add_firewall_rule() {
$ipt_n -A PSW $(dst $IPSET_LANIPLIST) -j RETURN
$ipt_n -A PSW $(dst $IPSET_VPSIPLIST) -j RETURN
$ipt_n -A PSW $(dst $IPSET_WHITELIST) -j RETURN
$ipt_n -A PSW -m mark --mark 0xff -j RETURN
$ipt_n -N PSW_OUTPUT
$ipt_n -A PSW_OUTPUT $(dst $IPSET_LANIPLIST) -j RETURN
$ipt_n -A PSW_OUTPUT $(dst $IPSET_VPSIPLIST) -j RETURN
$ipt_n -A PSW_OUTPUT $(dst $IPSET_WHITELIST) -j RETURN
$ipt_n -A PSW_OUTPUT -m mark --mark 0xff -j RETURN
$ipt_m -N PSW
$ipt_m -A PSW $(dst $IPSET_LANIPLIST) -j RETURN
$ipt_m -A PSW $(dst $IPSET_VPSIPLIST) -j RETURN
$ipt_m -A PSW $(dst $IPSET_WHITELIST) -j RETURN
$ipt_m -A PSW -m mark --mark 0xff -j RETURN
$ipt_m -N PSW_OUTPUT
$ipt_m -A PSW_OUTPUT $(dst $IPSET_LANIPLIST) -j RETURN
$ipt_m -A PSW_OUTPUT $(dst $IPSET_VPSIPLIST) -j RETURN
$ipt_m -A PSW_OUTPUT $(dst $IPSET_WHITELIST) -j RETURN
$ipt_m -A PSW_OUTPUT -m mark --mark 0xff -j RETURN
ip rule add fwmark 1 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100
@ -579,27 +594,19 @@ add_firewall_rule() {
$ip6t_m -A PSW $(dst $IPSET_LANIPLIST_6) -j RETURN
$ip6t_m -A PSW $(dst $IPSET_VPSIPLIST_6) -j RETURN
$ip6t_m -A PSW $(dst $IPSET_WHITELIST_6) -j RETURN
$ip6t_m -A PSW -m mark --mark 0xff -j RETURN
$ip6t_m -A PREROUTING -j PSW
$ip6t_m -N PSW_OUTPUT
$ip6t_m -A PSW_OUTPUT $(dst $IPSET_LANIPLIST_6) -j RETURN
$ip6t_m -A PSW_OUTPUT $(dst $IPSET_VPSIPLIST_6) -j RETURN
$ip6t_m -A PSW_OUTPUT $(dst $IPSET_WHITELIST_6) -j RETURN
$ip6t_m -A OUTPUT -p tcp -j PSW_OUTPUT
$ip6t_m -A PSW_OUTPUT -m mark --mark 0xff -j RETURN
$ip6t_m -A OUTPUT -j PSW_OUTPUT
ip -6 rule add fwmark 1 table 100
ip -6 route add local ::/0 dev lo table 100
[ -n "$lan_ifname" ] && {
lan_ipv6=$(ip address show $lan_ifname | grep -w "inet6" | awk '{print $2}') #当前LAN IPv6段
[ -n "$lan_ipv6" ] && {
for ip in $lan_ipv6; do
$ip6t_m -A PSW -d $ip -j RETURN
$ip6t_m -A PSW_OUTPUT -d $ip -j RETURN
done
}
}
# 加载路由器自身代理 TCP
if [ "$TCP_NODE" != "nil" ]; then
local ipt_tmp=$ipt_n
@ -679,8 +686,9 @@ add_firewall_rule() {
if [ "$node" == "nil" ] || [ "$port" == "0" ]; then
msg="${msg} 未配置完全,略过"
elif [ "$(echo $node | grep ^tcp)" ]; then
eval "node=\${TCP_NODE}"
msg="${msg} 使用与 TCP 代理自动切换${num} 相同的节点,延后处理"
#eval "node=\${TCP_NODE}"
#msg="${msg} 使用与 TCP 代理自动切换${num} 相同的节点,延后处理"
continue
else
filter_node $node TCP > /dev/null 2>&1 &
filter_node $node UDP > /dev/null 2>&1 &
@ -724,6 +732,7 @@ add_firewall_rule() {
$ipt_m -A OUTPUT -p udp -j PSW_OUTPUT
[ "$UDP_NO_REDIR_PORTS" != "disable" ] && {
$ipt_m -A PSW_OUTPUT -p udp -m multiport --dport $UDP_NO_REDIR_PORTS -j RETURN
$ip6t_m -A PSW_OUTPUT -p udp -m multiport --dport $UDP_NO_REDIR_PORTS -j RETURN
echolog " - [$?]不代理 UDP 端口:$UDP_NO_REDIR_PORTS"
}
$ipt_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST) $(REDIRECT 1 MARK)

View File

@ -3,6 +3,8 @@
require 'luci.sys'
local luci = luci
local ucic = luci.model.uci.cursor()
local jsonc = require "luci.jsonc"
local i18n = require "luci.i18n"
local name = 'passwall'
local arg1 = arg[1]
@ -12,10 +14,14 @@ local gfwlist_update = 0
local chnroute_update = 0
local chnroute6_update = 0
local chnlist_update = 0
local geoip_update = 0
local geosite_update = 0
-- match comments/title/whitelist/ip address/excluded_domain
local comment_pattern = "^[!\\[@]+"
local ip_pattern = "^%d+%.%d+%.%d+%.%d+"
local ip4_ipset_pattern = "^%d+%.%d+%.%d+%.%d+[%/][%d]+$"
local ip6_ipset_pattern = ":-[%x]+%:+[%x]-[%/][%d]+$"
local domain_pattern = "([%w%-%_]+%.[%w%.%-%_]+)[%/%*]*"
local excluded_domain = {"apple.com","sina.cn","sina.com.cn","baidu.com","byr.cn","jlike.com","weibo.com","zhongsou.com","youdao.com","sogou.com","so.com","soso.com","aliyun.com","taobao.com","jd.com","qq.com"}
@ -24,32 +30,13 @@ local mydnsip = '127.0.0.1'
local mydnsport = '7913'
local ipsetname = 'gfwlist'
-- custom url
local enable_custom_url = 1
local gfwlist_url = ucic:get_first(name, 'global_rules', "gfwlist_url", "https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt")
local chnroute_url = ucic:get_first(name, 'global_rules', "chnroute_url", "https://ispip.clang.cn/all_cn.txt")
local chnroute6_url = ucic:get_first(name, 'global_rules', "chnroute6_url", "https://ispip.clang.cn/all_cn_ipv6.txt")
local chnlist_url_1 = 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf'
local chnlist_url_2 = 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf'
local chnlist_url_3 = 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf'
local bc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- base64decoding
local function base64_dec(data)
data = string.gsub(data, '[^'..bc..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(bc:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string.char(c)
end))
end
local chnlist_url = ucic:get(name, "@global_rules[0]", "chnlist_url") or {"https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf","https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf","https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf"}
local geoip_api = "https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest"
local geosite_api = "https://api.github.com/repos/Loyalsoldier/v2ray-rules-dat/releases/latest"
local xray_asset_location = ucic:get_first(name, 'global_rules', "xray_location_asset", "/usr/share/xray/")
local log = function(...)
if arg1 then
@ -66,24 +53,29 @@ local log = function(...)
end
end
-- base64decoding
local function base64_dec(data)
local bc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
data = string.gsub(data, '[^'..bc..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(bc:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
return string.char(c)
end))
end
-- trim
local function trim(text)
if not text or text == "" then return "" end
return (string.gsub(text, "^%s*(.-)%s*$", "%1"))
end
-- wget
local function wget(url, file)
local cmd = "/usr/bin/wget --no-check-certificate -t 3 -T 10 -O"
if file then
cmd = cmd .. " " .. file .. " " .. url
else
cmd = cmd .. "- " .. url
end
local stdout = luci.sys.exec(cmd)
return trim(stdout)
end
-- curl
local function curl(url, file)
local cmd = "curl -skL -w %{http_code} --retry 3 --connect-timeout 3 '" .. url .. "'"
@ -99,52 +91,6 @@ local function curl(url, file)
end
end
--获取gfwlist
local function fetch_gfwlist()
--请求gfwlist
local sret = curl(gfwlist_url, "/tmp/gfwlist.txt")
if sret == 200 then
--解码gfwlist
local gfwlist = io.open("/tmp/gfwlist.txt", "r")
local decode = base64_dec(gfwlist:read("*all"))
gfwlist:close()
--写回gfwlist
gfwlist = io.open("/tmp/gfwlist.txt", "w")
gfwlist:write(decode)
gfwlist:close()
end
return sret;
end
--获取chnroute
local function fetch_chnroute()
--请求chnroute
local sret = curl(chnroute_url, "/tmp/chnroute_tmp")
return sret;
end
--获取chnroute6
local function fetch_chnroute6()
--请求chnroute6
local sret = curl(chnroute6_url, "/tmp/chnroute6_tmp")
return sret;
end
--获取chnlist
local function fetch_chnlist()
--请求chnlist
local sret = 0
local sret1 = curl(chnlist_url_1, "/tmp/chnlist_1")
local sret2 = curl(chnlist_url_2, "/tmp/chnlist_2")
local sret3 = curl(chnlist_url_3, "/tmp/chnlist_3")
if sret1 == 200 and sret2 ==200 and sret3 == 200 then
sret=200
end
return sret;
end
--check excluded domain
local function check_excluded_domain(value)
for k,v in ipairs(excluded_domain) do
@ -154,63 +100,219 @@ local function check_excluded_domain(value)
end
end
--gfwlist转码至dnsmasq格式
local function generate_gfwlist()
local domains = {}
local out = io.open("/tmp/gfwlist_tmp", "w")
--fetch gfwlist
local function fetch_gfwlist()
local sret = curl(gfwlist_url, "/tmp/gfwlist_dl")
if sret == 200 then
local domains = {}
local gfwlist = io.open("/tmp/gfwlist_dl", "r")
local decode = base64_dec(gfwlist:read("*all"))
gfwlist:close()
for line in io.lines("/tmp/gfwlist.txt") do
if not (string.find(line, comment_pattern) or string.find(line, ip_pattern) or check_excluded_domain(line)) then
local start, finish, match = string.find(line, domain_pattern)
if (start) then
domains[match] = true
gfwlist = io.open("/tmp/gfwlist_dl", "w")
gfwlist:write(decode)
gfwlist:close()
for line in io.lines("/tmp/gfwlist_dl") do
if not (string.find(line, comment_pattern) or string.find(line, ip_pattern) or check_excluded_domain(line)) then
local start, finish, match = string.find(line, domain_pattern)
if (start) then
domains[match] = true
end
end
end
local out = io.open("/tmp/gfwlist_tmp", "w")
for k,v in pairs(domains) do
out:write(string.format("server=/.%s/%s#%s\n", k,mydnsip,mydnsport))
out:write(string.format("ipset=/.%s/%s\n", k,ipsetname))
end
out:close()
end
for k,v in pairs(domains) do
out:write(string.format("server=/.%s/%s#%s\n", k,mydnsip,mydnsport))
out:write(string.format("ipset=/.%s/%s\n", k,ipsetname))
end
os.remove("/tmp/gfwlist_dl")
out:close()
return sret;
end
--处理合并chnlist列表
local function generate_chnlist()
--fetch chnroute
local function fetch_chnroute()
local sret = curl(chnroute_url, "/tmp/chnroute_dl")
if sret == 200 then
local out = io.open("/tmp/chnroute_tmp", "w")
for line in io.lines("/tmp/chnroute_dl") do
local start, finish, match = string.find(line, ip4_ipset_pattern)
if (start) then
out:write(string.format("%s\n", line))
end
end
out:close()
end
os.remove("/tmp/chnroute_dl")
return sret;
end
--fetch chnroute6
local function fetch_chnroute6()
local sret = curl(chnroute6_url, "/tmp/chnroute6_dl")
if sret == 200 then
local out = io.open("/tmp/chnroute6_tmp", "w")
for line in io.lines("/tmp/chnroute6_dl") do
local start, finish, match = string.find(line, ip6_ipset_pattern)
if (start) then
out:write(string.format("%s\n", line))
end
end
out:close()
end
os.remove("/tmp/chnroute6_dl")
return sret;
end
--fetch chnlist
local function fetch_chnlist()
local domains = {}
local out = io.open("/tmp/cdn_tmp", "w")
local sret = 200
local sret_tmp = 0
for line in io.lines("/tmp/chnlist_1") do
local start, finish, match = string.find(line, domain_pattern)
if (start) then
domains[match] = true
for k,v in ipairs(chnlist_url) do
sret_tmp = curl(v, "/tmp/chnlist_dl"..k)
if sret_tmp == 200 then
for line in io.lines("/tmp/chnlist_dl"..k) do
local start, finish, match = string.find(line, domain_pattern)
if (start) then
domains[match] = true
end
end
else
sret = 0
end
os.remove("/tmp/chnlist_dl"..k)
end
for line in io.lines("/tmp/chnlist_2") do
local start, finish, match = string.find(line, domain_pattern)
if (start) then
domains[match] = true
if sret == 200 then
local out = io.open("/tmp/cdn_tmp", "w")
for k,v in pairs(domains) do
out:write(string.format("%s\n", k))
end
out:close()
luci.sys.call("cat /tmp/cdn_tmp | sort -u > /tmp/chnlist_tmp")
os.remove("/tmp/cdn_tmp")
end
for line in io.lines("/tmp/chnlist_3") do
local start, finish, match = string.find(line, domain_pattern)
if (start) then
domains[match] = true
return sret;
end
--获取geoip
local function fetch_geoip()
--请求geoip
xpcall(function()
local json_str = curl(geoip_api)
local json = jsonc.parse(json_str)
if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do
if v.name and v.name == "geoip.dat.sha256sum" then
local sret = curl(v.browser_download_url, "/tmp/geoip.dat.sha256sum")
if sret == 200 then
local f = io.open("/tmp/geoip.dat.sha256sum", "r")
local content = f:read()
f:close()
f = io.open("/tmp/geoip.dat.sha256sum", "w")
f:write(content:gsub("geoip.dat", "/tmp/geoip.dat"), "")
f:close()
if nixio.fs.access(xray_asset_location .. "geoip.dat") then
luci.sys.call(string.format("cp -f %s %s", xray_asset_location .. "geoip.dat", "/tmp/geoip.dat"))
if luci.sys.call('sha256sum -c /tmp/geoip.dat.sha256sum > /dev/null 2>&1') == 0 then
log("geoip 版本一致,无需更新。")
return 1
end
end
for _2, v2 in ipairs(json.assets) do
if v2.name and v2.name == "geoip.dat" then
sret = curl(v2.browser_download_url, "/tmp/geoip.dat")
if luci.sys.call('sha256sum -c /tmp/geoip.dat.sha256sum > /dev/null 2>&1') == 0 then
luci.sys.call(string.format("mkdir -p %s && cp -f %s %s", xray_asset_location, "/tmp/geoip.dat", xray_asset_location .. "geoip.dat"))
reboot = 1
log("geoip 更新成功。")
return 1
else
log("geoip 更新失败,请稍后再试。")
end
break
end
end
end
break
end
end
end
end
end,
function(e)
end)
--写入临时文件
for k,v in pairs(domains) do
out:write(string.format("%s\n", k))
end
return 0
end
out:close()
--获取geosite
local function fetch_geosite()
--请求geosite
xpcall(function()
local json_str = curl(geosite_api)
local json = jsonc.parse(json_str)
if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do
if v.name and v.name == "geosite.dat.sha256sum" then
local sret = curl(v.browser_download_url, "/tmp/geosite.dat.sha256sum")
if sret == 200 then
local f = io.open("/tmp/geosite.dat.sha256sum", "r")
local content = f:read()
f:close()
f = io.open("/tmp/geosite.dat.sha256sum", "w")
f:write(content:gsub("geosite.dat", "/tmp/geosite.dat"), "")
f:close()
--删除重复条目并排序
luci.sys.call("cat /tmp/cdn_tmp | sort -u > /tmp/chnlist_tmp")
if nixio.fs.access(xray_asset_location .. "geosite.dat") then
luci.sys.call(string.format("cp -f %s %s", xray_asset_location .. "geosite.dat", "/tmp/geosite.dat"))
if luci.sys.call('sha256sum -c /tmp/geosite.dat.sha256sum > /dev/null 2>&1') == 0 then
log("geosite 版本一致,无需更新。")
return 1
end
end
for _2, v2 in ipairs(json.assets) do
if v2.name and v2.name == "geosite.dat" then
sret = curl(v2.browser_download_url, "/tmp/geosite.dat")
if luci.sys.call('sha256sum -c /tmp/geosite.dat.sha256sum > /dev/null 2>&1') == 0 then
luci.sys.call(string.format("mkdir -p %s && cp -f %s %s", xray_asset_location, "/tmp/geosite.dat", xray_asset_location .. "geosite.dat"))
reboot = 1
log("geosite 更新成功。")
return 1
else
log("geosite 更新失败,请稍后再试。")
end
break
end
end
end
break
end
end
end
end,
function(e)
end)
return 0
end
if arg[2] then
@ -226,117 +328,128 @@ if arg[2] then
if arg[2]:find("chnlist") then
chnlist_update = 1
end
if arg[2]:find("geoip") then
geoip_update = 1
end
if arg[2]:find("geosite") then
geosite_update = 1
end
else
gfwlist_update = ucic:get_first(name, 'global_rules', "gfwlist_update", 1)
chnroute_update = ucic:get_first(name, 'global_rules', "chnroute_update", 1)
chnroute6_update = ucic:get_first(name, 'global_rules', "chnroute6_update", 1)
chnlist_update = ucic:get_first(name, 'global_rules', "chnlist_update", 1)
geoip_update = ucic:get_first(name, 'global_rules', "geoip_update", 1)
geosite_update = ucic:get_first(name, 'global_rules', "geosite_update", 1)
end
if gfwlist_update == 0 and chnroute_update == 0 and chnroute6_update == 0 and chnlist_update == 0 then
if gfwlist_update == 0 and chnroute_update == 0 and chnroute6_update == 0 and chnlist_update == 0 and geoip_update == 0 and geosite_update == 0 then
os.exit(0)
end
log("开始更新规则...")
if tonumber(enable_custom_url) == 1 then
local new_version = os.date("%Y-%m-%d")
log("已启用自定义规则地址...")
if tonumber(gfwlist_update) == 1 then
log("开始更新gfwlist...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/gfwlist.conf | awk '{print $1}')")
local status = fetch_gfwlist()
if status == 200 then
generate_gfwlist()
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/gfwlist_tmp' ] && md5sum /tmp/gfwlist_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/gfwlist_tmp " .. rule_path .. "/gfwlist.conf")
ucic:set(name, ucic:get_first(name, 'global_rules'), "gfwlist_version", new_version)
reboot = 1
log("更新gfwlist成功...")
else
log("gfwlist版本一致不用更新。")
end
if tonumber(gfwlist_update) == 1 then
log("gfwlist 开始更新...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/gfwlist.conf | awk '{print $1}')")
local status = fetch_gfwlist()
if status == 200 then
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/gfwlist_tmp' ] && md5sum /tmp/gfwlist_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/gfwlist_tmp " .. rule_path .. "/gfwlist.conf")
reboot = 1
log("gfwlist 更新成功...")
else
log("gfwlist文件下载失败!")
log("gfwlist 版本一致,无需更新。")
end
os.remove("/tmp/gfwlist.txt")
os.remove("/tmp/gfwlist_tmp")
else
log("gfwlist 文件下载失败!")
end
if tonumber(chnroute_update) == 1 then
log("开始更新chnroute...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/chnroute | awk '{print $1}')")
local status = fetch_chnroute()
if status == 200 then
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/chnroute_tmp' ] && md5sum /tmp/chnroute_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/chnroute_tmp " .. rule_path .. "/chnroute")
ucic:set(name, ucic:get_first(name, 'global_rules'), "chnroute_version", new_version)
reboot = 1
log("更新chnroute成功...")
else
log("chnroute版本一致不用更新。")
end
os.remove("/tmp/gfwlist_tmp")
end
if tonumber(chnroute_update) == 1 then
log("chnroute 开始更新...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/chnroute | awk '{print $1}')")
local status = fetch_chnroute()
if status == 200 then
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/chnroute_tmp' ] && md5sum /tmp/chnroute_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/chnroute_tmp " .. rule_path .. "/chnroute")
reboot = 1
log("chnroute 更新成功...")
else
log("chnroute文件下载失败!")
log("chnroute 版本一致,无需更新。")
end
os.remove("/tmp/chnroute_tmp")
else
log("chnroute 文件下载失败!")
end
os.remove("/tmp/chnroute_tmp")
end
if tonumber(chnroute6_update) == 1 then
log("chnroute6 开始更新...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/chnroute6 | awk '{print $1}')")
local status = fetch_chnroute6()
if status == 200 then
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/chnroute6_tmp' ] && md5sum /tmp/chnroute6_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/chnroute6_tmp " .. rule_path .. "/chnroute6")
reboot = 1
log("chnroute6 更新成功...")
else
log("chnroute6 版本一致,无需更新。")
end
else
log("chnroute6 文件下载失败!")
end
os.remove("/tmp/chnroute6_tmp")
end
if tonumber(chnlist_update) == 1 then
log("chnlist 开始更新...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/chnlist | awk '{print $1}')")
local status = fetch_chnlist()
if status == 200 then
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/chnlist_tmp' ] && md5sum /tmp/chnlist_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/chnlist_tmp " .. rule_path .. "/chnlist")
reboot = 1
log("chnlist 更新成功...")
else
log("chnlist 版本一致,无需更新。")
end
else
log("chnlist 文件下载失败!")
end
if tonumber(chnroute6_update) == 1 then
log("开始更新chnroute6...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/chnroute6 | awk '{print $1}')")
local status = fetch_chnroute6()
if status == 200 then
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/chnroute6_tmp' ] && md5sum /tmp/chnroute6_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/chnroute6_tmp " .. rule_path .. "/chnroute6")
ucic:set(name, ucic:get_first(name, 'global_rules'), "chnroute6_version", new_version)
reboot = 1
log("更新chnroute6成功...")
else
log("chnroute6版本一致不用更新。")
end
else
log("chnroute6文件下载失败")
end
os.remove("/tmp/chnroute6_tmp")
end
if tonumber(chnlist_update) == 1 then
log("开始更新chnlist...")
local old_md5 = luci.sys.exec("echo -n $(md5sum " .. rule_path .. "/chnlist | awk '{print $1}')")
local status = fetch_chnlist()
if status == 200 then
generate_chnlist()
local new_md5 = luci.sys.exec("echo -n $([ -f '/tmp/chnlist_tmp' ] && md5sum /tmp/chnlist_tmp | awk '{print $1}')")
if old_md5 ~= new_md5 then
luci.sys.exec("mv -f /tmp/chnlist_tmp " .. rule_path .. "/chnlist")
ucic:set(name, ucic:get_first(name, 'global_rules'), "chnlist_version", new_version)
reboot = 1
log("更新chnlist成功...")
else
log("chnlist版本一致不用更新。")
end
else
log("chnlist文件下载失败")
end
os.remove("/tmp/chnlist_1")
os.remove("/tmp/chnlist_2")
os.remove("/tmp/chnlist_3")
os.remove("/tmp/cdn_tmp")
os.remove("/tmp/chnlist_tmp")
end
os.remove("/tmp/chnlist_tmp")
end
if tonumber(geoip_update) == 1 then
log("geoip 开始更新...")
local status = fetch_geoip()
os.remove("/tmp/geoip.dat")
os.remove("/tmp/geoip.dat.sha256sum")
end
if tonumber(geosite_update) == 1 then
log("geosite 开始更新...")
local status = fetch_geosite()
os.remove("/tmp/geosite.dat")
os.remove("/tmp/geosite.dat.sha256sum")
end
ucic:set(name, ucic:get_first(name, 'global_rules'), "gfwlist_update", gfwlist_update)
ucic:set(name, ucic:get_first(name, 'global_rules'), "chnroute_update", chnroute_update)
ucic:set(name, ucic:get_first(name, 'global_rules'), "chnroute6_update", chnroute6_update)
ucic:set(name, ucic:get_first(name, 'global_rules'), "chnlist_update", chnlist_update)
ucic:set(name, ucic:get_first(name, 'global_rules'), "geoip_update", geoip_update)
ucic:set(name, ucic:get_first(name, 'global_rules'), "geosite_update", geosite_update)
ucic:save(name)
luci.sys.call("uci commit " .. name)
if reboot == 1 then
log("重启服务,应用新的规则。")
luci.sys.call("/usr/share/" .. name .. "/iptables.sh flush_ipset && /etc/init.d/" .. name .. " restart")
luci.sys.call("/usr/share/" .. name .. "/iptables.sh flush_ipset && /etc/init.d/" .. name .. " restart")
end
log("规则脚本执行完毕...")
log("规则更新完毕...")

View File

@ -4128,6 +4128,7 @@
103.162.10.0/23
103.162.32.0/23
103.162.38.0/23
103.162.116.0/23
103.192.0.0/22
103.192.4.0/22
103.192.8.0/22

View File

@ -1769,6 +1769,7 @@
2407:cc0::/32
2407:f40::/32
2407:1180::/32
2407:17c0::/32
2407:1900::/32
2407:1d00::/32
2407:1e80::/32

View File

@ -85,9 +85,6 @@ config BUSYBOX_DEFAULT_FEATURE_SYSLOG_INFO
config BUSYBOX_DEFAULT_FEATURE_SYSLOG
bool
default y
config BUSYBOX_DEFAULT_PLATFORM_LINUX
bool
default y
config BUSYBOX_DEFAULT_STATIC
bool
default n
@ -130,6 +127,9 @@ config BUSYBOX_DEFAULT_USE_PORTABLE_CODE
config BUSYBOX_DEFAULT_STACK_OPTIMIZATION_386
bool
default n
config BUSYBOX_DEFAULT_STATIC_LIBGCC
bool
default n
config BUSYBOX_DEFAULT_INSTALL_APPLET_SYMLINKS
bool
default y
@ -169,6 +169,9 @@ config BUSYBOX_DEFAULT_UNIT_TEST
config BUSYBOX_DEFAULT_WERROR
bool
default n
config BUSYBOX_DEFAULT_WARN_SIMPLE_MSG
bool
default n
config BUSYBOX_DEFAULT_NO_DEBUG_LIB
bool
default y
@ -872,6 +875,9 @@ config BUSYBOX_DEFAULT_USLEEP
config BUSYBOX_DEFAULT_UUDECODE
bool
default n
config BUSYBOX_DEFAULT_BASE32
bool
default n
config BUSYBOX_DEFAULT_BASE64
bool
default n
@ -1160,6 +1166,9 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_QUIT
config BUSYBOX_DEFAULT_FEATURE_FIND_DELETE
bool
default n
config BUSYBOX_DEFAULT_FEATURE_FIND_EMPTY
bool
default n
config BUSYBOX_DEFAULT_FEATURE_FIND_PATH
bool
default y
@ -1565,9 +1574,6 @@ config BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG
config BUSYBOX_DEFAULT_HEXDUMP
bool
default y
config BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE
bool
default n
config BUSYBOX_DEFAULT_HD
bool
default n
@ -1778,6 +1784,9 @@ config BUSYBOX_DEFAULT_TASKSET
config BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY
bool
default n
config BUSYBOX_DEFAULT_FEATURE_TASKSET_CPULIST
bool
default n
config BUSYBOX_DEFAULT_UEVENT
bool
default n
@ -1814,6 +1823,9 @@ config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS
config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_CRAMFS
bool
default n
config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EROFS
bool
default n
config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXFAT
bool
default n
@ -2096,6 +2108,9 @@ config BUSYBOX_DEFAULT_MAN
config BUSYBOX_DEFAULT_MICROCOM
bool
default n
config BUSYBOX_DEFAULT_MIM
bool
default n
config BUSYBOX_DEFAULT_MT
bool
default n
@ -2268,6 +2283,18 @@ config BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY
config BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP
bool
default n
config BUSYBOX_DEFAULT_FEATURE_HTTPD_ETAG
bool
default n
config BUSYBOX_DEFAULT_FEATURE_HTTPD_LAST_MODIFIED
bool
default n
config BUSYBOX_DEFAULT_FEATURE_HTTPD_DATE
bool
default n
config BUSYBOX_DEFAULT_FEATURE_HTTPD_ACL_IP
bool
default n
config BUSYBOX_DEFAULT_IFCONFIG
bool
default y
@ -2892,6 +2919,9 @@ config BUSYBOX_DEFAULT_BASH_IS_HUSH
config BUSYBOX_DEFAULT_BASH_IS_NONE
bool
default y
config BUSYBOX_DEFAULT_SHELL_ASH
bool
default y
config BUSYBOX_DEFAULT_ASH
bool
default y
@ -2952,6 +2982,9 @@ config BUSYBOX_DEFAULT_CTTYHACK
config BUSYBOX_DEFAULT_HUSH
bool
default n
config BUSYBOX_DEFAULT_SHELL_HUSH
bool
default n
config BUSYBOX_DEFAULT_HUSH_BASH_COMPAT
bool
default n
@ -3114,6 +3147,9 @@ config BUSYBOX_DEFAULT_FEATURE_SYSLOGD_DUP
config BUSYBOX_DEFAULT_FEATURE_SYSLOGD_CFG
bool
default n
config BUSYBOX_DEFAULT_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS
bool
default n
config BUSYBOX_DEFAULT_FEATURE_SYSLOGD_READ_BUFFER_SIZE
int
default 0

View File

@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=busybox
PKG_VERSION:=1.31.1
PKG_RELEASE:=7
PKG_VERSION:=1.33.0
PKG_RELEASE:=1
PKG_FLAGS:=essential
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://www.busybox.net/downloads \
http://sources.buildroot.net
PKG_HASH:=d0f940a72f648943c1f2211e0e3117387c31d765137d92bd8284a3fb9752a998
PKG_HASH:=d568681c91a85edc6710770cebc1e80e042ad74d305b5c2e6d57a5f3de3b8fbd
PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
PKG_BUILD_PARALLEL:=1

View File

@ -155,12 +155,13 @@ config BUSYBOX_CONFIG_FEATURE_PIDFILE
config BUSYBOX_CONFIG_PID_FILE_PATH
string "Directory for pidfiles"
default BUSYBOX_DEFAULT_PID_FILE_PATH
depends on BUSYBOX_CONFIG_FEATURE_PIDFILE
depends on BUSYBOX_CONFIG_FEATURE_PIDFILE || BUSYBOX_CONFIG_FEATURE_CROND_SPECIAL_TIMES
help
This is the default path where pidfiles are created. Applets which
allow you to set the pidfile path on the command line will override
this value. The option has no effect on applets that require you to
specify a pidfile path.
specify a pidfile path. When crond has the 'Support special times'
option enabled, the 'crond.reboot' file is also stored here.
config BUSYBOX_CONFIG_BUSYBOX
bool "Include busybox applet"
@ -310,7 +311,6 @@ config BUSYBOX_CONFIG_BUSYBOX_EXEC_PATH
config BUSYBOX_CONFIG_SELINUX
bool "Support NSA Security Enhanced Linux"
default BUSYBOX_DEFAULT_SELINUX
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Enable support for SELinux in applets ls, ps, and id. Also provide
the option of compiling in SELinux applets.
@ -356,17 +356,6 @@ config BUSYBOX_CONFIG_FEATURE_SYSLOG
#This option is auto-selected when you select any applet which may
#send its output to syslog. You do not need to select it manually.
config BUSYBOX_CONFIG_PLATFORM_LINUX
bool #No description makes it a hidden option
default BUSYBOX_DEFAULT_PLATFORM_LINUX
#help
#For the most part, busybox requires only POSIX compatibility
#from the target system, but some applets and features use
#Linux-specific interfaces.
#
#This is automatically selected if any applet or feature requires
#Linux-specific interfaces. You do not need to select it manually.
comment 'Build Options'
config BUSYBOX_CONFIG_STATIC
@ -539,6 +528,14 @@ config BUSYBOX_CONFIG_STACK_OPTIMIZATION_386
do not work with it (they use SSE instructions without
ensuring stack alignment).
config BUSYBOX_CONFIG_STATIC_LIBGCC
bool "Use -static-libgcc"
default BUSYBOX_DEFAULT_STATIC_LIBGCC
help
This option instructs gcc to link in a static version of its
support library, libgcc. This means that the binary will require
one fewer dynamic library at run time.
comment 'Installation Options ("make install" behavior)'
choice
@ -660,6 +657,19 @@ config BUSYBOX_CONFIG_WERROR
Most people should answer N.
config BUSYBOX_CONFIG_WARN_SIMPLE_MSG
bool "Warn about single parameter bb_xx_msg calls"
default BUSYBOX_DEFAULT_WARN_SIMPLE_MSG
help
This will cause warnings to be shown for any instances of
bb_error_msg(), bb_error_msg_and_die(), bb_perror_msg(),
bb_perror_msg_and_die(), bb_herror_msg() or bb_herror_msg_and_die()
being called with a single parameter. In these cases the equivalent
bb_simple_xx_msg function should be used instead.
Note that use of STRERROR_FMT may give false positives.
If you aren't developing busybox, say N here.
choice
prompt "Additional debugging library"
default BUSYBOX_CONFIG_NO_DEBUG_LIB

View File

@ -256,7 +256,7 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS
help
Enable support for compression levels 4-9. The default level
is 6. If levels 1-3 are specified, 4 is used.
If this option is not selected, -N options are ignored and -9
If this option is not selected, -N options are ignored and -6
is used.
config BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS

View File

@ -9,7 +9,6 @@ menu "Console Utilities"
config BUSYBOX_CONFIG_CHVT
bool "chvt (2 kb)"
default BUSYBOX_DEFAULT_CHVT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program is used to change to another terminal.
Example: chvt 4 (change to terminal /dev/tty4)
@ -21,39 +20,33 @@ config BUSYBOX_CONFIG_CLEAR
config BUSYBOX_CONFIG_DEALLOCVT
bool "deallocvt (1.9 kb)"
default BUSYBOX_DEFAULT_DEALLOCVT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program deallocates unused virtual consoles.
config BUSYBOX_CONFIG_DUMPKMAP
bool "dumpkmap (1.6 kb)"
default BUSYBOX_DEFAULT_DUMPKMAP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program dumps the kernel's keyboard translation table to
stdout, in binary format. You can then use loadkmap to load it.
config BUSYBOX_CONFIG_FGCONSOLE
bool "fgconsole (1.5 kb)"
default BUSYBOX_DEFAULT_FGCONSOLE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program prints active (foreground) console number.
config BUSYBOX_CONFIG_KBD_MODE
bool "kbd_mode (4.1 kb)"
default BUSYBOX_DEFAULT_KBD_MODE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program reports and sets keyboard mode.
config BUSYBOX_CONFIG_LOADFONT
bool "loadfont (5.2 kb)"
default BUSYBOX_DEFAULT_LOADFONT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program loads a console font from standard input.
config BUSYBOX_CONFIG_SETFONT
bool "setfont (24 kb)"
default BUSYBOX_DEFAULT_SETFONT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Allows to load console screen map. Useful for i18n.
@ -87,14 +80,12 @@ config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW
config BUSYBOX_CONFIG_LOADKMAP
bool "loadkmap (1.8 kb)"
default BUSYBOX_DEFAULT_LOADKMAP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program loads a keyboard translation table from
standard input.
config BUSYBOX_CONFIG_OPENVT
bool "openvt (7.2 kb)"
default BUSYBOX_DEFAULT_OPENVT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program is used to start a command on an unused
virtual terminal.
@ -123,7 +114,6 @@ config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT
config BUSYBOX_CONFIG_SETCONSOLE
bool "setconsole (3.6 kb)"
default BUSYBOX_DEFAULT_SETCONSOLE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Redirect writes to /dev/console to another device,
like the current tty while logged in via telnet.
@ -137,20 +127,17 @@ config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS
config BUSYBOX_CONFIG_SETKEYCODES
bool "setkeycodes (2.1 kb)"
default BUSYBOX_DEFAULT_SETKEYCODES
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program loads entries into the kernel's scancode-to-keycode
map, allowing unusual keyboards to generate usable keycodes.
config BUSYBOX_CONFIG_SETLOGCONS
bool "setlogcons (1.8 kb)"
default BUSYBOX_DEFAULT_SETLOGCONS
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This program redirects the output console of kernel messages.
config BUSYBOX_CONFIG_SHOWKEY
bool "showkey (4.7 kb)"
default BUSYBOX_DEFAULT_SHOWKEY
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Shows keys pressed.

View File

@ -110,12 +110,10 @@ config BUSYBOX_CONFIG_FEATURE_DATE_ISOFMT
Enable option (-I) to output an ISO-8601 compliant
date/time string.
# defaults to "no": stat's nanosecond field is a bit non-portable
config BUSYBOX_CONFIG_FEATURE_DATE_NANO
bool "Support %[num]N nanosecond format specifier"
default BUSYBOX_DEFAULT_FEATURE_DATE_NANO # syscall(__NR_clock_gettime)
default BUSYBOX_DEFAULT_FEATURE_DATE_NANO # stat's nanosecond field is a bit non-portable
depends on BUSYBOX_CONFIG_DATE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Support %[num]N format specifier. Adds ~250 bytes of code.
@ -636,7 +634,6 @@ config BUSYBOX_CONFIG_FEATURE_STAT_FILESYSTEM
bool "Enable display of filesystem status (-f)"
default BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM
depends on BUSYBOX_CONFIG_STAT
select BUSYBOX_CONFIG_PLATFORM_LINUX # statfs()
help
Without this, stat will not support the '-f' option to display
information about filesystem status.
@ -837,6 +834,11 @@ config BUSYBOX_CONFIG_UUDECODE
default BUSYBOX_DEFAULT_UUDECODE
help
uudecode is used to decode a uuencoded file.
config BUSYBOX_CONFIG_BASE32
bool "base32 (4.9 kb)"
default BUSYBOX_DEFAULT_BASE32
help
Base32 encode and decode
config BUSYBOX_CONFIG_BASE64
bool "base64 (4.9 kb)"
default BUSYBOX_DEFAULT_BASE64

View File

@ -21,7 +21,6 @@ config BUSYBOX_CONFIG_FSCK
config BUSYBOX_CONFIG_LSATTR
bool "lsattr (5.5 kb)"
default BUSYBOX_DEFAULT_LSATTR
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
lsattr lists the file attributes on a second extended file system.
config BUSYBOX_CONFIG_TUNE2FS

View File

@ -159,6 +159,14 @@ config BUSYBOX_CONFIG_FEATURE_FIND_DELETE
WARNING: This option can do much harm if used wrong. Busybox will not
try to protect the user from doing stupid things. Use with care.
config BUSYBOX_CONFIG_FEATURE_FIND_EMPTY
bool "Enable -empty: match empty files or directories"
default BUSYBOX_DEFAULT_FEATURE_FIND_EMPTY
depends on BUSYBOX_CONFIG_FIND
help
Support the 'find -empty' option to find empty regular files
or directories.
config BUSYBOX_CONFIG_FEATURE_FIND_PATH
bool "Enable -path: match pathname with shell pattern"
default BUSYBOX_DEFAULT_FEATURE_FIND_PATH

View File

@ -24,7 +24,6 @@ config BUSYBOX_CONFIG_RESUME
config BUSYBOX_CONFIG_RUN_INIT
bool "run-init (7.7 kb)"
default BUSYBOX_DEFAULT_RUN_INIT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The run-init utility is used from initramfs to select a new
root device. Under initramfs, you have to use this instead of

View File

@ -390,7 +390,6 @@ config BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE
config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE
bool "Use sendfile system call"
default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
When enabled, busybox will use the kernel sendfile() function
instead of read/write loops to copy data between file descriptors
@ -432,7 +431,6 @@ config BUSYBOX_CONFIG_FEATURE_SKIP_ROOTFS
config BUSYBOX_CONFIG_MONOTONIC_SYSCALL
bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
default BUSYBOX_DEFAULT_MONOTONIC_SYSCALL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
time intervals (time, ping, traceroute etc need this).

View File

@ -9,7 +9,6 @@ menu "Miscellaneous Utilities"
config BUSYBOX_CONFIG_ADJTIMEX
bool "adjtimex (4.7 kb)"
default BUSYBOX_DEFAULT_ADJTIMEX
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Adjtimex reads and optionally sets adjustment parameters for
the Linux clock adjustment algorithm.
@ -122,7 +121,6 @@ endif
config BUSYBOX_CONFIG_BEEP
bool "beep (2.4 kb)"
default BUSYBOX_DEFAULT_BEEP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The beep applets beeps in a given freq/Hz.
@ -210,7 +208,6 @@ config BUSYBOX_CONFIG_FEATURE_CHAT_CLR_ABORT
config BUSYBOX_CONFIG_CONSPY
bool "conspy (10 kb)"
default BUSYBOX_DEFAULT_CONSPY
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
A text-mode VNC like program for Linux virtual terminals.
example: conspy NUM shared access to console num
@ -276,7 +273,6 @@ config BUSYBOX_CONFIG_CRONTAB
config BUSYBOX_CONFIG_DEVFSD
bool "devfsd (obsolete)"
default BUSYBOX_DEFAULT_DEVFSD
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_FEATURE_SYSLOG
help
This is deprecated and should NOT be used anymore.
@ -319,7 +315,6 @@ config BUSYBOX_CONFIG_DEVFSD_VERBOSE
config BUSYBOX_CONFIG_FEATURE_DEVFS
bool "Use devfs names for all devices (obsolete)"
default BUSYBOX_DEFAULT_FEATURE_DEVFS
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
This is obsolete and should NOT be used anymore.
Use linux >= 2.6 (optionally with hotplug) and mdev instead!
@ -337,7 +332,6 @@ config BUSYBOX_CONFIG_DEVMEM
config BUSYBOX_CONFIG_FBSPLASH
bool "fbsplash (26 kb)"
default BUSYBOX_DEFAULT_FBSPLASH
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Shows splash image and progress bar on framebuffer device.
Can be used during boot phase of an embedded device.
@ -383,7 +377,6 @@ config BUSYBOX_CONFIG_FLASHCP
config BUSYBOX_CONFIG_HDPARM
bool "hdparm (25 kb)"
default BUSYBOX_DEFAULT_HDPARM
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Get/Set hard drive parameters. Primarily intended for ATA
drives.
@ -445,35 +438,30 @@ config BUSYBOX_CONFIG_HEXEDIT
config BUSYBOX_CONFIG_I2CGET
bool "i2cget (5.5 kb)"
default BUSYBOX_DEFAULT_I2CGET
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Read from I2C/SMBus chip registers.
config BUSYBOX_CONFIG_I2CSET
bool "i2cset (6.7 kb)"
default BUSYBOX_DEFAULT_I2CSET
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Set I2C registers.
config BUSYBOX_CONFIG_I2CDUMP
bool "i2cdump (7.1 kb)"
default BUSYBOX_DEFAULT_I2CDUMP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Examine I2C registers.
config BUSYBOX_CONFIG_I2CDETECT
bool "i2cdetect (7.1 kb)"
default BUSYBOX_DEFAULT_I2CDETECT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Detect I2C chips.
config BUSYBOX_CONFIG_I2CTRANSFER
bool "i2ctransfer (4.0 kb)"
default BUSYBOX_DEFAULT_I2CTRANSFER
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Send user-defined I2C messages in one transfer.
@ -587,7 +575,6 @@ config BUSYBOX_CONFIG_LOCK
config BUSYBOX_CONFIG_LSSCSI
bool "lsscsi (2.5 kb)"
default BUSYBOX_DEFAULT_LSSCSI
#select PLATFORM_LINUX
help
lsscsi is a utility for displaying information about SCSI buses in the
system and devices connected to them.
@ -634,6 +621,13 @@ config BUSYBOX_CONFIG_MICROCOM
default BUSYBOX_DEFAULT_MICROCOM
help
The poor man's minicom utility for chatting with serial port devices.
config BUSYBOX_CONFIG_MIM
bool "mim (0.5 kb)"
default BUSYBOX_DEFAULT_MIM
depends on BUSYBOX_CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS
help
Run a script from a Makefile-like specification file.
Unlike 'make' dependencies aren't supported.
config BUSYBOX_CONFIG_MT
bool "mt (2.5 kb)"
default BUSYBOX_DEFAULT_MT
@ -644,26 +638,22 @@ config BUSYBOX_CONFIG_MT
config BUSYBOX_CONFIG_NANDWRITE
bool "nandwrite (4.8 kb)"
default BUSYBOX_DEFAULT_NANDWRITE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Write to the specified MTD device, with bad blocks awareness
config BUSYBOX_CONFIG_NANDDUMP
bool "nanddump (5.2 kb)"
default BUSYBOX_DEFAULT_NANDDUMP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Dump the content of raw NAND chip
config BUSYBOX_CONFIG_PARTPROBE
bool "partprobe (3.5 kb)"
default BUSYBOX_DEFAULT_PARTPROBE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Ask kernel to rescan partition table.
config BUSYBOX_CONFIG_RAIDAUTORUN
bool "raidautorun (1.3 kb)"
default BUSYBOX_DEFAULT_RAIDAUTORUN
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
raidautorun tells the kernel md driver to
search and start RAID arrays.
@ -671,7 +661,6 @@ config BUSYBOX_CONFIG_READAHEAD
bool "readahead (1.5 kb)"
default BUSYBOX_DEFAULT_READAHEAD
depends on BUSYBOX_CONFIG_LFS
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Preload the files listed on the command line into RAM cache so that
subsequent reads on these files will not block on disk I/O.
@ -687,7 +676,6 @@ config BUSYBOX_CONFIG_READAHEAD
config BUSYBOX_CONFIG_RFKILL
bool "rfkill (4.4 kb)"
default BUSYBOX_DEFAULT_RFKILL # doesn't build on Ubuntu 9.04
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Enable/disable wireless devices.
@ -708,7 +696,6 @@ config BUSYBOX_CONFIG_RUNLEVEL
config BUSYBOX_CONFIG_RX
bool "rx (2.9 kb)"
default BUSYBOX_DEFAULT_RX
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Receive files using the Xmodem protocol.
config BUSYBOX_CONFIG_SETFATTR
@ -719,7 +706,6 @@ config BUSYBOX_CONFIG_SETFATTR
config BUSYBOX_CONFIG_SETSERIAL
bool "setserial (6.9 kb)"
default BUSYBOX_DEFAULT_SETSERIAL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Retrieve or set Linux serial port.
config BUSYBOX_CONFIG_STRINGS
@ -749,48 +735,41 @@ config BUSYBOX_CONFIG_TTYSIZE
config BUSYBOX_CONFIG_UBIATTACH
bool "ubiattach (4.2 kb)"
default BUSYBOX_DEFAULT_UBIATTACH
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Attach MTD device to an UBI device.
config BUSYBOX_CONFIG_UBIDETACH
bool "ubidetach (4.1 kb)"
default BUSYBOX_DEFAULT_UBIDETACH
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Detach MTD device from an UBI device.
config BUSYBOX_CONFIG_UBIMKVOL
bool "ubimkvol (5.3 kb)"
default BUSYBOX_DEFAULT_UBIMKVOL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Create a UBI volume.
config BUSYBOX_CONFIG_UBIRMVOL
bool "ubirmvol (4.9 kb)"
default BUSYBOX_DEFAULT_UBIRMVOL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Delete a UBI volume.
config BUSYBOX_CONFIG_UBIRSVOL
bool "ubirsvol (4.2 kb)"
default BUSYBOX_DEFAULT_UBIRSVOL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Resize a UBI volume.
config BUSYBOX_CONFIG_UBIUPDATEVOL
bool "ubiupdatevol (5.2 kb)"
default BUSYBOX_DEFAULT_UBIUPDATEVOL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Update a UBI volume.
config BUSYBOX_CONFIG_UBIRENAME
bool "ubirename (2.4 kb)"
default BUSYBOX_DEFAULT_UBIRENAME
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Utility to rename UBI volumes
config BUSYBOX_CONFIG_VOLNAME
@ -801,7 +780,6 @@ config BUSYBOX_CONFIG_VOLNAME
config BUSYBOX_CONFIG_WATCHDOG
bool "watchdog (5.3 kb)"
default BUSYBOX_DEFAULT_WATCHDOG
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The watchdog utility is used with hardware or software watchdog
device drivers. It opens the specified watchdog device special file

View File

@ -37,7 +37,6 @@ config BUSYBOX_CONFIG_MODPROBE_SMALL
config BUSYBOX_CONFIG_DEPMOD
bool "depmod (27 kb)"
default BUSYBOX_DEFAULT_DEPMOD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
depmod generates modules.dep (and potentially modules.alias
and modules.symbols) that contain dependency information
@ -45,13 +44,11 @@ config BUSYBOX_CONFIG_DEPMOD
config BUSYBOX_CONFIG_INSMOD
bool "insmod (22 kb)"
default BUSYBOX_DEFAULT_INSMOD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
insmod is used to load specified modules in the running kernel.
config BUSYBOX_CONFIG_LSMOD
bool "lsmod (1.9 kb)"
default BUSYBOX_DEFAULT_LSMOD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
lsmod is used to display a list of loaded modules.
@ -66,13 +63,11 @@ config BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT
config BUSYBOX_CONFIG_MODINFO
bool "modinfo (24 kb)"
default BUSYBOX_DEFAULT_MODINFO
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Show information about a Linux Kernel module
config BUSYBOX_CONFIG_MODPROBE
bool "modprobe (28 kb)"
default BUSYBOX_DEFAULT_MODPROBE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Handle the loading of modules, and their dependencies on a high
level.
@ -90,7 +85,6 @@ config BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST
config BUSYBOX_CONFIG_RMMOD
bool "rmmod (3.3 kb)"
default BUSYBOX_DEFAULT_RMMOD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
rmmod is used to unload specified modules from the kernel.

View File

@ -61,19 +61,16 @@ config BUSYBOX_CONFIG_FEATURE_TLS_SHA1
config BUSYBOX_CONFIG_ARP
bool "arp (10 kb)"
default BUSYBOX_DEFAULT_ARP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Manipulate the system ARP cache.
config BUSYBOX_CONFIG_ARPING
bool "arping (9 kb)"
default BUSYBOX_DEFAULT_ARPING
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Ping hosts by ARP packets.
config BUSYBOX_CONFIG_BRCTL
bool "brctl (4.7 kb)"
default BUSYBOX_DEFAULT_BRCTL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Manage ethernet bridges.
Supports addbr/delbr and addif/delif.
@ -104,7 +101,6 @@ config BUSYBOX_CONFIG_DNSD
config BUSYBOX_CONFIG_ETHER_WAKE
bool "ether-wake (4.9 kb)"
default BUSYBOX_DEFAULT_ETHER_WAKE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Send a magic packet to wake up sleeping machines.
config BUSYBOX_CONFIG_FTPD
@ -289,10 +285,47 @@ config BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP
help
Makes httpd send files using GZIP content encoding if the
client supports it and a pre-compressed <file>.gz exists.
config BUSYBOX_CONFIG_FEATURE_HTTPD_ETAG
bool "Support caching via ETag header"
default BUSYBOX_DEFAULT_FEATURE_HTTPD_ETAG
depends on BUSYBOX_CONFIG_HTTPD
help
If server responds with ETag then next time client (browser)
resend it via If-None-Match header.
Then httpd will check if file wasn't modified and if not,
return 304 Not Modified status code.
The ETag value is constructed from last modification date
in unix epoch, and size: "hex(last_mod)-hex(file_size)".
It's not completely reliable as hash functions but fair enough.
config BUSYBOX_CONFIG_FEATURE_HTTPD_LAST_MODIFIED
bool "Add Last-Modified header to response"
default BUSYBOX_DEFAULT_FEATURE_HTTPD_LAST_MODIFIED
depends on BUSYBOX_CONFIG_HTTPD
help
The Last-Modified header is used for cache validation.
The client sends last seen mtime to server in If-Modified-Since.
Both headers MUST be an RFC 1123 formatted, which is hard to parse.
Use ETag header instead.
config BUSYBOX_CONFIG_FEATURE_HTTPD_DATE
bool "Add Date header to response"
default BUSYBOX_DEFAULT_FEATURE_HTTPD_DATE
depends on BUSYBOX_CONFIG_HTTPD
help
RFC2616 says that server MUST add Date header to response.
But it is almost useless and can be omitted.
config BUSYBOX_CONFIG_FEATURE_HTTPD_ACL_IP
bool "ACL IP"
default BUSYBOX_DEFAULT_FEATURE_HTTPD_ACL_IP
depends on BUSYBOX_CONFIG_HTTPD
help
Support IP deny/allow rules
config BUSYBOX_CONFIG_IFCONFIG
bool "ifconfig (12 kb)"
default BUSYBOX_DEFAULT_IFCONFIG
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Ifconfig is used to configure the kernel-resident network interfaces.
@ -339,14 +372,12 @@ config BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS
config BUSYBOX_CONFIG_IFENSLAVE
bool "ifenslave (13 kb)"
default BUSYBOX_DEFAULT_IFENSLAVE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Userspace application to bind several interfaces
to a logical interface (use with kernel bonding driver).
config BUSYBOX_CONFIG_IFPLUGD
bool "ifplugd (10 kb)"
default BUSYBOX_DEFAULT_IFPLUGD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Network interface plug detection daemon.
config BUSYBOX_CONFIG_IFUP
@ -498,7 +529,6 @@ config BUSYBOX_CONFIG_FEATURE_INETD_RPC
config BUSYBOX_CONFIG_IP
bool "ip (35 kb)"
default BUSYBOX_DEFAULT_IP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The "ip" applet is a TCP/IP interface configuration and routing
utility.
@ -510,7 +540,6 @@ config BUSYBOX_CONFIG_IPADDR
bool "ipaddr (14 kb)"
default BUSYBOX_DEFAULT_IPADDR
select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Short form of "ip addr"
@ -518,7 +547,6 @@ config BUSYBOX_CONFIG_IPLINK
bool "iplink (17 kb)"
default BUSYBOX_DEFAULT_IPLINK
select BUSYBOX_CONFIG_FEATURE_IP_LINK
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Short form of "ip link"
@ -526,7 +554,6 @@ config BUSYBOX_CONFIG_IPROUTE
bool "iproute (15 kb)"
default BUSYBOX_DEFAULT_IPROUTE
select BUSYBOX_CONFIG_FEATURE_IP_ROUTE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Short form of "ip route"
@ -534,7 +561,6 @@ config BUSYBOX_CONFIG_IPTUNNEL
bool "iptunnel (9.6 kb)"
default BUSYBOX_DEFAULT_IPTUNNEL
select BUSYBOX_CONFIG_FEATURE_IP_TUNNEL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Short form of "ip tunnel"
@ -542,7 +568,6 @@ config BUSYBOX_CONFIG_IPRULE
bool "iprule (10 kb)"
default BUSYBOX_DEFAULT_IPRULE
select BUSYBOX_CONFIG_FEATURE_IP_RULE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Short form of "ip rule"
@ -550,7 +575,6 @@ config BUSYBOX_CONFIG_IPNEIGH
bool "ipneigh (8.3 kb)"
default BUSYBOX_DEFAULT_IPNEIGH
select BUSYBOX_CONFIG_FEATURE_IP_NEIGH
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Short form of "ip neigh"
@ -641,7 +665,6 @@ config BUSYBOX_CONFIG_FAKEIDENTD
config BUSYBOX_CONFIG_NAMEIF
bool "nameif (6.6 kb)"
default BUSYBOX_DEFAULT_NAMEIF
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_FEATURE_SYSLOG
help
nameif is used to rename network interface by its MAC address.
@ -718,7 +741,6 @@ config BUSYBOX_CONFIG_NETMSG
config BUSYBOX_CONFIG_NETSTAT
bool "netstat (10 kb)"
default BUSYBOX_DEFAULT_NETSTAT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
netstat prints information about the Linux networking subsystem.
@ -768,7 +790,6 @@ config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS
config BUSYBOX_CONFIG_NTPD
bool "ntpd (22 kb)"
default BUSYBOX_DEFAULT_NTPD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The NTP client/server daemon.
@ -795,7 +816,6 @@ config BUSYBOX_CONFIG_FEATURE_NTP_AUTH
config BUSYBOX_CONFIG_PING
bool "ping (10 kb)"
default BUSYBOX_DEFAULT_PING
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to
elicit an ICMP ECHO_RESPONSE from a host or gateway.
@ -823,13 +843,11 @@ config BUSYBOX_CONFIG_PSCAN
config BUSYBOX_CONFIG_ROUTE
bool "route (8.7 kb)"
default BUSYBOX_DEFAULT_ROUTE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Route displays or manipulates the kernel's IP routing tables.
config BUSYBOX_CONFIG_SLATTACH
bool "slattach (6.2 kb)"
default BUSYBOX_DEFAULT_SLATTACH
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
slattach configures serial line as SLIP network interface.
config BUSYBOX_CONFIG_SSL_CLIENT
@ -1029,7 +1047,6 @@ config BUSYBOX_CONFIG_TLS
config BUSYBOX_CONFIG_TRACEROUTE
bool "traceroute (11 kb)"
default BUSYBOX_DEFAULT_TRACEROUTE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Utility to trace the route of IP packets.
@ -1055,7 +1072,6 @@ config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_USE_ICMP
config BUSYBOX_CONFIG_TUNCTL
bool "tunctl (6.2 kb)"
default BUSYBOX_DEFAULT_TUNCTL
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
tunctl creates or deletes tun devices.
@ -1069,7 +1085,6 @@ config BUSYBOX_CONFIG_FEATURE_TUNCTL_UG
config BUSYBOX_CONFIG_VCONFIG
bool "vconfig (2.3 kb)"
default BUSYBOX_DEFAULT_VCONFIG
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Creates, removes, and configures VLAN interfaces
config BUSYBOX_CONFIG_WGET
@ -1154,6 +1169,9 @@ config BUSYBOX_CONFIG_FEATURE_WGET_HTTPS
patches, but do want to waste bandwidth expaining how wrong
it is, you will be ignored.
FEATURE_WGET_OPENSSL does implement TLS verification
using the certificates available to OpenSSL.
config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL
bool "Try to connect to HTTPS using openssl"
default BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL
@ -1178,6 +1196,9 @@ config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL
If openssl can't be executed, internal TLS code will be used
(if you enabled it); if openssl can be executed but fails later,
wget can't detect this, and download will fail.
By default TLS verification is performed, unless
--no-check-certificate option is passed.
config BUSYBOX_CONFIG_WHOIS
bool "whois (6.3 kb)"
default BUSYBOX_DEFAULT_WHOIS
@ -1186,7 +1207,6 @@ config BUSYBOX_CONFIG_WHOIS
config BUSYBOX_CONFIG_ZCIP
bool "zcip (8.4 kb)"
default BUSYBOX_DEFAULT_ZCIP
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_FEATURE_SYSLOG
help
ZCIP provides ZeroConf IPv4 address selection, according to RFC 3927.

View File

@ -7,7 +7,6 @@
config BUSYBOX_CONFIG_UDHCPD
bool "udhcpd (21 kb)"
default BUSYBOX_DEFAULT_UDHCPD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
udhcpd is a DHCP server geared primarily toward embedded systems,
while striving to be fully functional and RFC compliant.
@ -63,7 +62,6 @@ config BUSYBOX_CONFIG_DHCPRELAY
config BUSYBOX_CONFIG_UDHCPC
bool "udhcpc (24 kb)"
default BUSYBOX_DEFAULT_UDHCPC
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
udhcpc is a DHCP client geared primarily toward embedded systems,
while striving to be fully functional and RFC compliant.

View File

@ -9,7 +9,6 @@ menu "Process Utilities"
config BUSYBOX_CONFIG_FREE
bool "free (3.1 kb)"
default BUSYBOX_DEFAULT_FREE
select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo()
help
free displays the total amount of free and used physical and swap
memory in the system, as well as the buffers used by the kernel.
@ -144,7 +143,6 @@ config BUSYBOX_CONFIG_FEATURE_PS_TIME
bool "Enable -o time and -o etime specifiers"
default BUSYBOX_DEFAULT_FEATURE_PS_TIME
depends on (BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_MINIPS) && BUSYBOX_CONFIG_DESKTOP
select BUSYBOX_CONFIG_PLATFORM_LINUX
config BUSYBOX_CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS
bool "Support Linux prior to 2.4.0 and non-ELF systems"
@ -243,7 +241,6 @@ config BUSYBOX_CONFIG_FEATURE_TOPMEM
config BUSYBOX_CONFIG_UPTIME
bool "uptime (3.7 kb)"
default BUSYBOX_DEFAULT_UPTIME
select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo()
help
uptime gives a one line display of the current time, how long
the system has been running, how many users are currently logged

View File

@ -18,6 +18,7 @@ choice
config BUSYBOX_CONFIG_SH_IS_ASH
depends on !BUSYBOX_CONFIG_NOMMU
bool "ash"
select BUSYBOX_CONFIG_SHELL_ASH
help
Choose ash to be the shell executed by 'sh' name.
The ash code will be built into busybox. If you don't select
@ -26,6 +27,7 @@ config BUSYBOX_CONFIG_SH_IS_ASH
config BUSYBOX_CONFIG_SH_IS_HUSH
bool "hush"
select BUSYBOX_CONFIG_SHELL_HUSH
help
Choose hush to be the shell executed by 'sh' name.
The hush code will be built into busybox. If you don't select
@ -58,6 +60,7 @@ choice
config BUSYBOX_CONFIG_BASH_IS_ASH
depends on !BUSYBOX_CONFIG_NOMMU
bool "ash"
select BUSYBOX_CONFIG_SHELL_ASH
help
Choose ash to be the shell executed by 'bash' name.
The ash code will be built into busybox. If you don't select
@ -66,6 +69,7 @@ config BUSYBOX_CONFIG_BASH_IS_ASH
config BUSYBOX_CONFIG_BASH_IS_HUSH
bool "hush"
select BUSYBOX_CONFIG_SHELL_HUSH
help
Choose hush to be the shell executed by 'bash' name.
The hush code will be built into busybox. If you don't select
@ -78,10 +82,15 @@ config BUSYBOX_CONFIG_BASH_IS_NONE
endchoice
config BUSYBOX_CONFIG_SHELL_ASH
bool #hidden option
depends on !BUSYBOX_CONFIG_NOMMU
config BUSYBOX_CONFIG_ASH
bool "ash (78 kb)"
default BUSYBOX_DEFAULT_ASH
depends on !BUSYBOX_CONFIG_NOMMU
select BUSYBOX_CONFIG_SHELL_ASH
help
The most complete and most pedantically correct shell included with
busybox. This shell is actually a derivative of the Debian 'dash'
@ -91,17 +100,17 @@ config BUSYBOX_CONFIG_ASH
# ash options
# note: Don't remove !NOMMU part in the next line; it would break
# menuconfig's indenting.
if !NOMMU && (BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH)
if !NOMMU && (BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH)
config BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE
bool "Optimize for size instead of speed"
default BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_INTERNAL_GLOB
bool "Use internal glob() implementation"
default BUSYBOX_DEFAULT_ASH_INTERNAL_GLOB # Y is bigger, but because of uclibc glob() bug, let Y be default for now
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
help
Do not use glob() function from libc, use internal implementation.
Use this if you are getting "glob.h: No such file or directory"
@ -112,7 +121,7 @@ config BUSYBOX_CONFIG_ASH_INTERNAL_GLOB
config BUSYBOX_CONFIG_ASH_BASH_COMPAT
bool "bash-compatible extensions"
default BUSYBOX_DEFAULT_ASH_BASH_COMPAT
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_BASH_SOURCE_CURDIR
bool "'source' and '.' builtins search current directory after $PATH"
@ -133,17 +142,17 @@ config BUSYBOX_CONFIG_ASH_BASH_NOT_FOUND_HOOK
config BUSYBOX_CONFIG_ASH_JOB_CONTROL
bool "Job control"
default BUSYBOX_DEFAULT_ASH_JOB_CONTROL
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_ALIAS
bool "Alias support"
default BUSYBOX_DEFAULT_ASH_ALIAS
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
bool "Pseudorandom generator and $RANDOM variable"
default BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
help
Enable pseudorandom generator and dynamic variable "$RANDOM".
Each read of "$RANDOM" will generate a new pseudorandom value.
@ -154,7 +163,7 @@ config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT
config BUSYBOX_CONFIG_ASH_EXPAND_PRMT
bool "Expand prompt string"
default BUSYBOX_DEFAULT_ASH_EXPAND_PRMT
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
help
$PS# may contain volatile content, such as backquote commands.
This option recreates the prompt string from the environment
@ -163,14 +172,14 @@ config BUSYBOX_CONFIG_ASH_EXPAND_PRMT
config BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT
bool "Idle timeout variable $TMOUT"
default BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
help
Enable bash-like auto-logout after $TMOUT seconds of idle time.
config BUSYBOX_CONFIG_ASH_MAIL
bool "Check for new mail in interactive shell"
default BUSYBOX_DEFAULT_ASH_MAIL
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
help
Enable "check for new mail" function:
if set, $MAIL file and $MAILPATH list of files
@ -180,32 +189,32 @@ config BUSYBOX_CONFIG_ASH_MAIL
config BUSYBOX_CONFIG_ASH_ECHO
bool "echo builtin"
default BUSYBOX_DEFAULT_ASH_ECHO
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_PRINTF
bool "printf builtin"
default BUSYBOX_DEFAULT_ASH_PRINTF
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_TEST
bool "test builtin"
default BUSYBOX_DEFAULT_ASH_TEST
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_HELP
bool "help builtin"
default BUSYBOX_DEFAULT_ASH_HELP
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_GETOPTS
bool "getopts builtin"
default BUSYBOX_DEFAULT_ASH_GETOPTS
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
config BUSYBOX_CONFIG_ASH_CMDCMD
bool "command builtin"
default BUSYBOX_DEFAULT_ASH_CMDCMD
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH
depends on BUSYBOX_CONFIG_SHELL_ASH
help
Enable support for the 'command' builtin, which allows
you to run the specified command or builtin,
@ -258,6 +267,7 @@ config BUSYBOX_CONFIG_CTTYHACK
config BUSYBOX_CONFIG_HUSH
bool "hush (68 kb)"
default BUSYBOX_DEFAULT_HUSH
select BUSYBOX_CONFIG_SHELL_HUSH
help
hush is a small shell. It handles the normal flow control
constructs such as if/then/elif/else/fi, for/in/do/done, while loops,
@ -269,10 +279,18 @@ config BUSYBOX_CONFIG_HUSH
It does not handle select, aliases, tilde expansion,
&>file and >&file redirection of stdout+stderr.
config BUSYBOX_CONFIG_SHELL_HUSH
bool "Internal shell for embedded script support"
default BUSYBOX_DEFAULT_SHELL_HUSH
# hush options
# It's only needed to get "nice" menuconfig indenting.
if SHELL_HUSH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
config BUSYBOX_CONFIG_HUSH_BASH_COMPAT
bool "bash-compatible extensions"
default BUSYBOX_DEFAULT_HUSH_BASH_COMPAT
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_BRACE_EXPANSION
bool "Brace expansion"
@ -296,7 +314,7 @@ config BUSYBOX_CONFIG_HUSH_BASH_SOURCE_CURDIR
config BUSYBOX_CONFIG_HUSH_INTERACTIVE
bool "Interactive mode"
default BUSYBOX_DEFAULT_HUSH_INTERACTIVE
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
help
Enable interactive mode (prompt and command editing).
Without this, hush simply reads and executes commands
@ -322,31 +340,31 @@ config BUSYBOX_CONFIG_HUSH_JOB
config BUSYBOX_CONFIG_HUSH_TICK
bool "Support command substitution"
default BUSYBOX_DEFAULT_HUSH_TICK
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
help
Enable `command` and $(command).
config BUSYBOX_CONFIG_HUSH_IF
bool "Support if/then/elif/else/fi"
default BUSYBOX_DEFAULT_HUSH_IF
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_LOOPS
bool "Support for, while and until loops"
default BUSYBOX_DEFAULT_HUSH_LOOPS
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_CASE
bool "Support case ... esac statement"
default BUSYBOX_DEFAULT_HUSH_CASE
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
help
Enable case ... esac statement. +400 bytes.
config BUSYBOX_CONFIG_HUSH_FUNCTIONS
bool "Support funcname() { commands; } syntax"
default BUSYBOX_DEFAULT_HUSH_FUNCTIONS
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
help
Enable support for shell functions. +800 bytes.
@ -360,7 +378,7 @@ config BUSYBOX_CONFIG_HUSH_LOCAL
config BUSYBOX_CONFIG_HUSH_RANDOM_SUPPORT
bool "Pseudorandom generator and $RANDOM variable"
default BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
help
Enable pseudorandom generator and dynamic variable "$RANDOM".
Each read of "$RANDOM" will generate a new pseudorandom value.
@ -368,7 +386,7 @@ config BUSYBOX_CONFIG_HUSH_RANDOM_SUPPORT
config BUSYBOX_CONFIG_HUSH_MODE_X
bool "Support 'hush -x' option and 'set -x' command"
default BUSYBOX_DEFAULT_HUSH_MODE_X
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
help
This instructs hush to print commands before execution.
Adds ~300 bytes.
@ -376,27 +394,27 @@ config BUSYBOX_CONFIG_HUSH_MODE_X
config BUSYBOX_CONFIG_HUSH_ECHO
bool "echo builtin"
default BUSYBOX_DEFAULT_HUSH_ECHO
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_PRINTF
bool "printf builtin"
default BUSYBOX_DEFAULT_HUSH_PRINTF
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_TEST
bool "test builtin"
default BUSYBOX_DEFAULT_HUSH_TEST
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_HELP
bool "help builtin"
default BUSYBOX_DEFAULT_HUSH_HELP
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_EXPORT
bool "export builtin"
default BUSYBOX_DEFAULT_HUSH_EXPORT
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_EXPORT_N
bool "Support 'export -n' option"
@ -408,83 +426,85 @@ config BUSYBOX_CONFIG_HUSH_EXPORT_N
config BUSYBOX_CONFIG_HUSH_READONLY
bool "readonly builtin"
default BUSYBOX_DEFAULT_HUSH_READONLY
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
help
Enable support for read-only variables.
config BUSYBOX_CONFIG_HUSH_KILL
bool "kill builtin (supports kill %jobspec)"
default BUSYBOX_DEFAULT_HUSH_KILL
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_WAIT
bool "wait builtin"
default BUSYBOX_DEFAULT_HUSH_WAIT
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_COMMAND
bool "command builtin"
default BUSYBOX_DEFAULT_HUSH_COMMAND
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_TRAP
bool "trap builtin"
default BUSYBOX_DEFAULT_HUSH_TRAP
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_TYPE
bool "type builtin"
default BUSYBOX_DEFAULT_HUSH_TYPE
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_TIMES
bool "times builtin"
default BUSYBOX_DEFAULT_HUSH_TIMES
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_READ
bool "read builtin"
default BUSYBOX_DEFAULT_HUSH_READ
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_SET
bool "set builtin"
default BUSYBOX_DEFAULT_HUSH_SET
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_UNSET
bool "unset builtin"
default BUSYBOX_DEFAULT_HUSH_UNSET
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_ULIMIT
bool "ulimit builtin"
default BUSYBOX_DEFAULT_HUSH_ULIMIT
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_UMASK
bool "umask builtin"
default BUSYBOX_DEFAULT_HUSH_UMASK
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_GETOPTS
bool "getopts builtin"
default BUSYBOX_DEFAULT_HUSH_GETOPTS
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_HUSH_MEMLEAK
bool "memleak builtin (debugging)"
default BUSYBOX_DEFAULT_HUSH_MEMLEAK
depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_HUSH
endif # hush options
comment "Options common to all shells"
if ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
if BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
config BUSYBOX_CONFIG_FEATURE_SH_MATH
bool "POSIX math support"
default BUSYBOX_DEFAULT_FEATURE_SH_MATH
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
help
Enable math support in the shell via $((...)) syntax.
@ -505,14 +525,14 @@ config BUSYBOX_CONFIG_FEATURE_SH_MATH_BASE
config BUSYBOX_CONFIG_FEATURE_SH_EXTRA_QUIET
bool "Hide message on interactive shell startup"
default BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
help
Remove the busybox introduction when starting a shell.
config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE
bool "Standalone shell"
default BUSYBOX_DEFAULT_FEATURE_SH_STANDALONE
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
help
This option causes busybox shells to use busybox applets
in preference to executables in the PATH whenever possible. For
@ -533,7 +553,7 @@ config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE
config BUSYBOX_CONFIG_FEATURE_SH_NOFORK
bool "Run 'nofork' applets directly"
default BUSYBOX_DEFAULT_FEATURE_SH_NOFORK
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
help
This option causes busybox shells to not execute typical
fork/exec/wait sequence, but call <applet>_main directly,
@ -551,14 +571,14 @@ config BUSYBOX_CONFIG_FEATURE_SH_NOFORK
config BUSYBOX_CONFIG_FEATURE_SH_READ_FRAC
bool "read -t N.NNN support (+110 bytes)"
default BUSYBOX_DEFAULT_FEATURE_SH_READ_FRAC
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
help
Enable support for fractional second timeout in read builtin.
config BUSYBOX_CONFIG_FEATURE_SH_HISTFILESIZE
bool "Use $HISTFILESIZE"
default BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
help
This option makes busybox shells to use $HISTFILESIZE variable
to set shell history size. Note that its max value is capped
@ -567,7 +587,7 @@ config BUSYBOX_CONFIG_FEATURE_SH_HISTFILESIZE
config BUSYBOX_CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS
bool "Embed scripts in the binary"
default BUSYBOX_DEFAULT_FEATURE_SH_EMBEDDED_SCRIPTS
depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH
depends on BUSYBOX_CONFIG_SHELL_ASH || BUSYBOX_CONFIG_SHELL_HUSH
help
Allow scripts to be compressed and embedded in the busybox
binary. The scripts should be placed in the 'embed' directory

View File

@ -23,7 +23,6 @@ config BUSYBOX_CONFIG_FEATURE_KLOGD_KLOGCTL
bool "Use the klogctl() interface"
default BUSYBOX_DEFAULT_FEATURE_KLOGD_KLOGCTL
depends on BUSYBOX_CONFIG_KLOGD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The klogd applet supports two interfaces for reading
kernel messages. Linux provides the klogctl() interface
@ -116,6 +115,14 @@ config BUSYBOX_CONFIG_FEATURE_SYSLOGD_CFG
help
Supports restricted syslogd config. See docs/syslog.conf.txt
config BUSYBOX_CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS
bool "Include milliseconds in timestamps"
default BUSYBOX_DEFAULT_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS
depends on BUSYBOX_CONFIG_SYSLOGD
help
Includes milliseconds (HH:MM:SS.mmm) in timestamp when
timestamps are added.
config BUSYBOX_CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE
int "Read buffer size in bytes"
default BUSYBOX_DEFAULT_FEATURE_SYSLOGD_READ_BUFFER_SIZE
@ -153,7 +160,6 @@ config BUSYBOX_CONFIG_FEATURE_KMSG_SYSLOG
bool "Linux kernel printk buffer support"
default BUSYBOX_DEFAULT_FEATURE_KMSG_SYSLOG
depends on BUSYBOX_CONFIG_SYSLOGD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
When you enable this feature, the syslogd utility will
write system log message to the Linux kernel's printk buffer.

View File

@ -9,7 +9,6 @@ menu "Linux System Utilities"
config BUSYBOX_CONFIG_ACPID
bool "acpid (9 kb)"
default BUSYBOX_DEFAULT_ACPID
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
acpid listens to ACPI events coming either in textual form from
/proc/acpi/event (though it is marked deprecated it is still widely
@ -31,13 +30,11 @@ config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT
config BUSYBOX_CONFIG_BLKDISCARD
bool "blkdiscard (4.3 kb)"
default BUSYBOX_DEFAULT_BLKDISCARD
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
blkdiscard discards sectors on a given device.
config BUSYBOX_CONFIG_BLKID
bool "blkid (12 kb)"
default BUSYBOX_DEFAULT_BLKID
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_VOLUMEID
help
Lists labels and UUIDs of all filesystems.
@ -67,7 +64,6 @@ config BUSYBOX_CONFIG_CHRT
config BUSYBOX_CONFIG_DMESG
bool "dmesg (3.7 kb)"
default BUSYBOX_DEFAULT_DMESG
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
dmesg is used to examine or control the kernel ring buffer. When the
Linux kernel prints messages to the system log, they are stored in
@ -100,7 +96,6 @@ config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY
config BUSYBOX_CONFIG_EJECT
bool "eject (4 kb)"
default BUSYBOX_DEFAULT_EJECT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Used to eject cdroms. (defaults to /dev/cdrom)
@ -119,13 +114,11 @@ config BUSYBOX_CONFIG_FALLOCATE
config BUSYBOX_CONFIG_FATATTR
bool "fatattr (1.9 kb)"
default BUSYBOX_DEFAULT_FATATTR
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
fatattr lists or changes the file attributes on a fat file system.
config BUSYBOX_CONFIG_FBSET
bool "fbset (5.9 kb)"
default BUSYBOX_DEFAULT_FBSET
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
fbset is used to show or change the settings of a Linux frame buffer
device. The frame buffer device provides a simple and unique
@ -153,13 +146,11 @@ config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE
config BUSYBOX_CONFIG_FDFORMAT
bool "fdformat (4.4 kb)"
default BUSYBOX_DEFAULT_FDFORMAT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
fdformat is used to low-level format a floppy disk.
config BUSYBOX_CONFIG_FDISK
bool "fdisk (37 kb)"
default BUSYBOX_DEFAULT_FDISK
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The fdisk utility is used to divide hard disks into one or more
logical disks, which are generally called partitions. This utility
@ -233,7 +224,6 @@ config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED
config BUSYBOX_CONFIG_FINDFS
bool "findfs (12 kb)"
default BUSYBOX_DEFAULT_FINDFS
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_VOLUMEID
help
Prints the name of a filesystem with given label or UUID.
@ -245,7 +235,6 @@ config BUSYBOX_CONFIG_FLOCK
config BUSYBOX_CONFIG_FDFLUSH
bool "fdflush (1.3 kb)"
default BUSYBOX_DEFAULT_FDFLUSH
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
fdflush is only needed when changing media on slightly-broken
removable media drives. It is used to make Linux believe that a
@ -258,7 +247,6 @@ config BUSYBOX_CONFIG_FDFLUSH
config BUSYBOX_CONFIG_FREERAMDISK
bool "freeramdisk (1.3 kb)"
default BUSYBOX_DEFAULT_FREERAMDISK
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Linux allows you to create ramdisks. This utility allows you to
delete them and completely free all memory that was used for the
@ -279,14 +267,12 @@ config BUSYBOX_CONFIG_FSCK_MINIX
config BUSYBOX_CONFIG_FSFREEZE
bool "fsfreeze (3.5 kb)"
default BUSYBOX_DEFAULT_FSFREEZE
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_LONG_OPTS
help
Halt new accesses and flush writes on a mounted filesystem.
config BUSYBOX_CONFIG_FSTRIM
bool "fstrim (4.4 kb)"
default BUSYBOX_DEFAULT_FSTRIM
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Discard unused blocks on a mounted filesystem.
config BUSYBOX_CONFIG_GETOPT
@ -313,16 +299,6 @@ config BUSYBOX_CONFIG_HEXDUMP
The hexdump utility is used to display binary data in a readable
way that is comparable to the output from most hex editors.
config BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE
bool "Support -R, reverse of 'hexdump -Cv'"
default BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE
depends on BUSYBOX_CONFIG_HEXDUMP
help
The hexdump utility is used to display binary data in an ascii
readable way. This option creates binary data from an ascii input.
NB: this option is non-standard. It's unwise to use it in scripts
aimed to be portable.
config BUSYBOX_CONFIG_HD
bool "hd (7.8 kb)"
default BUSYBOX_DEFAULT_HD
@ -337,7 +313,6 @@ config BUSYBOX_CONFIG_XXD
config BUSYBOX_CONFIG_HWCLOCK
bool "hwclock (5.8 kb)"
default BUSYBOX_DEFAULT_HWCLOCK
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The hwclock utility is used to read and set the hardware clock
on a system. This is primarily used to set the current time on
@ -358,7 +333,6 @@ config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS
config BUSYBOX_CONFIG_IONICE
bool "ionice (3.8 kb)"
default BUSYBOX_DEFAULT_IONICE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Set/set program io scheduling class and priority
Requires kernel >= 2.6.13
@ -372,7 +346,6 @@ config BUSYBOX_CONFIG_IPCRM
config BUSYBOX_CONFIG_IPCS
bool "ipcs (11 kb)"
default BUSYBOX_DEFAULT_IPCS
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The ipcs utility is used to provide information on the currently
allocated System V interprocess (IPC) objects in the system.
@ -393,7 +366,6 @@ config BUSYBOX_CONFIG_FEATURE_LAST_FANCY
config BUSYBOX_CONFIG_LOSETUP
bool "losetup (5.5 kb)"
default BUSYBOX_DEFAULT_LOSETUP
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
losetup is used to associate or detach a loop device with a regular
file or block device, and to query the status of a loop device. This
@ -401,7 +373,6 @@ config BUSYBOX_CONFIG_LOSETUP
config BUSYBOX_CONFIG_LSPCI
bool "lspci (6.3 kb)"
default BUSYBOX_DEFAULT_LSPCI
#select PLATFORM_LINUX
help
lspci is a utility for displaying information about PCI buses in the
system and devices connected to them.
@ -410,7 +381,6 @@ config BUSYBOX_CONFIG_LSPCI
config BUSYBOX_CONFIG_LSUSB
bool "lsusb (4.2 kb)"
default BUSYBOX_DEFAULT_LSUSB
#select PLATFORM_LINUX
help
lsusb is a utility for displaying information about USB buses in the
system and devices connected to them.
@ -419,7 +389,6 @@ config BUSYBOX_CONFIG_LSUSB
config BUSYBOX_CONFIG_MDEV
bool "mdev (17 kb)"
default BUSYBOX_DEFAULT_MDEV
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
mdev is a mini-udev implementation for dynamically creating device
nodes in the /dev directory.
@ -505,20 +474,17 @@ config BUSYBOX_CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP
config BUSYBOX_CONFIG_MKE2FS
bool "mke2fs (10 kb)"
default BUSYBOX_DEFAULT_MKE2FS
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Utility to create EXT2 filesystems.
config BUSYBOX_CONFIG_MKFS_EXT2
bool "mkfs.ext2 (10 kb)"
default BUSYBOX_DEFAULT_MKFS_EXT2
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Alias to "mke2fs".
config BUSYBOX_CONFIG_MKFS_MINIX
bool "mkfs.minix (10 kb)"
default BUSYBOX_DEFAULT_MKFS_MINIX
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The minix filesystem is a nice, small, compact, read-write filesystem
with little overhead. If you wish to be able to create minix
@ -535,21 +501,18 @@ config BUSYBOX_CONFIG_FEATURE_MINIX2
config BUSYBOX_CONFIG_MKFS_REISER
bool "mkfs_reiser"
default BUSYBOX_DEFAULT_MKFS_REISER
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Utility to create ReiserFS filesystems.
Note: this applet needs a lot of testing and polishing.
config BUSYBOX_CONFIG_MKDOSFS
bool "mkdosfs (7.2 kb)"
default BUSYBOX_DEFAULT_MKDOSFS
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Utility to create FAT32 filesystems.
config BUSYBOX_CONFIG_MKFS_VFAT
bool "mkfs.vfat (7.2 kb)"
default BUSYBOX_DEFAULT_MKFS_VFAT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Alias to "mkdosfs".
config BUSYBOX_CONFIG_MKSWAP
@ -583,7 +546,6 @@ config BUSYBOX_CONFIG_MORE
config BUSYBOX_CONFIG_MOUNT
bool "mount (23 kb)"
default BUSYBOX_DEFAULT_MOUNT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
All files and filesystems in Unix are arranged into one big directory
tree. The 'mount' utility is used to graft a filesystem onto a
@ -685,7 +647,7 @@ config BUSYBOX_CONFIG_NOLOGIN
config BUSYBOX_CONFIG_NOLOGIN_DEPENDENCIES
bool "Enable dependencies for nologin"
default BUSYBOX_DEFAULT_NOLOGIN_DEPENDENCIES
default BUSYBOX_DEFAULT_NOLOGIN_DEPENDENCIES # Y default makes it harder to select single-applet test
depends on BUSYBOX_CONFIG_NOLOGIN
select BUSYBOX_CONFIG_CAT
select BUSYBOX_CONFIG_ECHO
@ -699,13 +661,11 @@ config BUSYBOX_CONFIG_NOLOGIN_DEPENDENCIES
config BUSYBOX_CONFIG_NSENTER
bool "nsenter (6.5 kb)"
default BUSYBOX_DEFAULT_NSENTER
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Run program with namespaces of other processes.
config BUSYBOX_CONFIG_PIVOT_ROOT
bool "pivot_root (1.1 kb)"
default BUSYBOX_DEFAULT_PIVOT_ROOT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The pivot_root utility swaps the mount points for the root filesystem
with some other mounted filesystem. This allows you to do all sorts
@ -730,7 +690,6 @@ config BUSYBOX_CONFIG_RDEV
config BUSYBOX_CONFIG_READPROFILE
bool "readprofile (7.1 kb)"
default BUSYBOX_DEFAULT_READPROFILE
#select PLATFORM_LINUX
help
This allows you to parse /proc/profile for basic profiling.
config BUSYBOX_CONFIG_RENICE
@ -747,7 +706,6 @@ config BUSYBOX_CONFIG_REV
config BUSYBOX_CONFIG_RTCWAKE
bool "rtcwake (6.8 kb)"
default BUSYBOX_DEFAULT_RTCWAKE
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Enter a system sleep state until specified wakeup time.
config BUSYBOX_CONFIG_SCRIPT
@ -764,7 +722,6 @@ config BUSYBOX_CONFIG_SCRIPTREPLAY
config BUSYBOX_CONFIG_SETARCH
bool "setarch (3.6 kb)"
default BUSYBOX_DEFAULT_SETARCH
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The linux32 utility is used to create a 32bit environment for the
specified program (usually a shell). It only makes sense to have
@ -774,20 +731,17 @@ config BUSYBOX_CONFIG_SETARCH
config BUSYBOX_CONFIG_LINUX32
bool "linux32 (3.3 kb)"
default BUSYBOX_DEFAULT_LINUX32
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Alias to "setarch linux32".
config BUSYBOX_CONFIG_LINUX64
bool "linux64 (3.3 kb)"
default BUSYBOX_DEFAULT_LINUX64
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Alias to "setarch linux64".
config BUSYBOX_CONFIG_SETPRIV
bool "setpriv (6.6 kb)"
default BUSYBOX_DEFAULT_SETPRIV
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_LONG_OPTS
help
Run a program with different Linux privilege settings.
@ -828,7 +782,6 @@ config BUSYBOX_CONFIG_SETSID
config BUSYBOX_CONFIG_SWAPON
bool "swapon (15 kb)"
default BUSYBOX_DEFAULT_SWAPON
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
Once you have created some swap space using 'mkswap', you also need
to enable your swap space with the 'swapon' utility. The 'swapoff'
@ -855,7 +808,6 @@ config BUSYBOX_CONFIG_FEATURE_SWAPON_PRI
config BUSYBOX_CONFIG_SWAPOFF
bool "swapoff (14 kb)"
default BUSYBOX_DEFAULT_SWAPOFF
select BUSYBOX_CONFIG_PLATFORM_LINUX
config BUSYBOX_CONFIG_FEATURE_SWAPONOFF_LABEL
bool "Support specifying devices by label or UUID"
@ -868,7 +820,6 @@ config BUSYBOX_CONFIG_FEATURE_SWAPONOFF_LABEL
config BUSYBOX_CONFIG_SWITCH_ROOT
bool "switch_root (5.5 kb)"
default BUSYBOX_DEFAULT_SWITCH_ROOT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
The switch_root utility is used from initramfs to select a new
root device. Under initramfs, you have to use this instead of
@ -900,17 +851,23 @@ config BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY
Needed for machines with more than 32-64 CPUs:
affinity parameter 0xHHHHHHHHHHHHHHHHHHHH can be arbitrarily long
in this case. Otherwise, it is limited to sizeof(long).
config BUSYBOX_CONFIG_FEATURE_TASKSET_CPULIST
bool "CPU list support (-c option)"
default BUSYBOX_DEFAULT_FEATURE_TASKSET_CPULIST
depends on BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY
help
Add support for taking/printing affinity as CPU list when '-c'
option is used. For example, it prints '0-3,7' instead of mask '8f'.
config BUSYBOX_CONFIG_UEVENT
bool "uevent (3.1 kb)"
default BUSYBOX_DEFAULT_UEVENT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
uevent is a netlink listener for kernel uevent notifications
sent via netlink. It is usually used for dynamic device creation.
config BUSYBOX_CONFIG_UMOUNT
bool "umount (5.1 kb)"
default BUSYBOX_DEFAULT_UMOUNT
select BUSYBOX_CONFIG_PLATFORM_LINUX
help
When you want to remove a mounted filesystem from its current mount
point, for example when you are shutting down the system, the
@ -927,7 +884,6 @@ config BUSYBOX_CONFIG_UNSHARE
bool "unshare (7.2 kb)"
default BUSYBOX_DEFAULT_UNSHARE
depends on !BUSYBOX_CONFIG_NOMMU
select BUSYBOX_CONFIG_PLATFORM_LINUX
select BUSYBOX_CONFIG_LONG_OPTS
help
Run program with some namespaces unshared from parent.

View File

@ -23,6 +23,12 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_CRAMFS
bool "cramfs filesystem"
default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_CRAMFS
depends on BUSYBOX_CONFIG_VOLUMEID
config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EROFS
bool "erofs filesystem"
default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EROFS
depends on BUSYBOX_CONFIG_VOLUMEID
help
Erofs is a compressed readonly filesystem for Linux.
config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXFAT
bool "exFAT filesystem"
default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXFAT

View File

@ -1,84 +0,0 @@
From d3539be8f27b8cbfdfee460fe08299158f08bcd9 Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair.francis@wdc.com>
Date: Tue, 19 Nov 2019 13:06:40 +0100
Subject: Remove stime() function calls
stime() has been deprecated in glibc 2.31 and replaced with
clock_settime(). Let's replace the stime() function calls with
clock_settime() in preperation.
function old new delta
rdate_main 197 224 +27
clock_settime - 27 +27
date_main 926 941 +15
stime 37 - -37
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
coreutils/date.c | 6 +++++-
libbb/missing_syscalls.c | 8 --------
util-linux/rdate.c | 8 ++++++--
3 files changed, 11 insertions(+), 11 deletions(-)
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -279,6 +279,9 @@ int date_main(int argc UNUSED_PARAM, cha
time(&ts.tv_sec);
#endif
}
+#if !ENABLE_FEATURE_DATE_NANO
+ ts.tv_nsec = 0;
+#endif
localtime_r(&ts.tv_sec, &tm_time);
/* If date string is given, update tm_time, and maybe set date */
@@ -301,9 +304,10 @@ int date_main(int argc UNUSED_PARAM, cha
if (date_str[0] != '@')
tm_time.tm_isdst = -1;
ts.tv_sec = validate_tm_time(date_str, &tm_time);
+ ts.tv_nsec = 0;
/* if setting time, set it */
- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) {
+ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) {
bb_perror_msg("can't set date");
}
}
--- a/libbb/missing_syscalls.c
+++ b/libbb/missing_syscalls.c
@@ -15,14 +15,6 @@ pid_t getsid(pid_t pid)
return syscall(__NR_getsid, pid);
}
-int stime(const time_t *t)
-{
- struct timeval tv;
- tv.tv_sec = *t;
- tv.tv_usec = 0;
- return settimeofday(&tv, NULL);
-}
-
int sethostname(const char *name, size_t len)
{
return syscall(__NR_sethostname, name, len);
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -95,9 +95,13 @@ int rdate_main(int argc UNUSED_PARAM, ch
if (!(flags & 2)) { /* no -p (-s may be present) */
if (time(NULL) == remote_time)
bb_error_msg("current time matches remote time");
- else
- if (stime(&remote_time) < 0)
+ else {
+ struct timespec ts;
+ ts.tv_sec = remote_time;
+ ts.tv_nsec = 0;
+ if (clock_settime(CLOCK_REALTIME, &ts) < 0)
bb_perror_msg_and_die("can't set time of day");
+ }
}
if (flags != 1) /* not lone -s */

View File

@ -0,0 +1,11 @@
--- a/libbb/update_passwd.c
+++ b/libbb/update_passwd.c
@@ -48,7 +48,7 @@ static void check_selinux_update_passwd(
bb_simple_error_msg_and_die("SELinux: access denied");
}
if (ENABLE_FEATURE_CLEAN_UP)
- freecon(context);
+ freecon(seuser);
}
#else
# define check_selinux_update_passwd(username) ((void)0)

View File

@ -1,8 +0,0 @@
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
debug=false

View File

@ -1,8 +0,0 @@
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# Note: was using sed OPTS CMD -- FILES
# but users complain that many sed implementations

View File

@ -1,11 +0,0 @@
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -51,7 +51,7 @@ CFLAGS += $(call cc-option,-fno-builtin-
# -fno-guess-branch-probability: prohibit pseudo-random guessing
# of branch probabilities (hopefully makes bloatcheck more stable):
CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
-CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,)
+CFLAGS += $(call cc-option,-funsigned-char,)
CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,)
# Defeat .eh_frame bloat (gcc 4.6.3 x86-32 defconfig: 20% smaller busybox binary):
CFLAGS += $(call cc-option,-fno-unwind-tables,)

View File

@ -1,6 +1,6 @@
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -130,7 +130,7 @@ make-cmd = $(subst \#,\\\#,$(subst $$,$$
@@ -131,7 +131,7 @@ make-cmd = $(subst \#,\\\#,$(subst $$,$$
#
if_changed = $(if $(strip $(filter-out $(PHONY),$?) \
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
@ -9,7 +9,7 @@
$(echo-cmd) $(cmd_$(1)); \
echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd)
@@ -139,7 +139,7 @@ if_changed = $(if $(strip $(filter-out $
@@ -140,7 +140,7 @@ if_changed = $(if $(strip $(filter-out $
if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?) \
$(filter-out FORCE $(wildcard $^),$^) \
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
@ -18,7 +18,7 @@
$(echo-cmd) $(cmd_$(1)); \
scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \
rm -f $(depfile); \
@@ -150,5 +150,5 @@ if_changed_dep = $(if $(strip $(filter-o
@@ -151,5 +151,5 @@ if_changed_dep = $(if $(strip $(filter-o
# and if so will execute $(rule_foo)
if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?) \
$(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\

View File

@ -1,6 +1,6 @@
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -713,6 +713,7 @@ static int bcast_or_ucast(struct dhcp_pa
@@ -712,6 +712,7 @@ static int bcast_or_ucast(struct dhcp_pa
static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
{
struct dhcp_packet packet;
@ -8,7 +8,7 @@
/* Fill in: op, htype, hlen, cookie, chaddr fields,
* random xid field (we override it below),
@@ -730,6 +731,7 @@ static NOINLINE int send_discover(uint32
@@ -729,6 +730,7 @@ static NOINLINE int send_discover(uint32
*/
add_client_options(&packet);

View File

@ -1,6 +1,6 @@
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1416,6 +1416,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
@@ -1415,6 +1415,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c
/* silence "uninitialized!" warning */
unsigned timestamp_before_wait = timestamp_before_wait;

View File

@ -1,6 +1,6 @@
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -1126,7 +1126,6 @@ static void perform_renew(void)
@@ -1125,7 +1125,6 @@ static void perform_renew(void)
client_data.state = RENEW_REQUESTED;
break;
case RENEW_REQUESTED: /* impatient are we? fine, square 1 */

View File

@ -19,9 +19,9 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -134,6 +134,12 @@ else
LDLIBS += m
endif
@@ -158,6 +158,12 @@ endif
# libm may be needed for dc, awk, ntpd
# librt may be needed for clock_gettime()
+# nslookup_lede might need the resolv library
+RESOLV_AVAILABLE := $(shell echo 'int main(void){res_init();return 0;}' >resolvtest.c; $(CC) $(CFLAGS) -include resolv.h -lresolv -o /dev/null resolvtest.c >/dev/null 2>&1 && echo "y"; rm resolvtest.c)

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