inital commit

This commit is contained in:
Calin Crisan 2017-02-18 21:10:05 +02:00
commit 38f5847207
8032 changed files with 380329 additions and 0 deletions

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
/output
/.auto.deps
/.config.cmd
/.config.old
/..config.tmp
/.config
*.depend
*.o
/*.patch
/*.diff
*.orig
*.rej
*~
*.pyc
/.download
/.buildroot-ccache-*
*.img.gz

355
COPYING Normal file
View File

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

725
Config.in Normal file
View File

@ -0,0 +1,725 @@
#
mainmenu "Buildroot $BR2_VERSION Configuration"
config BR2_HAVE_DOT_CONFIG
bool
default y
config BR2_VERSION
string
option env="BR2_VERSION_FULL"
config BR2_HOSTARCH
string
option env="HOSTARCH"
config BR2_EXTERNAL
string
option env="BR2_EXTERNAL"
# Hidden config symbols for packages to check system gcc version
config BR2_HOST_GCC_VERSION
string
option env="HOST_GCC_VERSION"
config BR2_HOST_GCC_AT_LEAST_4_6
bool
default y if BR2_HOST_GCC_VERSION = "4 6"
config BR2_HOST_GCC_AT_LEAST_4_7
bool
default y if BR2_HOST_GCC_VERSION = "4 7"
select BR2_HOST_GCC_AT_LEAST_4_6
config BR2_HOST_GCC_AT_LEAST_4_8
bool
default y if BR2_HOST_GCC_VERSION = "4 8"
select BR2_HOST_GCC_AT_LEAST_4_7
config BR2_HOST_GCC_AT_LEAST_4_9
bool
default y if BR2_HOST_GCC_VERSION = "4 9"
select BR2_HOST_GCC_AT_LEAST_4_8
config BR2_HOST_GCC_AT_LEAST_5
bool
default y if BR2_HOST_GCC_VERSION = "5"
select BR2_HOST_GCC_AT_LEAST_4_9
# Hidden boolean selected by packages in need of Java in order to build
# (example: xbmc)
config BR2_NEEDS_HOST_JAVA
bool
# Hidden boolean selected by packages in need of javac in order to build
# (example: classpath)
config BR2_NEEDS_HOST_JAVAC
bool
# Hidden boolean selected by packages in need of jar in order to build
# (example: classpath)
config BR2_NEEDS_HOST_JAR
bool
# Hidden boolean selected by pre-built packages for x86, when they
# need to run on x86-64 machines (example: pre-built external
# toolchains, binary tools like SAM-BA, etc.).
config BR2_HOSTARCH_NEEDS_IA32_LIBS
bool
# Hidden boolean selected by packages that need to build 32 bits
# binaries with the host compiler, even on 64 bits build machines (e.g
# bootloaders).
config BR2_HOSTARCH_NEEDS_IA32_COMPILER
bool
source "arch/Config.in"
menu "Build options"
menu "Commands"
config BR2_WGET
string "Wget command"
default "wget --passive-ftp -nd -t 3"
config BR2_SVN
string "Subversion (svn) command"
default "svn"
config BR2_BZR
string "Bazaar (bzr) command"
default "bzr"
config BR2_GIT
string "Git command"
default "git"
config BR2_CVS
string "CVS command"
default "cvs"
config BR2_LOCALFILES
string "Local files retrieval command"
default "cp"
config BR2_SCP
string "Secure copy (scp) command"
default "scp"
config BR2_SSH
string "Secure shell (ssh) command"
default "ssh"
config BR2_HG
string "Mercurial (hg) command"
default "hg"
config BR2_ZCAT
string "zcat command"
default "gzip -d -c"
help
Command to be used to extract a gzip'ed file to stdout.
zcat is identical to gunzip -c except that the former may
not be available on your system.
Default is "gzip -d -c"
Other possible values include "gunzip -c" or "zcat".
config BR2_BZCAT
string "bzcat command"
default "bzcat"
help
Command to be used to extract a bzip2'ed file to stdout.
bzcat is identical to bunzip2 -c except that the former may
not be available on your system.
Default is "bzcat"
Other possible values include "bunzip2 -c" or "bzip2 -d -c".
config BR2_XZCAT
string "xzcat command"
default "xzcat"
help
Command to be used to extract a xz'ed file to stdout.
Default is "xzcat"
config BR2_TAR_OPTIONS
string "Tar options"
default ""
help
Options to pass to tar when extracting the sources.
E.g. " -v --exclude='*.svn*'" to exclude all .svn internal files
and to be verbose.
endmenu
config BR2_DEFCONFIG_FROM_ENV
string
option env="BR2_DEFCONFIG"
config BR2_DEFCONFIG
string "Location to save buildroot config"
default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
default "$(CONFIG_DIR)/defconfig"
help
When running 'make savedefconfig', the defconfig file will be saved
in this location.
config BR2_DL_DIR
string "Download dir"
default "$(TOPDIR)/dl"
help
Directory to store all the source files that we need to fetch.
If the Linux shell environment has defined the BR2_DL_DIR
environment variable, then this overrides this configuration item.
The default is $(TOPDIR)/dl
config BR2_HOST_DIR
string "Host dir"
default "$(BASE_DIR)/host"
help
Directory to store all the binary files that are built for the host.
This includes the cross compilation toolchain when building the
internal buildroot toolchain.
The default is $(BASE_DIR)/host
menu "Mirrors and Download locations"
config BR2_PRIMARY_SITE
string "Primary download site"
default ""
help
Primary site to download from. If this option is set then buildroot
will try to download package source first from this site and try the
default if the file is not found.
Valid URIs are:
- URIs recognized by $(WGET)
- local URIs of the form file://absolutepath
- scp URIs of the form scp://[user@]host:path.
config BR2_PRIMARY_SITE_ONLY
bool "Only allow downloads from primary download site"
depends on BR2_PRIMARY_SITE != ""
help
If this option is enabled, downloads will only be attempted
from the primary download site. Other locations, like the
package's official download location or the backup download
site, will not be considered. Therefore, if the package is
not present on the primary site, the download fails.
This is useful for project developers who want to ensure
that the project can be built even if the upstream tarball
locations disappear.
if !BR2_PRIMARY_SITE_ONLY
config BR2_BACKUP_SITE
string "Backup download site"
default "http://sources.buildroot.net"
help
Backup site to download from. If this option is set then buildroot
will fall back to download package sources from here if the
normal location fails.
config BR2_KERNEL_MIRROR
string "Kernel.org mirror"
default "https://www.kernel.org/pub"
help
kernel.org is mirrored on a number of servers around the world.
The following allows you to select your preferred mirror.
Have a look on the kernel.org site for a list of mirrors, then enter
the URL to the base directory. Examples:
http://www.XX.kernel.org/pub (XX = country code)
http://mirror.aarnet.edu.au/pub/ftp.kernel.org
config BR2_GNU_MIRROR
string "GNU Software mirror"
default "http://ftp.gnu.org/pub/gnu"
help
GNU has multiple software mirrors scattered around the world.
The following allows you to select your preferred mirror.
Have a look on the gnu.org site for a list of mirrors, then enter
the URL to the base directory. Examples:
http://ftp.gnu.org/pub/gnu
http://mirror.aarnet.edu.au/pub/gnu
config BR2_LUAROCKS_MIRROR
string "LuaRocks mirror"
default "http://rocks.moonscript.org"
help
LuaRocks repository.
See http://luarocks.org
config BR2_CPAN_MIRROR
string "CPAN mirror (Perl packages)"
default "http://cpan.metacpan.org"
help
CPAN (Comprehensive Perl Archive Network) is a repository
of Perl packages. It has multiple software mirrors scattered
around the world. This option allows you to select a mirror.
The list of mirrors is available at:
http://search.cpan.org/mirror
endif
endmenu
config BR2_JLEVEL
int "Number of jobs to run simultaneously (0 for auto)"
default "0"
help
Number of jobs to run simultaneously. If 0, determine
automatically according to number of CPUs on the host
system.
config BR2_CCACHE
bool "Enable compiler cache"
help
This option will enable the use of ccache, a compiler
cache. It will cache the result of previous builds to speed
up future builds. By default, the cache is stored in
$HOME/.buildroot-ccache.
Note that Buildroot does not try to invalidate the cache
contents when the compiler changes in an incompatible
way. Therefore, if you make a change to the compiler version
and/or configuration, you are responsible for purging the
ccache cache by removing the $HOME/.buildroot-ccache
directory.
if BR2_CCACHE
config BR2_CCACHE_DIR
string "Compiler cache location"
default "$(HOME)/.buildroot-ccache"
help
Where ccache should store cached files.
config BR2_CCACHE_INITIAL_SETUP
string "Compiler cache initial setup"
help
Initial ccache settings to apply, such as --max-files or --max-size.
For example, if your project is known to require more space than the
default max cache size, then you might want to increase the cache size
to a suitable amount using the -M (--max-size) option.
The string you specify here is passed verbatim to ccache. Refer to
ccache documentation for more details.
These initial settings are applied after ccache has been compiled.
config BR2_CCACHE_USE_BASEDIR
bool "Use relative paths"
default y
help
Allow ccache to convert absolute paths within the output
directory into relative paths.
During the build, many -I include directives are given with
an absolute path. These absolute paths end up in the hashes
that are computed by ccache. Therefore, when you build from a
different directory, the hash will be different and the
cached object will not be used.
To improve cache performance, set this option to y. This
allows ccache to rewrite absolute paths within the output
directory into relative paths. Note that only paths within
the output directory will be rewritten; therefore, if you
change BR2_HOST_DIR to point outside the output directory and
subsequently move it to a different location, this will lead
to cache misses.
This option has as a result that the debug information in the
object files also has only relative paths. Therefore, make
sure you cd to the build directory before starting gdb. See
the section "COMPILING IN DIFFERENT DIRECTORIES" in the
ccache manual for more information.
endif
config BR2_DEPRECATED
bool "Show options and packages that are deprecated or obsolete"
help
This option shows outdated/obsolete versions of packages and
options that are otherwise hidden.
if BR2_DEPRECATED
config BR2_DEPRECATED_SINCE_2015_05
bool
default y
config BR2_DEPRECATED_SINCE_2015_08
bool
default y
config BR2_DEPRECATED_SINCE_2015_11
bool
default y
config BR2_DEPRECATED_SINCE_2016_02
bool
default y
config BR2_DEPRECATED_SINCE_2016_05
bool
default y
endif
config BR2_ENABLE_DEBUG
bool "build packages with debugging symbols"
help
Build packages with debugging symbols enabled. All libraries
and binaries in the 'staging' directory will have debugging
symbols, which allows remote debugging even if libraries and
binaries are stripped on the target. Whether libraries and
binaries are stripped on the target is controlled by the
BR2_STRIP_* options below.
if BR2_ENABLE_DEBUG
choice
prompt "gcc debug level"
default BR2_DEBUG_2
help
Set the debug level for gcc
config BR2_DEBUG_1
bool "debug level 1"
help
Debug level 1 produces minimal information, enough
for making backtraces in parts of the program that
you don't plan to debug. This includes descriptions
of functions and external variables, but no information
about local variables and no line numbers.
config BR2_DEBUG_2
bool "debug level 2"
help
The default gcc debug level is 2
config BR2_DEBUG_3
bool "debug level 3"
help
Level 3 includes extra information, such as all the
macro definitions present in the program. Some debuggers
support macro expansion when you use -g3.
endchoice
endif
choice
prompt "strip command for binaries on target"
default BR2_STRIP_strip
config BR2_STRIP_strip
bool "strip"
depends on !BR2_PACKAGE_HOST_ELF2FLT
help
Binaries and libraries in the target filesystem will be
stripped using the normal 'strip' command. This allows to
save space, mainly by removing debugging symbols. Debugging
symbols on the target are needed for native debugging, but
not when remote debugging is used.
config BR2_STRIP_none
bool "none"
help
Do not strip binaries and libraries in the target
filesystem.
endchoice
config BR2_STRIP_EXCLUDE_FILES
string "executables that should not be stripped"
depends on !BR2_STRIP_none
default ""
help
You may specify a space-separated list of binaries and libraries
here that should not be stripped on the target.
config BR2_STRIP_EXCLUDE_DIRS
string "directories that should be skipped when stripping"
depends on !BR2_STRIP_none
default ""
help
You may specify a space-separated list of directories that should
be skipped when stripping. Binaries and libraries in these
directories will not be touched.
The directories should be specified relative to the target directory,
without leading slash.
choice
prompt "gcc optimization level"
default BR2_OPTIMIZE_S
help
Set the optimization level for gcc
config BR2_OPTIMIZE_0
bool "optimization level 0"
help
Do not optimize. This is the default.
config BR2_OPTIMIZE_1
bool "optimization level 1"
help
Optimize. Optimizing compilation takes somewhat more time,
and a lot more memory for a large function. With -O, the
compiler tries to reduce code size and execution time,
without performing any optimizations that take a great deal
of compilation time. -O turns on the following optimization
flags: -fdefer-pop -fdelayed-branch -fguess-branch-probability
-fcprop-registers -floop-optimize -fif-conversion
-fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts
-ftree-dse -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename
-ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants
-O also turns on -fomit-frame-pointer on machines where doing
so does not interfere with debugging.
config BR2_OPTIMIZE_2
bool "optimization level 2"
help
Optimize even more. GCC performs nearly all supported optimizations
that do not involve a space-speed tradeoff. The compiler does not
perform loop unrolling or function inlining when you specify -O2.
As compared to -O, this option increases both compilation time and
the performance of the generated code. -O2 turns on all optimization
flags specified by -O. It also turns on the following optimization
flags: -fthread-jumps -fcrossjumping -foptimize-sibling-calls
-fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm
-fexpensive-optimizations -fstrength-reduce -frerun-cse-after-loop
-frerun-loop-opt -fcaller-saves -fpeephole2 -fschedule-insns
-fschedule-insns2 -fsched-interblock -fsched-spec -fregmove
-fstrict-aliasing -fdelete-null-pointer-checks -freorder-blocks
-freorder-functions -falign-functions -falign-jumps -falign-loops
-falign-labels -ftree-vrp -ftree-pre
Please note the warning under -fgcse about invoking -O2 on programs
that use computed gotos.
config BR2_OPTIMIZE_3
bool "optimization level 3"
help
Optimize yet more. -O3 turns on all optimizations specified by -O2
and also turns on the -finline-functions, -funswitch-loops and
-fgcse-after-reload options.
config BR2_OPTIMIZE_S
bool "optimize for size"
help
Optimize for size. -Os enables all -O2 optimizations that do not
typically increase code size. It also performs further optimizations
designed to reduce code size. -Os disables the following optimization
flags: -falign-functions -falign-jumps -falign-loops -falign-labels
-freorder-blocks -freorder-blocks-and-partition -fprefetch-loop-arrays
-ftree-vect-loop-version
endchoice
config BR2_GOOGLE_BREAKPAD_ENABLE
bool "Enable google-breakpad support"
select BR2_PACKAGE_GOOGLE_BREAKPAD
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_USES_GLIBC
depends on BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS
help
This option will enable the use of google breakpad, a
library and tool suite that allows you to distribute an
application to users with compiler-provided debugging
information removed, record crashes in compact "minidump"
files, send them back to your server and produce C and C++
stack traces from these minidumps. Breakpad can also write
minidumps on request for programs that have not crashed.
if BR2_GOOGLE_BREAKPAD_ENABLE
config BR2_GOOGLE_BREAKPAD_INCLUDE_FILES
string "List of executables and libraries to extract symbols from"
default ""
help
You may specify a space-separated list of binaries and
libraries with full paths relative to $(TARGET_DIR) of which
debug symbols will be dumped for further use with google
breakpad.
A directory structure that can be used by minidump-stackwalk
will be created at:
$(STAGING_DIR)/usr/share/google-breakpad-symbols
endif
choice
bool "build code with Stack Smashing Protection"
default BR2_SSP_ALL if BR2_ENABLE_SSP # legacy
depends on BR2_TOOLCHAIN_HAS_SSP
help
Enable stack smashing protection support using GCC's
-fstack-protector option family.
See http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
for details.
Note that this requires the toolchain to have SSP
support. This is always the case for glibc and eglibc
toolchain, but is optional in uClibc toolchains.
config BR2_SSP_NONE
bool "None"
help
Disable stack-smashing protection.
config BR2_SSP_REGULAR
bool "-fstack-protector"
help
Emit extra code to check for buffer overflows, such as stack
smashing attacks. This is done by adding a guard variable to
functions with vulnerable objects. This includes functions
that call alloca, and functions with buffers larger than 8
bytes. The guards are initialized when a function is entered
and then checked when the function exits. If a guard check
fails, an error message is printed and the program exits.
config BR2_SSP_STRONG
bool "-fstack-protector-strong"
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
help
Like -fstack-protector but includes additional functions to be
protected - those that have local array definitions, or have
references to local frame addresses.
comment "Stack Smashing Protection strong needs a toolchain w/ gcc >= 4.9"
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
config BR2_SSP_ALL
bool "-fstack-protector-all"
help
Like -fstack-protector except that all functions are
protected. This option might have a significant performance
impact on the compiled binaries.
endchoice
comment "Stack Smashing Protection needs a toolchain w/ SSP"
depends on !BR2_TOOLCHAIN_HAS_SSP
choice
bool "libraries"
default BR2_SHARED_LIBS if BR2_BINFMT_SUPPORTS_SHARED
default BR2_STATIC_LIBS if !BR2_BINFMT_SUPPORTS_SHARED
help
Select the type of libraries you want to use on the target.
The default is to build dynamic libraries and use those on
the target filesystem, except when the architecture and/or
the selected binary format does not support shared
libraries.
config BR2_STATIC_LIBS
bool "static only"
help
Build and use only static libraries. No shared libraries
will be instaled on the target. This potentially increases
your code size and should only be used if you know what you
are doing. Note that some packages may not be available when
this option is enabled, due to their need for dynamic
library support.
config BR2_SHARED_LIBS
bool "shared only"
depends on BR2_BINFMT_SUPPORTS_SHARED
help
Build and use only shared libraries. This is the recommended
solution as it saves space and build time.
config BR2_SHARED_STATIC_LIBS
bool "both static and shared"
depends on BR2_BINFMT_SUPPORTS_SHARED
help
Build both shared and static libraries, but link executables
dynamically. While building both shared and static libraries
take more time and more disk space, having static libraries
may be useful to link some of the applications statically.
endchoice
config BR2_PACKAGE_OVERRIDE_FILE
string "location of a package override file"
default "$(CONFIG_DIR)/local.mk"
help
A package override file is a short makefile that contains
variable definitions of the form <pkg>_OVERRIDE_SRCDIR,
which allows to tell Buildroot to use an existing directory
as the source directory for a particular package. See the
Buildroot documentation for more details on this feature.
config BR2_GLOBAL_PATCH_DIR
string "global patch directories"
help
You may specify a space separated list of one or more directories
containing global package patches. For a specific version
<packageversion> of a specific package <packagename>, patches are
applied as follows:
First, the default Buildroot patch set for the package is applied
from the package's directory in Buildroot.
Then for every directory - <global-patch-dir> - that exists in
BR2_GLOBAL_PATCH_DIR, if the directory
<global-patch-dir>/<packagename>/<packageversion>/ exists, then all
*.patch files in this directory will be applied.
Otherwise, if the directory <global-patch-dir>/<packagename> exists,
then all *.patch files in the directory will be applied.
menu "Advanced"
config BR2_COMPILER_PARANOID_UNSAFE_PATH
bool "paranoid check of library/header paths"
help
By default, when this option is disabled, when the Buildroot
cross-compiler will encounter an unsafe library or header
path (such as /usr/include, or /usr/lib), the compiler will
display a warning.
By enabling this option, this warning is turned into an
error, which will completely abort the build when such
unsafe paths are encountered.
Note that this mechanism is available for both the internal
toolchain (through the toolchain wrapper and binutils patches)
and external toolchain backends (through the toolchain wrapper).
endmenu
endmenu
source "toolchain/Config.in"
source "system/Config.in"
source "linux/Config.in"
source "package/Config.in"
source "fs/Config.in"
source "boot/Config.in"
source "package/Config.in.host"
source "Config.in.legacy"
menu "User-provided options"
depends on BR2_EXTERNAL != "support/dummy-external"
source "$BR2_EXTERNAL/Config.in"
endmenu

2258
Config.in.legacy Normal file

File diff suppressed because it is too large Load Diff

1015
Makefile Normal file

File diff suppressed because it is too large Load Diff

62
Makefile.legacy Normal file
View File

@ -0,0 +1,62 @@
#
# Makefile.legacy - support for backward compatibility
#
# This file contains placeholders to detect backward-compatibility problems.
# When a buildroot "API" feature is being deprecated, a rule should be added
# here that issues an error when the old feature is used.
#
# This file is not included if BR2_DEPRECATED is selected, so it is possible
# to bypass the errors (although that's usually a bad idea).
ifeq ($(BR2_LEGACY),y)
$(error "You have legacy configuration in your .config! Please check your configuration.")
endif
#
# Legacy options from 2014.02
#
# The BUILDROOT_DL_DIR environment variable was renamed by BR2_DL_DIR. We
# want to detect someone using the old variable, _except_ if also the new
# variable was set. By the time we get here, however, we no longer have
# access to the BR2_DL_DIR environment variable (because it has been overridden
# by the .config inclusion). However, the environment variable (if defined) was
# saved in DL_DIR, so we can use that.
ifneq ($(BUILDROOT_DL_DIR),)
ifneq ($(BUILDROOT_DL_DIR),$(DL_DIR))
$(error "The BUILDROOT_DL_DIR environment variable was renamed to BR2_DL_DIR.")
endif
endif
# If a script is using the deprecated BUILDROOT_CONFIG, make sure it fails.
# Add some directories in front just in case someone used dirname on it.
BUILDROOT_CONFIG_FAKE = /tmp/deprecated/The-BUILDROOT_CONFIG-environment-variable-was-renamed-to-BR2_CONFIG
# Similar to above for BUILDROOT_CONFIG, but here we have no .config equivalent.
ifneq ($(BUILDROOT_CONFIG),)
ifneq ($(BUILDROOT_CONFIG),$(BR2_CONFIG))
ifneq ($(BUILDROOT_CONFIG),$(BUILDROOT_CONFIG_FAKE))
$(error "The BUILDROOT_CONFIG environment variable was renamed to BR2_CONFIG.")
endif
endif
endif
BUILDROOT_CONFIG = $(BUILDROOT_CONFIG_FAKE)
export BUILDROOT_CONFIG
#
# Legacy options from 2012.08
#
host-pkg-config:
@$(call MESSAGE,host-pkg-config is replaced by host-pkgconf)
@$(call MESSAGE,please update your .mk files)
@false
.PHONY: host-pkg-config
#
# Legacy options from 2012.05
#
GENTARGETS = $$(error The GENTARGETS macro no longer exists; use $$$$(eval $$$$(generic-package)) or $$$$(eval $$$$(host-generic-package)))
AUTOTARGETS = $$(error The AUTOTARGETS macro no longer exists; use $$$$(eval $$$$(autotools-package)) or $$$$(eval $$$$(host-autotools-package)))
CMAKETARGETS = $$(error The CMAKETARGETS macro no longer exists; use $$$$(eval $$$$(cmake-package)) or $$$$(eval $$$$(host-cmake-package)))

1
README.md Normal file
View File

@ -0,0 +1 @@
**thingOS** is a lightweight Linux OS for things.

408
arch/Config.in Normal file
View File

@ -0,0 +1,408 @@
menu "Target options"
config BR2_ARCH_IS_64
bool
config BR2_KERNEL_64_USERLAND_32
bool
config BR2_SOFT_FLOAT
bool
config BR2_ARCH_HAS_MMU_MANDATORY
bool
config BR2_ARCH_HAS_MMU_OPTIONAL
bool
config BR2_ARCH_HAS_FDPIC_SUPPORT
bool
choice
prompt "Target Architecture"
default BR2_i386
help
Select the target architecture family to build for.
config BR2_arcle
bool "ARC (little endian)"
select BR2_ARCH_HAS_MMU_MANDATORY
help
Synopsys' DesignWare ARC Processor Cores are a family of 32-bit CPUs
that can be used from deeply embedded to high performance host
applications. Little endian.
config BR2_arceb
bool "ARC (big endian)"
select BR2_ARCH_HAS_MMU_MANDATORY
help
Synopsys' DesignWare ARC Processor Cores are a family of 32-bit CPUs
that can be used from deeply embedded to high performance host
applications. Big endian.
config BR2_arm
bool "ARM (little endian)"
# MMU support is set by the subarchitecture file, arch/Config.in.arm
help
ARM is a 32-bit reduced instruction set computer (RISC) instruction
set architecture (ISA) developed by ARM Holdings. Little endian.
http://www.arm.com/
http://en.wikipedia.org/wiki/ARM
config BR2_armeb
bool "ARM (big endian)"
# MMU support is set by the subarchitecture file, arch/Config.in.arm
help
ARM is a 32-bit reduced instruction set computer (RISC) instruction
set architecture (ISA) developed by ARM Holdings. Big endian.
http://www.arm.com/
http://en.wikipedia.org/wiki/ARM
config BR2_aarch64
bool "AArch64 (little endian)"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
Aarch64 is a 64-bit architecture developed by ARM Holdings.
http://www.arm.com/products/processors/instruction-set-architectures/armv8-architecture.php
http://en.wikipedia.org/wiki/ARM
config BR2_aarch64_be
bool "AArch64 (big endian)"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
Aarch64 is a 64-bit architecture developed by ARM Holdings.
http://www.arm.com/products/processors/instruction-set-architectures/armv8-architecture.php
http://en.wikipedia.org/wiki/ARM
config BR2_bfin
bool "Blackfin"
select BR2_ARCH_HAS_FDPIC_SUPPORT
help
The Blackfin is a family of 16 or 32-bit microprocessors developed,
manufactured and marketed by Analog Devices.
http://www.analog.com/
http://en.wikipedia.org/wiki/Blackfin
config BR2_i386
bool "i386"
select BR2_ARCH_HAS_MMU_MANDATORY
help
Intel i386 architecture compatible microprocessor
http://en.wikipedia.org/wiki/I386
config BR2_m68k
bool "m68k"
# MMU support is set by the subarchitecture file, arch/Config.in.m68k
help
Motorola 68000 family microprocessor
http://en.wikipedia.org/wiki/M68k
config BR2_microblazeel
bool "Microblaze AXI (little endian)"
select BR2_ARCH_HAS_MMU_MANDATORY
help
Soft processor core designed for Xilinx FPGAs from Xilinx. AXI bus
based architecture (little endian)
http://www.xilinx.com
http://en.wikipedia.org/wiki/Microblaze
config BR2_microblazebe
bool "Microblaze non-AXI (big endian)"
select BR2_ARCH_HAS_MMU_MANDATORY
help
Soft processor core designed for Xilinx FPGAs from Xilinx. PLB bus
based architecture (non-AXI, big endian)
http://www.xilinx.com
http://en.wikipedia.org/wiki/Microblaze
config BR2_mips
bool "MIPS (big endian)"
select BR2_ARCH_HAS_MMU_MANDATORY
help
MIPS is a RISC microprocessor from MIPS Technologies. Big endian.
http://www.mips.com/
http://en.wikipedia.org/wiki/MIPS_Technologies
config BR2_mipsel
bool "MIPS (little endian)"
select BR2_ARCH_HAS_MMU_MANDATORY
help
MIPS is a RISC microprocessor from MIPS Technologies. Little endian.
http://www.mips.com/
http://en.wikipedia.org/wiki/MIPS_Technologies
config BR2_mips64
bool "MIPS64 (big endian)"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
MIPS is a RISC microprocessor from MIPS Technologies. Big endian.
http://www.mips.com/
http://en.wikipedia.org/wiki/MIPS_Technologies
config BR2_mips64el
bool "MIPS64 (little endian)"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
MIPS is a RISC microprocessor from MIPS Technologies. Little endian.
http://www.mips.com/
http://en.wikipedia.org/wiki/MIPS_Technologies
config BR2_nios2
bool "Nios II"
select BR2_ARCH_HAS_MMU_MANDATORY
help
Nios II is a soft core processor from Altera Corporation.
http://www.altera.com/
http://en.wikipedia.org/wiki/Nios_II
config BR2_powerpc
bool "PowerPC"
select BR2_ARCH_HAS_MMU_MANDATORY
help
PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
Big endian.
http://www.power.org/
http://en.wikipedia.org/wiki/Powerpc
config BR2_powerpc64
bool "PowerPC64 (big endian)"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
Big endian.
http://www.power.org/
http://en.wikipedia.org/wiki/Powerpc
config BR2_powerpc64le
bool "PowerPC64 (little endian)"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
PowerPC is a RISC architecture created by Apple-IBM-Motorola alliance.
Little endian.
http://www.power.org/
http://en.wikipedia.org/wiki/Powerpc
config BR2_sh
bool "SuperH"
select BR2_ARCH_HAS_MMU_OPTIONAL
help
SuperH (or SH) is a 32-bit reduced instruction set computer (RISC)
instruction set architecture (ISA) developed by Hitachi.
http://www.hitachi.com/
http://en.wikipedia.org/wiki/SuperH
config BR2_sh64
bool "SuperH64"
depends on BR2_DEPRECATED_SINCE_2015_05
select BR2_ARCH_HAS_MMU_MANDATORY
help
SuperH64 (or SH) is a 64-bit reduced instruction set computer (RISC)
instruction set architecture (ISA) developed by Hitachi.
http://www.hitachi.com/
http://en.wikipedia.org/wiki/SuperH
config BR2_sparc
bool "SPARC"
select BR2_ARCH_HAS_MMU_MANDATORY
help
SPARC (from Scalable Processor Architecture) is a RISC instruction
set architecture (ISA) developed by Sun Microsystems.
http://www.oracle.com/sun
http://en.wikipedia.org/wiki/Sparc
config BR2_sparc64
bool "SPARC64"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
SPARC (from Scalable Processor Architecture) is a RISC instruction
set architecture (ISA) developed by Sun Microsystems.
http://www.oracle.com/sun
http://en.wikipedia.org/wiki/Sparc
config BR2_x86_64
bool "x86_64"
select BR2_ARCH_IS_64
select BR2_ARCH_HAS_MMU_MANDATORY
help
x86-64 is an extension of the x86 instruction set (Intel i386
architecture compatible microprocessor).
http://en.wikipedia.org/wiki/X86_64
config BR2_xtensa
bool "Xtensa"
# MMU support is set by the subarchitecture file, arch/Config.in.xtensa
help
Xtensa is a Tensilica processor IP architecture.
http://en.wikipedia.org/wiki/Xtensa
http://www.tensilica.com/
endchoice
# The following string values are defined by the individual
# Config.in.$ARCH files
config BR2_ARCH
string
config BR2_ENDIAN
string
config BR2_GCC_TARGET_ARCH
string
config BR2_GCC_TARGET_ABI
string
config BR2_GCC_TARGET_CPU
string
config BR2_GCC_TARGET_CPU_REVISION
string
# The value of this option will be passed as --with-fpu=<value> when
# building gcc (internal backend) or -mfpu=<value> in the toolchain
# wrapper (external toolchain)
config BR2_GCC_TARGET_FPU
string
# The value of this option will be passed as --with-float=<value> when
# building gcc (internal backend) or -mfloat-abi=<value> in the toolchain
# wrapper (external toolchain)
config BR2_GCC_TARGET_FLOAT_ABI
string
# The value of this option will be passed as --with-mode=<value> when
# building gcc (internal backend) or -m<value> in the toolchain
# wrapper (external toolchain)
config BR2_GCC_TARGET_MODE
string
# Must be selected by binary formats that support shared libraries.
config BR2_BINFMT_SUPPORTS_SHARED
bool
# Set up target binary format
choice
prompt "Target Binary Format"
default BR2_BINFMT_ELF if BR2_USE_MMU
default BR2_BINFMT_FDPIC if BR2_ARCH_HAS_FDPIC_SUPPORT
default BR2_BINFMT_FLAT
config BR2_BINFMT_ELF
bool "ELF"
depends on BR2_USE_MMU
select BR2_BINFMT_SUPPORTS_SHARED
help
ELF (Executable and Linkable Format) is a format for libraries and
executables used across different architectures and operating
systems.
config BR2_BINFMT_FDPIC
bool "FDPIC"
depends on BR2_ARCH_HAS_FDPIC_SUPPORT
select BR2_BINFMT_SUPPORTS_SHARED
help
ELF FDPIC binaries are based on ELF, but allow the individual load
segments of a binary to be located in memory independently of each
other. This makes this format ideal for use in environments where no
MMU is available.
config BR2_BINFMT_FLAT
bool "FLAT"
depends on !BR2_USE_MMU
help
FLAT binary is a relatively simple and lightweight executable format
based on the original a.out format. It is widely used in environment
where no MMU is available.
endchoice
# Set up flat binary type
choice
prompt "FLAT Binary type"
depends on BR2_BINFMT_FLAT
default BR2_BINFMT_FLAT_ONE
config BR2_BINFMT_FLAT_ONE
bool "One memory region"
help
All segments are linked into one memory region.
config BR2_BINFMT_FLAT_SEP_DATA
bool "Separate data and code region"
help
Allow for the data and text segments to be separated and placed in
different regions of memory.
config BR2_BINFMT_FLAT_SHARED
bool "Shared binary"
# Even though this really generates shared binaries, there is no libdl
# and dlopen() cannot be used. So packages that require shared
# libraries cannot be built. Therefore, we don't select
# BR2_BINFMT_SUPPORTS_SHARED and therefore force BR2_STATIC_LIBS.
# Although this adds -static to the compilation, that's not a problem
# because the -mid-shared-library option overrides it.
help
Allow to load and link indiviual FLAT binaries at run time.
endchoice
if BR2_arcle || BR2_arceb
source "arch/Config.in.arc"
endif
if BR2_arm || BR2_armeb
source "arch/Config.in.arm"
endif
if BR2_aarch64 || BR2_aarch64_be
source "arch/Config.in.aarch64"
endif
if BR2_bfin
source "arch/Config.in.bfin"
endif
if BR2_m68k
source "arch/Config.in.m68k"
endif
if BR2_microblazeel || BR2_microblazebe
source "arch/Config.in.microblaze"
endif
if BR2_mips || BR2_mips64 || BR2_mipsel || BR2_mips64el
source "arch/Config.in.mips"
endif
if BR2_nios2
source "arch/Config.in.nios2"
endif
if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
source "arch/Config.in.powerpc"
endif
if BR2_sh || BR2_sh64
source "arch/Config.in.sh"
endif
if BR2_sparc || BR2_sparc64
source "arch/Config.in.sparc"
endif
if BR2_i386 || BR2_x86_64
source "arch/Config.in.x86"
endif
if BR2_xtensa
source "arch/Config.in.xtensa"
endif
endmenu # Target options

7
arch/Config.in.aarch64 Normal file
View File

@ -0,0 +1,7 @@
config BR2_ARCH
default "aarch64" if BR2_aarch64
default "aarch64_be" if BR2_aarch64_be
config BR2_ENDIAN
default "LITTLE" if BR2_aarch64
default "BIG" if BR2_aarch64_be

77
arch/Config.in.arc Normal file
View File

@ -0,0 +1,77 @@
choice
prompt "Target CPU"
depends on BR2_arc
default BR2_arc770d
help
Specific CPU to use
config BR2_arc750d
bool "ARC 750D"
config BR2_arc770d
bool "ARC 770D"
config BR2_archs38
bool "ARC HS38"
endchoice
# Choice of atomic instructions presence
config BR2_ARC_ATOMIC_EXT
bool "Atomic extension (LLOCK/SCOND instructions)"
default y if BR2_arc770d || BR2_archs38
config BR2_ARCH
default "arc" if BR2_arcle
default "arceb" if BR2_arceb
config BR2_arc
bool
default y if BR2_arcle || BR2_arceb
config BR2_ENDIAN
default "LITTLE" if BR2_arcle
default "BIG" if BR2_arceb
config BR2_GCC_TARGET_CPU
default "arc700" if BR2_arc750d
default "arc700" if BR2_arc770d
default "archs" if BR2_archs38
choice
prompt "MMU Page Size"
default BR2_ARC_PAGE_SIZE_8K
help
MMU starting from version 3 (found in ARC 770) and now
version 4 (found in ARC HS38) allows the selection of the
page size during ASIC design creation.
The following options are available for MMU v3 and v4: 4kB,
8kB and 16 kB.
The default is 8 kB (that really matches the only page size
in MMU v2). It is important to build a toolchain with page
size matching the hardware configuration. Otherwise
user-space applications will fail at runtime.
config BR2_ARC_PAGE_SIZE_4K
bool "4KB"
depends on BR2_arc770d || BR2_archs38
config BR2_ARC_PAGE_SIZE_8K
bool "8KB"
help
This is the one and only option available for MMUv2 and
default value for MMU v3 and v4.
config BR2_ARC_PAGE_SIZE_16K
bool "16KB"
depends on BR2_arc770d || BR2_archs38
endchoice
config BR2_ARC_PAGE_SIZE
string
default "4K" if BR2_ARC_PAGE_SIZE_4K
default "8K" if BR2_ARC_PAGE_SIZE_8K
default "16K" if BR2_ARC_PAGE_SIZE_16K

488
arch/Config.in.arm Normal file
View File

@ -0,0 +1,488 @@
# arm cpu features
config BR2_ARM_CPU_HAS_NEON
bool
# for some cores, NEON support is optional
config BR2_ARM_CPU_MAYBE_HAS_NEON
bool
# for some cores, VFPv2 is optional
config BR2_ARM_CPU_MAYBE_HAS_VFPV2
bool
config BR2_ARM_CPU_HAS_VFPV2
bool
# for some cores, VFPv3 is optional
config BR2_ARM_CPU_MAYBE_HAS_VFPV3
bool
select BR2_ARM_CPU_MAYBE_HAS_VFPV2
config BR2_ARM_CPU_HAS_VFPV3
bool
select BR2_ARM_CPU_HAS_VFPV2
# for some cores, VFPv4 is optional
config BR2_ARM_CPU_MAYBE_HAS_VFPV4
bool
select BR2_ARM_CPU_MAYBE_HAS_VFPV3
config BR2_ARM_CPU_HAS_VFPV4
bool
select BR2_ARM_CPU_HAS_VFPV3
config BR2_ARM_CPU_HAS_ARM
bool
config BR2_ARM_CPU_HAS_THUMB
bool
config BR2_ARM_CPU_HAS_THUMB2
bool
config BR2_ARM_CPU_ARMV4
bool
config BR2_ARM_CPU_ARMV5
bool
config BR2_ARM_CPU_ARMV6
bool
config BR2_ARM_CPU_ARMV7A
bool
config BR2_ARM_CPU_ARMV7M
bool
choice
prompt "Target Architecture Variant"
depends on BR2_arm || BR2_armeb
default BR2_arm926t
help
Specific CPU variant to use
config BR2_arm920t
bool "arm920t"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV4
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_arm922t
bool "arm922t"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV4
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_arm926t
bool "arm926t"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_MAYBE_HAS_VFPV2
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV5
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_arm1136j_s
bool "arm1136j-s"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV6
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_arm1136jf_s
bool "arm1136jf-s"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_VFPV2
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV6
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_arm1176jz_s
bool "arm1176jz-s"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV6
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_arm1176jzf_s
bool "arm1176jzf-s"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_VFPV2
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV6
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_arm11mpcore
bool "mpcore"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_MAYBE_HAS_VFPV2
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV6
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_a5
bool "cortex-A5"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_MAYBE_HAS_NEON
select BR2_ARM_CPU_MAYBE_HAS_VFPV4
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_a7
bool "cortex-A7"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_NEON
select BR2_ARM_CPU_HAS_VFPV4
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_a8
bool "cortex-A8"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_NEON
select BR2_ARM_CPU_HAS_VFPV3
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_a9
bool "cortex-A9"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_MAYBE_HAS_NEON
select BR2_ARM_CPU_MAYBE_HAS_VFPV3
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_a12
bool "cortex-A12"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_NEON
select BR2_ARM_CPU_HAS_VFPV4
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_a15
bool "cortex-A15"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_NEON
select BR2_ARM_CPU_HAS_VFPV4
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_a17
bool "cortex-A17"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_NEON
select BR2_ARM_CPU_HAS_VFPV4
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_cortex_m3
bool "cortex-M3"
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7M
config BR2_cortex_m4
bool "cortex-M4"
select BR2_ARM_CPU_HAS_THUMB2
select BR2_ARM_CPU_ARMV7M
config BR2_fa526
bool "fa526/626"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_ARMV4
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_pj4
bool "pj4"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_VFPV3
select BR2_ARM_CPU_ARMV7A
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_strongarm
bool "strongarm sa110/sa1100"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_ARMV4
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_xscale
bool "xscale"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_HAS_THUMB
select BR2_ARM_CPU_ARMV5
select BR2_ARCH_HAS_MMU_OPTIONAL
config BR2_iwmmxt
bool "iwmmxt"
select BR2_ARM_CPU_HAS_ARM
select BR2_ARM_CPU_ARMV5
select BR2_ARCH_HAS_MMU_OPTIONAL
endchoice
config BR2_ARM_ENABLE_NEON
bool "Enable NEON SIMD extension support"
depends on BR2_ARM_CPU_MAYBE_HAS_NEON
select BR2_ARM_CPU_HAS_NEON
help
For some CPU cores, the NEON SIMD extension is optional.
Select this option if you are certain your particular
implementation has NEON support and you want to use it.
config BR2_ARM_ENABLE_VFP
bool "Enable VFP extension support"
depends on BR2_ARM_CPU_MAYBE_HAS_VFPV2
select BR2_ARM_CPU_HAS_VFPV4 if BR2_ARM_CPU_MAYBE_HAS_VFPV4
select BR2_ARM_CPU_HAS_VFPV3 if BR2_ARM_CPU_MAYBE_HAS_VFPV3
select BR2_ARM_CPU_HAS_VFPV2 if BR2_ARM_CPU_MAYBE_HAS_VFPV2
help
For some CPU cores, the VFP extension is optional. Select
this option if you are certain your particular
implementation has VFP support and you want to use it.
choice
prompt "Target ABI"
depends on BR2_arm || BR2_armeb
default BR2_ARM_EABIHF if BR2_ARM_CPU_HAS_VFPV2
default BR2_ARM_EABI
help
Application Binary Interface to use. The Application Binary
Interface describes the calling conventions (how arguments
are passed to functions, how the return value is passed, how
system calls are made, etc.).
config BR2_ARM_EABI
bool "EABI"
help
The EABI is currently the standard ARM ABI, which is used in
most projects. It supports both the 'soft' floating point
model (in which floating point instructions are emulated in
software) and the 'softfp' floating point model (in which
floating point instructions are executed using an hardware
floating point unit, but floating point arguments to
functions are passed in integer registers).
The 'softfp' floating point model is link-compatible with
the 'soft' floating point model, i.e you can link a library
built 'soft' with some other code built 'softfp'.
However, passing the floating point arguments in integer
registers is a bit inefficient, so if your ARM processor has
a floating point unit, and you don't have pre-compiled
'soft' or 'softfp' code, using the EABIhf ABI will provide
better floating point performances.
If your processor does not have a floating point unit, then
you must use this ABI.
config BR2_ARM_EABIHF
bool "EABIhf"
depends on BR2_ARM_CPU_HAS_VFPV2
help
The EABIhf is an extension of EABI which supports the 'hard'
floating point model. This model uses the floating point
unit to execute floating point instructions, and passes
floating point arguments in floating point registers.
It is more efficient than EABI for floating point related
workload. However, it does not allow to link against code
that has been pre-built for the 'soft' or 'softfp' floating
point models.
If your processor has a floating point unit, and you don't
depend on existing pre-compiled code, this option is most
likely the best choice.
endchoice
choice
prompt "Floating point strategy"
depends on BR2_ARM_EABI || BR2_ARM_EABIHF
default BR2_ARM_FPU_VFPV4D16 if BR2_ARM_CPU_HAS_VFPV4
default BR2_ARM_FPU_VFPV3D16 if BR2_ARM_CPU_HAS_VFPV3
default BR2_ARM_FPU_VFPV2 if BR2_ARM_CPU_HAS_VFPV2
default BR2_ARM_SOFT_FLOAT if !BR2_ARM_CPU_HAS_VFPV2
config BR2_ARM_SOFT_FLOAT
bool "Soft float"
depends on BR2_ARM_EABI
select BR2_SOFT_FLOAT
help
This option allows to use software emulated floating
point. It should be used for ARM cores that do not include a
Vector Floating Point unit, such as ARMv5 cores (ARM926 for
example) or certain ARMv6 cores.
config BR2_ARM_FPU_VFPV2
bool "VFPv2"
depends on BR2_ARM_CPU_HAS_VFPV2
help
This option allows to use the VFPv2 floating point unit, as
available in some ARMv5 processors (ARM926EJ-S) and some
ARMv6 processors (ARM1136JF-S, ARM1176JZF-S and ARM11
MPCore).
Note that this option is also safe to use for newer cores
such as Cortex-A, because the VFPv3 and VFPv4 units are
backward compatible with VFPv2.
config BR2_ARM_FPU_VFPV3
bool "VFPv3"
depends on BR2_ARM_CPU_HAS_VFPV3
help
This option allows to use the VFPv3 floating point unit, as
available in some ARMv7 processors (Cortex-A{8, 9}). This
option requires a VFPv3 unit that has 32 double-precision
registers, which is not necessarily the case in all SOCs
based on Cortex-A{8, 9}. If you're unsure, use VFPv3-D16
instead, which is guaranteed to work on all Cortex-A{8, 9}.
Note that this option is also safe to use for newer cores
that have a VFPv4 unit, because VFPv4 is backward compatible
with VFPv3. They must of course also have 32
double-precision registers.
config BR2_ARM_FPU_VFPV3D16
bool "VFPv3-D16"
depends on BR2_ARM_CPU_HAS_VFPV3
help
This option allows to use the VFPv3 floating point unit, as
available in some ARMv7 processors (Cortex-A{8, 9}). This
option requires a VFPv3 unit that has 16 double-precision
registers, which is generally the case in all SOCs based on
Cortex-A{8, 9}, even though VFPv3 is technically optional on
Cortex-A9. This is the safest option for those cores.
Note that this option is also safe to use for newer cores
such that have a VFPv4 unit, because the VFPv4 is backward
compatible with VFPv3.
config BR2_ARM_FPU_VFPV4
bool "VFPv4"
depends on BR2_ARM_CPU_HAS_VFPV4
help
This option allows to use the VFPv4 floating point unit, as
available in some ARMv7 processors (Cortex-A{5, 7, 12,
15}). This option requires a VFPv4 unit that has 32
double-precision registers, which is not necessarily the
case in all SOCs based on Cortex-A{5, 7, 12, 15}. If you're
unsure, you should probably use VFPv4-D16 instead.
Note that if you want binary code that works on all ARMv7
cores, including the earlier Cortex-A{8, 9}, you should
instead select VFPv3.
config BR2_ARM_FPU_VFPV4D16
bool "VFPv4-D16"
depends on BR2_ARM_CPU_HAS_VFPV4
help
This option allows to use the VFPv4 floating point unit, as
available in some ARMv7 processors (Cortex-A{5, 7, 12,
15}). This option requires a VFPv4 unit that has 16
double-precision registers, which is always available on
Cortex-A12 and Cortex-A15, but optional on Cortex-A5 and
Cortex-A7.
Note that if you want binary code that works on all ARMv7
cores, including the earlier Cortex-A{8, 9}, you should
instead select VFPv3-D16.
config BR2_ARM_FPU_NEON
bool "NEON"
depends on BR2_ARM_CPU_HAS_NEON
help
This option allows to use the NEON SIMD unit, as available
in some ARMv7 processors, as a floating-point unit. It
should however be noted that using NEON for floating point
operations doesn't provide a complete compatibility with the
IEEE 754.
config BR2_ARM_FPU_NEON_VFPV4
bool "NEON/VFPv4"
depends on BR2_ARM_CPU_HAS_VFPV4
depends on BR2_ARM_CPU_HAS_NEON
help
This option allows to use both the VFPv4 and the NEON SIMD
units for floating point operations. Note that some ARMv7
cores do not necessarily have VFPv4 and/or NEON support, for
example on Cortex-A5 and Cortex-A7, support for VFPv4 and
NEON is optional.
endchoice
choice
prompt "ARM instruction set"
config BR2_ARM_INSTRUCTIONS_ARM
bool "ARM"
depends on BR2_ARM_CPU_HAS_ARM
help
This option instructs the compiler to generate regular ARM
instructions, that are all 32 bits wide.
config BR2_ARM_INSTRUCTIONS_THUMB
bool "Thumb"
depends on BR2_ARM_CPU_HAS_THUMB
# Thumb-1 and VFP are not compatible
depends on BR2_ARM_SOFT_FLOAT
help
This option instructions the compiler to generate Thumb
instructions, which allows to mix 16 bits instructions and
32 bits instructions. This generally provides a much smaller
compiled binary size.
comment "Thumb1 is not compatible with VFP"
depends on BR2_ARM_CPU_HAS_THUMB
depends on !BR2_ARM_SOFT_FLOAT
config BR2_ARM_INSTRUCTIONS_THUMB2
bool "Thumb2"
depends on BR2_ARM_CPU_HAS_THUMB2
help
This option instructions the compiler to generate Thumb2
instructions, which allows to mix 16 bits instructions and
32 bits instructions. This generally provides a much smaller
compiled binary size.
endchoice
config BR2_ARCH
default "arm" if BR2_arm
default "armeb" if BR2_armeb
config BR2_ENDIAN
default "LITTLE" if BR2_arm
default "BIG" if BR2_armeb
config BR2_GCC_TARGET_CPU
default "arm920t" if BR2_arm920t
default "arm922t" if BR2_arm922t
default "arm926ej-s" if BR2_arm926t
default "arm1136j-s" if BR2_arm1136j_s
default "arm1136jf-s" if BR2_arm1136jf_s
default "arm1176jz-s" if BR2_arm1176jz_s
default "arm1176jzf-s" if BR2_arm1176jzf_s
default "mpcore" if BR2_arm11mpcore && BR2_ARM_CPU_HAS_VFPV2
default "mpcorenovfp" if BR2_arm11mpcore
default "cortex-a5" if BR2_cortex_a5
default "cortex-a7" if BR2_cortex_a7
default "cortex-a8" if BR2_cortex_a8
default "cortex-a9" if BR2_cortex_a9
default "cortex-a12" if BR2_cortex_a12
default "cortex-a15" if BR2_cortex_a15
default "cortex-a17" if BR2_cortex_a17
default "cortex-m3" if BR2_cortex_m3
default "cortex-m4" if BR2_cortex_m4
default "fa526" if BR2_fa526
default "marvell-pj4" if BR2_pj4
default "strongarm" if BR2_strongarm
default "xscale" if BR2_xscale
default "iwmmxt" if BR2_iwmmxt
config BR2_GCC_TARGET_ABI
default "aapcs-linux"
config BR2_GCC_TARGET_FPU
default "vfp" if BR2_ARM_FPU_VFPV2
default "vfpv3" if BR2_ARM_FPU_VFPV3
default "vfpv3-d16" if BR2_ARM_FPU_VFPV3D16
default "vfpv4" if BR2_ARM_FPU_VFPV4
default "vfpv4-d16" if BR2_ARM_FPU_VFPV4D16
default "neon" if BR2_ARM_FPU_NEON
default "neon-vfpv4" if BR2_ARM_FPU_NEON_VFPV4
config BR2_GCC_TARGET_FLOAT_ABI
default "soft" if BR2_ARM_SOFT_FLOAT
default "softfp" if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABI
default "hard" if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABIHF
config BR2_GCC_TARGET_MODE
default "arm" if BR2_ARM_INSTRUCTIONS_ARM
default "thumb" if BR2_ARM_INSTRUCTIONS_THUMB || BR2_ARM_INSTRUCTIONS_THUMB2

107
arch/Config.in.bfin Normal file
View File

@ -0,0 +1,107 @@
choice
prompt "Target CPU"
depends on BR2_bfin
default BR2_bf609
help
Specify target CPU
config BR2_bf606
bool "bf606"
config BR2_bf607
bool "bf607"
config BR2_bf608
bool "bf608"
config BR2_bf609
bool "bf609"
config BR2_bf512
bool "bf512"
config BR2_bf514
bool "bf514"
config BR2_bf516
bool "bf516"
config BR2_bf518
bool "bf518"
config BR2_bf522
bool "bf522"
config BR2_bf523
bool "bf523"
config BR2_bf524
bool "bf524"
config BR2_bf525
bool "bf525"
config BR2_bf526
bool "bf526"
config BR2_bf527
bool "bf527"
config BR2_bf531
bool "bf531"
config BR2_bf532
bool "bf532"
config BR2_bf533
bool "bf533"
config BR2_bf534
bool "bf534"
config BR2_bf536
bool "bf536"
config BR2_bf537
bool "bf537"
config BR2_bf538
bool "bf538"
config BR2_bf539
bool "bf539"
config BR2_bf542
bool "bf542"
config BR2_bf544
bool "bf544"
config BR2_bf547
bool "bf547"
config BR2_bf548
bool "bf548"
config BR2_bf549
bool "bf549"
config BR2_bf561
bool "bf561"
endchoice
config BR2_ARCH
default "bfin"
config BR2_ENDIAN
default "LITTLE"
config BR2_GCC_TARGET_CPU
default bf606 if BR2_bf606
default bf607 if BR2_bf607
default bf608 if BR2_bf608
default bf609 if BR2_bf609
default bf512 if BR2_bf512
default bf514 if BR2_bf514
default bf516 if BR2_bf516
default bf518 if BR2_bf518
default bf522 if BR2_bf522
default bf523 if BR2_bf523
default bf524 if BR2_bf524
default bf525 if BR2_bf525
default bf526 if BR2_bf526
default bf527 if BR2_bf527
default bf531 if BR2_bf531
default bf532 if BR2_bf532
default bf533 if BR2_bf533
default bf534 if BR2_bf534
default bf536 if BR2_bf536
default bf537 if BR2_bf537
default bf538 if BR2_bf538
default bf539 if BR2_bf539
default bf542 if BR2_bf542
default bf544 if BR2_bf544
default bf547 if BR2_bf547
default bf548 if BR2_bf548
default bf549 if BR2_bf549
default bf561 if BR2_bf561
config BR2_GCC_TARGET_CPU_REVISION
string "Target CPU revision"
help
Specify a target CPU revision, which will be appended to the
value of the -mcpu option. For example, if the selected CPU is
bf609, and then selected CPU revision is "0.0", then gcc will
receive the -mcpu=bf609-0.0 option.

41
arch/Config.in.m68k Normal file
View File

@ -0,0 +1,41 @@
config BR2_ARCH
default "m68k" if BR2_m68k
config BR2_ENDIAN
default "BIG"
# symbols used to distinguish between m68k and coldfire
# for gcc multilib
config BR2_m68k_m68k
bool
config BR2_m68k_cf
bool
# coldfire variants will be added later
choice
prompt "Target CPU"
depends on BR2_m68k
default BR2_m68k_68040
help
Specific CPU variant to use
config BR2_m68k_68040
bool "68040"
select BR2_m68k_m68k
select BR2_ARCH_HAS_MMU_MANDATORY
config BR2_m68k_cf5208
bool "5208"
select BR2_m68k_cf
select BR2_SOFT_FLOAT
endchoice
config BR2_GCC_TARGET_CPU
default "68040" if BR2_m68k_68040
default "5208" if BR2_m68k_cf5208
config BR2_GCC_TARGET_ARCH
default "m68k" if BR2_m68k_m68k
default "cf" if BR2_m68k_cf

11
arch/Config.in.microblaze Normal file
View File

@ -0,0 +1,11 @@
config BR2_ARCH
default "microblazeel" if BR2_microblazeel
default "microblaze" if BR2_microblazebe
config BR2_ENDIAN
default "LITTLE" if BR2_microblazeel
default "BIG" if BR2_microblazebe
config BR2_microblaze
bool
default y if BR2_microblazeel || BR2_microblazebe

85
arch/Config.in.mips Normal file
View File

@ -0,0 +1,85 @@
choice
prompt "Target Architecture Variant"
depends on BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
default BR2_mips_32 if BR2_mips || BR2_mipsel
default BR2_mips_64 if BR2_mips64 || BR2_mips64el
help
Specific CPU variant to use
64bit cabable: 64, 64r2, 64r6
non-64bit capable: 32, 32r2, 32r6
config BR2_mips_32
bool "mips 32"
depends on !BR2_ARCH_IS_64
config BR2_mips_32r2
bool "mips 32r2"
depends on !BR2_ARCH_IS_64
config BR2_mips_32r6
bool "mips 32r6"
depends on !BR2_ARCH_IS_64
config BR2_mips_64
bool "mips 64"
depends on BR2_ARCH_IS_64
config BR2_mips_64r2
bool "mips 64r2"
depends on BR2_ARCH_IS_64
config BR2_mips_64r6
bool "mips 64r6"
depends on BR2_ARCH_IS_64
endchoice
choice
prompt "Target ABI"
depends on BR2_mips64 || BR2_mips64el
default BR2_MIPS_NABI32
help
Application Binary Interface to use
config BR2_MIPS_NABI32
bool "n32"
depends on BR2_ARCH_IS_64
select BR2_KERNEL_64_USERLAND_32
config BR2_MIPS_NABI64
bool "n64"
depends on BR2_ARCH_IS_64
endchoice
config BR2_MIPS_SOFT_FLOAT
bool "Use soft-float"
default y
select BR2_SOFT_FLOAT
help
If your target CPU does not have a Floating Point Unit (FPU)
or a kernel FPU emulator, but you still wish to support
floating point functions, then everything will need to be
compiled with soft floating point support (-msoft-float).
config BR2_ARCH
default "mips" if BR2_mips
default "mipsel" if BR2_mipsel
default "mips64" if BR2_mips64
default "mips64el" if BR2_mips64el
config BR2_ENDIAN
default "LITTLE" if BR2_mipsel || BR2_mips64el
default "BIG" if BR2_mips || BR2_mips64
config BR2_GCC_TARGET_ARCH
default "mips32" if BR2_mips_32
default "mips32r2" if BR2_mips_32r2
default "mips32r6" if BR2_mips_32r6
default "mips64" if BR2_mips_64
default "mips64r2" if BR2_mips_64r2
default "mips64r6" if BR2_mips_64r6
config BR2_MIPS_OABI32
bool
default y if BR2_mips || BR2_mipsel
config BR2_GCC_TARGET_ABI
default "32" if BR2_MIPS_OABI32
default "n32" if BR2_MIPS_NABI32
default "64" if BR2_MIPS_NABI64

5
arch/Config.in.nios2 Normal file
View File

@ -0,0 +1,5 @@
config BR2_ARCH
default "nios2"
config BR2_ENDIAN
default "LITTLE"

214
arch/Config.in.powerpc Normal file
View File

@ -0,0 +1,214 @@
config BR2_POWERPC_CPU_HAS_ALTIVEC
bool
config BR2_POWERPC_CPU_HAS_SPE
bool
choice
prompt "Target Architecture Variant"
default BR2_generic_powerpc
help
Specific CPU variant to use
config BR2_generic_powerpc
bool "generic"
config BR2_powerpc_401
bool "401"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_403
bool "403"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_405
bool "405"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_405fp
bool "405 with FPU"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_440
bool "440"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_440fp
bool "440 with FPU"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_464
bool "464"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_464fp
bool "464 with FPU"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_476
bool "476"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_476fp
bool "476 with FPU"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_505
bool "505"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_601
bool "601"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_602
bool "602"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_603
bool "603"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_603e
bool "603e"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_604
bool "604"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_604e
bool "604e"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_620
bool "620"
config BR2_powerpc_630
bool "630"
config BR2_powerpc_740
bool "740"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_7400
bool "7400"
select BR2_POWERPC_CPU_HAS_ALTIVEC
depends on !BR2_ARCH_IS_64
config BR2_powerpc_7450
bool "7450"
select BR2_POWERPC_CPU_HAS_ALTIVEC
depends on !BR2_ARCH_IS_64
config BR2_powerpc_750
bool "750"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_821
bool "821"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_823
bool "823"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_860
bool "860"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_970
bool "970"
select BR2_POWERPC_CPU_HAS_ALTIVEC
config BR2_powerpc_8540
bool "8540 / e500v1"
depends on !BR2_ARCH_IS_64
select BR2_POWERPC_CPU_HAS_SPE
config BR2_powerpc_8548
bool "8548 / e500v2"
depends on !BR2_ARCH_IS_64
select BR2_POWERPC_CPU_HAS_SPE
config BR2_powerpc_e300c2
bool "e300c2"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_e300c3
bool "e300c3"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_e500mc
bool "e500mc"
depends on !BR2_ARCH_IS_64
config BR2_powerpc_e5500
bool "e5500"
depends on !BR2_powerpc64le
config BR2_powerpc_e6500
bool "e6500"
depends on !BR2_powerpc64le
select BR2_POWERPC_CPU_HAS_ALTIVEC
config BR2_powerpc_power4
bool "power4"
config BR2_powerpc_power5
bool "power5"
config BR2_powerpc_power6
bool "power6"
select BR2_POWERPC_CPU_HAS_ALTIVEC
config BR2_powerpc_power7
bool "power7"
select BR2_POWERPC_CPU_HAS_ALTIVEC
config BR2_powerpc_power8
bool "power8"
select BR2_POWERPC_CPU_HAS_ALTIVEC
endchoice
choice
prompt "Target ABI"
default BR2_powerpc_SPE if BR2_POWERPC_CPU_HAS_SPE
default BR2_powerpc_CLASSIC
help
Application Binary Interface to use
config BR2_powerpc_CLASSIC
bool "Classic"
depends on !BR2_POWERPC_CPU_HAS_SPE
config BR2_powerpc_SPE
bool "SPE"
depends on BR2_POWERPC_CPU_HAS_SPE
endchoice
config BR2_POWERPC_SOFT_FLOAT
bool "Use soft-float"
select BR2_SOFT_FLOAT
help
If your target CPU does not have a Floating Point Unit (FPU)
or a kernel FPU emulator, but you still wish to support
floating point functions, then everything will need to be
compiled with soft floating point support (-msoft-float).
config BR2_ARCH
default "powerpc" if BR2_powerpc
default "powerpc64" if BR2_powerpc64
default "powerpc64le" if BR2_powerpc64le
config BR2_ENDIAN
default "BIG" if BR2_powerpc || BR2_powerpc64
default "LITTLE" if BR2_powerpc64le
config BR2_GCC_TARGET_CPU
default "401" if BR2_powerpc_401
default "403" if BR2_powerpc_403
default "405" if BR2_powerpc_405
default "405fp" if BR2_powerpc_405fp
default "440" if BR2_powerpc_440
default "440fp" if BR2_powerpc_440fp
default "464" if BR2_powerpc_464
default "464fp" if BR2_powerpc_464fp
default "476" if BR2_powerpc_476
default "476fp" if BR2_powerpc_476fp
default "505" if BR2_powerpc_505
default "601" if BR2_powerpc_601
default "602" if BR2_powerpc_602
default "603" if BR2_powerpc_603
default "603e" if BR2_powerpc_603e
default "604" if BR2_powerpc_604
default "604e" if BR2_powerpc_604e
default "620" if BR2_powerpc_620
default "630" if BR2_powerpc_630
default "740" if BR2_powerpc_740
default "7400" if BR2_powerpc_7400
default "7450" if BR2_powerpc_7450
default "750" if BR2_powerpc_750
default "821" if BR2_powerpc_821
default "823" if BR2_powerpc_823
default "860" if BR2_powerpc_860
default "970" if BR2_powerpc_970
default "8540" if BR2_powerpc_8540
default "8548" if BR2_powerpc_8548
default "e300c2" if BR2_powerpc_e300c2
default "e300c3" if BR2_powerpc_e300c3
default "e500mc" if BR2_powerpc_e500mc
default "e5500" if BR2_powerpc_e5500
default "e6500" if BR2_powerpc_e6500
default "power4" if BR2_powerpc_power4
default "power5" if BR2_powerpc_power5
default "power6" if BR2_powerpc_power6
default "power7" if BR2_powerpc_power7
default "power8" if BR2_powerpc_power8
config BR2_GCC_TARGET_ABI
default "altivec" if BR2_PPC_ABI_altivec
default "no-altivec" if BR2_PPC_ABI_no-altivec
default "spe" if BR2_PPC_ABI_spe
default "no-spe" if BR2_PPC_ABI_no-spe
default "ibmlongdouble" if BR2_PPC_ABI_ibmlongdouble
default "ieeelongdouble" if BR2_PPC_ABI_ieeelongdouble

30
arch/Config.in.sh Normal file
View File

@ -0,0 +1,30 @@
choice
prompt "Target Architecture Variant"
depends on BR2_sh
default BR2_sh4
help
Specific CPU variant to use
config BR2_sh2a
bool "sh2a (SH2A big endian)"
config BR2_sh4
bool "sh4 (SH4 little endian)"
config BR2_sh4eb
bool "sh4eb (SH4 big endian)"
config BR2_sh4a
bool "sh4a (SH4A little endian)"
config BR2_sh4aeb
bool "sh4aeb (SH4A big endian)"
endchoice
config BR2_ARCH
default "sh2a" if BR2_sh2a
default "sh4" if BR2_sh4
default "sh4eb" if BR2_sh4eb
default "sh4a" if BR2_sh4a
default "sh4aeb" if BR2_sh4aeb
default "sh64" if BR2_sh64
config BR2_ENDIAN
default "LITTLE" if BR2_sh4 || BR2_sh4a || BR2_sh64
default "BIG" if BR2_sh2a || BR2_sh4eb || BR2_sh4aeb

30
arch/Config.in.sparc Normal file
View File

@ -0,0 +1,30 @@
choice
prompt "Target Architecture Variant"
depends on BR2_sparc || BR2_sparc64
default BR2_sparc_v8 if BR2_sparc
default BR2_sparc_v9 if BR2_sparc64
help
Specific CPU variant to use
config BR2_sparc_v8
bool "v8"
depends on BR2_sparc
config BR2_sparc_leon3
bool "leon3"
depends on BR2_sparc
config BR2_sparc_v9
bool "v9"
depends on BR2_sparc64
endchoice
config BR2_ARCH
default "sparc" if BR2_sparc
default "sparc64" if BR2_sparc64
config BR2_ENDIAN
default "BIG"
config BR2_GCC_TARGET_CPU
default "leon3" if BR2_sparc_leon3
default "v8" if BR2_sparc_v8
default "ultrasparc" if BR2_sparc_v9

277
arch/Config.in.x86 Normal file
View File

@ -0,0 +1,277 @@
# i386/x86_64 cpu features
config BR2_X86_CPU_HAS_MMX
bool
config BR2_X86_CPU_HAS_SSE
bool
config BR2_X86_CPU_HAS_SSE2
bool
config BR2_X86_CPU_HAS_SSE3
bool
config BR2_X86_CPU_HAS_SSSE3
bool
config BR2_X86_CPU_HAS_SSE4
bool
config BR2_X86_CPU_HAS_SSE42
bool
config BR2_X86_CPU_HAS_AVX
bool
config BR2_X86_CPU_HAS_AVX2
bool
choice
prompt "Target Architecture Variant"
depends on BR2_i386 || BR2_x86_64
default BR2_x86_i586 if BR2_i386
help
Specific CPU variant to use
config BR2_x86_i486
bool "i486"
depends on !BR2_x86_64
config BR2_x86_i586
bool "i586"
depends on !BR2_x86_64
config BR2_x86_x1000
bool "x1000"
depends on !BR2_x86_64
help
The Intel X1000 is a Pentium class microprocessor in the
Quark (sub-Atom) Product Line. The X1000 has a bug on the
lock prefix requiring that prefix must be stripped at build
time.
See https://en.wikipedia.org/wiki/Intel_Quark
config BR2_x86_i686
bool "i686"
depends on !BR2_x86_64
config BR2_x86_pentiumpro
bool "pentium pro"
depends on !BR2_x86_64
config BR2_x86_pentium_mmx
bool "pentium MMX"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
config BR2_x86_pentium_m
bool "pentium mobile"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
depends on !BR2_x86_64
config BR2_x86_pentium2
bool "pentium2"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
config BR2_x86_pentium3
bool "pentium3"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
depends on !BR2_x86_64
config BR2_x86_pentium4
bool "pentium4"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
depends on !BR2_x86_64
config BR2_x86_prescott
bool "prescott"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
depends on !BR2_x86_64
config BR2_x86_nocona
bool "nocona"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
config BR2_x86_core2
bool "core2"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
select BR2_X86_CPU_HAS_SSSE3
config BR2_x86_corei7
bool "corei7"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
select BR2_X86_CPU_HAS_SSSE3
select BR2_X86_CPU_HAS_SSE4
select BR2_X86_CPU_HAS_SSE42
config BR2_x86_corei7_avx
bool "corei7-avx"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
select BR2_X86_CPU_HAS_SSSE3
select BR2_X86_CPU_HAS_SSE4
select BR2_X86_CPU_HAS_SSE42
select BR2_X86_CPU_HAS_AVX
config BR2_x86_core_avx2
bool "core-avx2"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
select BR2_X86_CPU_HAS_SSSE3
select BR2_X86_CPU_HAS_SSE4
select BR2_X86_CPU_HAS_SSE42
select BR2_X86_CPU_HAS_AVX
select BR2_X86_CPU_HAS_AVX2
config BR2_x86_atom
bool "atom"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
select BR2_X86_CPU_HAS_SSSE3
config BR2_x86_k6
bool "k6"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
config BR2_x86_k6_2
bool "k6-2"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
config BR2_x86_athlon
bool "athlon"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
config BR2_x86_athlon_4
bool "athlon-4"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
depends on !BR2_x86_64
config BR2_x86_opteron
bool "opteron"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
config BR2_x86_opteron_sse3
bool "opteron w/ SSE3"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
config BR2_x86_barcelona
bool "barcelona"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
config BR2_x86_jaguar
bool "jaguar"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
select BR2_X86_CPU_HAS_SSSE3
select BR2_X86_CPU_HAS_SSE4
select BR2_X86_CPU_HAS_SSE42
config BR2_x86_steamroller
bool "steamroller"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_SSE2
select BR2_X86_CPU_HAS_SSE3
select BR2_X86_CPU_HAS_SSSE3
select BR2_X86_CPU_HAS_SSE4
select BR2_X86_CPU_HAS_SSE42
config BR2_x86_geode
bool "geode"
# Don't include MMX support because there several variant of geode
# processor, some with MMX support, some without.
# See: http://en.wikipedia.org/wiki/Geode_%28processor%29
depends on !BR2_x86_64
config BR2_x86_c3
bool "Via/Cyrix C3 (Samuel/Ezra cores)"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
config BR2_x86_c32
bool "Via C3-2 (Nehemiah cores)"
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
depends on !BR2_x86_64
config BR2_x86_winchip_c6
bool "IDT Winchip C6"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
config BR2_x86_winchip2
bool "IDT Winchip 2"
select BR2_X86_CPU_HAS_MMX
depends on !BR2_x86_64
endchoice
config BR2_ARCH
default "i486" if BR2_x86_i486
default "i586" if BR2_x86_i586
default "i586" if BR2_x86_x1000
default "i586" if BR2_x86_pentium_mmx
default "i586" if BR2_x86_geode
default "i586" if BR2_x86_c3
default "i686" if BR2_x86_c32
default "i586" if BR2_x86_winchip_c6
default "i586" if BR2_x86_winchip2
default "i686" if BR2_x86_i686
default "i686" if BR2_x86_pentium2
default "i686" if BR2_x86_pentium3
default "i686" if BR2_x86_pentium4
default "i686" if BR2_x86_pentium_m
default "i686" if BR2_x86_pentiumpro
default "i686" if BR2_x86_prescott
default "i686" if BR2_x86_nocona && BR2_i386
default "i686" if BR2_x86_core2 && BR2_i386
default "i686" if BR2_x86_corei7 && BR2_i386
default "i686" if BR2_x86_corei7_avx && BR2_i386
default "i686" if BR2_x86_corei7_avx2 && BR2_i386
default "i686" if BR2_x86_atom && BR2_i386
default "i686" if BR2_x86_opteron && BR2_i386
default "i686" if BR2_x86_opteron_sse3 && BR2_i386
default "i686" if BR2_x86_barcelona && BR2_i386
default "i686" if BR2_x86_jaguar && BR2_i386
default "i686" if BR2_x86_steamroller && BR2_i386
default "i686" if BR2_x86_k6
default "i686" if BR2_x86_k6_2
default "i686" if BR2_x86_athlon
default "i686" if BR2_x86_athlon_4
default "x86_64" if BR2_x86_64
config BR2_ENDIAN
default "LITTLE"
config BR2_GCC_TARGET_ARCH
default "i486" if BR2_x86_i486
default "i586" if BR2_x86_i586
default "i586" if BR2_x86_x1000
default "pentium-mmx" if BR2_x86_pentium_mmx
default "i686" if BR2_x86_i686
default "pentiumpro" if BR2_x86_pentiumpro
default "pentium-m" if BR2_x86_pentium_m
default "pentium2" if BR2_x86_pentium2
default "pentium3" if BR2_x86_pentium3
default "pentium4" if BR2_x86_pentium4
default "prescott" if BR2_x86_prescott
default "nocona" if BR2_x86_nocona
default "core2" if BR2_x86_core2
default "corei7" if BR2_x86_corei7
default "corei7-avx" if BR2_x86_corei7_avx
default "core-avx2" if BR2_x86_core_avx2
default "atom" if BR2_x86_atom
default "k8" if BR2_x86_opteron
default "k8-sse3" if BR2_x86_opteron_sse3
default "barcelona" if BR2_x86_barcelona
default "btver2" if BR2_x86_jaguar
default "bdver3" if BR2_x86_steamroller
default "k6" if BR2_x86_k6
default "k6-2" if BR2_x86_k6_2
default "athlon" if BR2_x86_athlon
default "athlon-4" if BR2_x86_athlon_4
default "winchip-c6" if BR2_x86_winchip_c6
default "winchip2" if BR2_x86_winchip2
default "c3" if BR2_x86_c3
default "c3-2" if BR2_x86_c32
default "geode" if BR2_x86_geode

56
arch/Config.in.xtensa Normal file
View File

@ -0,0 +1,56 @@
choice
prompt "Target Architecture Variant"
depends on BR2_xtensa
default BR2_xtensa_fsf
config BR2_XTENSA_CUSTOM
select BR2_ARCH_HAS_MMU_OPTIONAL
bool "Custom Xtensa processor configuration"
config BR2_xtensa_fsf
select BR2_ARCH_HAS_MMU_MANDATORY
bool "fsf - Default configuration"
endchoice
config BR2_XTENSA_CUSTOM_NAME
string "Custom Xtensa processor configuration name"
depends on BR2_XTENSA_CUSTOM
default ""
help
Name given to a custom Xtensa processor configuration.
config BR2_XTENSA_CORE_NAME
string
default BR2_XTENSA_CUSTOM_NAME if BR2_XTENSA_CUSTOM
default "" if BR2_xtensa_fsf
config BR2_XTENSA_OVERLAY_DIR
string "Overlay directory for custom configuration"
depends on BR2_XTENSA_CUSTOM
default ""
help
Provide the directory path that contains the overlay file
for a custom processor configuration. The path is relative
to the top directory of buildroot.
These overlay files are tar packages with updated configuration
files for various toolchain packages and Xtensa processor
configurations. They are provided by the processor vendor or
directly from Tensilica.
choice
prompt "Target Architecture Endianness"
depends on BR2_XTENSA_CUSTOM
default BR2_XTENSA_LITTLE_ENDIAN
config BR2_XTENSA_LITTLE_ENDIAN
bool "Little endian"
config BR2_XTENSA_BIG_ENDIAN
bool "Big endian"
endchoice
config BR2_ENDIAN
default "LITTLE" if BR2_XTENSA_LITTLE_ENDIAN
default "BIG" if BR2_xtensa_fsf || BR2_XTENSA_BIG_ENDIAN
config BR2_ARCH
default "xtensa" if BR2_xtensa

7
board/bananapi/boot.cmd Normal file
View File

@ -0,0 +1,7 @@
setenv bootargs console=tty1 root=/dev/mmcblk0p2 rootwait panic=10 earlyprintk quiet loglevel=1 ipv6.disable=1 ${extra}
fatload mmc 0 0x49000000 sun7i-a20-bananapi.dtb
fatload mmc 0 0x46000000 uImage
setenv fdt_high ffffffff
setenv video-mode sunxi:1024x768-24@60,monitor=hdmi,hpd=1,edid=1
bootm 0x46000000 - 0x49000000

3304
board/bananapi/kernel.config Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

12
board/bananapi/mkimage.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash -e
BOARD_DIR=$(dirname $0)
COMMON_DIR=$BOARD_DIR/../common
export BOARD=$(basename $BOARD_DIR)
export IMG_DIR=$BOARD_DIR/../../output/$BOARD/images/
export UBOOT_BIN=$IMG_DIR/u-boot-sunxi-with-spl.bin
export UBOOT_SEEK=16
$COMMON_DIR/mkimage.sh

View File

@ -0,0 +1 @@
bananapi

View File

@ -0,0 +1,5 @@
#!/bin/bash
sn=$(cat /sys/class/net/eth0/address 2>/dev/null| tr -d ':')
echo ${sn: -8}

12
board/bananapi/postscript.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
UBOOT_HOST_DIR=$TARGET/../build/host-uboot-tools-*
cp $IMG_DIR/uImage $BOOT_DIR
cp $IMG_DIR/sun7i-a20-bananapi.dtb $BOOT_DIR
$UBOOT_HOST_DIR/tools/mkimage -C none -A arm -T script -d $BOARD_DIR/boot.cmd $BOOT_DIR/boot.scr
# disable software updating
sed -i 's/enable_update true/enable_update false/' $TARGET/etc/motioneye.conf

1057
board/common/busybox.config Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

193
board/common/cleanups.sh Executable file
View File

@ -0,0 +1,193 @@
#!/bin/sh
if [ -z "$TARGET" ]; then
echo "this script must be invoked from postscript.sh"
exit 1
fi
rm -f $TARGET/boot/.gitkeep
# /etc stuff
rm -rf $TARGET/etc/network/
rm -rf $TARGET/etc/dhcp/
rm -rf $TARGET/etc/ssh/
rm -rf $TARGET/etc/rc_keymaps/
rm -rf $TARGET/etc/default/
rm -rf $TARGET/etc/ctdb/
rm -rf $TARGET/etc/sudoers.d/
rm -rf $TARGET/etc/ssl/man
rm -rf $TARGET/etc/ssl/misc
rm -rf $TARGET/etc/ssl/private
rm -rf $TARGET/etc/logrotate.d
rm -f $TARGET/etc/rc_maps.cfg
rm -f $TARGET/etc/udev/hwdb.d/20-pci-vendor-model.hwdb
rm -f $TARGET/etc/motion-dist.conf
rm -f $TARGET/etc/hostname
rm -f $TARGET/etc/os-release
# /usr/share stuff
rm -rf $TARGET/usr/share/bash-completion/
rm -rf $TARGET/usr/share/locale/*
rm -rf $TARGET/usr/share/ffmpeg/
rm -rf $TARGET/usr/share/perl5/
rm -rf $TARGET/usr/share/common-lisp/
find $TARGET -name '*libmount*' | xargs rm -rf
# various binaries
rm -f $TARGET/bin/more
rm -f $TARGET/bin/wdctl
rm -f $TARGET/usr/sbin/readprofile
rm -f $TARGET/sbin/nologin
rm -f $TARGET/bin/mountpoint
rm -f $TARGET/sbin/ldattach
rm -f $TARGET/usr/sbin/ldattach
rm -f $TARGET/sbin/slattach
rm -f $TARGET/sbin/plipconfig
rm -f $TARGET/sbin/fstrim
rm -f $TARGET/usr/sbin/rtcwake
rm -f $TARGET/bin/lsblk
rm -f $TARGET/usr/bin/col
rm -f $TARGET/sbin/fdformat
rm -f $TARGET/sbin/ctrlaltdel
rm -f $TARGET/bin/findmnt
rm -f $TARGET/usr/bin/colcrt
rm -f $TARGET/sbin/fsfreeze
rm -f $TARGET/usr/bin/colrm
rm -f $TARGET/usr/sbin/addpart
rm -f $TARGET/sbin/blkdiscard
rm -f $TARGET/usr/sbin/delpart
rm -f $TARGET/usr/bin/column
rm -f $TARGET/sbin/swapon
rm -f $TARGET/usr/sbin/resizepart
rm -f $TARGET/usr/bin/hexdump
rm -f $TARGET/sbin/swapoff
rm -f $TARGET/usr/bin/rev
rm -f $TARGET/sbin/chcpu
rm -f $TARGET/usr/bin/tailf
rm -f $TARGET/usr/bin/pg
rm -f $TARGET/sbin/blkid
rm -f $TARGET/usr/bin/ul
rm -f $TARGET/sbin/findfs
rm -f $TARGET/sbin/wipefs
rm -f $TARGET/usr/bin/script
rm -f $TARGET/usr/bin/scriptreplay
rm -f $TARGET/sbin/fsck.minix
rm -f $TARGET/sbin/mkfs.minix
rm -f $TARGET/usr/bin/setterm
rm -f $TARGET/usr/bin/flock
rm -f $TARGET/sbin/mkfs
rm -f $TARGET/usr/bin/ipcmk
rm -f $TARGET/sbin/mkfs.bfs
rm -f $TARGET/usr/bin/ipcrm
rm -f $TARGET/usr/bin/ipcs
rm -f $TARGET/sbin/mkswap
rm -f $TARGET/usr/bin/renice
rm -f $TARGET/sbin/swaplabel
rm -f $TARGET/usr/bin/setsid
rm -f $TARGET/sbin/blockdev
rm -f $TARGET/usr/bin/cytune
rm -f $TARGET/usr/bin/setarch
rm -f $TARGET/sbin/sfdisk
rm -f $TARGET/usr/bin/prlimit
rm -f $TARGET/sbin/cfdisk
rm -f $TARGET/usr/bin/lscpu
rm -f $TARGET/usr/bin/unshare
rm -f $TARGET/usr/bin/nsenter
rm -f $TARGET/usr/bin/cal
rm -f $TARGET/usr/bin/look
rm -f $TARGET/usr/bin/mcookie
rm -f $TARGET/usr/bin/namei
rm -f $TARGET/usr/bin/whereis
rm -f $TARGET/usr/bin/lslocks
rm -f $TARGET/usr/bin/uuidgen
rm -f $TARGET/usr/bin/getopt
rm -f $TARGET/bin/isosize
rm -f $TARGET/usr/sbin/fdformat
rm -f $TARGET/usr/bin/linux32
rm -f $TARGET/usr/bin/linux64
rm -f $TARGET/usr/bin/uname26
rm -f $TARGET/bin/zcat
rm -f $TARGET/bin/zcmp
rm -f $TARGET/bin/zdiff
rm -f $TARGET/bin/zegrep
rm -f $TARGET/bin/zfgrep
rm -f $TARGET/bin/zforce
rm -f $TARGET/bin/zgrep
rm -f $TARGET/bin/zless
rm -f $TARGET/bin/zmore
rm -f $TARGET/bin/znew
rm -f $TARGET/bin/gzexe
rm -f $TARGET/bin/uncompress
rm -f $TARGET/usr/bin/v4l2-compliance
rm -f $TARGET/usr/bin/slogin
rm -f $TARGET/usr/bin/ssh-keyscan
rm -f $TARGET/usr/bin/ssh-add
rm -f $TARGET/usr/bin/ssh-agent
rm -f $TARGET/usr/libexec/ssh-keysign
rm -f $TARGET/usr/libexec/ssh-pkcs11-helper
rm -f $TARGET/usr/libexec/rmt
rm -rf $TARGET/libexec
# samba4 unneeded stuff
rm -f $TARGET/usr/bin/cifsdd
rm -f $TARGET/usr/bin/containers_*
rm -f $TARGET/usr/bin/ctdb*
rm -f $TARGET/usr/bin/dbwrap_tool
rm -f $TARGET/usr/bin/eventlogadm
rm -f $TARGET/usr/bin/gentest
rm -f $TARGET/usr/bin/ldb*
rm -f $TARGET/usr/bin/locktest
rm -f $TARGET/usr/bin/ltdbtool
rm -f $TARGET/usr/bin/masktest
rm -f $TARGET/usr/bin/ndrdump
rm -f $TARGET/usr/bin/net
rm -f $TARGET/usr/bin/ntdb*
rm -f $TARGET/usr/bin/ntlm_auth
rm -f $TARGET/usr/bin/oLschema2ldif
rm -f $TARGET/usr/bin/onnode
rm -f $TARGET/usr/bin/pdbedit
rm -f $TARGET/usr/bin/pidl
rm -f $TARGET/usr/bin/ping_pong
rm -f $TARGET/usr/bin/profiles
rm -f $TARGET/usr/bin/reg*
rm -f $TARGET/usr/bin/rpcclient
rm -f $TARGET/usr/bin/sharesec
rm -f $TARGET/usr/bin/smbcacls
rm -f $TARGET/usr/bin/smbcontrol
rm -f $TARGET/usr/bin/smbcquotas
rm -f $TARGET/usr/bin/smbget
rm -f $TARGET/usr/bin/smbspool
rm -f $TARGET/usr/bin/smbstatus
rm -f $TARGET/usr/bin/smbta-util
rm -f $TARGET/usr/bin/smbtar
rm -f $TARGET/usr/bin/smbtree
rm -f $TARGET/usr/bin/smnotify
rm -f $TARGET/usr/bin/tdb*
rm -f $TARGET/usr/bin/testparm
rm -f $TARGET/usr/bin/wbinfo
rm -f $TARGET/usr/sbin/ctdb*
rm -f $TARGET/usr/sbin/winbindd
rm -f $TARGET/usr/share/perl5
# unused python folders
rm -rf $TARGET/usr/lib/python2.7/site-packages/samba/
rm -rf $TARGET/usr/lib/python2.7/ensurepip/
# buildroot default startup scripts
rm -f $TARGET/etc/init.d/S01logging
rm -f $TARGET/etc/init.d/S10udev
rm -f $TARGET/etc/init.d/S15watchdog
rm -f $TARGET/etc/init.d/S49ntp
rm -f $TARGET/etc/init.d/S50sshd
rm -f $TARGET/etc/init.d/S50proftpd
rm -f $TARGET/etc/init.d/S20urandom
rm -f $TARGET/etc/init.d/S80dhcp-relay
rm -f $TARGET/etc/init.d/S80dhcp-server
rm -f $TARGET/etc/init.d/S91smb
# other unwanted dirs
rm -rf $TARGET/data/*

171
board/common/mkimage.sh Executable file
View File

@ -0,0 +1,171 @@
#!/bin/bash -e
if [ -z "$IMG_DIR" ] || [ -z "$BOARD" ]; then
echo "this script must be invoked from board specific mkimage.sh"
exit 1
fi
test "root" != "$USER" && exec sudo -E $0 "$@"
function msg() {
echo ":: $1"
}
function cleanup {
set +e
# unmount loop mounts
mount | grep /dev/loop | cut -d ' ' -f 3 | xargs -r umount
# remove loop devices
losetup -a | cut -d ':' -f 1 | xargs -r losetup -d
}
trap cleanup EXIT
BOOT_SRC=$IMG_DIR/boot
BOOT=$IMG_DIR/.boot
BOOT_IMG=$IMG_DIR/boot.img
BOOT_SIZE="20" # MB
ROOT_SRC=$IMG_DIR/rootfs.tar
ROOT=$IMG_DIR/.root
ROOT_IMG=$IMG_DIR/root.img
ROOT_SIZE="180" # MB
DISK_SIZE="220" # MB
OS_NAME=$(source $IMG_DIR/../../../board/common/overlay/etc/version && echo $os_short_name)
# boot filesystem
msg "creating boot loop device"
dd if=/dev/zero of=$BOOT_IMG bs=1M count=$BOOT_SIZE
loop_dev=$(losetup -f)
losetup -f $BOOT_IMG
msg "creating boot filesystem"
mkfs.vfat -F16 $loop_dev
msg "mounting boot loop device"
mkdir -p $BOOT
mount -o loop $loop_dev $BOOT
msg "copying boot filesystem contents"
cp $BOOT_SRC/* $BOOT
sync
msg "unmounting boot filesystem"
umount $BOOT
msg "destroying boot loop device"
losetup -d $loop_dev
sync
# root filesystem
msg "creating root loop device"
dd if=/dev/zero of=$ROOT_IMG bs=1M count=$ROOT_SIZE
loop_dev=$(losetup -f)
losetup -f $ROOT_IMG
msg "creating root filesystem"
mkfs.ext4 $loop_dev
tune2fs -O^has_journal $loop_dev
msg "mounting root loop device"
mkdir -p $ROOT
mount -o loop $loop_dev $ROOT
msg "copying root filesystem contents"
tar -xpsf $ROOT_SRC -C $ROOT
msg "unmounting root filesystem"
umount $ROOT
msg "destroying root loop device"
losetup -d $loop_dev
sync
DISK_IMG=$IMG_DIR/disk.img
BOOT_IMG=$IMG_DIR/boot.img
ROOT_IMG=$IMG_DIR/root.img
if ! [ -r $BOOT_IMG ]; then
echo "boot image missing"
exit -1
fi
if ! [ -r $ROOT_IMG ]; then
echo "root image missing"
exit -1
fi
# disk image
msg "creating disk loop device"
dd if=/dev/zero of=$DISK_IMG bs=1M count=$DISK_SIZE
if [ -n "$UBOOT_BIN" ] && [ -n "$UBOOT_SEEK" ]; then
msg "copying u-boot image"
dd conv=notrunc if=$UBOOT_BIN of=$DISK_IMG bs=512 seek=$UBOOT_SEEK
fi
loop_dev=$(losetup -f)
losetup -f $DISK_IMG
msg "partitioning disk"
set +e
fdisk -u=sectors $loop_dev <<END
o
n
p
1
+${BOOT_SIZE}M
n
p
2
+${ROOT_SIZE}M
t
1
e
a
1
w
END
set -e
sync
msg "reading partition offsets"
boot_offs=$(fdisk -u=sectors -l $loop_dev | grep -E 'loop[[:digit:]]p1' | tr -d '*' | tr -s ' ' | cut -d ' ' -f 2)
root_offs=$(fdisk -u=sectors -l $loop_dev | grep -E 'loop[[:digit:]]p2' | tr -d '*' | tr -s ' ' | cut -d ' ' -f 2)
msg "destroying disk loop device"
losetup -d $loop_dev
msg "creating boot loop device"
loop_dev=$(losetup -f)
losetup -f -o $(($boot_offs * 512)) $DISK_IMG
msg "copying boot image"
dd if=$BOOT_IMG of=$loop_dev
sync
msg "destroying boot loop device"
losetup -d $loop_dev
msg "creating root loop device"
loop_dev=$(losetup -f)
losetup -f -o $(($root_offs * 512)) $DISK_IMG
sync
msg "copying root image"
dd if=$ROOT_IMG of=$loop_dev
sync
msg "destroying root loop device"
losetup -d $loop_dev
sync
mv $DISK_IMG $(dirname $DISK_IMG)/$OS_NAME-$BOARD.img
DISK_IMG=$(dirname $DISK_IMG)/$OS_NAME-$BOARD.img
msg "$(realpath "$DISK_IMG") is ready"

View File

@ -0,0 +1,69 @@
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
BOOT_DEV=/dev/mmcblk0p1
ROOT_DEV=/dev/mmcblk0p2
DATA_DEV=/dev/mmcblk0p3
FW_DIR=/data/.fwupdate
FW_FILE=firmware.img.gz
FW_FILE_EXTR=firmware.img
ROOT_INFO_FILE=root_info
msg() {
echo "* $1"
}
on_exit() {
msg "Switching to normal boot"
/remove_initramfs
msg "Unmounting data partition"
umount /data
msg "Unmounting boot partition"
umount /boot
msg "Syncing"
sync
msg "Rebooting"
echo 'b' > /proc/sysrq-trigger
}
trap on_exit EXIT
msg "Waiting for sdcard"
sleep 2
msg "Mounting pseudo filesystems"
mount -t devtmpfs devtmpfs /dev
mount -t proc proc /proc
msg "Mounting boot partition"
mount $BOOT_DEV /boot
msg "Mounting data partition"
mount $DATA_DEV /data
if ! [ -r $FW_DIR/$FW_FILE_EXTR ]; then
msg "No firmware found, aborting"
exit 1
fi
if ! [ -r $FW_DIR/$ROOT_INFO_FILE ]; then
msg "No root partition info, aborting"
exit 1
fi
msg "Copying root image"
root_start=$(cat $FW_DIR/$ROOT_INFO_FILE | cut -d ' ' -f 1)
root_size=$(cat $FW_DIR/$ROOT_INFO_FILE | cut -d ' ' -f 2)
dd if=$FW_DIR/$FW_FILE_EXTR skip=$root_start of=$ROOT_DEV bs=1048576 count=$root_size || exit 1
msg "Cleaning up"
rm -rf $FW_DIR

View File

@ -0,0 +1 @@
/data/etc/adjtime

View File

@ -0,0 +1,2 @@
14 3 * * * /usr/sbin/logrotate /etc/logrotate.conf

View File

@ -0,0 +1,6 @@
date_timeout=10
date_method=http
date_host="google.com"
date_interval=900
date_ntp_server=""

View File

@ -0,0 +1,9 @@
# <file system> <mount pt> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
tmpfs /tmp tmpfs mode=1777 0 0
sysfs /sys sysfs defaults 0 0
/dev/mmcblk0p1 /boot vfat ro,defaults 0 0
/dev/mmcblk0p3 /data ext4 defaults,noatime 0 0

View File

@ -0,0 +1,28 @@
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
kmem:x:9:
wheel:x:10:root
cdrom:x:11:
dialout:x:18:
floppy:x:19:
video:x:28:
audio:x:29:
tape:x:32:
www-data:x:33:
utmp:x:43:
plugdev:x:46:
staff:x:50:
lock:x:54:
haldaemon:x:68:
dbus:x:81:
netdev:x:82:
ftp:x:83
nogroup:x:99:
users:x:100:

View File

@ -0,0 +1 @@
/tmp/hosts

View File

@ -0,0 +1,55 @@
#!/bin/bash
disk_dev="/dev/mmcblk0"
data_dev="${disk_dev}p3"
test -b $data_dev && exit 0
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Creating data partition"
echo -e "n
p
3
\n
\n
w" | /sbin/fdisk $disk_dev 2>&1 >/dev/null | grep -v "Device or resource busy" | grep -v '^$'
partx -a $disk_dev &>/dev/null
test -b $data_dev && msg_done || msg_fail
msg_begin "Formatting data partition"
mkfs.ext4 -q $data_dev
test $? == 0 && msg_done || msg_fail
msg_begin "Mounting data partition"
mount /data
test $? == 0 && msg_done || msg_fail
msg_begin "Creating required data files"
mkdir /data/etc
mkdir /data/log
mkdir -m 775 /data/output
mkdir -m 775 /data/media
cp /etc/version /data/etc/version
ln -s /usr/share/zoneinfo/UTC /data/etc/localtime
touch /data/etc/adjtime
sync
msg_done
# mount other partitions depending on data
mount -a
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,44 @@
#!/bin/bash
test -n "$os_version" || source /etc/init.d/base
mount_fs() {
msg_begin "Mounting filesystems"
/bin/mount -a
test $? == 0 && msg_done || msg_fail
}
remount_rw() {
msg_begin "Remounting boot partition read-write"
mount -o remount,rw /boot
test $? == 0 && msg_done || msg_fail
msg_begin "Remounting root partition read-write"
mount -o remount,rw /
test $? == 0 && msg_done || msg_fail
}
mk_tty_login() {
test -z "$os_tty_login" && os_tty_login=tty1
ln -sf /dev/$os_tty_login /dev/ttylogin
}
case "$1" in
start)
mount_fs
test -n "$os_debug" || source /etc/init.d/conf
test "$os_debug" == "true" && remount_rw
mk_tty_login
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,33 @@
#!/bin/bash
sys_modules_file="/etc/modules"
modules_file="/data/etc/modules"
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Loading kernel modules"
if [ -r $sys_modules_file ]; then
cat $sys_modules_file | while read line; do test -n "$line" && /sbin/modprobe $line &>/dev/null; done
fi
if [ -r $modules_file ]; then
cat $modules_file | while read line; do test -n "$line" && /sbin/modprobe $line &>/dev/null; done
fi
msg_done
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,43 @@
#!/bin/bash
sys_hostname_file="/etc/hostname"
boot_hostname_file="/boot/hostname"
hostname_file="/data/etc/hostname"
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Setting hostname"
if ! [ -f $hostname_file ]; then
if [ -f $boot_hostname_file ]; then
cp $boot_hostname_file $hostname_file
elif [ -f $sys_hostname_file ]; then
cp $sys_hostname_file $hostname_file
fi
fi
if [ -f $hostname_file ]; then
hostname=$(cat $hostname_file)
else
hostname="$os_prefix-$board_sn"
fi
/bin/hostname $hostname
echo "127.0.0.1 localhost $hostname" > /etc/hosts
msg_done
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,29 @@
#!/bin/bash
test -n "$os_version" || source /etc/init.d/base
dmesg_log="/var/log/dmesg.log"
case "$1" in
start)
msg_begin "Starting syslogd"
syslogd
test $? == 0 && msg_done || msg_fail
echo "---- booting $os_name $os_version----" >> $dmesg_log
dmesg -T -w >> $dmesg_log &
;;
stop)
msg_begin "Stopping syslogd"
killall syslogd &>/dev/null
test $? == 0 && msg_done || msg_fail
killall dmesg &>/dev/null
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit $?

View File

@ -0,0 +1,30 @@
#!/bin/bash
test -c /dev/watchdog || exit 0
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Starting watchdog"
watchdog -t 5 /dev/watchdog
test $? == 0 && msg_done || msg_fail
;;
stop)
true
;;
reallystop)
msg_begin "Stopping watchdog"
killall watchdog &>/dev/null
test $? == 0 && msg_done || msg_fail
;;
*)
echo $"Usage: $0 {start|reallystop}"
exit 1
esac
exit $?

View File

@ -0,0 +1,48 @@
#!/bin/bash
test -f /etc/udev/udev.conf || exit 0
test -n "$os_version" || source /etc/init.d/base
source /etc/udev/udev.conf
start() {
msg_begin "Starting eudev"
echo '\000\000\000\000' > /proc/sys/kernel/hotplug
/sbin/udevd --daemon --resolve-names=never
test $? == 0 && msg_done || msg_fail
/sbin/udevadm trigger --type=subsystems --action=add
/sbin/udevadm trigger --type=devices --action=add
/sbin/udevadm settle --timeout=30
}
stop() {
msg_begin "Stopping eudev"
udevadm control --stop-exec-queue
killall udevd &>/dev/null
test $? == 0 && msg_done || msg_fail
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit $?

View File

@ -0,0 +1,53 @@
#!/bin/bash
test -n "$os_version" || source /etc/init.d/base
sys_version_file="/etc/version"
version_file="/data/etc/version"
post_upgrade_dir="/usr/share/post-upgrade"
hash=$(md5sum $version_file 2>/dev/null | cut -d ' ' -f 1)
sys_hash=$(md5sum $sys_version_file 2>/dev/null | cut -d ' ' -f 1)
test "$hash" == "$sys_hash" && exit 0
function version_gt() {
if [ "$1" != "$2" ] && [ $(echo -e "$2\n$1" | sort -t . | head -n 1) == "$2" ]; then
return 0
else
return 1
fi
}
function run_post_upgrade() {
version="$(source $version_file 2>/dev/null && echo $os_version)"
sys_version="$(source $sys_version_file 2>/dev/null && echo $os_version)"
versions=$(ls -1 $post_upgrade_dir | cut -d '.' -f 1)
for v in $versions; do
if [ -z "$version" ] || version_gt $v $version; then
msg_begin "Post-upgrading to version $v"
out=$($post_upgrade_dir/$v.sh 2>&1)
test $? == 0 && msg_done || msg_fail
echo "$out" | logger -t post-upgrade
fi
done
}
case "$1" in
start)
run_post_upgrade
cp $sys_version_file $version_file
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,44 @@
#!/bin/bash
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
# make sure root and admin users exist in shadow file
touch /data/etc/shadow
chmod go-rwx /data/etc/shadow
if ! grep root /data/etc/shadow &>/dev/null; then
echo 'root::::::::' >> /data/etc/shadow
fi
if ! grep admin /data/etc/shadow &>/dev/null; then
echo 'admin::::::::' >> /data/etc/shadow
fi
# set root and admin passwords
password=$(/etc/init.d/adminpw)
msg_begin "Setting root password"
rm -f /data/etc/shadow+
rm -f /data/etc/shadow-
echo -en "$password\n$password\n" | passwd &>/dev/null # root
echo -en "$password\n$password\n" | passwd admin &>/dev/null # admin
sed -r -i 's/root:([^:]+):[[:digit:]]+:/root:\1::/' /data/etc/shadow # removes pwd expiration
sed -r -i 's/admin:([^:]+):[[:digit:]]+:/admin:\1::/' /data/etc/shadow # removes pwd expiration
sync
msg_done
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,138 @@
#!/bin/bash
sys_conf="/etc/wpa_supplicant.conf"
boot_conf="/boot/wpa_supplicant.conf"
conf="/data/etc/wpa_supplicant.conf"
log="/var/log/wpa_supplicant.log"
prog="/usr/sbin/wpa_supplicant"
driver=wext
sys_watch_conf="/etc/watch.conf"
boot_watch_conf="/boot/watch.conf"
watch_conf="/data/etc/watch.conf"
if ! [ -f $watch_conf ]; then
if [ -f $boot_watch_conf ]; then
cp $boot_watch_conf $watch_conf
elif [ -f $sys_watch_conf ]; then
cp $sys_watch_conf $watch_conf
fi
fi
source $watch_conf
if ! [ -f $conf ]; then
if [ -f $boot_conf ]; then
cp $boot_conf $conf
elif [ -f $sys_conf ]; then
cp $sys_conf $conf
fi
fi
test -f $conf || exit 0
ssid=$(cat $conf | grep ssid | grep -v scan_ssid | cut -d '"' -f 2)
test -n "$ssid" || exit 0
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
test "$os_networkless" == "true" && exit 0
connected() {
ip link show dev $os_wlan 2>&1 | grep LOWER_UP &> /dev/null && return 0 || return 1
}
watch() {
count=0
while true; do
sleep 5
if connected; then
count=0
else
if [ $count -lt $link_watch_timeout ]; then
count=$(($count + 5))
logger -t wifi -s "disconnected"
else
logger -t wifi -s "disconnected for $link_watch_timeout seconds, rebooting"
reboot
fi
fi
done
}
start() {
test -n "$os_country" && iw reg set $os_country
msg_begin "Starting wpa_supplicant"
# wait up to 5 seconds for interface
count=0
while ! ifconfig $os_wlan >/dev/null 2>&1; do
sleep 1
count=$(($count + 1))
if [ $count -ge 5 ]; then
msg_fail "no device"
return 1
fi
done
module=$(basename $(readlink /sys/class/net/$os_wlan/device/driver/module 2>/dev/null) 2>/dev/null)
iwconfig $os_wlan power off &> /dev/null
iw $os_wlan set power_save off &> /dev/null
$prog -i$os_wlan -c$conf -D$driver -B &> $log
count=0
while true; do
sleep 1
if connected; then
break
fi
if [ $count -gt $link_watch_timeout ] || ! pidof wpa_supplicant > /dev/null; then
test -n "$module" && msg_fail "failed ($module)"|| msg_fail
return 1
fi
count=$(($count + 1))
done
if [ "$link_watch" == "true" ]; then
watch &
fi
test -n "$module" && msg_done "done ($module)"|| msg_done
}
stop() {
msg_begin "Stopping wpa_supplicant"
killall wpa_supplicant &>/dev/null
ps | grep wifi | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
msg_done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
# continue after an unsuccessfull wifi start
# as we may still have an ethernet connection available
exit 0

View File

@ -0,0 +1,138 @@
#!/bin/bash
sys_conf="/etc/ppp/default"
boot_conf="/boot/ppp"
conf="/data/etc/ppp"
prog="/usr/sbin/pppd"
provider="mobile"
watch_conf="/data/etc/watch.conf"
source $watch_conf
if ! [ -d $conf ]; then
if [ -d $boot_conf ]; then
cp -r $boot_conf $conf
elif [ -d $sys_conf ]; then
cp -r $sys_conf $conf
fi
fi
test -e $conf/modem || exit 0
test -e $conf/apn || exit 0
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
test "$os_networkless" == "true" && exit 0
connected() {
ifconfig | grep $os_ppp &>/dev/null 2>&1 && return 0 || return 1
}
watch() {
count=0
while true; do
sleep 5
if connected; then
count=0
else
if [ $count -lt $link_watch_timeout ]; then
count=$(($count + 5))
logger -t ppp -s "disconnected"
else
logger -t ppp -s "disconnected for $link_watch_timeout seconds, rebooting"
reboot
fi
fi
done
}
udev_trigger_add() {
for ((i = 0; i < $1; i++)); do
/sbin/udevadm trigger --type=devices --action=add
done
}
start() {
test -e $conf/auth || touch $conf/auth
test -e $conf/extra || touch $conf/extra
test -e $conf/pin || touch $conf/pin
mknod /dev/ppp c 108 0 &>/dev/null
msg_begin "Starting pppd"
# wait for modem
modem=$(head -n 1 $conf/modem)
if ! [ -e /dev/$modem ]; then
udev_trigger_add 4 &
fi
count=0
while true; do
if [ -e /dev/$modem ] || [ $count -gt $link_watch_timeout ]; then
break
fi
count=$(($count + 1))
sleep 1
done
if ! [ -e /dev/$modem ]; then
msg_fail "modem /dev/$modem not present"
return
fi
$prog call $provider
count=0
while true; do
sleep 1
if connected; then
break
fi
if [ $count -gt $link_watch_timeout ] || ! pidof pppd > /dev/null; then
msg_fail
return
fi
count=$(($count + 1))
done
if [ "$link_watch" == "true" ]; then
watch &
fi
msg_done
}
stop() {
msg_begin "Stopping pppd"
killall pppd &>/dev/null
ps | grep ppp | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
msg_done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?

View File

@ -0,0 +1,233 @@
#!/bin/bash
mkdir -p /var/lib/dhcp
dh_conf="/var/cache/dhclient.conf"
sys_static_conf="/etc/static_ip.conf"
boot_static_conf="/boot/static_ip.conf"
static_conf="/data/etc/static_ip.conf"
watch_conf="/data/etc/watch.conf"
link_nego_timeout=10
source $watch_conf
if ! [ -f $static_conf ]; then
if [ -f $boot_static_conf ]; then
cp $boot_static_conf $static_conf
elif [ -f $sys_static_conf ]; then
cp $sys_static_conf $static_conf
fi
fi
test -r $static_conf && source $static_conf
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
watch_eth() {
count=0
while true; do
sleep 5
if [ "$(cat /sys/class/net/$os_eth/operstate 2>/dev/null)" == "up" ]; then
count=0
else
if [ $count -lt $link_watch_timeout ]; then
count=$(($count + 5))
logger -t ethernet -s "disconnected"
else
logger -t ethernet -s "disconnected for $link_watch_timeout seconds, rebooting"
reboot
fi
fi
done
}
watch_ip() {
iface=$1
count=0
while true; do
sleep 5
if ip addr show dev $iface | grep inet &>/dev/null; then
count=0
else
if [ $count -lt $ip_watch_timeout ]; then
count=$(($count + 5))
logger -t network -s "$iface has no IP address"
else
logger -t network -s "$iface had no IP address for $ip_watch_timeout seconds, rebooting"
reboot
fi
fi
done
}
start_lo() {
ifconfig lo up
}
start_wlan() {
msg_begin "Configuring wireless network"
if ! ifconfig $os_wlan &>/dev/null; then
msg_fail "no device"
return 1
fi
if [ "$(cat /sys/class/net/$os_wlan/carrier 2>/dev/null)" != "1" ]; then
msg_fail "no link"
return 1
fi
if [ -n "$mtu" ]; then
ip link set mtu $mtu dev $os_wlan
fi
if [ -n "$static_ip" ]; then
msg_done $static_ip
ifconfig $os_wlan $static_ip up
static_ip="" # won't be used again
else
msg_done dhcp
dhclient -cf "$dh_conf" $os_wlan
fi
if [ "$ip_watch" == "true" ] && ip addr show dev $os_wlan | grep inet &>/dev/null; then
watch_ip $os_wlan &
fi
}
start_eth() {
msg_begin "Configuring wired network"
# wait for driver
w=3
count=0
while ! ifconfig $os_eth >/dev/null 2>&1; do
sleep 1
count=$(($count + 1))
if [ $count -ge $w ]; then
msg_done "no device"
return 1
fi
done
# bring it up
ifconfig $os_eth up
# wait for operstate
w=3
count=0
while [ "$(cat /sys/class/net/$os_eth/operstate 2>&1)" == "unknown" ]; do
sleep 1
count=$(($count + 1))
if [ $count -ge $w ]; then
msg_done "no link"
return 1
fi
done
# wait for link
test "$link_watch" == "true" || link_nego_timeout=5
count=0
while [ "$(cat /sys/class/net/$os_eth/carrier 2>&1)" != "1" ]; do
sleep 1
count=$(($count + 1))
if [ $count -ge $link_nego_timeout ]; then
msg_done "no link"
return 1
fi
done
if [ -n "$mtu" ]; then
ip link set mtu $mtu dev $os_eth
fi
if [ -n "$static_ip" ]; then
msg_done $static_ip
ifconfig $os_eth $static_ip up
static_ip="" # won't be used again
else
msg_done dhcp
dhclient -cf "$dh_conf" $os_eth
fi
if [ "$link_watch" == "true" ]; then
watch_eth &
fi
if [ "$ip_watch" == "true" ] && ip addr show dev $os_eth | grep inet &>/dev/null; then
watch_ip $os_eth &
fi
}
start() {
hostname=$(hostname)
echo "send host-name = \"$hostname\";" > /var/cache/dhclient.conf
start_lo
test "$os_networkless" == "true" && return 0
ssid=$(cat /data/etc/wpa_supplicant.conf 2>&1 | grep ssid | grep -v scan_ssid | cut -d '"' -f 2)
test -n "$ssid" && start_wlan && wlan_ok="ok"
test -r /data/etc/ppp/modem && ppp_ok="ok" # TODO actually test the ppp link
# if wifi or ppp link ok, start eth in background
if [ "$wlan_ok" == "ok" ] || [ "$ppp_ok" == "ok" ]; then
start_eth &>/dev/null &
else
start_eth && eth_ok="ok"
fi
if [ "$eth_ok" != "ok" ] && [ "$wlan_ok" != "ok" ] && [ "$ppp_ok" != "ok" ]; then
if [ "$link_watch" == "true" ]; then
logger -t ethernet -s "no network connection available, rebooting"
reboot
return 1
else
logger -t ethernet -s "no network connection available"
return 0
fi
fi
if [ -n "$static_gw" ]; then
msg_begin "Setting static gateway to $static_gw"
ip route add default via $static_gw
test $? == 0 && msg_done || msg_fail
fi
if [ -n "$static_dns" ]; then
msg_begin "Setting static DNS server to $static_dns"
echo "nameserver $static_dns" > /etc/resolv.conf
test $? == 0 && msg_done || msg_fail
fi
}
stop() {
msg_begin "Stopping network"
killall dhclient &>/dev/null
ps | grep S40network | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
msg_done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?

View File

@ -0,0 +1,60 @@
#!/bin/bash
watch_conf="/data/etc/watch.conf"
netwatch_retries=3
netwatch_timeout=5
netwatch_interval=20
test -f $watch_conf && source $watch_conf || exit 0
test -z "$netwatch_host" || -z "$netwatch_port" && exit 0
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
test "$os_networkless" == "true" && exit 0
watch() {
count=0
netwatch_retries=$(($netwatch_retries - 1))
while true; do
if nc -z -w $netwatch_timeout $netwatch_host $netwatch_port </dev/null >/dev/null 2>&1; then
count=0
else
if [ $count -lt $netwatch_retries ]; then
count=$(($count + 1))
continue
else
logger -t netwatch -s "cannot connect to $netwatch_host:$netwatch_port, rebooting"
reboot
fi
fi
sleep $netwatch_interval
done
}
case "$1" in
start)
msg_begin "Starting netwatch"
watch &
msg_done
;;
stop)
msg_begin "Stopping netwatch"
ps | grep netwatch | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
msg_done
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?

View File

@ -0,0 +1,149 @@
#!/bin/bash
sys_conf="/etc/date.conf"
boot_conf="/boot/date.conf"
conf="/data/etc/date.conf"
sys_ntp_conf="/etc/ntp.conf"
boot_ntp_conf="/boot/ntp.conf"
ntp_conf="/data/etc/ntp.conf"
if ! [ -f $conf ]; then
if [ -f $boot_conf ]; then
cp $boot_conf $conf
elif [ -f $sys_conf ]; then
cp $sys_conf $conf
fi
fi
if ! [ -f $ntp_conf ]; then
if [ -f $boot_ntp_conf ]; then
cp $boot_ntp_conf $ntp_conf
elif [ -f $sys_ntp_conf ]; then
cp $sys_ntp_conf $ntp_conf
fi
fi
test -f $conf || exit 0
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
test "$os_networkless" == "true" && exit 0
date_timeout=10
date_method=http
date_host="google.com"
date_interval="900"
source $conf
kill_after_timeout() {
sleep $date_timeout
ps aux | grep httplib | grep -v grep | tr -s ' ' | cut -d ' ' -f 2 | xargs -r kill
}
set_current_date_http() {
kill_after_timeout &
timestamp=$(python -c "import calendar, httplib, email.utils; conn = httplib.HTTPConnection('$date_host'); conn.request('HEAD', '/'); \
print calendar.timegm(email.utils.parsedate(conn.getresponse().getheader('date')))")
if [ -n "$timestamp" ]; then
date +%s -s @$timestamp > /dev/null
else
return 1
fi
}
set_current_date_ntp() {
cat $ntp_conf | grep server | head -n 1 | cut -d ' ' -f 2 | xargs ntpdate -t $date_timeout -s
}
start_http() {
msg_begin "Setting current date using http"
set_current_date_http
test $? == 0 && msg_done "$(date)" || msg_fail
msg_begin "Starting http date updater"
while true; do
sleep $date_interval
set_current_date_http
done &
msg_done
}
start_ntp() {
mkdir -p /var/lib/ntp
cat $ntp_conf | grep -v iburst > ${ntp_conf}.tmp
if [ -n "$date_ntp_server" ]; then
echo "server $date_ntp_server iburst" > $ntp_conf
else
cat $sys_ntp_conf | grep iburst > $ntp_conf
fi
cat ${ntp_conf}.tmp >> $ntp_conf
rm ${ntp_conf}.tmp
msg_begin "Setting current date using ntp"
set_current_date_ntp
test $? == 0 && msg_done "$(date)" || msg_fail
msg_begin "Starting ntpd"
ntpd -g -c $ntp_conf
test $? == 0 && msg_done || msg_fail
}
stop_http() {
msg_begin "Stopping date updater"
ps | grep S60date | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
test $? == 0 && msg_done || msg_fail
}
stop_ntp() {
msg_begin "Stopping ntpd"
killall ntpd &>/dev/null
test $? == 0 && msg_done || msg_fail
}
start() {
if [ "$date_method" == "http" ]; then
start_http
else
start_ntp
fi
echo "system date is $(date '+%Y-%m-%d %H:%M:%S')" > /dev/kmsg
}
stop() {
if [ "$date_method" == "http" ]; then
stop_http
else
stop_ntp
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?

View File

@ -0,0 +1,48 @@
#!/bin/bash
sys_conf="/etc/crontabs"
conf="/data/etc/crontabs"
test -n "$os_version" || source /etc/init.d/base
start() {
msg_begin "Starting crond"
if [ -d $sys_conf ]; then
/usr/sbin/crond -c $sys_conf
fi
mkdir -p $conf
/usr/sbin/crond -c $conf
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping crond"
killall crond &>/dev/null
test $? == 0 && msg_done || msg_fail
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,54 @@
#!/bin/bash
conf="/etc/sshd_config"
test -f $conf || exit 0
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
test "$os_networkless" == "true" && exit 0
start() {
msg_begin "Starting sshd"
# create any missing keys
if ! /usr/bin/ssh-keygen -A >/dev/null; then
msg_fail
return 1
fi
umask 077
hostname=$(hostname)
echo "Welcome to $hostname!" > /var/cache/sshd_banner
sync
/usr/sbin/sshd -f $conf
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping sshd"
killall sshd &>/dev/null
test $? == 0 && msg_done || msg_fail
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

View File

@ -0,0 +1,26 @@
#!/bin/bash
userinit_sh="/data/etc/userinit.sh"
test -f $userinit_sh || exit 0
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Executing user init script"
/bin/bash $userinit_sh
test $? == 0 && msg_done || msg_fail
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,45 @@
#!/bin/bash
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
msg_info() {
echo " # $1"
}
show_iface_ip_addr() {
addr=$(ip addr show dev $1 2>/dev/null | grep inet | tr -s ' ' | sed -r 's/^\s+//' | cut -d ' ' -f 2)
test -n "$addr" && msg_info "Interface $1 has IP address $addr"
}
show_gateway() {
gateway=$(ip route | grep default | cut -d ' ' -f 3)
test -n "$gateway" && msg_info "Default gateway is $gateway"
}
show_dns() {
test -r /etc/resolv.conf || return
dns=$(cat /etc/resolv.conf | grep nameserver | head -n 1 | cut -d ' ' -f 2)
test -n "$dns" && msg_info "DNS server address is $dns"
}
case "$1" in
start)
show_iface_ip_addr $os_eth
show_iface_ip_addr $os_wlan
show_iface_ip_addr $os_ppp
show_gateway
show_dns
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -0,0 +1,6 @@
#!/bin/bash
if [ -f /data/etc/motion.conf ]; then
cat /data/etc/motion.conf | grep admin_password | grep -v _hash | cut -d ' ' -f 3-
fi

View File

@ -0,0 +1,18 @@
#!/bin/bash
source /etc/version
board_sn=$(/etc/init.d/boardsn)
board_name=$(cat /etc/board)
msg_begin() {
echo -n " * $1: "
}
msg_done() {
test -n "$1" && echo $1 || echo "done"
}
msg_fail() {
test -n "$1" && echo $1 || echo "failed"
}

View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "00000000"

View File

@ -0,0 +1,29 @@
#!/bin/bash
_sys_conf="/etc/os.conf"
_boot_conf="/boot/os.conf"
_conf="/data/etc/os.conf"
if ! [ -f $_conf ]; then
if [ -f $_boot_conf ]; then
cp $_boot_conf $_conf
elif [ -f $_sys_conf ]; then
cp $_sys_conf $_conf
fi
fi
source $_conf
has_net_conn() {
test "$os_networkless" == "true" && return 1
addr_eth=$(ip addr show dev $os_eth 2>/dev/null | grep inet | tr -s ' ' | sed -r 's/^\s+//' | cut -d ' ' -f 2)
addr_wlan=$(ip addr show dev $os_wlan 2>/dev/null | grep inet | tr -s ' ' | sed -r 's/^\s+//' | cut -d ' ' -f 2)
if [ -n "$addr_eth" ] || [ -n "$addr_wlan" ]; then
return 0
else
return 1
fi
}

View File

@ -0,0 +1,10 @@
#!/bin/bash
/bin/mkdir -p /dev/pts
/bin/mkdir -p /dev/shm
/bin/mount --make-shared /
/bin/mount -a -t proc
/bin/mount -a -t devpts
/bin/mount -a -t tmpfs
/bin/mount -a -t sysfs

View File

@ -0,0 +1,22 @@
#!/bin/sh
boot_log=/var/log/boot.log
pid_file=/tmp/rc.pid
source /etc/init.d/base
echo "---- shutting down $os_name $os_version ----" >> $boot_log
# stop all init scripts in /etc/init.d,
# executing them in reverse numerical order.
(for i in $(ls -r /etc/init.d/S??*); do
[ ! -x "$i" ] && continue
[ -f /data/etc/no_$(basename $i) ] && continue
$i stop
done& echo $! > $pid_file) | tee -a $boot_log &
pid=$(cat $pid_file)
while kill -0 $pid 2>/dev/null; do
sleep 1
done

View File

@ -0,0 +1,25 @@
#!/bin/sh
boot_log=/var/log/boot.log
tmp_boot_log=/tmp/boot.log
pid_file=/tmp/rc.pid
source /etc/init.d/base
echo "---- booting $os_name $os_version----" >> $tmp_boot_log
# start all init scripts in /etc/init.d,
# executing them in numerical order.
(for i in /etc/init.d/S??*; do
[ ! -x "$i" ] && continue
[ -f /data/etc/no_$(basename $i) ] && continue
$i start || break
done& echo $! > $pid_file) | tee -a $tmp_boot_log &
pid=$(cat $pid_file)
while kill -0 $pid 2>/dev/null; do
sleep 1
done
test -d $(dirname $boot_log) && cat $tmp_boot_log >> $boot_log

View File

@ -0,0 +1,29 @@
# /etc/inittab
#
# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
#
# Note: BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use
# sysvinit.
#
# Format for each entry: <id>:<runlevels>:<action>:<process>
#
# id == tty to run on, or empty for /dev/console
# runlevels == ignored
# action == one of sysinit, respawn, askfirst, wait, and once
# process == program to run
# Startup the system
::sysinit:/etc/init.d/mountsys
::sysinit:/etc/init.d/rcS
# Start a getty for local login
ttylogin::respawn:/sbin/getty -L ttylogin 115200 vt100
# Stuff to do for the 3-finger salute
::ctrlaltdel:/sbin/reboot
# Stuff to do before rebooting
::shutdown:/etc/init.d/rcK
null::shutdown:/bin/umount -a -r

View File

@ -0,0 +1,44 @@
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info readline' for more information.
# Be 8 bit clean.
set input-meta on
set output-meta on
set bell-style visible
# To allow the use of 8bit-characters like the german umlauts, comment out
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.
# set convert-meta off
"\e0d": backward-word
"\e0c": forward-word
"\e[h": beginning-of-line
"\e[f": end-of-line
"\e[1~": beginning-of-line
"\e[4~": end-of-line
#"\e[5~": beginning-of-history
#"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
# Common standard keypad and cursor
# (codes courtsey Werner Fink, <werner@suse.de>)
#"\e[1~": history-search-backward
"\e[2~": yank
"\e[3~": delete-char
#"\e[4~": set-mark
"\e[5~": history-search-backward
"\e[6~": history-search-forward
# Normal keypad and cursor of xterm
"\e[F": end-of-line
"\e[H": beginning-of-line
# Application keypad and cursor of xterm
"\eOA": previous-history
"\eOC": forward-char
"\eOB": next-history
"\eOD": backward-char
"\eOF": end-of-line
"\eOH": beginning-of-line

View File

@ -0,0 +1 @@
Welcome to \n!

View File

@ -0,0 +1 @@
/data/etc/localtime

View File

@ -0,0 +1,9 @@
/var/log/*.log /var/log/messages /var/log/samba/*.* {
rotate 9
compress
copytruncate
size 10M
missingok
nomail
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
# wifi
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
options mwifiex disconnect_on_suspend=0
options rndis_wlan power_save=0
options b43 hwpctl=0
options ath6kl_core suspend_mode=1
options brcmfmac roamoff=1

View File

@ -0,0 +1 @@
/data/etc/modprobe.conf

View File

View File

@ -0,0 +1 @@
/proc/mounts

View File

@ -0,0 +1,17 @@
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files

View File

@ -0,0 +1,13 @@
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 127.127.1.0
fudge 127.127.1.0 stratum 10
restrict default noquery nopeer
restrict 127.0.0.1
restrict ::1
driftfile /var/lib/ntp/ntp.drift

View File

@ -0,0 +1,12 @@
os_debug="false"
os_prereleases="false"
os_tty_login="tty1"
os_eth="eth0"
os_wlan="wlan0"
os_ppp="ppp0"
os_networkless="false"
os_country="GB"
os_firmware_method="github"
os_firmware_repo="ccrisan/thingos"
os_firmware_username=""
os_firmware_password=""

View File

@ -0,0 +1,16 @@
root:x:0:0:root:/root:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:100:sync:/bin:/bin/sync
mail:x:8:8:mail:/var/spool/mail:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
operator:x:37:37:Operator:/var:/bin/sh
haldaemon:x:68:68:hald:/:/bin/sh
dbus:x:81:81:dbus:/var/run/dbus:/bin/sh
ftp:x:83:83:ftp:/home/ftp:/bin/sh
sshd:x:103:99:sshd:/var:/bin/sh
nobody:x:99:99:nobody:/home:/bin/sh
admin:x:0:0::/home/ftp:/bin/sh

View File

@ -0,0 +1,21 @@
ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'VOICE'
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT 'DELAYED'
REPORT CONNECT
TIMEOUT 6
'' 'ATQ0'
'OK-AT-OK' 'ATZ'
TIMEOUT 3
'OK' @/data/etc/ppp/pin
'OK\d-AT-OK' 'ATI'
'OK' 'ATZ'
'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'
'OK' @/data/etc/ppp/extra
'OK-AT-OK' @/data/etc/ppp/apn
'OK' 'ATDT*99***1#'
TIMEOUT 30
CONNECT ''

View File

@ -0,0 +1,12 @@
#!/bin/sh
resolv_conf=/etc/resolv.conf
echo -n > $resolv_conf
if [ -n "$DNS1" ]; then
echo "nameserver $DNS1" >> $resolv_conf
fi
if [ -n "$DNS2" ]; then
echo "nameserver $DNS2" >> $resolv_conf
fi

View File

@ -0,0 +1,13 @@
lock
crtscts
modem
passive
novj
defaultroute
noipdefault
usepeerdns
noauth
hide-password
persist
holdoff 10
maxfail 0

View File

@ -0,0 +1,4 @@
file /data/etc/ppp/modem
file /etc/ppp/options
file /data/etc/ppp/auth
connect "/usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile.chat"

View File

@ -0,0 +1,32 @@
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
# If running interactively, then:
if [ "$PS1" ]; then
if [ "$BASH" ]; then
export PS1="[\u@\h \W]\\$ "
alias ll='/bin/ls --color=tty -laFh'
alias ls='/bin/ls --color=tty -F'
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:';
else
if [ "`id -u`" -eq 0 ]; then
export PS1='# '
else
export PS1='$ '
fi
fi
export USER=`id -un`
export LOGNAME=$USER
export HOSTNAME=`/bin/hostname`
export HISTSIZE=1000
export HISTFILESIZE=1000
export PAGER="/usr/bin/less"
export EDITOR="/usr/bin/nano"
export INPUTRC="/etc/inputrc"
export TERM=linux
fi;
if [ -f /data/etc/profile ]; then
source /data/etc/profile
fi

View File

@ -0,0 +1,61 @@
# Internet (IP) protocols
#
# Updated from http://www.iana.org/assignments/protocol-numbers and other
# sources.
ip 0 IP # internet protocol, pseudo protocol number
hopopt 0 HOPOPT # IPv6 Hop-by-Hop Option [RFC1883]
icmp 1 ICMP # internet control message protocol
igmp 2 IGMP # Internet Group Management
ggp 3 GGP # gateway-gateway protocol
ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'')
st 5 ST # ST datagram mode
tcp 6 TCP # transmission control protocol
egp 8 EGP # exterior gateway protocol
igp 9 IGP # any private interior gateway (Cisco)
pup 12 PUP # PARC universal packet protocol
udp 17 UDP # user datagram protocol
hmp 20 HMP # host monitoring protocol
xns-idp 22 XNS-IDP # Xerox NS IDP
rdp 27 RDP # "reliable datagram" protocol
iso-tp4 29 ISO-TP4 # ISO Transport Protocol class 4 [RFC905]
dccp 33 DCCP # Datagram Congestion Control Prot. [RFC4340]
xtp 36 XTP # Xpress Transfer Protocol
ddp 37 DDP # Datagram Delivery Protocol
idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport
ipv6 41 IPv6 # Internet Protocol, version 6
ipv6-route 43 IPv6-Route # Routing Header for IPv6
ipv6-frag 44 IPv6-Frag # Fragment Header for IPv6
idrp 45 IDRP # Inter-Domain Routing Protocol
rsvp 46 RSVP # Reservation Protocol
gre 47 GRE # General Routing Encapsulation
esp 50 IPSEC-ESP # Encap Security Payload [RFC2406]
ah 51 IPSEC-AH # Authentication Header [RFC2402]
skip 57 SKIP # SKIP
ipv6-icmp 58 IPv6-ICMP # ICMP for IPv6
ipv6-nonxt 59 IPv6-NoNxt # No Next Header for IPv6
ipv6-opts 60 IPv6-Opts # Destination Options for IPv6
rspf 73 RSPF CPHB # Radio Shortest Path First (officially CPHB)
vmtp 81 VMTP # Versatile Message Transport
eigrp 88 EIGRP # Enhanced Interior Routing Protocol (Cisco)
ospf 89 OSPFIGP # Open Shortest Path First IGP
ax.25 93 AX.25 # AX.25 frames
ipip 94 IPIP # IP-within-IP Encapsulation Protocol
etherip 97 ETHERIP # Ethernet-within-IP Encapsulation [RFC3378]
encap 98 ENCAP # Yet Another IP encapsulation [RFC1241]
# 99 # any private encryption scheme
pim 103 PIM # Protocol Independent Multicast
ipcomp 108 IPCOMP # IP Payload Compression Protocol
vrrp 112 VRRP # Virtual Router Redundancy Protocol [RFC5798]
l2tp 115 L2TP # Layer Two Tunneling Protocol [RFC2661]
isis 124 ISIS # IS-IS over IPv4
sctp 132 SCTP # Stream Control Transmission Protocol
fc 133 FC # Fibre Channel
mobility-header 135 Mobility-Header # Mobility Support for IPv6 [RFC3775]
udplite 136 UDPLite # UDP-Lite [RFC3828]
mpls-in-ip 137 MPLS-in-IP # MPLS-in-IP [RFC4023]
manet 138 # MANET Protocols [RFC5498]
hip 139 HIP # Host Identity Protocol
shim6 140 Shim6 # Shim6 Protocol [RFC5533]
wesp 141 WESP # Wrapped Encapsulating Security Payload
rohc 142 ROHC # Robust Header Compression

Binary file not shown.

View File

@ -0,0 +1 @@
../tmp/resolv.conf

View File

@ -0,0 +1,57 @@
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
ttyS0
ttyS1
ttyS2
ttyS3
ttyAMA0
ttyAMA1
ttyAMA2
ttyAMA3
ttySAC0
ttySAC1
ttySAC2
ttySAC3
ttyUL0
ttyUL1
ttyUL2
ttyUL3
ttyPS0
ttyPS1
ttyPSC0
ttyPSC1
ttyPSC2
ttyPSC3
ttyCPM0
ttyCPM1
ttyCPM2
ttyCPM3
ttymxc0
ttymxc1
ttymxc2
ttyO0
ttyO1
ttyO2
ttyO3
ttyAM0
ttyAM1
ttyAM2
ttySC0
ttySC1
ttySC2
ttySC3
ttySC4
ttySC5
ttySC6
ttySC7
ttyGS0
hvc0
hvc1
hvc2
hvc3

View File

@ -0,0 +1,302 @@
# /etc/services:
# $Id: services,v 1.1 2004/10/09 02:49:18 andersen Exp $
#
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single well-known
# port number for both TCP and UDP; hence, most entries here have two entries
# even if the protocol doesn't support UDP operations.
# Updated from RFC 1700, ``Assigned Numbers'' (October 1994). Not all ports
# are included, only the more common ones.
tcpmux 1/tcp # TCP port service multiplexer
echo 7/tcp
echo 7/udp
discard 9/tcp sink null
discard 9/udp sink null
systat 11/tcp users
daytime 13/tcp
daytime 13/udp
netstat 15/tcp
qotd 17/tcp quote
msp 18/tcp # message send protocol
msp 18/udp # message send protocol
chargen 19/tcp ttytst source
chargen 19/udp ttytst source
ftp-data 20/tcp
ftp 21/tcp
fsp 21/udp fspd
ssh 22/tcp # SSH Remote Login Protocol
ssh 22/udp # SSH Remote Login Protocol
telnet 23/tcp
# 24 - private
smtp 25/tcp mail
# 26 - unassigned
time 37/tcp timserver
time 37/udp timserver
rlp 39/udp resource # resource location
nameserver 42/tcp name # IEN 116
whois 43/tcp nicname
re-mail-ck 50/tcp # Remote Mail Checking Protocol
re-mail-ck 50/udp # Remote Mail Checking Protocol
domain 53/tcp nameserver # name-domain server
domain 53/udp nameserver
mtp 57/tcp # deprecated
bootps 67/tcp # BOOTP server
bootps 67/udp
bootpc 68/tcp # BOOTP client
bootpc 68/udp
tftp 69/udp
gopher 70/tcp # Internet Gopher
gopher 70/udp
rje 77/tcp netrjs
finger 79/tcp
www 80/tcp http # WorldWideWeb HTTP
www 80/udp # HyperText Transfer Protocol
link 87/tcp ttylink
kerberos 88/tcp kerberos5 krb5 # Kerberos v5
kerberos 88/udp kerberos5 krb5 # Kerberos v5
supdup 95/tcp
# 100 - reserved
hostnames 101/tcp hostname # usually from sri-nic
iso-tsap 102/tcp tsap # part of ISODE.
csnet-ns 105/tcp cso-ns # also used by CSO name server
csnet-ns 105/udp cso-ns
# unfortunately the poppassd (Eudora) uses a port which has already
# been assigned to a different service. We list the poppassd as an
# alias here. This should work for programs asking for this service.
# (due to a bug in inetd the 3com-tsmux line is disabled)
#3com-tsmux 106/tcp poppassd
#3com-tsmux 106/udp poppassd
rtelnet 107/tcp # Remote Telnet
rtelnet 107/udp
pop-2 109/tcp postoffice # POP version 2
pop-2 109/udp
pop-3 110/tcp # POP version 3
pop-3 110/udp
sunrpc 111/tcp portmapper # RPC 4.0 portmapper TCP
sunrpc 111/udp portmapper # RPC 4.0 portmapper UDP
auth 113/tcp authentication tap ident
sftp 115/tcp
uucp-path 117/tcp
nntp 119/tcp readnews untp # USENET News Transfer Protocol
ntp 123/tcp
ntp 123/udp # Network Time Protocol
netbios-ns 137/tcp # NETBIOS Name Service
netbios-ns 137/udp
netbios-dgm 138/tcp # NETBIOS Datagram Service
netbios-dgm 138/udp
netbios-ssn 139/tcp # NETBIOS session service
netbios-ssn 139/udp
imap2 143/tcp # Interim Mail Access Proto v2
imap2 143/udp
snmp 161/udp # Simple Net Mgmt Proto
snmp-trap 162/udp snmptrap # Traps for SNMP
cmip-man 163/tcp # ISO mgmt over IP (CMOT)
cmip-man 163/udp
cmip-agent 164/tcp
cmip-agent 164/udp
xdmcp 177/tcp # X Display Mgr. Control Proto
xdmcp 177/udp
nextstep 178/tcp NeXTStep NextStep # NeXTStep window
nextstep 178/udp NeXTStep NextStep # server
bgp 179/tcp # Border Gateway Proto.
bgp 179/udp
prospero 191/tcp # Cliff Neuman's Prospero
prospero 191/udp
irc 194/tcp # Internet Relay Chat
irc 194/udp
smux 199/tcp # SNMP Unix Multiplexer
smux 199/udp
at-rtmp 201/tcp # AppleTalk routing
at-rtmp 201/udp
at-nbp 202/tcp # AppleTalk name binding
at-nbp 202/udp
at-echo 204/tcp # AppleTalk echo
at-echo 204/udp
at-zis 206/tcp # AppleTalk zone information
at-zis 206/udp
qmtp 209/tcp # The Quick Mail Transfer Protocol
qmtp 209/udp # The Quick Mail Transfer Protocol
z3950 210/tcp wais # NISO Z39.50 database
z3950 210/udp wais
ipx 213/tcp # IPX
ipx 213/udp
imap3 220/tcp # Interactive Mail Access
imap3 220/udp # Protocol v3
ulistserv 372/tcp # UNIX Listserv
ulistserv 372/udp
https 443/tcp # MCom
https 443/udp # MCom
snpp 444/tcp # Simple Network Paging Protocol
snpp 444/udp # Simple Network Paging Protocol
saft 487/tcp # Simple Asynchronous File Transfer
saft 487/udp # Simple Asynchronous File Transfer
npmp-local 610/tcp dqs313_qmaster # npmp-local / DQS
npmp-local 610/udp dqs313_qmaster # npmp-local / DQS
npmp-gui 611/tcp dqs313_execd # npmp-gui / DQS
npmp-gui 611/udp dqs313_execd # npmp-gui / DQS
hmmp-ind 612/tcp dqs313_intercell# HMMP Indication / DQS
hmmp-ind 612/udp dqs313_intercell# HMMP Indication / DQS
#
# UNIX specific services
#
exec 512/tcp
biff 512/udp comsat
login 513/tcp
who 513/udp whod
shell 514/tcp cmd # no passwords used
syslog 514/udp
printer 515/tcp spooler # line printer spooler
talk 517/udp
ntalk 518/udp
route 520/udp router routed # RIP
timed 525/udp timeserver
tempo 526/tcp newdate
courier 530/tcp rpc
conference 531/tcp chat
netnews 532/tcp readnews
netwall 533/udp # -for emergency broadcasts
uucp 540/tcp uucpd # uucp daemon
afpovertcp 548/tcp # AFP over TCP
afpovertcp 548/udp # AFP over TCP
remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem
klogin 543/tcp # Kerberized `rlogin' (v5)
kshell 544/tcp krcmd # Kerberized `rsh' (v5)
kerberos-adm 749/tcp # Kerberos `kadmin' (v5)
#
webster 765/tcp # Network dictionary
webster 765/udp
#
# From ``Assigned Numbers'':
#
#> The Registered Ports are not controlled by the IANA and on most systems
#> can be used by ordinary user processes or programs executed by ordinary
#> users.
#
#> Ports are used in the TCP [45,106] to name the ends of logical
#> connections which carry long term conversations. For the purpose of
#> providing services to unknown callers, a service contact port is
#> defined. This list specifies the port used by the server process as its
#> contact port. While the IANA can not control uses of these ports it
#> does register or list uses of these ports as a convienence to the
#> community.
#
nfsdstatus 1110/tcp
nfsd-keepalive 1110/udp
ingreslock 1524/tcp
ingreslock 1524/udp
prospero-np 1525/tcp # Prospero non-privileged
prospero-np 1525/udp
datametrics 1645/tcp old-radius # datametrics / old radius entry
datametrics 1645/udp old-radius # datametrics / old radius entry
sa-msg-port 1646/tcp old-radacct # sa-msg-port / old radacct entry
sa-msg-port 1646/udp old-radacct # sa-msg-port / old radacct entry
radius 1812/tcp # Radius
radius 1812/udp # Radius
radacct 1813/tcp # Radius Accounting
radacct 1813/udp # Radius Accounting
nfsd 2049/tcp nfs
nfsd 2049/udp nfs
cvspserver 2401/tcp # CVS client/server operations
cvspserver 2401/udp # CVS client/server operations
mysql 3306/tcp # MySQL
mysql 3306/udp # MySQL
rfe 5002/tcp # Radio Free Ethernet
rfe 5002/udp # Actually uses UDP only
cfengine 5308/tcp # CFengine
cfengine 5308/udp # CFengine
bbs 7000/tcp # BBS service
#
#
# Kerberos (Project Athena/MIT) services
# Note that these are for Kerberos v4, and are unofficial. Sites running
# v4 should uncomment these and comment out the v5 entries above.
#
kerberos4 750/udp kerberos-iv kdc # Kerberos (server) udp
kerberos4 750/tcp kerberos-iv kdc # Kerberos (server) tcp
kerberos_master 751/udp # Kerberos authentication
kerberos_master 751/tcp # Kerberos authentication
passwd_server 752/udp # Kerberos passwd server
krb_prop 754/tcp # Kerberos slave propagation
krbupdate 760/tcp kreg # Kerberos registration
kpasswd 761/tcp kpwd # Kerberos "passwd"
kpop 1109/tcp # Pop with Kerberos
knetd 2053/tcp # Kerberos de-multiplexor
zephyr-srv 2102/udp # Zephyr server
zephyr-clt 2103/udp # Zephyr serv-hm connection
zephyr-hm 2104/udp # Zephyr hostmanager
eklogin 2105/tcp # Kerberos encrypted rlogin
#
# Unofficial but necessary (for NetBSD) services
#
supfilesrv 871/tcp # SUP server
supfiledbg 1127/tcp # SUP debugging
#
# Datagram Delivery Protocol services
#
rtmp 1/ddp # Routing Table Maintenance Protocol
nbp 2/ddp # Name Binding Protocol
echo 4/ddp # AppleTalk Echo Protocol
zip 6/ddp # Zone Information Protocol
#
# Services added for the Debian GNU/Linux distribution
poppassd 106/tcp # Eudora
poppassd 106/udp # Eudora
mailq 174/tcp # Mailer transport queue for Zmailer
mailq 174/tcp # Mailer transport queue for Zmailer
omirr 808/tcp omirrd # online mirror
omirr 808/udp omirrd # online mirror
rmtcfg 1236/tcp # Gracilis Packeten remote config server
xtel 1313/tcp # french minitel
coda_opcons 1355/udp # Coda opcons (Coda fs)
coda_venus 1363/udp # Coda venus (Coda fs)
coda_auth 1357/udp # Coda auth (Coda fs)
coda_udpsrv 1359/udp # Coda udpsrv (Coda fs)
coda_filesrv 1361/udp # Coda filesrv (Coda fs)
codacon 1423/tcp venus.cmu # Coda Console (Coda fs)
coda_aux1 1431/tcp # coda auxiliary service (Coda fs)
coda_aux1 1431/udp # coda auxiliary service (Coda fs)
coda_aux2 1433/tcp # coda auxiliary service (Coda fs)
coda_aux2 1433/udp # coda auxiliary service (Coda fs)
coda_aux3 1435/tcp # coda auxiliary service (Coda fs)
coda_aux3 1435/udp # coda auxiliary service (Coda fs)
cfinger 2003/tcp # GNU Finger
afbackup 2988/tcp # Afbackup system
afbackup 2988/udp # Afbackup system
icp 3130/tcp # Internet Cache Protocol (Squid)
icp 3130/udp # Internet Cache Protocol (Squid)
postgres 5432/tcp # POSTGRES
postgres 5432/udp # POSTGRES
fax 4557/tcp # FAX transmission service (old)
hylafax 4559/tcp # HylaFAX client-server protocol (new)
noclog 5354/tcp # noclogd with TCP (nocol)
noclog 5354/udp # noclogd with UDP (nocol)
hostmon 5355/tcp # hostmon uses TCP (nocol)
hostmon 5355/udp # hostmon uses TCP (nocol)
ircd 6667/tcp # Internet Relay Chat
ircd 6667/udp # Internet Relay Chat
webcache 8080/tcp # WWW caching service
webcache 8080/udp # WWW caching service
tproxy 8081/tcp # Transparent Proxy
tproxy 8081/udp # Transparent Proxy
mandelspawn 9359/udp mandelbrot # network mandelbrot
amanda 10080/udp # amanda backup services
amandaidx 10082/tcp # amanda backup services
amidxtape 10083/tcp # amanda backup services
isdnlog 20011/tcp # isdn logging system
isdnlog 20011/udp # isdn logging system
vboxd 20012/tcp # voice box system
vboxd 20012/udp # voice box system
binkp 24554/tcp # Binkley
binkp 24554/udp # Binkley
asp 27374/tcp # Address Search Protocol
asp 27374/udp # Address Search Protocol
tfido 60177/tcp # Ifmail
tfido 60177/udp # Ifmail
fido 60179/tcp # Ifmail
fido 60179/udp # Ifmail
# Local services

View File

@ -0,0 +1 @@
/data/etc/shadow

View File

@ -0,0 +1,17 @@
Port 22
ListenAddress 0.0.0.0
HostKey /data/etc/ssh_host_rsa_key
HostKey /data/etc/ssh_host_dsa_key
HostKey /data/etc/ssh_host_ecdsa_key
HostKey /data/etc/ssh_host_ed25519_key
PermitRootLogin yes
PermitEmptyPasswords yes
AuthorizedKeysFile /data/etc/ssh_authorized_keys
UseDNS no
Banner /var/cache/sshd_banner
UsePrivilegeSeparation sandbox
Subsystem sftp /usr/libexec/sftp-server
IPQoS cs0 cs0

View File

@ -0,0 +1,2 @@
syslog.=info /dev/null
*.*;syslog.!info /var/log/messages

View File

@ -0,0 +1,2 @@
SUBSYSTEMS=="scsi", ENV{ID_FS_TYPE}=="vfat|ext2|ext3|ext4" RUN+="/bin/mkdir -p /data/media/%k", RUN+="/bin/mount /dev/%k /data/media/%k"
SUBSYSTEMS=="scsi", ENV{ID_FS_TYPE}=="ntfs" RUN+="/bin/mkdir -p /data/media/%k", RUN+="/usr/bin/ntfs-3g /dev/%k /data/media/%k"

View File

@ -0,0 +1,4 @@
os_name="motionEyeOS"
os_short_name="motioneyeos"
os_prefix="meye"
os_version="20170212"

View File

@ -0,0 +1,15 @@
link_watch="true"
link_watch_timeout=20
ip_watch="true"
ip_watch_timeout=40
#netwatch_host=www.google.com
#netwatch_port=80
netwatch_retries=3
netwatch_timeout=5
netwatch_interval=20
#meyewatch_disable="true"
meyewatch_timeout=120

View File

@ -0,0 +1,6 @@
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
}

View File

@ -0,0 +1,66 @@
# NVRAM file for BCM943430WLPTH
# 2.4 GHz, 20 MHz BW mode
# The following parameter values are just placeholders, need to be updated.
manfid=0x2d0
prodid=0x0727
vendid=0x14e4
devid=0x43e2
boardtype=0x0727
boardrev=0x1101
boardnum=22
macaddr=00:90:4c:c5:12:38
sromrev=11
boardflags=0x00404201
boardflags3=0x08000000
xtalfreq=37400
nocrc=1
ag0=255
aa2g=1
ccode=ALL
pa0itssit=0x20
extpagain2g=0
#PA parameters for 2.4GHz, measured at CHIP OUTPUT
pa2ga0=-168,7161,-820
AvVmid_c0=0x0,0xc8
cckpwroffset0=5
# PPR params
maxp2ga0=84
txpwrbckof=6
cckbw202gpo=0
legofdmbw202gpo=0x66111111
mcsbw202gpo=0x77711111
propbw202gpo=0xdd
# OFDM IIR :
ofdmdigfilttype=18
ofdmdigfilttypebe=18
# PAPD mode:
papdmode=1
papdvalidtest=1
pacalidx2g=42
papdepsoffset=-22
papdendidx=58
# LTECX flags
ltecxmux=0
ltecxpadnum=0x0102
ltecxfnsel=0x44
ltecxgcigpio=0x01
il0macaddr=00:90:4c:c5:12:38
wl0id=0x431b
deadman_to=0xffffffff
# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
muxenab=0x1
# CLDO PWM voltage settings - 0x4 - 1.1 volt
#cldo_pwm=0x4
#VCO freq 326.4MHz
spurconfig=0x3
edonthd20l=-75
edoffthd20ul=-80

View File

@ -0,0 +1,319 @@
#!/bin/bash
make_resolv_conf() {
resolv_conf=/etc/resolv.conf
echo -n > $resolv_conf
# DHCPv4
if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
[ -n "$new_domain_name_servers" ]; then
if [ -n "$new_domain_name" ]; then
echo domain ${new_domain_name%% *} >>$resolv_conf
fi
if [ -n "$new_domain_search" ]; then
if [ -n "$new_domain_name" ]; then
domain_in_search_list=""
for domain in $new_domain_search; do
if [ "$domain" = "${new_domain_name}" ] ||
[ "$domain" = "${new_domain_name}." ]; then
domain_in_search_list="Yes"
fi
done
if [ -z "$domain_in_search_list" ]; then
new_domain_search="$new_domain_name $new_domain_search"
fi
fi
echo "search ${new_domain_search}" >> $resolv_conf
elif [ -n "$new_domain_name" ]; then
echo "search ${new_domain_name}" >> $resolv_conf
fi
if [ -n "$new_domain_name_servers" ]; then
for nameserver in $new_domain_name_servers; do
echo nameserver $nameserver >>$resolv_conf
done
else # keep 'old' nameservers
sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$resolv_conf
fi
# DHCPv6
elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then
if [ -n "$new_dhcp6_domain_search" ]; then
echo "search ${new_dhcp6_domain_search}" >> $resolv_conf
fi
if [ -n "$new_dhcp6_name_servers" ]; then
for nameserver in $new_dhcp6_name_servers; do
# append %interface to link-local-address nameservers
if [ "${nameserver##fe80::}" != "$nameserver" ] ||
[ "${nameserver##FE80::}" != "$nameserver" ]; then
nameserver="${nameserver}%${interface}"
fi
echo nameserver $nameserver >>$resolv_conf
done
else # keep 'old' nameservers
sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$resolv_conf
fi
fi
}
# set host name
set_hostname() {
local current_hostname
if [ -n "$new_host_name" ]; then
current_hostname=$(hostname)
# current host name is empty, '(none)' or 'localhost' or differs from new one from DHCP
if [ -z "$current_hostname" ] ||
[ "$current_hostname" = '(none)' ] ||
[ "$current_hostname" = 'localhost' ] ||
[ "$current_hostname" = "$old_host_name" ]; then
if [ "$new_host_name" != "$old_host_name" ]; then
hostname "$new_host_name"
fi
fi
fi
}
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
exit_with_hooks() {
exit_status=$1
if [ -f /etc/dhclient-exit-hooks ]; then
. /etc/dhclient-exit-hooks
fi
exit $exit_status
}
# The 576 MTU is only used for X.25 and dialup connections
# where the admin wants low latency. Such a low MTU can cause
# problems with UDP traffic, among other things. As such,
# disallow MTUs from 576 and below by default, so that broken
# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
if [ -z "$new_interface_mtu" ] || [ "$new_interface_mtu" -le 576 ]; then
new_interface_mtu=''
fi
# The action starts here
# Invoke the local dhcp client enter hooks, if they exist.
if [ -f /etc/dhclient-enter-hooks ]; then
exit_status=0
. /etc/dhclient-enter-hooks
if [ $exit_status -ne 0 ]; then
exit $exit_status
fi
fi
# Execute the operation
case "$reason" in
### DHCPv4 Handlers
MEDIUM|ARPCHECK|ARPSEND)
# Do nothing
;;
PREINIT)
# The DHCP client is requesting that an interface be
# configured as required in order to send packets prior to
# receiving an actual address. - dhclient-script(8)
# ensure interface is up
ip link set dev ${interface} up
if [ -n "$alias_ip_address" ]; then
# flush alias IP from interface
ip -4 addr flush dev ${interface} label ${interface}:0
fi
;;
BOUND|RENEW|REBIND|REBOOT)
set_hostname
if [ -n "$old_ip_address" ] && [ -n "$alias_ip_address" ] &&
[ "$alias_ip_address" != "$old_ip_address" ]; then
# alias IP may have changed => flush it
ip -4 addr flush dev ${interface} label ${interface}:0
fi
if [ -n "$old_ip_address" ] &&
[ "$old_ip_address" != "$new_ip_address" ]; then
# leased IP has changed => flush it
ip -4 addr flush dev ${interface} label ${interface}
fi
if [ -z "$old_ip_address" ] ||
[ "$old_ip_address" != "$new_ip_address" ] ||
[ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then
# new IP has been leased or leased IP changed => set it
ip -4 addr add ${new_ip_address}${new_subnet_mask:+/$new_subnet_mask} \
${new_broadcast_address:+broadcast $new_broadcast_address} \
dev ${interface} label ${interface}
if [ -n "$new_interface_mtu" ]; then
# set MTU
ip link set dev ${interface} mtu ${new_interface_mtu}
fi
# set if_metric if IF_METRIC is set or there's more than one router
if_metric="$IF_METRIC"
if [ "${new_routers%% *}" != "${new_routers}" ]; then
if_metric=${if_metric:-1}
fi
for router in $new_routers; do
if [ "$new_subnet_mask" = "255.255.255.255" ]; then
# point-to-point connection => set explicit route
ip -4 route add ${router} dev $interface >/dev/null 2>&1
fi
# set default route
ip -4 route add default via ${router} dev ${interface} \
${if_metric:+metric $if_metric} >/dev/null 2>&1
if [ -n "$if_metric" ]; then
if_metric=$((if_metric+1))
fi
done
fi
if [ -n "$alias_ip_address" ] &&
[ "$new_ip_address" != "$alias_ip_address" ]; then
# separate alias IP given, which may have changed
# => flush it, set it & add host route to it
ip -4 addr flush dev ${interface} label ${interface}:0
ip -4 addr add ${alias_ip_address}${alias_subnet_mask:+/$alias_subnet_mask} \
dev ${interface} label ${interface}:0
ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
fi
# update /etc/resolv.conf
make_resolv_conf
;;
EXPIRE|FAIL|RELEASE|STOP)
if [ -n "$alias_ip_address" ]; then
# flush alias IP
ip -4 addr flush dev ${interface} label ${interface}:0
fi
if [ -n "$old_ip_address" ]; then
# flush leased IP
ip -4 addr flush dev ${interface} label ${interface}
fi
if [ -n "$alias_ip_address" ]; then
# alias IP given => set it & add host route to it
ip -4 addr add ${alias_ip_address}${alias_network_arg} \
dev ${interface} label ${interface}:0
ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
fi
;;
TIMEOUT)
if [ -n "$alias_ip_address" ]; then
# flush alias IP
ip -4 addr flush dev ${interface} label ${interface}:0
fi
# set IP from recorded lease
ip -4 addr add ${new_ip_address}${new_subnet_mask:+/$new_subnet_mask} \
${new_broadcast_address:+broadcast $new_broadcast_address} \
dev ${interface} label ${interface}
if [ -n "$new_interface_mtu" ]; then
# set MTU
ip link set dev ${interface} mtu ${new_interface_mtu}
fi
# if there is no router recorded in the lease or the 1st router answers pings
if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}"; then
if [ -n "$alias_ip_address" ] &&
[ "$new_ip_address" != "$alias_ip_address" ]; then
# separate alias IP given => set up the alias IP & add host route to it
ip -4 addr add ${alias_ip_address}${alias_subnet_mask:+/$alias_subnet_mask} \
dev ${interface} label ${interface}:0
ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
fi
# set if_metric if IF_METRIC is set or there's more than one router
if_metric="$IF_METRIC"
if [ "${new_routers%% *}" != "${new_routers}" ]; then
if_metric=${if_metric:-1}
fi
# set default route
for router in $new_routers; do
ip -4 route add default via ${router} dev ${interface} \
${if_metric:+metric $if_metric} >/dev/null 2>&1
if [ -n "$if_metric" ]; then
if_metric=$((if_metric+1))
fi
done
# update /etc/resolv.conf
make_resolv_conf
else
# flush all IPs from interface
ip -4 addr flush dev ${interface}
exit_with_hooks 1
fi
;;
### DHCPv6 Handlers
# TODO handle prefix change: ?based on ${old_ip6_prefix} and ${new_ip6_prefix}?
PREINIT6)
# ensure interface is up
ip link set ${interface} up
# flush any stale global permanent IPs from interface
ip -6 addr flush dev ${interface} scope global permanent
;;
BOUND6|RENEW6|REBIND6)
if [ "${new_ip6_address}" ] && [ "${new_ip6_prefixlen}" ]; then
# set leased IP
ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
dev ${interface} scope global
fi
# update /etc/resolv.conf
if [ "${reason}" = BOUND6 ] ||
[ "${new_dhcp6_name_servers}" != "${old_dhcp6_name_servers}" ] ||
[ "${new_dhcp6_domain_search}" != "${old_dhcp6_domain_search}" ]; then
make_resolv_conf
fi
;;
DEPREF6)
if [ -z "${cur_ip6_prefixlen}" ]; then
exit_with_hooks 1
fi
# set preferred lifetime of leased IP to 0
ip -6 addr change ${cur_ip6_address}/${cur_ip6_prefixlen} \
dev ${interface} scope global preferred_lft 0
;;
EXPIRE6|RELEASE6|STOP6)
if [ -z "${old_ip6_address}" ] || [ -z "${old_ip6_prefixlen}" ]; then
exit_with_hooks 1
fi
# delete leased IP
ip -6 addr del ${old_ip6_address}/${old_ip6_prefixlen} \
dev ${interface}
;;
esac
exit_with_hooks 0

View File

@ -0,0 +1,385 @@
#!/bin/bash
#### usage ####
function exit_usage() {
echo "Usage: fwupdate versions (lists available versions)"
echo " fwupdate current (shows the current version"
echo " fwupdate download <version|url> (downloads a firmware version)"
echo " fwupdate extract (extracts the downloaded firmware archive)"
echo " fwupdate flashboot (flashes the boot partition from extracted image)"
echo " fwupdate flashreboot (prepares for reboot + root partititon flash)"
echo " fwupdate status (shows the current firmware updating status; see below)"
echo ""
echo "Statuses:"
echo " idle"
echo " downloading <version>: <percent>%"
echo " downloaded <version>"
echo " extracting <version>"
echo " extracted <version>"
echo " flashing boot <version>"
echo " boot ready <version>"
echo ""
exit 1
}
if [ -z "$1" ]; then
exit_usage
fi
#### configuration ####
SYS_VERSION_FILE=/etc/version
SYS_BOARD_FILE=/etc/board
OS_CONF=/data/etc/os.conf
BOOT_DEV=/dev/mmcblk0p1
MIN_FREE_DISK=$((500*1024)) # 500 MB
VER_FILE=version
ROOT_INFO_FILE=root_info
BOOT_READY_FILE=boot_flash_ready
FW_DIR=/data/.fwupdate
FW_FILE=firmware.img.gz
FW_FILE_EXTR=firmware.img
WGET_LOG_FILE=wget.log
WGET_PID_FILE=wget.pid
GUNZIP_LOG_FILE=gunzip.log
GUNZIP_PID_FILE=gunzip.pid
DD_LOG_FILE=dd.log
DD_PID_FILE=dd.pid
#### versions ####
function show_versions() {
source $OS_CONF
board=$(cat $SYS_BOARD_FILE)
show_url=$1
# the /usr/libexec/list-versions-* helpers return a table with the following format:
# <version>|<prerelease>|<board>|<url>
versions=$(FW_USERNAME=$os_firmware_username FW_PASSWORD=$os_firmware_password \
/usr/libexec/list-versions-$os_firmware_method $os_firmware_repo)
for version in $versions; do
OIFS=$IFS
IFS="|"
varr=($version)
IFS=$OIFS
if [ "$os_prereleases" == "false" ] && [ "${varr[1]}" == "true" ]; then
continue # skip prereleases
fi
if [ "$board" != "${varr[2]}" ]; then
continue # skip other boards
fi
if [ "$show_url" == "true" ]; then
echo ${varr[0]} ${varr[3]}
else
echo ${varr[0]}
fi
done
}
function show_current() {
source $SYS_VERSION_FILE
echo $os_version
}
#### download ####
function do_download() {
echo "downloading..."
rm -f $FW_DIR/$FW_FILE
rm -f $FW_DIR/$FW_FILE_EXTR
rm -f $FW_DIR/$BOOT_READY_FILE
source $OS_CONF
board=$(cat $SYS_BOARD_FILE)
url=$1
version=$1
if ! [[ "$url" == http* ]]; then # a version was given
url=$(show_versions true | grep "^$1" | cut -d ' ' -f 2)
else
version="custom"
fi
if [ -z "$url" ]; then
echo "no such version" 1>&2
exit 1
fi
free_disk=$(df /data | tail -n 1 | tr -s ' ' | cut -d ' ' -f 4)
if [ "$free_disk" -lt $MIN_FREE_DISK ]; then
echo "not enough disk space" 1>&2
exit 1
fi
rm -rf $FW_DIR/*
mkdir -p $FW_DIR
echo $version > $FW_DIR/$VER_FILE
wget --no-check-certificate -O $FW_DIR/$FW_FILE --quiet --show-progress --progress=dot "$url" &> $FW_DIR/$WGET_LOG_FILE &
pid=$!
echo $pid > $FW_DIR/$WGET_PID_FILE
wait $pid
}
function download_status() {
if [ -f $FW_DIR/$WGET_PID_FILE ]; then
pid=$(cat $FW_DIR/$WGET_PID_FILE)
if kill -0 $pid &>/dev/null; then
progress=$(tail -n2 $FW_DIR/$WGET_LOG_FILE | grep -oe '[[:digit:]]*%')
if [ -z "$progress" ]; then
progress="0%"
fi
progress=($progress)
echo ${progress[0]}
return
fi
fi
if [ -f $FW_DIR/$FW_FILE ]; then
echo "done"
fi
}
#### extract ####
function do_extract() {
echo "extracting..."
rm -f $FW_DIR/$FW_FILE_EXTR
rm -f $FW_DIR/$BOOT_READY_FILE
if ! [ -f $FW_DIR/$FW_FILE ]; then
echo "firmware file not downloaded" 1>&2
exit 1
fi
rm -f $FW_DIR/$FW_FILE_EXTR
gunzip -k -c $FW_DIR/$FW_FILE > $FW_DIR/$FW_FILE_EXTR 2>$FW_DIR/$GUNZIP_LOG_FILE &
pid=$!
echo $pid > $FW_DIR/$GUNZIP_PID_FILE
wait $pid
# TODO verify hash
}
function extract_status() {
if [ -f $FW_DIR/$GUNZIP_PID_FILE ]; then
pid=$(cat $FW_DIR/$GUNZIP_PID_FILE)
if kill -0 $pid &>/dev/null; then
echo "running"
return
fi
fi
if [ -f $FW_DIR/$FW_FILE_EXTR ]; then
echo "done"
fi
}
#### flash boot ####
function flash_boot() {
echo "flashing boot..."
rm -f $FW_DIR/$BOOT_READY_FILE
set +e
board=$(cat $SYS_BOARD_FILE)
cp -r /boot $FW_DIR/old_boot
umount /boot
trap flash_cleanup EXIT
mount -o remount,rw /
mv /sbin/reboot /sbin/reboot.bak
ln -s /bin/true /sbin/reboot
boot_info=$(fdisk --bytes -l -o device,start,end,size $FW_DIR/$FW_FILE_EXTR | grep "${FW_FILE_EXTR}1")
boot_info=($boot_info)
boot_start=$((${boot_info[1]} / 2048)) # in MB
boot_size=$((${boot_info[3]} / 1048576)) # in MB
root_info=$(fdisk --bytes -l -o device,start,end,size $FW_DIR/$FW_FILE_EXTR | grep "${FW_FILE_EXTR}2")
root_info=($root_info)
root_start=$((${root_info[1]} / 2048)) # in MB
root_size=$((${root_info[3]} / 1048576)) # in MB
echo $root_start $root_size > $FW_DIR/$ROOT_INFO_FILE
dd if=$FW_DIR/$FW_FILE_EXTR skip=$boot_start of=$BOOT_DEV bs=1048576 count=$boot_size &>$FW_DIR/$DD_LOG_FILE &
pid=$!
echo $pid > $FW_DIR/$DD_PID_FILE
wait $pid
mount -o rw /boot
restore_boot_$board $FW_DIR/old_boot 2>/dev/null || true
touch $FW_DIR/$BOOT_READY_FILE
}
function flash_boot_status() {
if [ -f $FW_DIR/$DD_PID_FILE ]; then
pid=$(cat $FW_DIR/$DD_PID_FILE)
if kill -0 $pid &>/dev/null; then
echo "running"
return
fi
fi
if [ -f $FW_DIR/$BOOT_READY_FILE ]; then
echo "done"
fi
}
function flash_cleanup() {
if [ -f /sbin/reboot.bak ]; then
rm -f /sbin/reboot
mv /sbin/reboot.bak /sbin/reboot
fi
mount /boot 2>/dev/null
}
function restore_boot_raspberrypi() {
old_boot=$1
cp $old_boot/config.txt /boot
}
function restore_boot_raspberrypi2() {
restore_boot_raspberrypi
}
function restore_boot_raspberrypi3() {
restore_boot_raspberrypi
}
#### flash reboot ####
function flash_reboot() {
echo "preparing for reboot..."
board=$(cat $SYS_BOARD_FILE)
mount -o remount,rw /boot
prepare_boot_$board
sync
busybox reboot &
sleep 10
echo b > /proc/sysrq-trigger
exit 0
}
function prepare_boot_raspberrypi() {
echo "initramfs fwupdater.gz" >> /boot/config.txt
}
function prepare_boot_raspberrypi2() {
prepare_boot_raspberrypi
}
function prepare_boot_raspberrypi3() {
prepare_boot_raspberrypi
}
#### status ####
function show_status() {
status=$(flash_boot_status)
if [ "$status" == "running" ]; then
echo "flashing boot $(new_version)"
return
elif [ "$status" == "done" ]; then
echo "boot ready $(new_version)"
return
fi
status=$(extract_status)
if [ "$status" == "running" ]; then
echo "extracting $(new_version)"
return
elif [ "$status" == "done" ]; then
echo "extracted $(new_version)"
return
fi
status=$(download_status)
if [ "$status" == "done" ]; then
echo "downloaded $(new_version)"
return
elif [ -n "$status" ]; then
echo "downloading $(new_version): $status"
return
fi
echo "idle"
}
function new_version() {
cat $FW_DIR/$VER_FILE
}
case "$1" in
versions)
show_versions
;;
current)
show_current
;;
download)
if [ -z "$2" ]; then
exit_usage
fi
do_download $2
show_status
;;
extract)
do_extract
show_status
;;
flashboot)
flash_boot
show_status
;;
flashreboot)
flash_reboot
;;
status)
show_status
;;
*)
exit_usage
;;
esac

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