Compare commits

..

No commits in common. "dev" and "20181129" have entirely different histories.

8623 changed files with 117065 additions and 142515 deletions

10
.br-external.mk Normal file
View File

@ -0,0 +1,10 @@
#
# Automatically generated file; DO NOT EDIT.
#
BR2_EXTERNAL ?=
BR2_EXTERNAL_NAMES =
BR2_EXTERNAL_DIRS =
BR2_EXTERNAL_MKS =
# No br2-external tree defined.

View File

@ -1,5 +0,0 @@
[flake8]
exclude=
# copied from the kernel sources
utils/diffconfig
max-line-length=80

View File

@ -1,38 +0,0 @@
### Preliminary Docs
I confirm that I have read the [CONTRIBUTING](https://github.com/ccrisan/motioneyeos/blob/master/.github/CONTRIBUTING.md) guide before opening this issue.
I confirm that I have read the [FAQ](https://github.com/ccrisan/motioneyeos/wiki/FAQ) before opening this issue.
### motionEyeOS Version
I am running motionEyeOS version: (insert your version here, e.g. 20180314).
### Board Model
I am using the following board/model: (insert your board model here, e.g. Raspberry PI 3B+).
### Camera
I am using the following type of camera: (choose from V4L2, MMAL, Network Camera, Fast Network Camera and Simple MJPEG Camera).
My camera model is: (insert your camera model, e.g. Logitech C290).
### Network Connection
My motionEyeOS unit is connected to the network via: (choose your network connection, e.g. WiFi, Ethernet).
### Peripherals
I am using the following peripherals that I consider relevant to this issue:
* (e.g. USB WiFi adapter)
* (e.g. External Hard Disk)
### Log Files
I consider the following log files relevant to this issue:
* (attach e.g. motioneye.log)
* (attach e.g. boot.log)

View File

@ -1,125 +0,0 @@
# Configuration for Gitlab-CI.
# Builds appear on https://gitlab.com/buildroot.org/buildroot/pipelines
# The .gitlab-ci.yml file is generated from .gitlab-ci.yml.in.
# It needs to be regenerated every time a defconfig is added, using
# "make .gitlab-ci.yml".
image: buildroot/base:20191027.2027
.check_base:
except:
- /^.*-.*_defconfig$/
- /^.*-tests\..*$/
check-DEVELOPERS:
extends: .check_base
# get-developers should print just "No action specified"; if it prints
# anything else, it's a parse error.
# The initial ! is removed by YAML so we need to quote it.
script:
- "! utils/get-developers | grep -v 'No action specified'"
check-flake8:
extends: .check_base
before_script:
# Help flake8 to find the Python files without .py extension.
- find * -type f -name '*.py' > files.txt
- find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
- sort -u files.txt | tee files.processed
script:
- python -m flake8 --statistics --count --max-line-length=132 $(cat files.processed)
after_script:
- wc -l files.processed
check-gitlab-ci.yml:
extends: .check_base
script:
- mv .gitlab-ci.yml .gitlab-ci.yml.orig
- make .gitlab-ci.yml
- diff -u .gitlab-ci.yml.orig .gitlab-ci.yml
check-package:
extends: .check_base
script:
- make check-package
.defconfig_base:
script:
- echo "Configure Buildroot for ${DEFCONFIG_NAME}"
- make ${DEFCONFIG_NAME}
- echo 'Build buildroot'
- |
make > >(tee build.log |grep '>>>') 2>&1 || {
echo 'Failed build last output'
tail -200 build.log
exit 1
}
- |
./support/scripts/boot-qemu-image.py "${DEFCONFIG_NAME}" > >(tee runtime-test.log) 2>&1 || {
echo 'Failed runtime test last output'
tail -200 runtime-test.log
exit 1
}
artifacts:
when: always
expire_in: 2 weeks
paths:
- .config
- build.log
- output/images/
- output/build/build-time.log
- output/build/packages-file-list.txt
- output/build/*/.config
- runtime-test.log
.defconfig:
extends: .defconfig_base
# Running the defconfigs for every push is too much, so limit to
# explicit triggers through the API.
only:
- triggers
- tags
- /-defconfigs$/
before_script:
- DEFCONFIG_NAME=${CI_JOB_NAME}
one-defconfig:
extends: .defconfig_base
only:
- /^.*-.*_defconfig$/
before_script:
- DEFCONFIG_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
.runtime_test_base:
# Keep build directories so the rootfs can be an artifact of the job. The
# runner will clean up those files for us.
# Multiply every emulator timeout by 10 to avoid sporadic failures in
# elastic runners.
script:
- echo "Starting runtime test ${TEST_CASE_NAME}"
- ./support/testing/run-tests -o test-output/ -d test-dl/ -k --timeout-multiplier 10 ${TEST_CASE_NAME}
artifacts:
when: always
expire_in: 2 weeks
paths:
- test-output/*.log
- test-output/*/.config
- test-output/*/images/*
.runtime_test:
extends: .runtime_test_base
# Running the runtime tests for every push is too much, so limit to
# explicit triggers through the API.
only:
- triggers
- tags
- /-runtime-tests$/
before_script:
- TEST_CASE_NAME=${CI_JOB_NAME}
one-runtime_test:
extends: .runtime_test_base
only:
- /^.*-tests\..*$/
before_script:
- TEST_CASE_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')

View File

@ -15,6 +15,7 @@ If your issue hasn't been reported yet, [report it yourself](https://github.com/
If you're using motionEye on a Linux distro rather than motionEyeOS, please switch over to [motionEye's issue tracker](https://github.com/ccrisan/motioneye/issues/).
##### Version And Hardware
Please clearly specify what OS version you are running and on what board. It is also important to know what types of cameras you have attached to your motionEyeOS system.
##### Attach Log Files

119
Config.in
View File

@ -14,21 +14,38 @@ config BR2_HOSTARCH
string
option env="HOSTARCH"
config BR2_BASE_DIR
config BR2_BUILD_DIR
string
option env="BASE_DIR"
# br2-external paths definitions
source "$BR2_BASE_DIR/.br2-external.in.paths"
option env="BUILD_DIR"
# 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_5
bool
default y if BR2_HOST_GCC_VERSION = "4 5"
config BR2_HOST_GCC_AT_LEAST_4_6
bool
default y if BR2_HOST_GCC_VERSION = "4 6"
select BR2_HOST_GCC_AT_LEAST_4_5
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
@ -50,11 +67,6 @@ config BR2_HOST_GCC_AT_LEAST_8
default y if BR2_HOST_GCC_VERSION = "8"
select BR2_HOST_GCC_AT_LEAST_7
config BR2_HOST_GCC_AT_LEAST_9
bool
default y if BR2_HOST_GCC_VERSION = "9"
select BR2_HOST_GCC_AT_LEAST_8
# When adding new entries above, be sure to update
# the HOSTCC_MAX_VERSION variable in the Makefile.
@ -63,6 +75,16 @@ config BR2_HOST_GCC_AT_LEAST_9
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.).
@ -114,6 +136,10 @@ 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"
@ -516,14 +542,13 @@ config BR2_OPTIMIZE_S
This is the default.
config BR2_OPTIMIZE_FAST
bool "optimize for fast (may break packages!)"
bool "optimize for fast"
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
help
Optimize for fast. Disregard strict standards
compliance. -Ofast enables all -O3 optimizations. It also
enables optimizations that are not valid for all
standard-compliant programs, so be careful, as it may break
some packages. It turns on -ffast-math and the
standard-compliant programs. It turns on -ffast-math and the
Fortran-specific -fstack-arrays, unless -fmax-stack-var-size
is specified, and -fno-protect-parens.
@ -532,6 +557,7 @@ endchoice
config BR2_GOOGLE_BREAKPAD_ENABLE
bool "Enable google-breakpad support"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_HOST_GCC_AT_LEAST_4_8 # C++11
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_HAS_THREADS
@ -655,18 +681,6 @@ config BR2_COMPILER_PARANOID_UNSAFE_PATH
and external toolchain backends (through the toolchain
wrapper).
config BR2_FORCE_HOST_BUILD
bool "Force the building of host dependencies"
help
Build all available host dependencies, even if they are
already installed on the system.
This option can be used to ensure that the download cache of
source archives for packages remain consistent between
different build hosts.
This option will increase build time.
config BR2_REPRODUCIBLE
bool "Make the build reproducible (experimental)"
# SOURCE_DATE_EPOCH support in toolchain-wrapper requires GCC 4.4
@ -686,40 +700,10 @@ config BR2_REPRODUCIBLE
This is labeled as an experimental feature, as not all
packages behave properly to ensure reproducibility.
config BR2_PER_PACKAGE_DIRECTORIES
bool "Use per-package directories (experimental)"
help
This option will change the build process of Buildroot
package to use per-package target and host directories.
This is useful for two related purposes:
- Cleanly isolate the build of each package, so that a
given package only "sees" the dependencies it has
explicitly expressed, and not other packages that may
have by chance been built before.
- Enable top-level parallel build.
This is labeled as an experimental feature, as not all
packages behave properly with per-package directories.
endmenu
comment "Security Hardening Options"
config BR2_PIC_PIE
bool "Build code with PIC/PIE"
depends on BR2_SHARED_LIBS
depends on BR2_TOOLCHAIN_SUPPORTS_PIE
help
Generate Position-Independent Code (PIC) and link
Position-Independent Executables (PIE).
comment "PIC/PIE needs a toolchain w/ PIE"
depends on BR2_SHARED_LIBS
depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
choice
bool "Stack Smashing Protection"
default BR2_SSP_ALL if BR2_ENABLE_SSP # legacy
@ -754,15 +738,14 @@ config BR2_SSP_REGULAR
config BR2_SSP_STRONG
bool "-fstack-protector-strong"
depends on BR2_TOOLCHAIN_HAS_SSP_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.
-fstack-protector-strong officially appeared in gcc 4.9, but
some vendors have backported -fstack-protector-strong to older
versions of gcc.
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"
@ -773,12 +756,6 @@ config BR2_SSP_ALL
endchoice
config BR2_SSP_OPTION
string
default "-fstack-protector" if BR2_SSP_REGULAR
default "-fstack-protector-strong" if BR2_SSP_STRONG
default "-fstack-protector-all" if BR2_SSP_ALL
comment "Stack Smashing Protection needs a toolchain w/ SSP"
depends on !BR2_TOOLCHAIN_HAS_SSP
@ -803,16 +780,11 @@ config BR2_RELRO_PARTIAL
config BR2_RELRO_FULL
bool "Full"
depends on BR2_TOOLCHAIN_SUPPORTS_PIE
select BR2_PIC_PIE
help
This option includes the partial configuration, but also marks
the GOT as read-only at the cost of initialization time during
program loading, i.e every time an executable is started.
comment "RELRO Full needs a toolchain w/ PIE"
depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
endchoice
comment "RELocation Read Only (RELRO) needs shared libraries"
@ -840,8 +812,6 @@ config BR2_FORTIFY_SOURCE_NONE
config BR2_FORTIFY_SOURCE_1
bool "Conservative"
# gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164
depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6
help
This option sets _FORTIFY_SOURCE to 1 and only introduces
checks that shouldn't change the behavior of conforming
@ -849,8 +819,6 @@ config BR2_FORTIFY_SOURCE_1
config BR2_FORTIFY_SOURCE_2
bool "Aggressive"
# gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164
depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6
help
This option sets _FORTIFY_SOURCES to 2 and some more
checking is added, but some conforming programs might fail.
@ -879,5 +847,4 @@ source "package/Config.in.host"
source "Config.in.legacy"
# br2-external menus definitions
source "$BR2_BASE_DIR/.br2-external.in.menus"
source "$BR2_BUILD_DIR/.br2-external.in"

File diff suppressed because it is too large Load Diff

2706
DEVELOPERS

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +0,0 @@
from ubuntu:18.04
USER root
RUN \
apt-get update -q && \
DEBIAN_FRONTEND="noninteractive" apt-get install -qy --fix-missing --no-install-recommends \
ca-certificates \
build-essential \
#fakeroot \
git \
wget \
curl \
file \
python2.7-dev \
python3-dev \
libssl-dev \
libncurses5-dev \
rsync \
patch \
cpio \
gzip \
unzip \
bc \
openssh-client \
asciidoc \
dblatex \
graphviz \
python-matplotlib && \
rm -rf /var/lib/apt/lists/* && \
useradd -ms /bin/bash build && \
mkdir -p /build && \
chown -R build:build /build
USER build
WORKDIR /build
# container just waits, by default, actual builds can be done with `docker exec`
CMD /bin/bash -c 'for ((i = 0; ; i++)); do sleep 100; done'

320
Makefile
View File

@ -2,7 +2,7 @@
#
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
# Copyright (C) 2006-2014 by the Buildroot developers <buildroot@uclibc.org>
# Copyright (C) 2014-2020 by the Buildroot developers <buildroot@buildroot.org>
# Copyright (C) 2014-2018 by the Buildroot developers <buildroot@buildroot.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -92,9 +92,9 @@ all:
.PHONY: all
# Set and export the version string
export BR2_VERSION := 2020.05.1
export BR2_VERSION := 2018.08.2
# Actual time the release is cut (for reproducible builds)
BR2_VERSION_EPOCH = 1595662000
BR2_VERSION_EPOCH = 1540470000
# Save running make version since it's clobbered by the make package
RUNNING_MAKE_VERSION := $(MAKE_VERSION)
@ -105,6 +105,22 @@ ifneq ($(firstword $(sort $(RUNNING_MAKE_VERSION) $(MIN_MAKE_VERSION))),$(MIN_MA
$(error You have make '$(RUNNING_MAKE_VERSION)' installed. GNU make >= $(MIN_MAKE_VERSION) is required)
endif
# Parallel execution of this Makefile is disabled because it changes
# the packages building order, that can be a problem for two reasons:
# - If a package has an unspecified optional dependency and that
# dependency is present when the package is built, it is used,
# otherwise it isn't (but compilation happily proceeds) so the end
# result will differ if the order is swapped due to parallel
# building.
# - Also changing the building order can be a problem if two packages
# manipulate the same file in the target directory.
#
# Taking into account the above considerations, if you still want to execute
# this top-level Makefile in parallel comment the ".NOTPARALLEL" line and
# use the -j<jobs> option when building, e.g:
# make -j$((`getconf _NPROCESSORS_ONLN`+1))
.NOTPARALLEL:
# absolute path
TOPDIR := $(CURDIR)
CONFIG_CONFIG_IN = Config.in
@ -117,9 +133,9 @@ export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlo
# List of targets and target patterns for which .config doesn't need to be read in
noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \
defconfig %_defconfig allyesconfig allnoconfig alldefconfig syncconfig release \
defconfig %_defconfig allyesconfig allnoconfig alldefconfig silentoldconfig release \
randpackageconfig allyespackageconfig allnopackageconfig \
print-version olddefconfig distclean manual manual-% check-package
print-version olddefconfig distclean manual manual-%
# Some global targets do not trigger a build, but are used to collect
# metadata, or do various checks. When such targets are triggered,
@ -135,7 +151,7 @@ nobuild_targets := source %-source \
clean distclean help show-targets graph-depends \
%-graph-depends %-show-depends %-show-version \
graph-build graph-size list-defconfigs \
savedefconfig update-defconfig printvars
savedefconfig printvars
ifeq ($(MAKECMDGOALS),)
BR_BUILDING = y
else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
@ -179,18 +195,16 @@ $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
# still be overridden on the command line, therefore the file is re-created
# every time make is run.
BR2_EXTERNAL_FILE = $(BASE_DIR)/.br2-external.mk
BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external.mk
-include $(BR2_EXTERNAL_FILE)
$(shell support/scripts/br2-external -d '$(BASE_DIR)' $(BR2_EXTERNAL))
$(shell support/scripts/br2-external \
-m -o '$(BR2_EXTERNAL_FILE)' $(BR2_EXTERNAL))
BR2_EXTERNAL_ERROR =
include $(BR2_EXTERNAL_FILE)
ifneq ($(BR2_EXTERNAL_ERROR),)
$(error $(BR2_EXTERNAL_ERROR))
endif
# Workaround bug in make-4.3: https://savannah.gnu.org/bugs/?57676
$(BASE_DIR)/.br2-external.mk:;
# To make sure that the environment variable overrides the .config option,
# set this before including .config.
ifneq ($(BR2_DL_DIR),)
@ -206,8 +220,10 @@ BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf)
BUILD_DIR := $(BASE_DIR)/build
BINARIES_DIR := $(BASE_DIR)/images
# The target directory is common to all packages,
# but there is one that is specific to each filesystem.
BASE_TARGET_DIR := $(BASE_DIR)/target
PER_PACKAGE_DIR := $(BASE_DIR)/per-package
TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(BASE_TARGET_DIR))
# initial definition so that 'make clean' works for most users, even without
# .config. HOST_DIR will be overwritten later when .config is included.
HOST_DIR := $(BASE_DIR)/host
@ -230,18 +246,12 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-include $(BR2_CONFIG)
endif
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),)
# Disable top-level parallel build if per-package directories is not
# used. Indeed, per-package directories is necessary to guarantee
# determinism and reproducibility with top-level parallel build.
.NOTPARALLEL:
endif
# timezone and locale may affect build output
ifeq ($(BR2_REPRODUCIBLE),y)
export TZ = UTC
export LANG = C
export LC_ALL = C
export GZIP = -n
endif
# To put more focus on warnings, be less verbose as default
@ -343,7 +353,7 @@ export HOSTARCH := $(shell LC_ALL=C $(HOSTCC_NOCCACHE) -v 2>&1 | \
# When adding a new host gcc version in Config.in,
# update the HOSTCC_MAX_VERSION variable:
HOSTCC_MAX_VERSION := 9
HOSTCC_MAX_VERSION := 8
HOSTCC_VERSION := $(shell V=$$($(HOSTCC_NOCCACHE) --version | \
sed -n -r 's/^.* ([0-9]*)\.([0-9]*)\.([0-9]*)[ ]*.*/\1 \2/p'); \
@ -412,8 +422,6 @@ unexport TERMINFO
unexport MACHINE
unexport O
unexport GCC_COLORS
unexport PLATFORM
unexport OS
GNU_HOST_NAME := $(shell support/gnuconfig/config.guess)
@ -432,12 +440,10 @@ KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
-e s/arceb/arc/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/aarch64.*/arm64/ \
-e s/nds32.*/nds32/ \
-e s/or1k/openrisc/ \
-e s/parisc64/parisc/ \
-e s/powerpc64.*/powerpc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/riscv.*/riscv/ \
-e s/sh.*/sh/ \
-e s/microblazeel/microblaze/)
@ -447,37 +453,28 @@ XZCAT := $(call qstrip,$(BR2_XZCAT))
LZCAT := $(call qstrip,$(BR2_LZCAT))
TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
HOST_DIR = $(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/host,$(call qstrip,$(BR2_HOST_DIR)))
TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/target,$(BASE_TARGET_DIR)))
else
# packages compiled for the host go here
HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(BASE_TARGET_DIR))
endif
ifneq ($(HOST_DIR),$(BASE_DIR)/host)
HOST_DIR_SYMLINK = $(BASE_DIR)/host
$(HOST_DIR_SYMLINK): | $(BASE_DIR)
ln -snf $(HOST_DIR) $(HOST_DIR_SYMLINK)
$(HOST_DIR_SYMLINK): $(BASE_DIR)
ln -snf $(HOST_DIR) $(BASE_DIR)/host
endif
STAGING_DIR_SYMLINK = $(BASE_DIR)/staging
$(STAGING_DIR_SYMLINK): | $(BASE_DIR)
ln -snf $(STAGING_DIR) $(STAGING_DIR_SYMLINK)
# Quotes are needed for spaces and all in the original PATH content.
BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
# Location of a file giving a big fat warning that output/target
# should not be used as the root filesystem.
TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
TARGET_DIR_WARNING_FILE = $(BASE_TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
ifeq ($(BR2_CCACHE),y)
CCACHE = $(HOST_DIR)/bin/ccache
CCACHE := $(HOST_DIR)/bin/ccache
BR_CACHE_DIR ?= $(call qstrip,$(BR2_CCACHE_DIR))
export BR_CACHE_DIR
HOSTCC = $(CCACHE) $(HOSTCC_NOCCACHE)
HOSTCXX = $(CCACHE) $(HOSTCXX_NOCCACHE)
HOSTCC := $(CCACHE) $(HOSTCC)
HOSTCXX := $(CCACHE) $(HOSTCXX)
else
export BR_NO_CCACHE
endif
@ -507,9 +504,9 @@ include Makefile.legacy
include system/system.mk
include package/Makefile.in
# arch/arch.mk must be after package/Makefile.in because it may need to
# arch/arch.mk.* must be after package/Makefile.in because it may need to
# complement variables defined therein, like BR_NO_CHECK_HASH_FOR.
include arch/arch.mk
-include $(sort $(wildcard arch/arch.mk.*))
include support/dependencies/dependencies.mk
include $(sort $(wildcard toolchain/*.mk))
@ -552,16 +549,9 @@ include $(BR2_EXTERNAL_MKS)
#
# Only trigger the check for default builds. If the user forces building
# a package, even if not enabled in the configuration, we want to accept
# it. However; we also want to be able to force checking the dependencies
# if the user so desires. Forcing a dependency check is useful in the case
# of test-pkg, as we want to make sure during testing, that a package has
# all the dependencies selected in the config file.
# it.
#
ifeq ($(MAKECMDGOALS),)
BR_FORCE_CHECK_DEPENDENCIES = YES
endif
ifeq ($(BR_FORCE_CHECK_DEPENDENCIES),YES)
define CHECK_ONE_DEPENDENCY
ifeq ($$($(2)_TYPE),target)
@ -581,8 +571,12 @@ $(foreach pkg,$(call UPPERCASE,$(PACKAGES)),\
endif
.PHONY: dirs
dirs: $(BUILD_DIR) $(STAGING_DIR) $(BASE_TARGET_DIR) \
$(HOST_DIR) $(HOST_DIR_SYMLINK) $(BINARIES_DIR)
$(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG)
$(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" syncconfig
$(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig
.PHONY: prepare
prepare: $(BUILD_DIR)/buildroot-config/auto.conf
@ -590,61 +584,38 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
.PHONY: world
world: target-post-image
.PHONY: prepare-sdk
prepare-sdk: world
.PHONY: sdk
sdk: world
@$(call MESSAGE,"Rendering the SDK relocatable")
PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath host
PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath staging
$(TOPDIR)/support/scripts/fix-rpath host
$(TOPDIR)/support/scripts/fix-rpath staging
$(INSTALL) -m 755 $(TOPDIR)/support/misc/relocate-sdk.sh $(HOST_DIR)/relocate-sdk.sh
mkdir -p $(HOST_DIR)/share/buildroot
echo $(HOST_DIR) > $(HOST_DIR)/share/buildroot/sdk-location
BR2_SDK_PREFIX ?= $(GNU_TARGET_NAME)_sdk-buildroot
.PHONY: sdk
sdk: prepare-sdk $(BR2_TAR_HOST_DEPENDENCY)
@$(call MESSAGE,"Generating SDK tarball")
$(if $(BR2_SDK_PREFIX),,$(error BR2_SDK_PREFIX can not be empty))
$(Q)mkdir -p $(BINARIES_DIR)
$(TAR) czf "$(BINARIES_DIR)/$(BR2_SDK_PREFIX).tar.gz" \
--owner=0 --group=0 --numeric-owner \
--transform='s#^$(patsubst /%,%,$(HOST_DIR))#$(BR2_SDK_PREFIX)#' \
-C / $(patsubst /%,%,$(HOST_DIR))
# Populating the staging with the base directories is handled by the skeleton package
$(STAGING_DIR):
@mkdir -p $(STAGING_DIR)
@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
RSYNC_VCS_EXCLUSIONS = \
--exclude .svn --exclude .git --exclude .hg --exclude .bzr \
--exclude CVS
# When stripping, obey to BR2_STRIP_EXCLUDE_DIRS and
# BR2_STRIP_EXCLUDE_FILES
STRIP_FIND_COMMON_CMD = \
find $(TARGET_DIR) \
$(if $(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)), \
\( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) \
-prune -o \
) \
$(if $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES)), \
-not \( $(call findfileclauses,$(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) )
# Regular stripping for everything, except libpthread, ld-*.so and
# kernel modules:
STRIP_FIND_CMD = find $(TARGET_DIR)
ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)))
STRIP_FIND_CMD += \( $(call finddirclauses,$(TARGET_DIR),$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS))) \) -prune -o
endif
STRIP_FIND_CMD += -type f \( -perm /111 -o -name '*.so*' \)
# file exclusions:
# - libpthread.so: a non-stripped libpthread shared library is needed for
# proper debugging of pthread programs using gdb.
# - ld.so: a non-stripped dynamic linker library is needed for valgrind
# - kernel modules (*.ko): do not function properly when stripped like normal
# applications and libraries. Normally kernel modules are already excluded
# by the executable permission check, so the explicit exclusion is only
# by the executable permission check above, so the explicit exclusion is only
# done for kernel modules with incorrect permissions.
STRIP_FIND_CMD = \
$(STRIP_FIND_COMMON_CMD) \
-type f \( -perm /111 -o -name '*.so*' \) \
-not \( $(call findfileclauses,libpthread*.so* ld-*.so* *.ko) \) \
-print0
# Special stripping (only debugging symbols) for libpthread and ld-*.so.
STRIP_FIND_SPECIAL_LIBS_CMD = \
$(STRIP_FIND_COMMON_CMD) \
\( -name 'ld-*.so*' -o -name 'libpthread*.so*' \) \
-print0
STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* ld-*.so* *.ko $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print0
ifeq ($(BR2_ECLIPSE_REGISTER),y)
define TOOLCHAIN_ECLIPSE_REGISTER
@ -698,9 +669,8 @@ define PURGE_LOCALES
rm -f $(LOCALE_WHITELIST)
for i in $(LOCALE_NOPURGE) locale-archive; do echo $$i >> $(LOCALE_WHITELIST); done
for dir in $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/lib/locale); \
for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/lib/locale)); \
do \
if [ ! -d $$dir ]; then continue; fi; \
for langdir in $$dir/*; \
do \
if [ -e "$${langdir}" ]; \
@ -728,36 +698,25 @@ $(TARGETS_ROOTFS): target-finalize
# Avoid the rootfs name leaking down the dependency chain
target-finalize: ROOTFS=
TARGET_DIR_FILES_LISTS = $(sort $(wildcard $(BUILD_DIR)/*/.files-list.txt))
HOST_DIR_FILES_LISTS = $(sort $(wildcard $(BUILD_DIR)/*/.files-list-host.txt))
STAGING_DIR_FILES_LISTS = $(sort $(wildcard $(BUILD_DIR)/*/.files-list-staging.txt))
.PHONY: host-finalize
host-finalize: $(PACKAGES) $(HOST_DIR) $(HOST_DIR_SYMLINK)
@$(call MESSAGE,"Finalizing host directory")
$(call per-package-rsync,$(sort $(PACKAGES)),host,$(HOST_DIR))
.PHONY: staging-finalize
staging-finalize: $(STAGING_DIR_SYMLINK)
.PHONY: target-finalize
target-finalize: $(PACKAGES) $(TARGET_DIR) host-finalize
target-finalize: $(PACKAGES)
@$(call MESSAGE,"Finalizing target directory")
$(call per-package-rsync,$(sort $(PACKAGES)),target,$(TARGET_DIR))
# Check files that are touched by more than one package
./support/scripts/check-uniq-files -t target $(BUILD_DIR)/packages-file-list.txt
./support/scripts/check-uniq-files -t staging $(BUILD_DIR)/packages-file-list-staging.txt
./support/scripts/check-uniq-files -t host $(BUILD_DIR)/packages-file-list-host.txt
$(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
$(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \
$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake \
$(TARGET_DIR)/usr/doc
$(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake
find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
find $(TARGET_DIR)/lib/ $(TARGET_DIR)/usr/lib/ $(TARGET_DIR)/usr/libexec/ \
\( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | xargs -0 rm -f
\( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
ifneq ($(BR2_PACKAGE_GDB),y)
rm -rf $(TARGET_DIR)/usr/share/gdb
endif
ifneq ($(BR2_PACKAGE_BASH),y)
rm -rf $(TARGET_DIR)/usr/share/bash-completion
rm -rf $(TARGET_DIR)/etc/bash_completion.d
endif
ifneq ($(BR2_PACKAGE_ZSH),y)
rm -rf $(TARGET_DIR)/usr/share/zsh
@ -767,12 +726,20 @@ endif
rm -rf $(TARGET_DIR)/usr/doc $(TARGET_DIR)/usr/share/doc
rm -rf $(TARGET_DIR)/usr/share/gtk-doc
rmdir $(TARGET_DIR)/usr/share 2>/dev/null || true
ifneq ($(BR2_ENABLE_DEBUG):$(BR2_STRIP_strip),y:)
rm -rf $(TARGET_DIR)/lib/debug $(TARGET_DIR)/usr/lib/debug
endif
$(STRIP_FIND_CMD) | xargs -0 $(STRIPCMD) 2>/dev/null || true
$(STRIP_FIND_SPECIAL_LIBS_CMD) | xargs -0 -r $(STRIPCMD) $(STRIP_STRIP_DEBUG) 2>/dev/null || true
# See http://sourceware.org/gdb/wiki/FAQ, "GDB does not see any threads
# besides the one in which crash occurred; or SIGTRAP kills my program when
# I set a breakpoint"
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
find $(TARGET_DIR)/lib/ -type f -name 'libpthread*.so*' | \
xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
endif
# Valgrind needs ld.so with enough information, so only strip
# debugging symbols.
find $(TARGET_DIR)/lib/ -type f -name 'ld-*.so*' | \
xargs -r $(STRIPCMD) $(STRIP_STRIP_DEBUG)
test -f $(TARGET_DIR)/etc/ld.so.conf && \
{ echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
test -d $(TARGET_DIR)/etc/ld.so.conf.d && \
@ -788,34 +755,13 @@ endif
ln -sf ../usr/lib/os-release $(TARGET_DIR)/etc
@$(call MESSAGE,"Sanitizing RPATH in target tree")
PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath target
# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
# counterparts are appropriately setup as symlinks ones to the others.
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
@$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
$(call MESSAGE,"Sanity check in overlay $(d)"); \
not_merged_dirs="$$(support/scripts/check-merged-usr.sh $(d))"; \
test -n "$$not_merged_dirs" && { \
echo "ERROR: The overlay in $(d) is not" \
"using a merged /usr for the following directories:" \
$$not_merged_dirs; \
exit 1; \
} || true$(sep))
endif # merged /usr
$(TOPDIR)/support/scripts/fix-rpath target
@$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
$(call MESSAGE,"Copying overlay $(d)"); \
$(call SYSTEM_RSYNC,$(d),$(TARGET_DIR))$(sep))
$(if $(TARGET_DIR_FILES_LISTS), \
cat $(TARGET_DIR_FILES_LISTS)) > $(BUILD_DIR)/packages-file-list.txt
$(if $(HOST_DIR_FILES_LISTS), \
cat $(HOST_DIR_FILES_LISTS)) > $(BUILD_DIR)/packages-file-list-host.txt
$(if $(STAGING_DIR_FILES_LISTS), \
cat $(STAGING_DIR_FILES_LISTS)) > $(BUILD_DIR)/packages-file-list-staging.txt
rsync -a --ignore-times --keep-dirlinks $(RSYNC_VCS_EXCLUSIONS) \
--chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
$(d)/ $(TARGET_DIR)$(sep))
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_BUILD_SCRIPT)), \
$(call MESSAGE,"Executing post-build script $(s)"); \
@ -824,9 +770,8 @@ endif # merged /usr
touch $(TARGET_DIR)/usr
.PHONY: target-post-image
target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize
target-post-image: $(TARGETS_ROOTFS) target-finalize
@rm -f $(ROOTFS_COMMON_TAR)
$(Q)mkdir -p $(BINARIES_DIR)
@$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \
$(call MESSAGE,"Executing post-image script $(s)"); \
$(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep))
@ -846,15 +791,15 @@ legal-info-clean:
.PHONY: legal-info-prepare
legal-info-prepare: $(LEGAL_INFO_DIR)
@$(call MESSAGE,"Buildroot $(BR2_VERSION_FULL) Collecting legal info")
@$(call legal-license-file,buildroot,buildroot,support/legal-info/buildroot.hash,COPYING,COPYING,HOST)
@$(call legal-manifest,TARGET,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
@$(call legal-manifest,HOST,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,DEPENDENCIES WITH LICENSES)
@$(call legal-manifest,HOST,buildroot,$(BR2_VERSION_FULL),GPL-2.0+,COPYING,not saved,not saved)
@$(call legal-license-file,buildroot,buildroot,support/legal-info,COPYING,COPYING,HOST)
@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,TARGET)
@$(call legal-manifest,PACKAGE,VERSION,LICENSE,LICENSE FILES,SOURCE ARCHIVE,SOURCE SITE,HOST)
@$(call legal-manifest,buildroot,$(BR2_VERSION_FULL),GPL-2.0+,COPYING,not saved,not saved,HOST)
@$(call legal-warning,the Buildroot source code has not been saved)
@cp $(BR2_CONFIG) $(LEGAL_INFO_DIR)/buildroot.config
.PHONY: legal-info
legal-info: legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all-legal-info) \
legal-info: dirs legal-info-clean legal-info-prepare $(foreach p,$(PACKAGES),$(p)-all-legal-info) \
$(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST)
@cat support/legal-info/README.header >>$(LEGAL_REPORT)
@if [ -r $(LEGAL_WARNINGS) ]; then \
@ -908,29 +853,13 @@ graph-size:
$(Q)$(TOPDIR)/support/scripts/size-stats --builddir $(BASE_DIR) \
--graph $(GRAPHS_DIR)/graph-size.$(BR_GRAPH_OUT) \
--file-size-csv $(GRAPHS_DIR)/file-size-stats.csv \
--package-size-csv $(GRAPHS_DIR)/package-size-stats.csv \
$(BR2_GRAPH_SIZE_OPTS)
--package-size-csv $(GRAPHS_DIR)/package-size-stats.csv
.PHONY: check-dependencies
check-dependencies:
@cd "$(CONFIG_DIR)"; \
$(TOPDIR)/support/scripts/graph-depends -C
.PHONY: show-info
show-info:
@:
$(info $(call clean-json, \
{ $(foreach p, \
$(sort $(foreach i,$(PACKAGES) $(TARGETS_ROOTFS), \
$(i) \
$($(call UPPERCASE,$(i))_FINAL_RECURSIVE_DEPENDENCIES) \
) \
), \
$(call json-info,$(call UPPERCASE,$(p)))$(comma) \
) } \
) \
)
else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
# Some subdirectories are also package names. To avoid that "make linux"
@ -950,6 +879,9 @@ endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
HOSTCFLAGS = $(CFLAGS_FOR_BUILD)
export HOSTCFLAGS
.PHONY: prepare-kconfig
prepare-kconfig: outputmakefile $(BUILD_DIR)/.br2-external.in
$(BUILD_DIR)/buildroot-config/%onf:
mkdir -p $(@D)/lxdialog
PKG_CONFIG_PATH="$(HOST_PKG_CONFIG_PATH)" $(MAKE) CC="$(HOSTCC_NOCCACHE)" HOSTCC="$(HOSTCC_NOCCACHE)" \
@ -966,22 +898,22 @@ COMMON_CONFIG_ENV = \
KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
BR2_CONFIG=$(BR2_CONFIG) \
HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
BASE_DIR=$(BASE_DIR) \
BUILD_DIR=$(BUILD_DIR) \
SKIP_LEGACY=
xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
xconfig: $(BUILD_DIR)/buildroot-config/qconf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
gconfig: $(BUILD_DIR)/buildroot-config/gconf outputmakefile
gconfig: $(BUILD_DIR)/buildroot-config/gconf prepare-kconfig
@$(COMMON_CONFIG_ENV) srctree=$(TOPDIR) $< $(CONFIG_CONFIG_IN)
menuconfig: $(BUILD_DIR)/buildroot-config/mconf outputmakefile
menuconfig: $(BUILD_DIR)/buildroot-config/mconf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
nconfig: $(BUILD_DIR)/buildroot-config/nconf outputmakefile
nconfig: $(BUILD_DIR)/buildroot-config/nconf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
config: $(BUILD_DIR)/buildroot-config/conf outputmakefile
config: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< $(CONFIG_CONFIG_IN)
# For the config targets that automatically select options, we pass
@ -989,11 +921,11 @@ config: $(BUILD_DIR)/buildroot-config/conf outputmakefile
# no values are set for the legacy options so a subsequent oldconfig
# will query them. Therefore, run an additional olddefconfig.
randconfig allyesconfig alldefconfig allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
randconfig allyesconfig alldefconfig allnoconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --$@ $(CONFIG_CONFIG_IN)
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
randpackageconfig allyespackageconfig allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
randpackageconfig allyespackageconfig allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
@ -1001,29 +933,27 @@ randpackageconfig allyespackageconfig allnopackageconfig: $(BUILD_DIR)/buildroot
@rm -f $(CONFIG_DIR)/.config.nopkg
@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
oldconfig syncconfig olddefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
oldconfig silentoldconfig olddefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< --$@ $(CONFIG_CONFIG_IN)
defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
defconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
define percent_defconfig
# Override the BR2_DEFCONFIG from COMMON_CONFIG_ENV with the new defconfig
%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(1)/configs/%_defconfig outputmakefile
%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(1)/configs/%_defconfig prepare-kconfig
@$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(1)/configs/$$@ \
$$< --defconfig=$(1)/configs/$$@ $$(CONFIG_CONFIG_IN)
endef
$(eval $(foreach d,$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)),$(call percent_defconfig,$(d))$(sep)))
update-defconfig: savedefconfig
savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
@$(COMMON_CONFIG_ENV) $< \
--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
$(CONFIG_CONFIG_IN)
@$(SED) '/BR2_DEFCONFIG=/d' $(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig)
.PHONY: defconfig savedefconfig update-defconfig
.PHONY: defconfig savedefconfig
################################################################################
#
@ -1033,7 +963,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
# staging and target directories do NOT list these as
# dependencies anywhere else
$(BUILD_DIR) $(BASE_TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST) $(PER_PACKAGE_DIR):
$(BUILD_DIR) $(BASE_TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
@mkdir -p $@
# outputmakefile generates a Makefile in the output directory, if using a
@ -1045,6 +975,13 @@ ifeq ($(NEED_WRAPPER),y)
$(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
endif
# Even though the target is a real file, we mark it as PHONY as we
# want it to be re-generated each time make is invoked, in case the
# value of BR2_EXTERNAL is changed.
.PHONY: $(BUILD_DIR)/.br2-external.in
$(BUILD_DIR)/.br2-external.in: $(BUILD_DIR)
$(Q)support/scripts/br2-external -k -o "$(@)" $(BR2_EXTERNAL)
# printvars prints all the variables currently defined in our
# Makefiles. Alternatively, if a non-empty VARS variable is passed,
# only the variables matching the make pattern passed in VARS are
@ -1053,7 +990,7 @@ endif
printvars:
@:
$(foreach V, \
$(sort $(filter $(VARS),$(.VARIABLES))), \
$(sort $(if $(VARS),$(filter $(VARS),$(.VARIABLES)),$(.VARIABLES))), \
$(if $(filter-out environment% default automatic, \
$(origin $V)), \
$(if $(QUOTED_VARS),\
@ -1065,7 +1002,7 @@ printvars:
clean:
rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
$(BUILD_DIR) $(BASE_DIR)/staging \
$(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR)
$(LEGAL_INFO_DIR) $(GRAPHS_DIR)
.PHONY: distclean
distclean: clean
@ -1073,7 +1010,7 @@ ifeq ($(O),$(CURDIR)/output)
rm -rf $(O)
endif
rm -rf $(TOPDIR)/dl $(BR2_CONFIG) $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/..config.tmp \
$(CONFIG_DIR)/.auto.deps $(BASE_DIR)/.br2-external.*
$(CONFIG_DIR)/.auto.deps $(BR2_EXTERNAL_FILE)
.PHONY: help
help:
@ -1092,13 +1029,12 @@ help:
@echo ' xconfig - interactive Qt-based configurator'
@echo ' gconfig - interactive GTK-based configurator'
@echo ' oldconfig - resolve any unresolved symbols in .config'
@echo ' syncconfig - Same as oldconfig, but quietly, additionally update deps'
@echo ' olddefconfig - Same as syncconfig but sets new symbols to their default value'
@echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
@echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
@echo ' randconfig - New config with random answer to all options'
@echo ' defconfig - New config with default answer to all options;'
@echo ' BR2_DEFCONFIG, if set on the command line, is used as input'
@echo ' savedefconfig - Save current config to BR2_DEFCONFIG (minimal config)'
@echo ' update-defconfig - Same as savedefconfig'
@echo ' allyesconfig - New config where all options are accepted with yes'
@echo ' allnoconfig - New config where all options are answered with no'
@echo ' alldefconfig - New config where all options are set to default'
@ -1114,7 +1050,6 @@ help:
@echo ' <pkg>-depends - Build <pkg>'\''s dependencies'
@echo ' <pkg>-configure - Build <pkg> up to the configure step'
@echo ' <pkg>-build - Build <pkg> up to the build step'
@echo ' <pkg>-show-info - generate info about <pkg>, as a JSON blurb'
@echo ' <pkg>-show-depends - List packages on which <pkg> depends'
@echo ' <pkg>-show-rdepends - List packages which have <pkg> as a dependency'
@echo ' <pkg>-show-recursive-depends'
@ -1147,8 +1082,7 @@ help:
@echo ' source - download all sources needed for offline-build'
@echo ' external-deps - list external packages used'
@echo ' legal-info - generate info about license compliance'
@echo ' show-info - generate info about packages, as a JSON blurb'
@echo ' printvars - dump internal variables selected with VARS=...'
@echo ' printvars - dump all the internal variables'
@echo
@echo ' make V=0|1 - 0 => quiet build (default), 1 => verbose build'
@echo ' make O=dir - Locate all output files in "dir", including .config'
@ -1194,7 +1128,7 @@ release: OUT = buildroot-$(BR2_VERSION)
release:
git archive --format=tar --prefix=$(OUT)/ HEAD > $(OUT).tar
$(MAKE) O=$(OUT) manual-html manual-text manual-pdf
$(MAKE) O=$(OUT) distclean
$(MAKE) O=$(OUT) manual-clean
tar rf $(OUT).tar $(OUT)
gzip -9 -c < $(OUT).tar > $(OUT).tar.gz
bzip2 -9 -c < $(OUT).tar > $(OUT).tar.bz2
@ -1203,13 +1137,11 @@ release:
print-version:
@echo $(BR2_VERSION_FULL)
check-package:
find $(TOPDIR) -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \) \
-exec ./utils/check-package {} +
.PHONY: .gitlab-ci.yml
.gitlab-ci.yml: .gitlab-ci.yml.in
./support/scripts/generate-gitlab-ci-yml $< > $@
cp $< $@
(cd configs; LC_ALL=C ls -1 *_defconfig) | sed 's/$$/: *defconfig/' >> $@
./support/testing/run-tests -l 2>&1 | sed -r -e '/^test_run \((.*)\).*/!d; s//\1: *runtime_test/' | LC_ALL=C sort >> $@
include docs/manual/manual.mk
-include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(sort $(wildcard $(dir)/docs/*/*.mk)))

View File

@ -1,3 +1,8 @@
**motionEyeOS** is a Linux distribution that turns your single board computer into a video surveillance system. Check out the [wiki](https://github.com/ccrisan/motioneyeos/wiki) for more details.
Due to personal reasons I can no longer be actively involved with this project. If anyone is interested in taking it over, please contact me and we'll work out together a hand-off plan.
[<img src="https://img.shields.io/badge/rating-4%2B%20stars-brightgreen.svg">](https://recordnotfound.com/motioneyeos-ccrisan-2430)
Follow us on facebook: [https://www.facebook.com/motioneyeos](https://www.facebook.com/motioneyeos).
You can support the development of motionEyeOS by making a small donation.
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ccrisan%40gmail%2ecom&lc=US&item_name=motionEyeOS&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" alt="[paypal]" /></a>

View File

@ -77,10 +77,8 @@ config BR2_aarch64_be
config BR2_csky
bool "csky"
select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT
select BR2_ARCH_HAS_MMU_MANDATORY
# Most variants are supported by gcc-9+, except one that is
# handled as a special exception in package/gcc/Config.in.host
select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
help
csky is processor IP from china.
http://www.c-sky.com/
@ -156,14 +154,6 @@ config BR2_mips64el
http://www.mips.com/
http://en.wikipedia.org/wiki/MIPS_Technologies
config BR2_nds32
bool "nds32"
select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT
select BR2_ARCH_HAS_MMU_MANDATORY
help
nds32 is a 32-bit architecture developed by Andes Technology.
https://en.wikipedia.org/wiki/Andes_Technology
config BR2_nios2
bool "Nios II"
select BR2_ARCH_HAS_MMU_MANDATORY
@ -208,17 +198,6 @@ config BR2_powerpc64le
http://www.power.org/
http://en.wikipedia.org/wiki/Powerpc
config BR2_riscv
bool "RISCV"
select BR2_ARCH_HAS_MMU_MANDATORY
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
help
RISC-V is an open, free Instruction Set Architecture created
by the UC Berkeley Architecture Research group and supported
and promoted by RISC-V Foundation.
https://riscv.org/
https://en.wikipedia.org/wiki/RISC-V
config BR2_sh
bool "SuperH"
select BR2_ARCH_HAS_MMU_OPTIONAL
@ -304,10 +283,6 @@ config BR2_ARCH_NEEDS_GCC_AT_LEAST_8
bool
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_ARCH_NEEDS_GCC_AT_LEAST_9
bool
select BR2_ARCH_NEEDS_GCC_AT_LEAST_8
# The following string values are defined by the individual
# Config.in.$ARCH files
config BR2_ARCH
@ -331,6 +306,9 @@ config BR2_GCC_TARGET_FP32_MODE
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)
@ -433,10 +411,6 @@ if BR2_mips || BR2_mips64 || BR2_mipsel || BR2_mips64el
source "arch/Config.in.mips"
endif
if BR2_nds32
source "arch/Config.in.nds32"
endif
if BR2_nios2
source "arch/Config.in.nios2"
endif
@ -449,10 +423,6 @@ if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
source "arch/Config.in.powerpc"
endif
if BR2_riscv
source "arch/Config.in.riscv"
endif
if BR2_sh
source "arch/Config.in.sh"
endif

View File

@ -13,43 +13,13 @@ config BR2_arc770d
config BR2_archs38
bool "ARC HS38"
help
Generic ARC HS capable of running Linux, i.e. with MMU,
caches and 32-bit multiplier. Also it corresponds to the
default configuration in older GNU toolchain versions.
config BR2_archs38_64mpy
bool "ARC HS38 with 64-bit mpy"
help
Fully featured ARC HS capable of running Linux, i.e. with
MMU, caches and 64-bit multiplier.
If you're not sure which version of ARC HS core you build
for use this one.
config BR2_archs38_full
bool "ARC HS38 with Quad MAC & FPU"
help
Fully featured ARC HS with additional support for
- Dual- and quad multiply and MC oprations
- Double-precision FPU
It corresponds to "hs38_slc_full" ARC HS template in
ARChitect.
config BR2_archs4x_rel31
bool "ARC HS48 rel 31"
help
Latest release of HS48 processor
- Dual- and quad multiply and MC oprations
- Double-precision FPU
endchoice
# Choice of atomic instructions presence
config BR2_ARC_ATOMIC_EXT
bool "Atomic extension (LLOCK/SCOND instructions)"
default y if BR2_arc770d || BR2_archs38 || BR2_archs38_64mpy || BR2_archs38_full || BR2_archs4x_rel31
default y if BR2_arc770d || BR2_archs38
config BR2_ARCH
default "arc" if BR2_arcle
@ -67,13 +37,10 @@ config BR2_GCC_TARGET_CPU
default "arc700" if BR2_arc750d
default "arc700" if BR2_arc770d
default "archs" if BR2_archs38
default "hs38" if BR2_archs38_64mpy
default "hs38_linux" if BR2_archs38_full
default "hs4x_rel31" if BR2_archs4x_rel31
config BR2_READELF_ARCH_NAME
default "ARCompact" if BR2_arc750d || BR2_arc770d
default "ARCv2" if BR2_archs38 || BR2_archs38_64mpy || BR2_archs38_full || BR2_archs4x_rel31
default "ARCv2" if BR2_archs38
choice
prompt "MMU Page Size"
@ -93,7 +60,7 @@ choice
config BR2_ARC_PAGE_SIZE_4K
bool "4KB"
depends on BR2_arc770d || BR2_archs38 || BR2_archs38_64mpy || BR2_archs38_full || BR2_archs4x_rel31
depends on BR2_arc770d || BR2_archs38
config BR2_ARC_PAGE_SIZE_8K
bool "8KB"
@ -103,7 +70,7 @@ config BR2_ARC_PAGE_SIZE_8K
config BR2_ARC_PAGE_SIZE_16K
bool "16KB"
depends on BR2_arc770d || BR2_archs38 || BR2_archs38_64mpy || BR2_archs38_full || BR2_archs4x_rel31
depends on BR2_arc770d || BR2_archs38
endchoice
@ -112,6 +79,3 @@ config BR2_ARC_PAGE_SIZE
default "4K" if BR2_ARC_PAGE_SIZE_4K
default "8K" if BR2_ARC_PAGE_SIZE_8K
default "16K" if BR2_ARC_PAGE_SIZE_16K
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -367,13 +367,6 @@ config BR2_cortex_a73_a53
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_emag
bool "emag"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
config BR2_exynos_m1
bool "exynos-m1"
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
@ -385,60 +378,54 @@ config BR2_exynos_m1
select BR2_ARCH_NEEDS_GCC_AT_LEAST_5
config BR2_falkor
bool "falkor"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_phecda
bool "phecda"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
config BR2_qdf24xx
bool "qdf24xx"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_6
if BR2_ARCH_IS_64
config BR2_thunderx
bool "thunderx (aka octeontx)"
depends on BR2_ARCH_IS_64
bool "thunderx"
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_5
config BR2_thunderxt81
bool "thunderxt81 (aka octeontx81)"
depends on BR2_ARCH_IS_64
bool "thunderxt81"
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_thunderxt83
bool "thunderxt83 (aka octeontx83)"
depends on BR2_ARCH_IS_64
bool "thunderxt83"
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_thunderxt88
bool "thunderxt88"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_thunderxt88p1
bool "thunderxt88p1"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
endif # BR2_ARCH_IS_64
config BR2_xgene1
bool "xgene1"
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
@ -449,94 +436,36 @@ config BR2_xgene1
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_5
if BR2_ARCH_IS_64
comment "armv8.1a cores"
config BR2_thunderx2t99
bool "thunderx2t99"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_thunderx2t99p1
bool "thunderx2t99p1"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
config BR2_vulcan
bool "vulcan"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
comment "armv8.2a cores"
config BR2_cortex_a55
bool "cortex-A55"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_8
config BR2_cortex_a75
bool "cortex-A75"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_8
config BR2_cortex_a75_a55
bool "cortex-A75/A55 big.LITTLE"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_8
config BR2_cortex_a76
bool "cortex-A76"
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
config BR2_cortex_a76_a55
bool "cortex-A76/A55 big.LITTLE"
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
config BR2_neoverse_n1
bool "neoverse-N1 (aka ares)"
select BR2_ARM_CPU_HAS_ARM if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_NEON if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_THUMB2 if !BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
config BR2_tsv110
bool "tsv110"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
comment "armv8.4a cores"
config BR2_saphira
bool "saphira"
depends on BR2_ARCH_IS_64
select BR2_ARM_CPU_HAS_FP_ARMV8
select BR2_ARM_CPU_ARMV8A
select BR2_ARCH_HAS_MMU_OPTIONAL
select BR2_ARCH_NEEDS_GCC_AT_LEAST_8
endif # BR2_ARCH_IS_64
endchoice
config BR2_ARM_ENABLE_NEON
@ -869,17 +798,12 @@ config BR2_GCC_TARGET_CPU
default "cortex-a73" if BR2_cortex_a73
default "cortex-a73.cortex-a35" if BR2_cortex_a73_a35
default "cortex-a73.cortex-a53" if BR2_cortex_a73_a53
default "emag" if BR2_emag
default "exynos-m1" if BR2_exynos_m1
default "falkor" if BR2_falkor
default "phecda" if BR2_phecda
default "qdf24xx" if BR2_qdf24xx
default "thunderx" if BR2_thunderx && !BR2_TOOLCHAIN_GCC_AT_LEAST_9
default "octeontx" if BR2_thunderx && BR2_TOOLCHAIN_GCC_AT_LEAST_9
default "thunderxt81" if BR2_thunderxt81 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9
default "octeontx81" if BR2_thunderxt81 && BR2_TOOLCHAIN_GCC_AT_LEAST_9
default "thunderxt83" if BR2_thunderxt83 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9
default "octeontx83" if BR2_thunderxt83 && BR2_TOOLCHAIN_GCC_AT_LEAST_9
default "thunderx" if BR2_thunderx
default "thunderxt81" if BR2_thunderxt81
default "thunderxt83" if BR2_thunderxt83
default "thunderxt88" if BR2_thunderxt88
default "thunderxt88p1" if BR2_thunderxt88p1
default "xgene1" if BR2_xgene1
@ -887,16 +811,6 @@ config BR2_GCC_TARGET_CPU
default "thunderx2t99" if BR2_thunderx2t99
default "thunderx2t99p1" if BR2_thunderx2t99p1
default "vulcan" if BR2_vulcan
# armv8.2a
default "cortex-a55" if BR2_cortex_a55
default "cortex-a75" if BR2_cortex_a75
default "cortex-a75.cortex-a55" if BR2_cortex_a75_a55
default "cortex-a76" if BR2_cortex_a76
default "cortex-a76.cortex-a55" if BR2_cortex_a76_a55
default "neoverse-n1" if BR2_neoverse_n1
default "tsv110" if BR2_tsv110
# armv8.4a
default "saphira" if BR2_saphira
config BR2_GCC_TARGET_ABI
default "aapcs-linux" if BR2_arm || BR2_armeb
@ -929,6 +843,3 @@ config BR2_GCC_TARGET_MODE
config BR2_READELF_ARCH_NAME
default "ARM" if BR2_arm || BR2_armeb
default "AArch64" if BR2_aarch64 || BR2_aarch64_be
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -5,8 +5,6 @@ choice
Specific CPU variant to use
config BR2_ck610
# Not supported by upstream gcc <= 9, and handled as a special
# exception in package/gcc/Config.in.host
bool "ck610"
config BR2_ck807
@ -15,26 +13,19 @@ config BR2_ck807
config BR2_ck810
bool "ck810"
config BR2_ck860
bool "ck860"
endchoice
config BR2_CSKY_FPU
bool "Enable FPU coprocessor"
depends on BR2_ck810 || BR2_ck807 || BR2_ck860
depends on BR2_ck810 || BR2_ck807
help
You can say N here if your C-SKY CPU doesn't have a
Floating-Point Coprocessor or if you don't need FPU support
for your user-space programs.
config BR2_CSKY_VDSP
bool "Enable VDSP enhanced instructions Co-processor"
depends on BR2_CSKY_FPU
config BR2_GCC_TARGET_FLOAT_ABI
default "soft" if !BR2_CSKY_FPU
default "hard" if BR2_CSKY_FPU
config BR2_CSKY_DSP
bool "Enable DSP enhanced instructions"
depends on BR2_ck810 || BR2_ck807
config BR2_ARCH
default "csky"
@ -42,8 +33,16 @@ config BR2_ARCH
config BR2_ENDIAN
default "LITTLE"
config BR2_GCC_TARGET_CPU
default "ck610" if (BR2_ck610 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
default "ck807" if (BR2_ck807 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
default "ck807e" if (BR2_ck807 && !BR2_CSKY_FPU && BR2_CSKY_DSP)
default "ck807f" if (BR2_ck807 && BR2_CSKY_FPU && !BR2_CSKY_DSP)
default "ck807ef" if (BR2_ck807 && BR2_CSKY_FPU && BR2_CSKY_DSP)
default "ck810" if (BR2_ck810 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
default "ck810e" if (BR2_ck810 && !BR2_CSKY_FPU && BR2_CSKY_DSP)
default "ck810f" if (BR2_ck810 && BR2_CSKY_FPU && !BR2_CSKY_DSP)
default "ck810ef" if (BR2_ck810 && BR2_CSKY_FPU && BR2_CSKY_DSP)
config BR2_READELF_ARCH_NAME
default "CSKY"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -38,6 +38,3 @@ config BR2_GCC_TARGET_CPU
config BR2_READELF_ARCH_NAME
default "MC68000"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -12,6 +12,3 @@ config BR2_READELF_ARCH_NAME
config BR2_microblaze
bool
default y if BR2_microblazeel || BR2_microblazebe
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -5,9 +5,6 @@ config BR2_MIPS_CPU_MIPS32
config BR2_MIPS_CPU_MIPS32R2
bool
select BR2_MIPS_NAN_LEGACY
config BR2_MIPS_CPU_MIPS32R3
bool
select BR2_MIPS_NAN_LEGACY
config BR2_MIPS_CPU_MIPS32R5
bool
select BR2_ARCH_NEEDS_GCC_AT_LEAST_5
@ -21,9 +18,6 @@ config BR2_MIPS_CPU_MIPS64
config BR2_MIPS_CPU_MIPS64R2
bool
select BR2_MIPS_NAN_LEGACY
config BR2_MIPS_CPU_MIPS64R3
bool
select BR2_MIPS_NAN_LEGACY
config BR2_MIPS_CPU_MIPS64R5
bool
select BR2_ARCH_NEEDS_GCC_AT_LEAST_5
@ -40,8 +34,8 @@ choice
help
Specific CPU variant to use
64bit capable: 64, 64r2, 64r3, 64r5, 64r6
non-64bit capable: 32, 32r2, 32r3, 32r5, 32r6
64bit cabable: 64, 64r2, 64r5, 64r6
non-64bit capable: 32, 32r2, 32r5, 32r6
config BR2_mips_32
bool "Generic MIPS32"
@ -51,10 +45,6 @@ config BR2_mips_32r2
bool "Generic MIPS32R2"
depends on !BR2_ARCH_IS_64
select BR2_MIPS_CPU_MIPS32R2
config BR2_mips_32r3
bool "Generic MIPS32R3"
depends on !BR2_ARCH_IS_64
select BR2_MIPS_CPU_MIPS32R3
config BR2_mips_32r5
bool "Generic MIPS32R5"
depends on !BR2_ARCH_IS_64
@ -105,10 +95,6 @@ config BR2_mips_64r2
bool "Generic MIPS64R2"
depends on BR2_ARCH_IS_64
select BR2_MIPS_CPU_MIPS64R2
config BR2_mips_64r3
bool "Generic MIPS64R3"
depends on BR2_ARCH_IS_64
select BR2_MIPS_CPU_MIPS64R3
config BR2_mips_64r5
bool "Generic MIPS64R5"
depends on BR2_ARCH_IS_64
@ -122,20 +108,6 @@ config BR2_mips_i6400
depends on BR2_ARCH_IS_64
select BR2_MIPS_CPU_MIPS64R6
select BR2_ARCH_NEEDS_GCC_AT_LEAST_6
config BR2_mips_octeon2
bool "Octeon II"
depends on BR2_ARCH_IS_64
select BR2_MIPS_CPU_MIPS64R2
help
Marvell (formerly Cavium Networks) Octeon II CN60XX
processors.
config BR2_mips_octeon3
bool "Octeon III"
depends on BR2_ARCH_IS_64
select BR2_MIPS_CPU_MIPS64R3
help
Marvell (formerly Cavium Networks) Octeon III CN7XXX
processors.
config BR2_mips_p6600
bool "P6600"
depends on BR2_ARCH_IS_64
@ -163,7 +135,6 @@ endchoice
config BR2_MIPS_SOFT_FLOAT
bool "Use soft-float"
default y
depends on !BR2_mips_octeon3 # hard-float only
select BR2_SOFT_FLOAT
help
If your target CPU does not have a Floating Point Unit (FPU)
@ -242,7 +213,6 @@ config BR2_ENDIAN
config BR2_GCC_TARGET_ARCH
default "mips32" if BR2_mips_32
default "mips32r2" if BR2_mips_32r2
default "mips32r3" if BR2_mips_32r3
default "mips32r5" if BR2_mips_32r5
default "mips32r6" if BR2_mips_32r6
default "interaptiv" if BR2_mips_interaptiv
@ -252,12 +222,9 @@ config BR2_GCC_TARGET_ARCH
default "mips32r2" if BR2_mips_xburst
default "mips64" if BR2_mips_64
default "mips64r2" if BR2_mips_64r2
default "mips64r3" if BR2_mips_64r3
default "mips64r5" if BR2_mips_64r5
default "mips64r6" if BR2_mips_64r6
default "i6400" if BR2_mips_i6400
default "octeon2" if BR2_mips_octeon2
default "octeon3" if BR2_mips_octeon3
default "p6600" if BR2_mips_p6600
config BR2_MIPS_OABI32
@ -271,6 +238,3 @@ config BR2_GCC_TARGET_ABI
config BR2_READELF_ARCH_NAME
default "MIPS R3000"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -1,14 +0,0 @@
config BR2_ARCH
default "nds32le"
config BR2_GCC_TARGET_ARCH
default "v3"
config BR2_ENDIAN
default "LITTLE"
config BR2_READELF_ARCH_NAME
default "Andes Technology compact code size embedded RISC processor family"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -6,6 +6,3 @@ config BR2_ENDIAN
config BR2_READELF_ARCH_NAME
default "Altera Nios II"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -6,6 +6,3 @@ config BR2_ENDIAN
config BR2_READELF_ARCH_NAME
default "OpenRISC 1000"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -205,9 +205,14 @@ config BR2_GCC_TARGET_CPU
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
config BR2_READELF_ARCH_NAME
default "PowerPC" if BR2_powerpc
default "PowerPC64" if BR2_powerpc64 || BR2_powerpc64le
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -1,134 +0,0 @@
# RISC-V CPU ISA extensions.
config BR2_RISCV_ISA_RVI
bool
config BR2_RISCV_ISA_RVM
bool
config BR2_RISCV_ISA_RVA
bool
config BR2_RISCV_ISA_RVF
bool
config BR2_RISCV_ISA_RVD
bool
config BR2_RISCV_ISA_RVC
bool
choice
prompt "Target Architecture Variant"
default BR2_riscv_g
config BR2_riscv_g
bool "General purpose (G)"
select BR2_RISCV_ISA_RVI
select BR2_RISCV_ISA_RVM
select BR2_RISCV_ISA_RVA
select BR2_RISCV_ISA_RVF
select BR2_RISCV_ISA_RVD
help
General purpose (G) is equivalent to IMAFD.
config BR2_riscv_custom
bool "Custom architecture"
select BR2_RISCV_ISA_RVI
select BR2_RISCV_ISA_CUSTOM_RVA
endchoice
if BR2_riscv_custom
comment "Instruction Set Extensions"
config BR2_RISCV_ISA_CUSTOM_RVM
bool "Integer Multiplication and Division (M)"
select BR2_RISCV_ISA_RVM
config BR2_RISCV_ISA_CUSTOM_RVA
bool "Atomic Instructions (A)"
select BR2_RISCV_ISA_RVA
config BR2_RISCV_ISA_CUSTOM_RVF
bool "Single-precision Floating-point (F)"
select BR2_RISCV_ISA_RVF
config BR2_RISCV_ISA_CUSTOM_RVD
bool "Double-precision Floating-point (D)"
depends on BR2_RISCV_ISA_RVF
select BR2_RISCV_ISA_RVD
config BR2_RISCV_ISA_CUSTOM_RVC
bool "Compressed Instructions (C)"
select BR2_RISCV_ISA_RVC
endif
choice
prompt "Target Architecture Size"
default BR2_RISCV_64
config BR2_RISCV_32
bool "32-bit"
config BR2_RISCV_64
bool "64-bit"
select BR2_ARCH_IS_64
endchoice
choice
prompt "Target ABI"
default BR2_RISCV_ABI_ILP32D if !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
default BR2_RISCV_ABI_ILP32F if !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
default BR2_RISCV_ABI_ILP32 if !BR2_ARCH_IS_64
default BR2_RISCV_ABI_LP64D if BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
default BR2_RISCV_ABI_LP64F if BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
default BR2_RISCV_ABI_LP64 if BR2_ARCH_IS_64
config BR2_RISCV_ABI_ILP32
bool "ilp32"
depends on !BR2_ARCH_IS_64
config BR2_RISCV_ABI_ILP32F
bool "ilp32f"
depends on !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
config BR2_RISCV_ABI_ILP32D
bool "ilp32d"
depends on !BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
config BR2_RISCV_ABI_LP64
bool "lp64"
depends on BR2_ARCH_IS_64
config BR2_RISCV_ABI_LP64F
bool "lp64f"
depends on BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVF
config BR2_RISCV_ABI_LP64D
bool "lp64d"
depends on BR2_ARCH_IS_64 && BR2_RISCV_ISA_RVD
endchoice
config BR2_ARCH
default "riscv32" if !BR2_ARCH_IS_64
default "riscv64" if BR2_ARCH_IS_64
config BR2_ENDIAN
default "LITTLE"
config BR2_GCC_TARGET_ABI
default "ilp32" if BR2_RISCV_ABI_ILP32
default "ilp32f" if BR2_RISCV_ABI_ILP32F
default "ilp32d" if BR2_RISCV_ABI_ILP32D
default "lp64" if BR2_RISCV_ABI_LP64
default "lp64f" if BR2_RISCV_ABI_LP64F
default "lp64d" if BR2_RISCV_ABI_LP64D
config BR2_READELF_ARCH_NAME
default "RISC-V"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -30,6 +30,3 @@ config BR2_ENDIAN
config BR2_READELF_ARCH_NAME
default "Renesas / SuperH SH"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -32,6 +32,3 @@ config BR2_GCC_TARGET_CPU
config BR2_READELF_ARCH_NAME
default "Sparc" if BR2_sparc
default "Sparc v9" if BR2_sparc64
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -1,8 +1,6 @@
# i386/x86_64 cpu features
config BR2_X86_CPU_HAS_MMX
bool
config BR2_X86_CPU_HAS_3DNOW
bool
config BR2_X86_CPU_HAS_SSE
bool
config BR2_X86_CPU_HAS_SSE2
@ -103,15 +101,6 @@ config BR2_x86_corei7
select BR2_X86_CPU_HAS_SSSE3
select BR2_X86_CPU_HAS_SSE4
select BR2_X86_CPU_HAS_SSE42
config BR2_x86_westmere
bool "westmere"
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
@ -157,18 +146,15 @@ config BR2_x86_k6_2
bool "k6-2"
depends on !BR2_x86_64
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_3DNOW
config BR2_x86_athlon
bool "athlon"
depends on !BR2_x86_64
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_3DNOW
config BR2_x86_athlon_4
bool "athlon-4"
depends on !BR2_x86_64
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_SSE
select BR2_X86_CPU_HAS_3DNOW
config BR2_x86_opteron
bool "opteron"
select BR2_X86_CPU_HAS_MMX
@ -214,7 +200,6 @@ config BR2_x86_c3
bool "Via/Cyrix C3 (Samuel/Ezra cores)"
depends on !BR2_x86_64
select BR2_X86_CPU_HAS_MMX
select BR2_X86_CPU_HAS_3DNOW
config BR2_x86_c32
bool "Via C3-2 (Nehemiah cores)"
depends on !BR2_x86_64
@ -250,9 +235,8 @@ config BR2_ARCH
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_westmere && BR2_i386
default "i686" if BR2_x86_corei7_avx && BR2_i386
default "i686" if BR2_x86_core_avx2 && BR2_i386
default "i686" if BR2_x86_corei7_avx2 && BR2_i386
default "i686" if BR2_x86_atom && BR2_i386
default "i686" if BR2_x86_silvermont && BR2_i386
default "i686" if BR2_x86_opteron && BR2_i386
@ -287,7 +271,6 @@ config BR2_GCC_TARGET_ARCH
default "corei7-avx" if BR2_x86_corei7_avx
default "core-avx2" if BR2_x86_core_avx2
default "atom" if BR2_x86_atom
default "westmere" if BR2_x86_westmere
default "silvermont" if BR2_x86_silvermont
default "k8" if BR2_x86_opteron
default "k8-sse3" if BR2_x86_opteron_sse3
@ -307,6 +290,3 @@ config BR2_GCC_TARGET_ARCH
config BR2_READELF_ARCH_NAME
default "Intel 80386" if BR2_i386
default "Advanced Micro Devices X86-64" if BR2_x86_64
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -50,6 +50,3 @@ config BR2_ARCH
config BR2_READELF_ARCH_NAME
default "Tensilica Xtensa Processor"
# vim: ft=kconfig
# -*- mode:kconfig; -*-

View File

@ -1,22 +0,0 @@
################################################################################
#
# Architecture-specific definitions
#
################################################################################
# Allow GCC target configuration settings to be optionally
# overwritten by architecture specific makefiles.
# Makefiles must use the GCC_TARGET_* variables below instead
# of the BR2_GCC_TARGET_* versions.
GCC_TARGET_ARCH := $(call qstrip,$(BR2_GCC_TARGET_ARCH))
GCC_TARGET_ABI := $(call qstrip,$(BR2_GCC_TARGET_ABI))
GCC_TARGET_NAN := $(call qstrip,$(BR2_GCC_TARGET_NAN))
GCC_TARGET_FP32_MODE := $(call qstrip,$(BR2_GCC_TARGET_FP32_MODE))
GCC_TARGET_CPU := $(call qstrip,$(BR2_GCC_TARGET_CPU))
GCC_TARGET_FPU := $(call qstrip,$(BR2_GCC_TARGET_FPU))
GCC_TARGET_FLOAT_ABI := $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
GCC_TARGET_MODE := $(call qstrip,$(BR2_GCC_TARGET_MODE))
# Include any architecture specific makefiles.
-include $(sort $(wildcard arch/arch.mk.*))

View File

@ -1,17 +0,0 @@
ifeq ($(BR2_arc),y)
# -matomic is always required when the ARC core has the atomic extensions
ifeq ($(BR2_ARC_ATOMIC_EXT),y)
ARCH_TOOLCHAIN_WRAPPER_OPTS = -matomic
endif
# Explicitly set LD's "max-page-size" instead of relying on some defaults
ifeq ($(BR2_ARC_PAGE_SIZE_4K),y)
ARCH_TOOLCHAIN_WRAPPER_OPTS += -Wl,-z,max-page-size=4096
else ifeq ($(BR2_ARC_PAGE_SIZE_8K),y)
ARCH_TOOLCHAIN_WRAPPER_OPTS += -Wl,-z,max-page-size=8192
else ifeq ($(BR2_ARC_PAGE_SIZE_16K),y)
ARCH_TOOLCHAIN_WRAPPER_OPTS += -Wl,-z,max-page-size=16384
endif
endif

View File

@ -1,26 +0,0 @@
#
# Configure the GCC_TARGET_ARCH variable and append the
# appropriate C-SKY ISA extensions.
#
ifeq ($(BR2_csky),y)
ifeq ($(BR2_ck610),y)
GCC_TARGET_CPU := ck610
else ifeq ($(BR2_ck807),y)
GCC_TARGET_CPU := ck807
else ifeq ($(BR2_ck810),y)
GCC_TARGET_CPU := ck810
else ifeq ($(BR2_ck860),y)
GCC_TARGET_CPU := ck860
endif
ifeq ($(BR2_CSKY_FPU),y)
GCC_TARGET_CPU := $(GCC_TARGET_CPU)f
endif
ifeq ($(BR2_CSKY_VDSP),y)
GCC_TARGET_CPU := $(GCC_TARGET_CPU)v
endif
endif

View File

@ -1,30 +0,0 @@
#
# Configure the GCC_TARGET_ARCH variable and append the
# appropriate RISC-V ISA extensions.
#
ifeq ($(BR2_riscv),y)
ifeq ($(BR2_RISCV_64),y)
GCC_TARGET_ARCH := rv64i
else
GCC_TARGET_ARCH := rv32i
endif
ifeq ($(BR2_RISCV_ISA_RVM),y)
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)m
endif
ifeq ($(BR2_RISCV_ISA_RVA),y)
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)a
endif
ifeq ($(BR2_RISCV_ISA_RVF),y)
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)f
endif
ifeq ($(BR2_RISCV_ISA_RVD),y)
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)d
endif
ifeq ($(BR2_RISCV_ISA_RVC),y)
GCC_TARGET_ARCH := $(GCC_TARGET_ARCH)c
endif
endif

View File

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

View File

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

View File

@ -1,4 +1,4 @@
#!/bin/bash
cp ${IMG_DIR}/rootfs.cpio.uboot ${BOARD_DIR}/uInitrd
cp $IMG_DIR/rootfs.cpio.uboot $BOARD_DIR/uInitrd

View File

@ -1,12 +1,12 @@
#!/bin/bash -e
BOARD_DIR=$(dirname $0)
COMMON_DIR=${BOARD_DIR}/../common
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 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
$COMMON_DIR/mkimage.sh

View File

@ -4,3 +4,4 @@ if [ -f /boot/boot-normal.scr ]; then
mv /boot/boot.scr /boot/boot-fwupdater.scr
mv /boot/boot-normal.scr /boot/boot.scr
fi

View File

@ -2,13 +2,13 @@
set -e
UBOOT_HOST_DIR=${TARGET}/../build/host-uboot-tools-*
UBOOT_HOST_DIR=$TARGET/../build/host-uboot-tools-*
cp ${IMG_DIR}/uImage ${BOOT_DIR}
cp ${IMG_DIR}/sun7i-a20-bananapi.dtb ${BOOT_DIR}
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
${UBOOT_HOST_DIR}/tools/mkimage -C none -A arm -T script -d ${BOARD_DIR}/boot-fwupdater.cmd ${BOOT_DIR}/boot-fwupdater.scr
$UBOOT_HOST_DIR/tools/mkimage -C none -A arm -T script -d $BOARD_DIR/boot.cmd $BOOT_DIR/boot.scr
$UBOOT_HOST_DIR/tools/mkimage -C none -A arm -T script -d $BOARD_DIR/boot-fwupdater.cmd $BOOT_DIR/boot-fwupdater.scr
cp ${BOARD_DIR}/uInitrd ${BOOT_DIR}
cp $BOARD_DIR/uInitrd $BOOT_DIR

Binary file not shown.

View File

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.31.1
# Fri Aug 28 11:34:30 2020
# Busybox version: 1.29.2
# Wed Nov 14 23:22:52 2018
#
CONFIG_HAVE_DOT_CONFIG=y
@ -24,7 +24,6 @@ CONFIG_FEATURE_WTMP=y
# CONFIG_FEATURE_PIDFILE is not set
CONFIG_PID_FILE_PATH=""
CONFIG_BUSYBOX=y
CONFIG_FEATURE_SHOW_SCRIPT=y
CONFIG_FEATURE_INSTALLER=y
# CONFIG_INSTALL_NO_USR is not set
CONFIG_FEATURE_SUID=y
@ -34,7 +33,6 @@ CONFIG_FEATURE_SUID=y
CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
# CONFIG_SELINUX is not set
# CONFIG_FEATURE_CLEAN_UP is not set
CONFIG_FEATURE_SYSLOG_INFO=y
CONFIG_FEATURE_SYSLOG=y
CONFIG_PLATFORM_LINUX=y
@ -84,9 +82,7 @@ CONFIG_NO_DEBUG_LIB=y
# Library Tuning
#
# CONFIG_FEATURE_USE_BSS_TAIL is not set
CONFIG_FLOAT_DURATION=y
CONFIG_FEATURE_RTMINMAX=y
CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS=y
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
@ -209,7 +205,6 @@ CONFIG_CKSUM=y
# CONFIG_COMM is not set
CONFIG_CP=y
# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
# CONFIG_FEATURE_CP_REFLINK is not set
CONFIG_CUT=y
CONFIG_DATE=y
CONFIG_FEATURE_DATE_ISOFMT=y
@ -237,6 +232,7 @@ CONFIG_EXPR_MATH_SUPPORT_64=y
CONFIG_FACTOR=y
CONFIG_FALSE=y
CONFIG_FOLD=y
# CONFIG_FSYNC is not set
CONFIG_HEAD=y
CONFIG_FEATURE_FANCY_HEAD=y
CONFIG_HOSTID=y
@ -270,7 +266,7 @@ CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
CONFIG_MKDIR=y
CONFIG_MKFIFO=y
CONFIG_MKNOD=y
CONFIG_MKTEMP=y
# CONFIG_MKTEMP is not set
CONFIG_MV=y
CONFIG_NICE=y
CONFIG_NL=y
@ -291,6 +287,7 @@ CONFIG_SHRED=y
# CONFIG_SHUF is not set
CONFIG_SLEEP=y
# CONFIG_FEATURE_FANCY_SLEEP is not set
# CONFIG_FEATURE_FLOAT_SLEEP is not set
CONFIG_SORT=y
CONFIG_FEATURE_SORT_BIG=y
# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set
@ -303,7 +300,6 @@ CONFIG_STTY=y
# CONFIG_SUM is not set
CONFIG_SYNC=y
CONFIG_FEATURE_SYNC_FANCY=y
# CONFIG_FSYNC is not set
# CONFIG_TAC is not set
CONFIG_TAIL=y
CONFIG_FEATURE_FANCY_TAIL=y
@ -385,12 +381,12 @@ CONFIG_RESET=y
# Debian Utilities
#
# CONFIG_PIPE_PROGRESS is not set
CONFIG_RUN_PARTS=y
CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
CONFIG_FEATURE_RUN_PARTS_FANCY=y
# CONFIG_START_STOP_DAEMON is not set
# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
# CONFIG_RUN_PARTS is not set
# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
CONFIG_START_STOP_DAEMON=y
CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
CONFIG_WHICH=y
#
@ -442,7 +438,6 @@ CONFIG_FEATURE_FIND_MTIME=y
CONFIG_FEATURE_FIND_MMIN=y
CONFIG_FEATURE_FIND_PERM=y
CONFIG_FEATURE_FIND_TYPE=y
CONFIG_FEATURE_FIND_EXECUTABLE=y
CONFIG_FEATURE_FIND_XDEV=y
CONFIG_FEATURE_FIND_MAXDEPTH=y
CONFIG_FEATURE_FIND_NEWER=y
@ -456,7 +451,6 @@ CONFIG_FEATURE_FIND_DEPTH=y
CONFIG_FEATURE_FIND_PAREN=y
CONFIG_FEATURE_FIND_SIZE=y
CONFIG_FEATURE_FIND_PRUNE=y
CONFIG_FEATURE_FIND_QUIT=y
# CONFIG_FEATURE_FIND_DELETE is not set
CONFIG_FEATURE_FIND_PATH=y
CONFIG_FEATURE_FIND_REGEX=y
@ -506,7 +500,7 @@ CONFIG_FEATURE_SHADOWPASSWDS=y
# CONFIG_USE_BB_PWD_GRP is not set
# CONFIG_USE_BB_SHADOW is not set
CONFIG_USE_BB_CRYPT=y
CONFIG_USE_BB_CRYPT_SHA=y
# CONFIG_USE_BB_CRYPT_SHA is not set
# CONFIG_ADDGROUP is not set
# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
# CONFIG_ADD_SHELL is not set
@ -531,7 +525,7 @@ CONFIG_FEATURE_NOLOGIN=y
CONFIG_FEATURE_SECURETTY=y
CONFIG_PASSWD=y
# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
CONFIG_SU=y
# CONFIG_SU is not set
# CONFIG_FEATURE_SU_SYSLOG is not set
# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
@ -627,7 +621,7 @@ CONFIG_HWCLOCK=y
# CONFIG_IPCS is not set
# CONFIG_LAST is not set
# CONFIG_FEATURE_LAST_FANCY is not set
CONFIG_LOSETUP=y
# CONFIG_LOSETUP is not set
# CONFIG_LSPCI is not set
CONFIG_LSUSB=y
# CONFIG_MDEV is not set
@ -636,7 +630,6 @@ CONFIG_LSUSB=y
# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
# CONFIG_FEATURE_MDEV_EXEC is not set
# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
# CONFIG_FEATURE_MDEV_DAEMON is not set
CONFIG_MESG=y
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y
CONFIG_MKE2FS=y
@ -660,15 +653,13 @@ CONFIG_FEATURE_MOUNT_FLAGS=y
CONFIG_FEATURE_MOUNT_FSTAB=y
CONFIG_FEATURE_MOUNT_OTHERTAB=y
# CONFIG_MOUNTPOINT is not set
CONFIG_NOLOGIN=y
CONFIG_NOLOGIN_DEPENDENCIES=y
CONFIG_NSENTER=y
# CONFIG_PIVOT_ROOT is not set
# CONFIG_RDATE is not set
# CONFIG_RDEV is not set
# CONFIG_READPROFILE is not set
CONFIG_RENICE=y
CONFIG_REV=y
# CONFIG_REV is not set
# CONFIG_RTCWAKE is not set
# CONFIG_SCRIPT is not set
# CONFIG_SCRIPTREPLAY is not set
@ -737,12 +728,6 @@ CONFIG_FEATURE_VOLUMEID_MINIX=y
# CONFIG_ADJTIMEX is not set
# CONFIG_BBCONFIG is not set
# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
CONFIG_BC=y
# CONFIG_DC is not set
CONFIG_FEATURE_DC_BIG=y
# CONFIG_FEATURE_DC_LIBM is not set
CONFIG_FEATURE_BC_INTERACTIVE=y
CONFIG_FEATURE_BC_LONG_OPTIONS=y
# CONFIG_BEEP is not set
CONFIG_FEATURE_BEEP_FREQ=0
CONFIG_FEATURE_BEEP_LENGTH_MS=0
@ -761,12 +746,14 @@ CONFIG_FEATURE_CROND_D=y
CONFIG_FEATURE_CROND_SPECIAL_TIMES=y
CONFIG_FEATURE_CROND_DIR="/data/etc"
CONFIG_CRONTAB=y
# CONFIG_DC is not set
# CONFIG_FEATURE_DC_LIBM is not set
# CONFIG_DEVFSD is not set
# CONFIG_DEVFSD_MODLOAD is not set
# CONFIG_DEVFSD_FG_NP is not set
# CONFIG_DEVFSD_VERBOSE is not set
# CONFIG_FEATURE_DEVFS is not set
CONFIG_DEVMEM=y
# CONFIG_DEVMEM is not set
# CONFIG_FBSPLASH is not set
# CONFIG_FLASHCP is not set
# CONFIG_FLASH_ERASEALL is not set
@ -784,7 +771,6 @@ CONFIG_I2CGET=y
CONFIG_I2CSET=y
CONFIG_I2CDUMP=y
CONFIG_I2CDETECT=y
CONFIG_I2CTRANSFER=y
# CONFIG_INOTIFYD is not set
CONFIG_LESS=y
CONFIG_FEATURE_LESS_MAXLINES=9999999
@ -811,14 +797,13 @@ CONFIG_FEATURE_MAKEDEVS_TABLE=y
CONFIG_PARTPROBE=y
# CONFIG_RAIDAUTORUN is not set
# CONFIG_READAHEAD is not set
CONFIG_RFKILL=y
# CONFIG_RFKILL is not set
# CONFIG_RUNLEVEL is not set
# CONFIG_RX is not set
CONFIG_SETFATTR=y
# CONFIG_SETSERIAL is not set
# CONFIG_STRINGS is not set
CONFIG_TIME=y
CONFIG_TS=y
# CONFIG_TTYSIZE is not set
CONFIG_UBIRENAME=y
# CONFIG_UBIATTACH is not set
@ -837,7 +822,6 @@ CONFIG_FEATURE_IPV6=y
# CONFIG_FEATURE_UNIX_LOCAL is not set
# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
# CONFIG_FEATURE_TLS_SHA1 is not set
# CONFIG_ARP is not set
CONFIG_ARPING=y
# CONFIG_BRCTL is not set
@ -873,15 +857,15 @@ CONFIG_DNSDOMAINNAME=y
# CONFIG_FEATURE_IFCONFIG_HW is not set
# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
# CONFIG_IFENSLAVE is not set
CONFIG_IFPLUGD=y
# CONFIG_IFPLUGD is not set
CONFIG_IFUP=y
CONFIG_IFDOWN=y
CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
CONFIG_FEATURE_IFUPDOWN_IP=y
CONFIG_FEATURE_IFUPDOWN_IPV4=y
CONFIG_FEATURE_IFUPDOWN_IPV6=y
CONFIG_IFUPDOWN_IFSTATE_PATH=""
# CONFIG_FEATURE_IFUPDOWN_IP is not set
# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set
# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set
CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
# CONFIG_INETD is not set
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
@ -925,7 +909,6 @@ CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
# CONFIG_NTPD is not set
# CONFIG_FEATURE_NTPD_SERVER is not set
# CONFIG_FEATURE_NTPD_CONF is not set
# CONFIG_FEATURE_NTP_AUTH is not set
CONFIG_PING=y
# CONFIG_PING6 is not set
CONFIG_FEATURE_FANCY_PING=y
@ -946,7 +929,6 @@ CONFIG_FEATURE_TC_INGRESS=y
# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
# CONFIG_TFTP is not set
# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
# CONFIG_FEATURE_TFTP_HPA_COMPAT is not set
# CONFIG_TFTPD is not set
# CONFIG_FEATURE_TFTP_GET is not set
# CONFIG_FEATURE_TFTP_PUT is not set
@ -1152,13 +1134,11 @@ CONFIG_ASH_TEST=y
#
CONFIG_FEATURE_SH_MATH=y
CONFIG_FEATURE_SH_MATH_64=y
CONFIG_FEATURE_SH_MATH_BASE=y
# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
# CONFIG_FEATURE_SH_STANDALONE is not set
# CONFIG_FEATURE_SH_NOFORK is not set
CONFIG_FEATURE_SH_READ_FRAC=y
# CONFIG_FEATURE_SH_HISTFILESIZE is not set
CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS=y
#
# System Logging Utilities

View File

@ -1,227 +1,212 @@
#!/bin/sh
if [ -z "${TARGET}" ]; then
if [ -z "$TARGET" ]; then
echo "this script must be invoked from postscript.sh"
exit 1
fi
find ${TARGET} -name '.empty' | xargs -r rm
find $TARGET -name '.empty' | xargs -r rm
# /etc stuff
rm -rf ${TARGET}/etc/network/
rm -rf ${TARGET}/etc/dhcp/
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 -rf ${TARGET}/etc/fstab
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/hostname
rm -f ${TARGET}/etc/os-release
rm -f ${TARGET}/etc/hostapd.conf
rm -f ${TARGET}/etc/timezone
rm -f $TARGET/etc/rc_maps.cfg
rm -f $TARGET/etc/udev/hwdb.d/20-pci-vendor-model.hwdb
rm -f $TARGET/etc/hostname
rm -f $TARGET/etc/os-release
rm -f $TARGET/etc/hostapd.conf
# /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/
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/
# 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/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/bin/xmllint
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/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/bin/xmllint
rm -f ${TARGET}/usr/libexec/ssh-keysign
rm -f ${TARGET}/usr/libexec/ssh-pkcs11-helper
rm -f ${TARGET}/usr/libexec/rmt
rm -f $TARGET/usr/libexec/ssh-keysign
rm -f $TARGET/usr/libexec/ssh-pkcs11-helper
rm -f $TARGET/usr/libexec/rmt
# 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/event_rpcgen.py
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/samba-regedit
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/winbindd
rm -rf ${TARGET}/usr/share/ctdb
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/event_rpcgen.py
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/samba-regedit
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/winbindd
rm -rf $TARGET/usr/share/ctdb
# unused mongodb binaries
rm -f ${TARGET}/usr/bin/mongos
rm -f ${TARGET}/usr/bin/mongoperf
# unused redis binaries
rm -f $TARGET/usr/bin/redis-check-aof
rm -f $TARGET/usr/bin/redis-check-rdb
rm -f $TARGET/usr/bin/redis-benchmark
rm -f $TARGET/usr/bin/redis-cli
rm -f $TARGET/usr/bin/redis-sentinel
# useless mongodb binaries
rm -f $TARGET/usr/bin/mongos
rm -f $TARGET/usr/bin/mongoperf
# v4l-utils
rm -f ${TARGET}/usr/bin/cec-compliance
rm -f ${TARGET}/usr/bin/cec-ctl
rm -f ${TARGET}/usr/bin/cec-follower
rm -f ${TARGET}/usr/bin/dvb-fe-tool
rm -f ${TARGET}/usr/bin/dvb-format-convert
rm -f ${TARGET}/usr/bin/dvbv5-daemon
rm -f ${TARGET}/usr/bin/dvbv5-scan
rm -f ${TARGET}/usr/bin/dvbv5-zap
rm -f ${TARGET}/usr/bin/media-ctl
rm -f ${TARGET}/usr/bin/rds-ctl
rm -f ${TARGET}/usr/bin/v4l2-compliance
rm -f $TARGET/usr/bin/cec-compliance
rm -f $TARGET/usr/bin/cec-ctl
rm -f $TARGET/usr/bin/cec-follower
rm -f $TARGET/usr/bin/dvb-fe-tool
rm -f $TARGET/usr/bin/dvb-format-convert
rm -f $TARGET/usr/bin/dvbv5-daemon
rm -f $TARGET/usr/bin/dvbv5-scan
rm -f $TARGET/usr/bin/dvbv5-zap
rm -f $TARGET/usr/bin/media-ctl
rm -f $TARGET/usr/bin/rds-ctl
rm -f $TARGET/usr/bin/v4l2-compliance
# unused python folders
rm -rf ${TARGET}/usr/lib/python2.7/site-packages/samba/
rm -rf ${TARGET}/usr/lib/python2.7/ensurepip/
rm -rf ${TARGET}/usr/lib/python2.7/config/
rm -rf ${TARGET}/usr/lib/python2.7/unittest/
rm -rf $TARGET/usr/lib/python2.7/site-packages/samba/
rm -rf $TARGET/usr/lib/python2.7/ensurepip/
rm -rf $TARGET/usr/lib/python2.7/config/
rm -rf $TARGET/usr/lib/python2.7/unittest/
# buildroot default startup scripts
rm -f ${TARGET}/etc/init.d/S01syslogd
rm -f ${TARGET}/etc/init.d/S02sysctl
rm -f ${TARGET}/etc/init.d/S10udev
rm -f ${TARGET}/etc/init.d/S15watchdog
rm -f ${TARGET}/etc/init.d/S20urandom
rm -f ${TARGET}/etc/init.d/S21rngd
rm -f ${TARGET}/etc/init.d/S48sntp
rm -f ${TARGET}/etc/init.d/S49ntp
rm -f ${TARGET}/etc/init.d/S49chrony
rm -f ${TARGET}/etc/init.d/S50sshd
rm -f ${TARGET}/etc/init.d/S50proftpd
rm -f ${TARGET}/etc/init.d/S50postgresql
rm -f ${TARGET}/etc/init.d/S50redis
rm -f ${TARGET}/etc/init.d/S80dhcp-relay
rm -f ${TARGET}/etc/init.d/S80dhcp-server
rm -f ${TARGET}/etc/init.d/S80dnsmasq
rm -f ${TARGET}/etc/init.d/S91smb
rm -f ${TARGET}/etc/init.d/S99motion
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/S20urandom
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/S80dhcp-relay
rm -f $TARGET/etc/init.d/S80dhcp-server
rm -f $TARGET/etc/init.d/S80dnsmasq
rm -f $TARGET/etc/init.d/S91smb
rm -f $TARGET/etc/init.d/S99motion
# other unwanted dirs
rm -rf ${TARGET}/data/*
rm -rf ${TARGET}/run
rm -rf ${TARGET}/etc/profile.d
rm -rf $TARGET/data/*
rm -rf $TARGET/run

View File

@ -1,19 +1,11 @@
#!/bin/bash -e
# env vars:
# THINGOS_LOOP_DEV=/dev/loop0
# THINGOS_NAME=thingOS
# THINGOS_SHORT_NAME=thingos
# THINGOS_PREFIX=thing
# THINGOS_VERSION=3.14.15
if [ -z "${IMG_DIR}" ] || [ -z "${BOARD}" ]; then
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 "$@"
test "root" != "$USER" && exec sudo -E $0 "$@"
function msg() {
echo " * $1"
@ -21,118 +13,115 @@ function msg() {
BOOT_START=${BOOT_START:-1} # MB
BOOT_SRC=${IMG_DIR}/boot
BOOT=${IMG_DIR}/.boot
BOOT_IMG=${IMG_DIR}/boot.img
BOOT_SRC=$IMG_DIR/boot
BOOT=$IMG_DIR/.boot
BOOT_IMG=$IMG_DIR/boot.img
BOOT_SIZE="30" # MB - reserved up to 100 MB
ROOT_START="100" # MB
ROOT_SRC=${IMG_DIR}/rootfs.tar
ROOT=${IMG_DIR}/.root
ROOT_IMG=${IMG_DIR}/root.img
ROOT_SIZE="220" # MB
ROOT_SRC=$IMG_DIR/rootfs.tar
ROOT=$IMG_DIR/.root
ROOT_IMG=$IMG_DIR/root.img
ROOT_SIZE="200" # MB
GUARD_SIZE="10" # MB
DISK_SIZE=$((ROOT_START + ROOT_SIZE + GUARD_SIZE))
COMMON_DIR=$(cd ${IMG_DIR}/../../../board/common; pwd)
OS_NAME=$(source ${COMMON_DIR}/overlay/etc/version && echo ${OS_SHORT_NAME})
# "-f", unless a /dev/loopX is specified
LOOP_DEV=${THINGOS_LOOP_DEV:--f}
COMMON_DIR=$(cd $IMG_DIR/../../../board/common; pwd)
OS_NAME=$(source $COMMON_DIR/overlay/etc/version && echo $os_short_name)
# boot filesystem
msg "creating boot loop device ${LOOP_DEV}"
dd if=/dev/zero of=${BOOT_IMG} bs=1M count=${BOOT_SIZE}
loop_dev=$(losetup --show ${LOOP_DEV} ${BOOT_IMG})
msg "creating boot loop device"
dd if=/dev/zero of=$BOOT_IMG bs=1M count=$BOOT_SIZE
loop_dev=$(losetup -f --show $BOOT_IMG)
msg "creating boot filesystem"
mkfs.vfat -F16 ${loop_dev}
mkfs.vfat -F16 $loop_dev
msg "mounting boot loop device"
mkdir -p ${BOOT}
mount ${loop_dev} ${BOOT}
mkdir -p $BOOT
mount -o loop $loop_dev $BOOT
msg "copying boot filesystem contents"
cp -r ${BOOT_SRC}/* ${BOOT}
cp -r $BOOT_SRC/* $BOOT
sync
msg "unmounting boot filesystem"
umount ${BOOT}
umount $BOOT
msg "destroying boot loop device ${loop_dev}"
losetup -d ${loop_dev}
msg "destroying boot loop device ($loop_dev)"
losetup -d $loop_dev
sync
# root filesystem
msg "creating root loop device ${LOOP_DEV}"
dd if=/dev/zero of=${ROOT_IMG} bs=1M count=${ROOT_SIZE}
loop_dev=$(losetup --show ${LOOP_DEV} ${ROOT_IMG})
msg "creating root loop device"
dd if=/dev/zero of=$ROOT_IMG bs=1M count=$ROOT_SIZE
loop_dev=$(losetup -f --show $ROOT_IMG)
msg "creating root filesystem"
mkfs.ext4 ${loop_dev}
tune2fs -O^has_journal ${loop_dev}
mkfs.ext4 $loop_dev
tune2fs -O^has_journal $loop_dev
msg "mounting root loop device"
mkdir -p ${ROOT}
mount ${loop_dev} ${ROOT}
mkdir -p $ROOT
mount -o loop $loop_dev $ROOT
msg "copying root filesystem contents"
tar -xpsf ${ROOT_SRC} -C ${ROOT}
tar -xpsf $ROOT_SRC -C $ROOT
# set internal OS name, prefix and version according to env variables
if [ -f ${ROOT}/etc/version ]; then
if [ -n "${THINGOS_NAME}" ]; then
msg "setting OS name to ${THINGOS_NAME}"
sed -ri "s/OS_NAME=\".*\"/OS_NAME=\"${THINGOS_NAME}\"/" ${ROOT}/etc/version
if [ -f $ROOT/etc/version ]; then
if [ -n "$THINGOS_NAME" ]; then
msg "setting OS name to $THINGOS_NAME"
sed -ri "s/os_name=\".*\"/os_name=\"$THINGOS_NAME\"/" $ROOT/etc/version
fi
if [ -n "${THINGOS_SHORT_NAME}" ]; then
msg "setting OS short name to ${THINGOS_SHORT_NAME}"
sed -ri "s/OS_SHORT_NAME=\".*\"/OS_SHORT_NAME=\"${THINGOS_SHORT_NAME}\"/" ${ROOT}/etc/version
if [ -n "$THINGOS_SHORT_NAME" ]; then
msg "setting OS short name to $THINGOS_SHORT_NAME"
sed -ri "s/os_short_name=\".*\"/os_short_name=\"$THINGOS_SHORT_NAME\"/" $ROOT/etc/version
fi
if [ -n "${THINGOS_PREFIX}" ]; then
msg "setting OS prefix to ${THINGOS_PREFIX}"
sed -ri "s/OS_PREFIX=\".*\"/OS_PREFIX=\"${THINGOS_PREFIX}\"/" ${ROOT}/etc/version
if [ -n "$THINGOS_PREFIX" ]; then
msg "setting OS prefix to $THINGOS_PREFIX"
sed -ri "s/os_prefix=\".*\"/os_prefix=\"$THINGOS_PREFIX\"/" $ROOT/etc/version
fi
if [ -n "${THINGOS_VERSION}" ]; then
msg "setting OS version to ${THINGOS_VERSION}"
sed -ri "s/OS_VERSION=\".*\"/OS_VERSION=\"${THINGOS_VERSION}\"/" ${ROOT}/etc/version
if [ -n "$THINGOS_VERSION" ]; then
msg "setting OS version to $THINGOS_VERSION"
sed -ri "s/os_version=\".*\"/os_version=\"$THINGOS_VERSION\"/" $ROOT/etc/version
fi
fi
msg "unmounting root filesystem"
umount ${ROOT}
umount $ROOT
msg "destroying root loop device ${loop_dev}"
losetup -d ${loop_dev}
msg "destroying root loop device ($loop_dev)"
losetup -d $loop_dev
sync
DISK_IMG=${IMG_DIR}/disk.img
BOOT_IMG=${IMG_DIR}/boot.img
ROOT_IMG=${IMG_DIR}/root.img
DISK_IMG=$IMG_DIR/disk.img
BOOT_IMG=$IMG_DIR/boot.img
ROOT_IMG=$IMG_DIR/root.img
if ! [ -r ${BOOT_IMG} ]; then
if ! [ -r $BOOT_IMG ]; then
echo "boot image missing"
exit -1
fi
if ! [ -r ${ROOT_IMG} ]; then
if ! [ -r $ROOT_IMG ]; then
echo "root image missing"
exit -1
fi
# disk image
msg "creating disk loop device ${LOOP_DEV}"
dd if=/dev/zero of=${DISK_IMG} bs=1M count=${DISK_SIZE}
if [ -n "${UBOOT_BIN}" ] && [ -n "${UBOOT_SEEK}" ]; then
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}
dd conv=notrunc if=$UBOOT_BIN of=$DISK_IMG bs=512 seek=$UBOOT_SEEK
fi
loop_dev=$(losetup --show ${LOOP_DEV} ${DISK_IMG})
loop_dev=$(losetup -f --show $DISK_IMG)
msg "partitioning disk"
set +e
fdisk -u=sectors ${loop_dev} <<END
fdisk -u=sectors $loop_dev <<END
o
n
p
@ -156,36 +145,36 @@ 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)
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 (${loop_dev})"
losetup -d ${loop_dev}
msg "destroying disk loop device ($loop_dev)"
losetup -d $loop_dev
msg "creating boot loop device"
loop_dev=$(losetup --show -o $((${boot_offs} * 512)) ${LOOP_DEV} ${DISK_IMG})
loop_dev=$(losetup -f --show -o $(($boot_offs * 512)) $DISK_IMG)
msg "copying boot image"
dd if=${BOOT_IMG} of=${loop_dev}
dd if=$BOOT_IMG of=$loop_dev
sync
msg "destroying boot loop device (${loop_dev})"
losetup -d ${loop_dev}
msg "destroying boot loop device ($loop_dev)"
losetup -d $loop_dev
msg "creating root loop device"
loop_dev=$(losetup --show -o $((${root_offs} * 512)) ${LOOP_DEV} ${DISK_IMG})
loop_dev=$(losetup -f --show -o $(($root_offs * 512)) $DISK_IMG)
sync
msg "copying root image"
dd if=${ROOT_IMG} of=${loop_dev}
dd if=$ROOT_IMG of=$loop_dev
sync
msg "destroying root loop device ${loop_dev}"
losetup -d ${loop_dev}
msg "destroying root loop device ($loop_dev)"
losetup -d $loop_dev
sync
mv ${DISK_IMG} $(dirname ${DISK_IMG})/${OS_NAME}-${BOARD}.img
DISK_IMG=$(dirname ${DISK_IMG})/${OS_NAME}-${BOARD}.img
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"
msg "$(realpath "$DISK_IMG") is ready"

View File

@ -1,7 +1,7 @@
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
DISK_TIMEOUT=10
DISK_TIMEOUT="10"
msg() {
echo " * $1"
@ -12,7 +12,7 @@ mount -t devtmpfs devtmpfs /dev
mount -t proc proc /proc
ROOT_DEV=$(cat /proc/cmdline | grep -oE 'root=[/a-z0-9]+' | cut -d '=' -f 2)
if echo ${ROOT_DEV:-2} | grep -E 'p[0-9]' &>/dev/null; then # e.g. /dev/mmcblk0p2
if echo ${ROOT_DEV: -2} | grep -E 'p[0-9]' &>/dev/null; then # e.g. /dev/mmcblk0p2
DISK_DEV=${ROOT_DEV:0:$((${#ROOT_DEV}-2))}
BOOT_DEV=${DISK_DEV}p1
DATA_DEV=${DISK_DEV}p3
@ -25,28 +25,31 @@ fi
msg "Waiting for sdcard"
count=0
while true; do
if [ ${count} -ge ${DISK_TIMEOUT} ]; then
if [ $count -ge $DISK_TIMEOUT ]; then
break
fi
if [[ -b ${ROOT_DEV} ]]; then
if [ -b $ROOT_DEV ]; then
break
fi
count=$((count + 1))
count=$(($count + 1))
sleep 1
done
msg "Disk device is ${DISK_DEV}"
msg "Boot device is ${BOOT_DEV}"
msg "Root device is ${ROOT_DEV}"
msg "Data device is ${DATA_DEV}"
msg "Disk device is $DISK_DEV"
msg "Boot device is $BOOT_DEV"
msg "Root device is $ROOT_DEV"
msg "Data device is $DATA_DEV"
FW_DIR=/data/.fwupdate
FW_FILE=${FW_DIR}/firmware.img.gz
FW_FILE_EXTR=${FW_DIR}/firmware.img
FW_FILE=firmware.img.gz
FW_FILE_EXTR=firmware.img
ROOT_INFO_FILE=${FW_DIR}/root_info
LEGACY_FW_DIR=/data/.firmware_update
LEGACY_FW_FILE_EXTR=firmware
cleanup_on_exit() {
ROOT_INFO_FILE=root_info
on_exit() {
msg "Switching to normal boot"
/remove_initramfs
@ -63,7 +66,7 @@ cleanup_on_exit() {
echo 'b' > /proc/sysrq-trigger
}
trap cleanup_on_exit EXIT
trap on_exit EXIT
if [ -x /prepare_initramfs ]; then
msg "Preparing initramfs"
@ -71,45 +74,41 @@ if [ -x /prepare_initramfs ]; then
fi
msg "Mounting boot partition"
mount ${BOOT_DEV} /boot
mount $BOOT_DEV /boot
msg "Mounting data partition"
mount ${DATA_DEV} /data
mount $DATA_DEV /data
if ! [[ -r ${FW_FILE_EXTR} ]]; then
if ! [ -r $FW_DIR/$FW_FILE_EXTR ]; then
if [ -r $LEGACY_FW_DIR/$LEGACY_FW_FILE_EXTR ]; then
msg "Detected legacy firmware path"
mkdir -p $FW_DIR
mv $LEGACY_FW_DIR/$LEGACY_FW_FILE_EXTR $FW_DIR/$FW_FILE_EXTR
msg "Computing root partition info"
root_start=$(fdisk -l $FW_DIR/$FW_FILE_EXTR | grep ${FW_FILE_EXTR}2 | tr -s ' ' | cut -d ' ' -f 4)
root_start=$(($root_start / 2048))
root_size=$(fdisk -l $FW_DIR/$FW_FILE_EXTR | grep ${FW_FILE_EXTR}2 | tr -s ' ' | cut -d ' ' -f 6)
root_size=$(($root_size / 2048))
echo $root_start $root_size > $FW_DIR/$ROOT_INFO_FILE
else
msg "No firmware found, aborting"
exit 1
fi
fi
if ! [[ -r ${ROOT_INFO_FILE} ]]; then
if ! [ -r $FW_DIR/$ROOT_INFO_FILE ]; then
msg "No root partition info, aborting"
exit 1
fi
msg "Copying root image"
root_info=$(cat ${ROOT_INFO_FILE})
count=0
root_start=$(cat $FW_DIR/$ROOT_INFO_FILE | cut -d ' ' -f 1)
root_size=$(cat $FW_DIR/$ROOT_INFO_FILE | cut -d ' ' -f 2)
for i in ${root_info}; do count=$((count + 1)); done
if [[ ${count} == 3 ]]; then
root_start=$(echo ${root_info} | cut -d ' ' -f 1)
root_size=$(echo ${root_info} | cut -d ' ' -f 3)
root_start=$((root_start / 2048))
root_size=$((root_size / 2048))
elif [[ ${count} == 2 ]]; then
# compatibility with old info file format
root_start=$(echo ${root_info} | cut -d ' ' -f 1)
root_size=$(echo ${root_info} | cut -d ' ' -f 2)
else
msg "Unrecognized root partition info file format"
exit 1
fi
dd if=${FW_FILE_EXTR} skip=${root_start} of=${ROOT_DEV} bs=1048576 count=${root_size} || exit 1
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}
rm -rf $FW_DIR

View File

@ -1,5 +1,5 @@
#!/bin/bash
mkdir -p /var/lib/samba/private
echo -e "${PASSWORD}\n${PASSWORD}\n" | /usr/bin/smbpasswd -a admin -s > /dev/null
echo -e "$PASSWORD\n$PASSWORD\n" | /usr/bin/smbpasswd -a admin -s > /dev/null

View File

@ -1,3 +1,2 @@
13 * * * * /usr/sbin/logrotate /etc/logrotate.conf
0 2 * * 0 /usr/sbin/https-update
*/15 * * * * /usr/sbin/dyndns-update
14 3 * * * /usr/sbin/logrotate /etc/logrotate.conf

View File

@ -1,5 +1,6 @@
DATE_TIMEOUT=10
DATE_METHOD=sntp
DATE_HOST="google.com"
DATE_INTERVAL=900
DATE_NTP_SERVER=""
date_timeout=10
date_method=http
date_host="google.com"
date_interval=900
date_ntp_server=""

View File

@ -1,6 +0,0 @@
BASEDIR="/var/lib/dehydrated"
DOMAINS_TXT="/data/etc/ssl/domain"
WELLKNOWN="/tmp/dehydrated"
HOOK="/usr/libexec/dehydrated-hook"
CONTACT_EMAIL="$(</data/etc/ssl/email)"
AUTO_CLEANUP="yes"

View File

@ -1,3 +1,4 @@
# <file system> <mount pt> <type> <options> <dump> <pass>
${disk_dev_prefix}1 /boot vfat ro,defaults 0 0
${disk_dev_prefix}3 /data ext4 defaults,noatime 0 0
/dev/mmcblk0p1 /boot vfat ro,defaults 0 0
/dev/mmcblk0p3 /data ext4 defaults,noatime 0 0

View File

@ -1,4 +0,0 @@
# <file system> <mount pt> <type> <options> <dump> <pass>
overlay /usr overlay lowerdir=/usr,upperdir=/data/usr,workdir=/data/.overlay-usr 0 0
overlay /var/log overlay lowerdir=/var/log,upperdir=/data/log,workdir=/data/.overlay-log 0 0
overlay /var/lib overlay lowerdir=/var/lib,upperdir=/data/varlib,workdir=/data/.overlay-varlib 0 0

View File

@ -4,3 +4,4 @@ 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

View File

@ -1,84 +1,61 @@
#!/bin/bash
DATA_OFFS="1024" # up to 1024MB reserved for boot + root
test -n "${OS_VERSION}" || source /etc/init.d/base
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Detecting disk device"
root_dev=$(cat /proc/cmdline | grep -oE 'root=[/a-z0-9]+' | cut -d '=' -f 2)
if [[ "${root_dev}" =~ ^([/a-z0-9]+)(p[0-9])$ ]]; then # e.g. /dev/mmcblk0p2
if [[ "$root_dev" =~ ^([/a-z0-9]+)(p[0-9])$ ]]; then # e.g. /dev/mmcblk0p2
disk_dev=${BASH_REMATCH[1]}
disk_dev_prefix=${disk_dev}p
boot_dev=${disk_dev}p1
root_dev=${disk_dev}p2
data_dev=${disk_dev}p3
elif [[ "${root_dev}" =~ ^([/a-z0-9]+)([0-9])$ ]]; then # e.g. /dev/sdc2
elif [[ "$root_dev" =~ ^([/a-z0-9]+)([0-9])$ ]]; then # e.g. /dev/sdc2
disk_dev=${BASH_REMATCH[1]}
disk_dev_prefix=${disk_dev}
boot_dev=${disk_dev}1
root_dev=${disk_dev}2
data_dev=${disk_dev}3
else
msg_fail "unknown (${root_dev})"
msg_fail "unknown ($root_dev)"
exit 1
fi
msg_done "$disk_dev"
for ext in disk extra overlay; do
sed "s,"'${disk_dev_prefix}'",${disk_dev_prefix},g" /etc/fstab.${ext} > /tmp/fstab.${ext}
done
# Output disk info to /tmp/disk_info
{
echo "DISK_DEV=${disk_dev}"
echo "DISK_DEV_PREFIX=${disk_dev_prefix}"
echo "BOOT_DEV=${boot_dev}"
echo "ROOT_DEV=${root_dev}"
echo "DATA_DEV=${data_dev}"
} > /tmp/disk_info
msg_done "${disk_dev}"
if [[ -b ${data_dev} ]]; then
msg_begin "Checking data filesystem"
if grep -q 'fsck.mode=force' /proc/cmdline; then
/sbin/e2fsck -fy ${data_dev} &> /tmp/fsck.log
elif ! grep -q 'fsck.mode=skip' /proc/cmdline; then
/sbin/e2fsck -y ${data_dev} &> /tmp/fsck.log
fi
if [[ $? == 0 ]]; then
msg_done
else
msg_fail
cat /tmp/fsck.log
fi
exit 0
fi
test -b $data_dev && exit 0
msg_begin "Creating data partition"
data_start=$((DATA_OFFS * 2048))
data_start=$((1024 * 2048)) # up to 1024MB reserved for boot + root
echo -e "n
p
3
${data_start}
\n
w" | /sbin/fdisk ${disk_dev} &>/dev/null
partx -a ${disk_dev} &>/dev/null
test -b ${data_dev} && msg_done || msg_fail
w" | /sbin/fdisk $disk_dev &>/dev/null
partx -a $disk_dev &>/dev/null
test -b $data_dev && msg_done || msg_fail
msg_begin "Formatting data partition"
mkfs.ext4 -q ${data_dev}
mkfs.ext4 -q $data_dev
test $? == 0 && msg_done || msg_fail
msg_begin "Mounting data partition"
mount -T /tmp/fstab.disk /data && msg_done || msg_fail
mount -T /etc/fstab.disk /data
test $? == 0 && msg_done || msg_fail
msg_begin "Copying data skeleton"
msg_begin "Creating required data files"
cp -pur /usr/share/dataskel/* /data
cp /etc/version /data/etc/version
ln -s /usr/share/zoneinfo/UTC /data/etc/localtime
touch /data/etc/adjtime
sync
msg_done
msg_begin "Setting empty root password"
PASSWORD="" adminpasswd
msg_done
# mount other partitions depending on data
mount -T /etc/fstab.disk -a
mount -T /etc/fstab.extra -a
;;
stop)
@ -89,3 +66,4 @@ case "$1" in
echo "Usage: $0 {start}"
exit 1
esac

View File

@ -1,28 +1,16 @@
#!/bin/bash
test -n "${OS_VERSION}" || source /etc/init.d/base
test -n "$os_version" || source /etc/init.d/base
mount_fs() {
msg_begin "Mounting filesystems"
/bin/mount -T /tmp/fstab.disk -a &&
/bin/mount -T /tmp/fstab.extra -a &&
/bin/mount -T /etc/fstab.disk -a &&
/bin/mount -T /etc/fstab.extra -a &&
if [[ -r /data/etc/fstab.user ]]; then /bin/mount -T /data/etc/fstab.user -a; fi
test $? == 0 && msg_done || msg_fail
}
mount_overlay() {
modprobe overlay &>/dev/null
grep -qw overlay /proc/filesystems || return
msg_begin "Mounting overlay filesystems"
grep -oE 'lowerdir=[^,]+' /tmp/fstab.overlay | cut -d '=' -f 2 | xargs -r mkdir -p
grep -oE 'upperdir=[^,]+' /tmp/fstab.overlay | cut -d '=' -f 2 | xargs -r mkdir -p
grep -oE 'workdir=[^ ]+' /tmp/fstab.overlay | cut -d '=' -f 2 | xargs -r mkdir -p
/bin/mount -T /tmp/fstab.overlay -a
test $? == 0 && msg_done || msg_fail
}
remount_rw() {
msg_begin "Remounting boot partition read-write"
mount -o remount,rw /boot
@ -34,18 +22,17 @@ remount_rw() {
}
mk_tty_login() {
test -z "${OS_TTY_LOGIN}" && OS_TTY_LOGIN=tty1
ln -sf /dev/${OS_TTY_LOGIN} /dev/ttylogin
test -z "$os_tty_login" && os_tty_login=tty1
ln -sf /dev/$os_tty_login /dev/ttylogin
}
case "$1" in
start)
mount_fs
mount_overlay
# we need to source conf again, now that /data is available
source /etc/init.d/os_conf
test "${OS_DEBUG}" == "true" && remount_rw
test -n "$os_debug" || source /etc/init.d/conf
test "$os_debug" == "true" && remount_rw
mk_tty_login
;;
@ -59,3 +46,4 @@ case "$1" in
esac
exit $?

View File

@ -1,45 +0,0 @@
#!/bin/bash
test -n "${OS_VERSION}" || source /etc/init.d/base
set_empty_root_passwd() {
msg_begin "Setting empty root password"
PASSWORD="" adminpasswd
sync
msg_done
}
copy_version() {
msg_begin "Copying version file"
cp /etc/version /data/etc/version
sync
msg_done
}
set_utc_timezone() {
msg_begin "Setting UTC timezone"
ln -s /usr/share/zoneinfo/UTC /data/etc/localtime
touch /data/etc/adjtime
sync
msg_done
}
case "$1" in
start)
test -s /data/etc/shadow || set_empty_root_passwd
test -s /data/etc/version || copy_version
test -s /data/etc/localtime || set_utc_timezone
;;
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

@ -1,47 +0,0 @@
#!/bin/bash
BACKUPS_DIR="/boot"
BACKUP_PATTERN="backup-*.tar.gz"
DATA_DIR="/data"
test -n "${OS_VERSION}" || source /etc/init.d/base
case "$1" in
start)
if ! ls ${BACKUPS_DIR}/${BACKUP_PATTERN} &>/dev/null; then
exit; # no backups
fi
mount -o remount,rw /boot
for file in ${BACKUPS_DIR}/${BACKUP_PATTERN}; do
msg_begin "Restoring backup from $(basename ${file})"
tar -mxf ${file} -C ${DATA_DIR}
if [[ $? == 0 ]]; then
rm ${file}
msg_done
else
msg_fail
fi
done
# source os_conf again, as it might have changed after restore
test -s /etc/init.d/os_conf && source /etc/init.d/os_conf
if [[ "${OS_DEBUG}" != "true" ]]; then
mount -o remount,ro /boot
fi
;;
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

@ -1,39 +0,0 @@
#!/bin/bash
SYS_MODULES_FILE="/etc/modules"
BOOT_MODULES_FILE="/boot/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 ${BOOT_MODULES_FILE} ]]; then
cat ${BOOT_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

@ -1,38 +0,0 @@
#!/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"
prepare_conf ${HOSTNAME_FILE} ${SYS_HOSTNAME_FILE} ${BOOT_HOSTNAME_FILE}
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

@ -1,34 +0,0 @@
#!/bin/bash
PROG="/sbin/syslogd"
PROG_D="/bin/dmesg"
DMESG_LOG="/var/log/dmesg.log"
test -n "${OS_VERSION}" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Starting syslogd"
${PROG}
test $? == 0 && msg_done || msg_fail
echo "---- booting ${OS_NAME} ${OS_VERSION} ----" >> ${DMESG_LOG}
${PROG_D} -w >> ${DMESG_LOG} &
;;
stop)
msg_begin "Stopping syslogd"
killall -q $(basename ${PROG})
test $? == 0 && msg_done || msg_fail
killall -q $(basename ${PROG_D})
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit $?

View File

@ -1,36 +0,0 @@
#!/bin/bash
SYS_CONF="/etc/sysctl.conf"
BOOT_CONF="/boot/sysctl.conf"
CONF="/data/etc/sysctl.conf"
PROG="/sbin/sysctl"
test -n "${OS_VERSION}" || source /etc/init.d/base
if [[ ! -f ${CONF} && ! -f ${SYS_CONF} && ! -f ${BOOT_CONF} ]]; then
exit 0
fi
case "$1" in
start)
msg_begin "Applying sysctl parameters"
test -s ${SYS_CONF} && sysctl -q -p ${SYS_CONF}
test -s ${CONF} && sysctl -q -p ${CONF}
test -s ${BOOT_CONF} && sysctl -q -p ${BOOT_CONF}
msg_done
;;
stop)
true
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit $?

View File

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

View File

@ -1,20 +1,13 @@
#!/bin/bash
DEV="/dev/watchdog"
PROG="/sbin/watchdog"
test -x ${PROG} || exit 0
test -c ${DEV} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test -c /dev/watchdog || exit 0
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Starting watchdog"
${PROG} -t 5 ${DEV}
watchdog -t 5 /dev/watchdog
test $? == 0 && msg_done || msg_fail
;;
@ -24,7 +17,7 @@ case "$1" in
reallystop)
msg_begin "Stopping watchdog"
killall -q $(basename ${PROG})
killall watchdog &>/dev/null
test $? == 0 && msg_done || msg_fail
;;

View File

@ -1,24 +1,22 @@
#!/bin/bash
SYS_VERSION_FILE="/etc/version"
VERSION_FILE="/data/etc/version"
POST_UPGRADE_DIR="/usr/share/post-upgrade"
POST_UPGRADE_NET_SCHEDULED="/data/.post-upgrade-net-scheduled"
test -n "$os_version" || source /etc/init.d/base
LOG="/var/log/post-upgrade.log"
sys_version_file="/etc/version"
version_file="/data/etc/version"
post_upgrade_dir="/usr/share/post-upgrade"
sys_os_conf="/etc/os.conf"
os_conf="/data/etc/os.conf"
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 -n "${OS_VERSION}" || source /etc/init.d/base
test "$hash" == "$sys_hash" && exit 0
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
test -d ${POST_UPGRADE_DIR} || exit 0
test -d $post_upgrade_dir || exit 0
function version_gt() {
if [[ "$1" != "$2" ]] && [[ $(echo -e "$2\n$1" | semver-sort | head -n 1) == "$2" ]]; then
if [[ "$1" != "$2" ]] && [[ $(echo -e "$2\n$1" | sort -t . | head -n 1) == "$2" ]]; then
return 0
else
return 1
@ -26,45 +24,37 @@ function version_gt() {
}
function run_post_upgrade() {
unset OS_VERSION
# ensure compatibility with previous lowercase os_version
version="$(source ${VERSION_FILE} 2>/dev/null && echo ${OS_VERSION}${os_version})"
version="$(source $version_file 2>/dev/null && echo $os_version)"
sys_version="$(source $sys_version_file 2>/dev/null && echo $os_version)"
sys_version="$(source ${SYS_VERSION_FILE} 2>/dev/null && echo ${OS_VERSION})"
echo "---- post-upgrade from ${version} to ${sys_version} ----" >> ${LOG}
echo -n > ${POST_UPGRADE_NET_SCHEDULED}
versions=$(ls -1 ${POST_UPGRADE_DIR} | rev | cut -d '.' -f 2-100 | rev)
for v in ${versions}; do
if [[ ${v} == "post-upgrade" ]]; then
continue
fi
if [[ ${v} == *-net ]]; then # scripts that require network
echo "${POST_UPGRADE_DIR}/${v}.sh" >> ${POST_UPGRADE_NET_SCHEDULED}
continue
fi
if [[ -z "${version}" ]] || version_gt ${v} ${version}; then
msg_begin "Post-upgrading to version ${v}"
${POST_UPGRADE_DIR}/${v}.sh >> ${LOG} 2>&1
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
}
if [[ -x "${POST_UPGRADE_DIR}/post-upgrade.sh" ]]; then
msg_begin "Running common post-upgrade script"
${POST_UPGRADE_DIR}/post-upgrade.sh >> ${LOG} 2>&1
test $? == 0 && msg_done || msg_fail
function update_os_conf() {
source $sys_os_conf
sys_vars=$(cat $sys_os_conf | cut -d '=' -f 1)
for var in $sys_vars; do
if ! grep "$var=" $os_conf &>/dev/null; then
msg_begin "Adding $var to os.conf"
echo "$var=\"${!var}\"" >> $os_conf
msg_done
fi
done
}
case "$1" in
start)
run_post_upgrade
cp ${SYS_VERSION_FILE} ${VERSION_FILE}
cp $sys_version_file $version_file
update_os_conf
;;
stop)
@ -77,3 +67,4 @@ case "$1" in
esac
exit $?

View File

@ -1,43 +0,0 @@
#!/bin/bash
PROG="/usr/sbin/rngd"
test -f ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
start() {
msg_begin "Starting rngd"
${PROG} &>/dev/null
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping rngd"
killall -q $(basename ${PROG})
msg_done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit $?

View File

@ -1,21 +1,15 @@
#!/bin/bash
SYS_BTCONF="/etc/bluetooth.conf"
BOOT_BTCONF="/boot/bluetooth.conf"
BTCONF="/data/etc/bluetooth.conf"
PROG="/usr/bin/dbus-daemon"
PROG_UG="/usr/bin/dbus-uuidgen"
PROG_UA="/usr/bin/udevadm"
test -x ${PROG} || exit 0
sys_btconf="/etc/bluetooth.conf"
boot_btconf="/boot/bluetooth.conf"
btconf="/data/etc/bluetooth.conf"
# dbus is currently only used by bluez
test -s ${BTCONF} || test -s ${BOOT_BTCONF} || test -s ${SYS_BTCONF} || exit 0
test -f $btconf || test -f $boot_btconf || test -f $sys_btconf || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test -x /usr/bin/dbus-daemon || exit 0
test -n "$os_version" || source /etc/init.d/base
start() {
mkdir -p /tmp/dbus
@ -23,16 +17,16 @@ start() {
msg_begin "Starting dbus"
${PROG_UG} --ensure
${PROG} --system
dbus-uuidgen --ensure
dbus-daemon --system
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping dbus"
${PROG_UA} control --stop-exec-queue
killall -q $(basename ${PROG})
udevadm control --stop-exec-queue
killall dbus-daemon &>/dev/null
test $? == 0 && msg_done || msg_fail
rm -f /var/run/messagebus.pid

View File

@ -1,26 +1,30 @@
#!/bin/bash
SYS_CONF="/etc/hostapd.conf"
BOOT_CONF="/boot/hostapd.conf"
CONF="/data/etc/hostapd.conf"
sys_conf="/etc/hostapd.conf"
boot_conf="/boot/hostapd.conf"
conf="/data/etc/hostapd.conf"
LOG="/var/log/hostapd.log"
PROG="/usr/sbin/hostapd"
log="/var/log/hostapd.log"
prog="/usr/sbin/hostapd"
WATCH_CONF="/data/etc/watch.conf"
watch_conf="/data/etc/watch.conf"
LINK_WATCH=yes
LINK_WATCH_TIMEOUT=20
link_watch=yes
link_watch_timeout=20
test -f $watch_conf && source $watch_conf
test -x ${PROG} || exit 0
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 -n "${OS_VERSION}" || source /etc/init.d/base
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -s ${WATCH_CONF} && source ${WATCH_CONF}
test -f $conf || exit 0
test -n "$os_version" || source /etc/init.d/base
running() {
killall -0 hostapd &> /dev/null
@ -30,74 +34,47 @@ watch() {
while true; do
sleep 5
if ! running; then
logger -t hostapd "dead, calling panic action"
logger -t hostapd -s "dead, calling panic action"
panic_action hostapd
break
fi
done
}
prepare_ap_ifaces() {
wifi_ifaces=$(ip link | grep -oE 'wlan[[:digit:]]')
msg_begin "Preparing AP interfaces"
ap_ifaces=""
for iface in ${wifi_ifaces}; do
ap_iface=ap${iface: -1}
if iw dev ${iface} interface add ${ap_iface} type __ap &>/dev/null; then
ap_ifaces+="${ap_iface} "
fi
done
msg_done "${ap_ifaces:-none}"
}
start_hostapd() {
start() {
msg_begin "Starting hostapd"
# wait up to 5 seconds for interface
count=0
while ! ifconfig ${iface} >/dev/null 2>&1; do
while ! ifconfig $iface >/dev/null 2>&1; do
sleep 1
count=$((${count} + 1))
if [[ ${count} -ge 5 ]]; then
count=$(($count + 1))
if [[ $count -ge 5 ]]; then
msg_fail "no device"
return 1
fi
done
iface=$(cat ${CONF} | grep interface | cut -d '=' -f 2)
module=$(basename $(readlink /sys/class/net/${iface}/device/driver/module 2>/dev/null) 2>/dev/null)
iface=$(cat $conf | grep interface | cut -d '=' -f 2)
module=$(basename $(readlink /sys/class/net/$iface/device/driver/module 2>/dev/null) 2>/dev/null)
iwconfig ${iface} power off &> /dev/null
${PROG} ${CONF} &> ${LOG} &
iwconfig $iface power off &> /dev/null
$prog $conf &> $log &
if [[ "${LINK_WATCH}" == "yes" ]]; then
if [[ "$link_watch" == "yes" ]]; then
watch &
fi
test -n "${module}" && msg_done "done (${module})"|| msg_done
test -n "$module" && msg_done "done ($module)"|| msg_done
}
stop_hostapd() {
stop() {
msg_begin "Stopping hostpad"
killall hostapd &>/dev/null
ps | grep hostapd | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
msg_done
}
start() {
prepare_ap_ifaces
if [[ -s ${CONF} ]]; then
start_hostapd
fi
}
stop() {
if [[ -s ${CONF} ]]; then
stop_hostapd
fi
}
case "$1" in
start)
start
@ -116,3 +93,4 @@ case "$1" in
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

View File

@ -1,36 +1,49 @@
#!/bin/bash
SYS_CONF="/etc/wpa_supplicant.conf"
BOOT_CONF="/boot/wpa_supplicant.conf"
CONF="/data/etc/wpa_supplicant.conf"
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=nl80211,wext
log="/var/log/wpa_supplicant.log"
prog="/usr/sbin/wpa_supplicant"
driver=nl80211,wext
SYS_WATCH_CONF="/etc/watch.conf"
BOOT_WATCH_CONF="/boot/watch.conf"
WATCH_CONF="/data/etc/watch.conf"
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
test -x ${PROG} || exit 0
source $watch_conf
test -n "${OS_VERSION}" || source /etc/init.d/base
if ! [[ -f $conf ]]; then
if [[ -f $boot_conf ]]; then
cp $boot_conf $conf
elif [[ -f $sys_conf ]]; then
cp $sys_conf $conf
fi
fi
prepare_conf ${WATCH_CONF} ${SYS_WATCH_CONF} ${BOOT_WATCH_CONF}
source ${WATCH_CONF}
test -f $conf || exit 0
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -s ${CONF} || exit 0
# we want only Unix newlines here
sed -i 's/\r//g' $conf
ssid=$(cat ${CONF} | grep ssid | grep -v scan_ssid | cut -d '"' -f 2)
test -n "${ssid}" || exit 0
ssid=$(cat $conf | grep ssid | grep -v scan_ssid | cut -d '"' -f 2)
test -n "$ssid" || exit 0
test "${OS_NETWORKLESS}" == "true" && exit 0
test -n "$os_version" || source /etc/init.d/base
test "$os_networkless" == "true" && exit 0
connected() {
ip link show dev ${OS_WLAN} 2>&1 | grep LOWER_UP &> /dev/null && return 0 || return 1
ip link show dev $os_wlan 2>&1 | grep LOWER_UP &> /dev/null && return 0 || return 1
}
watch() {
@ -40,11 +53,11 @@ watch() {
if connected; then
count=0
else
if [[ ${count} -lt ${LINK_WATCH_TIMEOUT} ]]; then
count=$((${count} + 5))
logger -t wifi "disconnected"
if [[ $count -lt $link_watch_timeout ]]; then
count=$(($count + 5))
logger -t wifi -s "disconnected"
else
logger -t wifi "disconnected for ${LINK_WATCH_TIMEOUT} seconds, calling panic action"
logger -t wifi -s "disconnected for $link_watch_timeout seconds, calling panic action"
panic_action wifi
fi
fi
@ -52,33 +65,26 @@ watch() {
}
start() {
test -n "${OS_COUNTRY}" && iw reg set ${OS_COUNTRY}
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
while ! ifconfig $os_wlan >/dev/null 2>&1; do
sleep 1
count=$((${count} + 1))
if [[ ${count} -ge 5 ]]; then
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
opts="-i${OS_WLAN} -c${CONF} -D${DRIVER} -B"
if [[ ${OS_DEBUG} == "true" ]]; then
opts+=" -dd"
fi
${PROG} ${opts} &>> ${LOG}
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
@ -87,24 +93,24 @@ start() {
break
fi
if [[ ${count} -gt ${LINK_WATCH_TIMEOUT} ]] || ! pidof $(basename ${PROG}) > /dev/null; then
test -n "${module}" && msg_fail "failed (${module})"|| msg_fail
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))
count=$(($count + 1))
done
if [[ "${LINK_WATCH}" == "true" ]]; then
if [[ "$link_watch" == "true" ]]; then
watch &
fi
test -n "${module}" && msg_done "done (${module})"|| msg_done
test -n "$module" && msg_done "done ($module)"|| msg_done
}
stop() {
msg_begin "Stopping wpa_supplicant"
killall -q $(basename ${PROG})
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
}

View File

@ -1,31 +1,33 @@
#!/bin/bash
SYS_CONF="/etc/ppp/default"
BOOT_CONF="/boot/ppp"
CONF="/data/etc/ppp"
sys_conf="/etc/ppp/default"
boot_conf="/boot/ppp"
conf="/data/etc/ppp"
PROG="/usr/sbin/pppd"
PROVIDER="mobile"
prog="/usr/sbin/pppd"
provider="mobile"
WATCH_CONF="/data/etc/watch.conf"
watch_conf="/data/etc/watch.conf"
source $watch_conf
test -x ${PROG} || exit 0
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 -n "${OS_VERSION}" || source /etc/init.d/base
test -e $conf/modem || exit 0
test -e $conf/apn || exit 0
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -e ${CONF}/modem || exit 0
test -e ${CONF}/apn || exit 0
source ${WATCH_CONF}
test "${OS_NETWORKLESS}" == "true" && exit 0
test -n "$os_version" || source /etc/init.d/base
test "$os_networkless" == "true" && exit 0
connected() {
ifconfig | grep ${OS_PPP} &>/dev/null && return 0 || return 1
ifconfig | grep $os_ppp &>/dev/null && return 0 || return 1
}
watch() {
@ -35,11 +37,11 @@ watch() {
if connected; then
count=0
else
if [[ ${count} -lt ${LINK_WATCH_TIMEOUT} ]]; then
count=$((${count} + 5))
logger -t ppp "disconnected"
if [[ $count -lt $link_watch_timeout ]]; then
count=$(($count + 5))
logger -t ppp -s "disconnected"
else
logger -t ppp "disconnected for ${LINK_WATCH_TIMEOUT} seconds, calling panic action"
logger -t ppp -s "disconnected for $link_watch_timeout seconds, calling panic action"
panic_action ppp
fi
fi
@ -53,35 +55,35 @@ udev_trigger_add() {
}
start() {
test -e ${CONF}/auth || touch ${CONF}/auth
test -e ${CONF}/extra || touch ${CONF}/extra
test -e ${CONF}/pin || touch ${CONF}/pin
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
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
if [[ -e /dev/$modem ]] || [[ $count -gt $link_watch_timeout ]]; then
break
fi
count=$((${count} + 1))
count=$(($count + 1))
sleep 1
done
if ! [[ -e /dev/${modem} ]]; then
msg_fail "modem /dev/${modem} not present"
if ! [[ -e /dev/$modem ]]; then
msg_fail "modem /dev/$modem not present"
return
fi
${PROG} call ${PROVIDER}
$prog call $provider
count=0
while true; do
sleep 1
@ -90,15 +92,15 @@ start() {
break
fi
if [[ ${count} -gt ${LINK_WATCH_TIMEOUT} ]] || ! pidof $(basename ${PROG}) > /dev/null; then
if [[ $count -gt $link_watch_timeout ]] || ! pidof pppd > /dev/null; then
msg_fail
return
fi
count=$((${count} + 1))
count=$(($count + 1))
done
if [[ "${LINK_WATCH}" == "true" ]]; then
if [[ "$link_watch" == "true" ]]; then
watch &
fi
@ -107,7 +109,7 @@ start() {
stop() {
msg_begin "Stopping pppd"
killall -q $(basename ${PROG})
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
}

View File

@ -1,38 +1,41 @@
#!/bin/bash
SYS_CONF="/etc/bluetooth.conf"
BOOT_CONF="/boot/bluetooth.conf"
CONF="/data/etc/bluetooth.conf"
RUN_CONF="/var/lib/bluetooth.conf"
sys_conf="/etc/bluetooth.conf"
boot_conf="/boot/bluetooth.conf"
conf="/data/etc/bluetooth.conf"
ADAPTER="hci0"
PROG="/usr/libexec/bluetooth/bluetoothd"
PROG_HC="/usr/bin/hciconfig"
DATA_DIR="/var/lib/bluetooth"
RUN_DATA_DIR="/data/bluetooth"
NO_ON_BOARD_BT="/tmp/.no_on_board_bt" # used by RPi to explicitly indicate that no on-board BT was detected
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
test -x ${PROG} || exit 0
hci=hci0
bluetoothd=/usr/libexec/bluetooth/bluetoothd
data_dir=/var/lib/bluetooth
run_data_dir=/data/bluetooth
run_conf=/var/lib/bluetooth.conf
test -n "${OS_VERSION}" || source /etc/init.d/base
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -s ${CONF} || exit 0
test -x $bluetoothd || exit 0
test -n "$os_version" || source /etc/init.d/base
configure() {
mkdir -p ${RUN_DATA_DIR}
ln -sf ${RUN_DATA_DIR} ${DATA_DIR}
cp ${CONF} ${RUN_CONF}
mkdir -p $run_data_dir
ln -sf $run_data_dir $data_dir
cp $conf $run_conf
# if no specific name configured, use hostname
if ! grep -E 'Name\s*=' ${RUN_CONF} &>/dev/null; then
sed -ri "s/(\[General\])/\1\nName = $(hostname)/" ${RUN_CONF}
if ! grep -E 'Name\s*=' $run_conf &>/dev/null; then
sed -ri "s/(\[General\])/\1\nName = $(hostname)/" $run_conf
fi
# bring adapter up
${PROG_HC} ${ADAPTER} up
hciconfig $hci up
}
start() {
@ -40,17 +43,15 @@ start() {
# wait up to 10 seconds for device
count=0
while ! ${PROG_HC} ${ADAPTER} &>/dev/null; do
# on RPi boards, the absence of an on-board BT can be detected earlier, preventing 10s timeout
count=$((count + 1))
if [[ ${count} -ge 10 ]] || [[ -f "${NO_ON_BOARD_BT}" ]]; then
msg_fail "no device"
logger -t bluetooth "bluetooth device not available"
return 0
fi
while ! hciconfig $hci &>/dev/null; do
sleep 1
count=$(($count + 1))
if [[ $count -ge 10 ]]; then
msg_fail "no device"
logger -t bluetooth -s "bluetooth device not available, calling panic action"
panic_action bluetooth
return 1
fi
done
if configure; then
@ -61,19 +62,19 @@ start() {
fi
msg_begin "Starting bluetoothd"
${PROG} &>/dev/null &
$bluetoothd &>/dev/null &
msg_done
# if DiscoverableTimeout is set to 0, make adapter discoverable from boot time
if grep -E '^DiscoverableTimeout\s*=\s*0$' ${RUN_CONF} &>/dev/null; then
if grep -E '^DiscoverableTimeout\s*=\s*0$' $run_conf &>/dev/null; then
sleep 1
${PROG_HC} ${ADAPTER} piscan
hciconfig $hci piscan
fi
}
stop() {
msg_begin "Stopping bluetoothd"
killall -q $(basename ${PROG})
killall bluetoothd &>/dev/null
test $? == 0 && msg_done || msg_fail
}

View File

@ -1,43 +1,40 @@
#!/bin/bash
DH_CONF="/var/cache/dhclient.conf"
WATCH_CONF="/data/etc/watch.conf"
SYS_STATIC_CONF="/etc/static_ip.conf"
BOOT_STATIC_CONF="/boot/static_ip.conf"
STATIC_CONF="/data/etc/static_ip.conf"
SYS_INTERFACES_CONF="/etc/network/interfaces"
BOOT_INTERFACES_CONF="/boot/network/interfaces"
INTERFACES_CONF="/data/etc/network/interfaces"
LINK_NEGO_TIMEOUT=10
test -n "${OS_VERSION}" || source /etc/init.d/base
source ${WATCH_CONF}
prepare_conf ${STATIC_CONF} ${SYS_STATIC_CONF} ${BOOT_STATIC_CONF}
test -r ${STATIC_CONF} && source ${STATIC_CONF}
prepare_conf ${INTERFACES_CONF} ${SYS_INTERFACES_CONF} ${BOOT_INTERFACES_CONF}
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
watch_eth() {
count=0
while true; do
sleep 5
if [[ "$(cat /sys/class/net/${OS_ETH}/operstate 2>/dev/null)" == "up" ]]; then
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 "disconnected"
if [[ $count -lt $link_watch_timeout ]]; then
count=$(($count + 5))
logger -t ethernet -s "disconnected"
else
logger -t ethernet "disconnected for ${LINK_WATCH_TIMEOUT} seconds, calling panic action"
logger -t ethernet -s "disconnected for $link_watch_timeout seconds, calling panic action"
panic_action network
fi
fi
@ -49,14 +46,14 @@ watch_ip() {
count=0
while true; do
sleep 5
if ip addr show dev ${iface} | grep inet &>/dev/null; then
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 "${iface} has no IP address"
if [[ $count -lt $ip_watch_timeout ]]; then
count=$(($count + 5))
logger -t network -s "$iface has no IP address"
else
logger -t network "${iface} had no IP address for ${IP_WATCH_TIMEOUT} seconds, calling panic action"
logger -t network -s "$iface had no IP address for $ip_watch_timeout seconds, calling panic action"
panic_action network
fi
fi
@ -64,45 +61,36 @@ watch_ip() {
}
start_lo() {
if [[ -r ${INTERFACES_CONF} ]] && grep -q "^iface lo" ${INTERFACES_CONF}; then
ifup -i ${INTERFACES_CONF} lo 2>&1 | logger -t network
else
ifconfig lo up
fi
}
start_wlan() {
msg_begin "Configuring wireless network"
if ! ifconfig ${OS_WLAN} &>/dev/null; then
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
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}
if [[ -n "$mtu" ]]; then
ip link set mtu $mtu dev $os_wlan
fi
if [[ -r ${INTERFACES_CONF} ]] && grep -q "^iface ${OS_WLAN}" ${INTERFACES_CONF}; then
ifup -i ${INTERFACES_CONF} ${OS_WLAN} 2>&1 | logger -t network
test ${PIPESTATUS[0]} == 0 && msg_done || msg_fail
else
if [[ -n "${STATIC_IP}" ]]; then
msg_done ${STATIC_IP}
ifconfig ${OS_WLAN} ${STATIC_IP} up
STATIC_IP="" # won't be used again
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
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} &
if [[ "$ip_watch" == "true" ]] && ip addr show dev $os_wlan | grep inet &>/dev/null; then
watch_ip $os_wlan &
fi
}
@ -112,148 +100,112 @@ start_eth() {
# wait for driver
w=3
count=0
while ! ifconfig ${OS_ETH} >/dev/null 2>&1; do
while ! ifconfig $os_eth >/dev/null 2>&1; do
sleep 1
count=$((${count} + 1))
if [[ ${count} -ge ${w} ]]; then
count=$(($count + 1))
if [[ $count -ge $w ]]; then
msg_done "no device"
return 1
fi
done
# bring it up
ifconfig ${OS_ETH} up
ifconfig $os_eth up
# wait for operstate
w=3
count=0
while [[ "$(cat /sys/class/net/${OS_ETH}/operstate 2>&1)" == "unknown" ]]; do
while [[ "$(cat /sys/class/net/$os_eth/operstate 2>&1)" == "unknown" ]]; do
sleep 1
count=$((${count} + 1))
if [[ ${count} -ge ${w} ]]; then
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
test "$link_watch" == "true" || link_nego_timeout=5
count=0
while [[ "$(cat /sys/class/net/${OS_ETH}/carrier 2>&1)" != "1" ]]; do
while [[ "$(cat /sys/class/net/$os_eth/carrier 2>&1)" != "1" ]]; do
sleep 1
count=$((${count} + 1))
if [[ ${count} -ge ${LINK_NEGO_TIMEOUT} ]]; then
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}
if [[ -n "$mtu" ]]; then
ip link set mtu $mtu dev $os_eth
fi
if [[ -r ${INTERFACES_CONF} ]] && grep -q "^iface ${OS_ETH}" ${INTERFACES_CONF}; then
ifup -i ${INTERFACES_CONF} ${OS_ETH} 2>&1 | logger -t network
test ${PIPESTATUS[0]} == 0 && msg_done || msg_fail
else
if [[ -n "${STATIC_IP}" ]]; then
msg_done ${STATIC_IP}
ifconfig ${OS_ETH} ${STATIC_IP} up
STATIC_IP="" # won't be used again
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
dhclient -cf "$dh_conf" $os_eth
fi
if [[ "${LINK_WATCH}" == "true" ]]; then
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} &
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
echo "send host-name = \"$hostname\";" > /var/cache/dhclient.conf
start_lo
test "${OS_NETWORKLESS}" == "true" && return 0
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 "${OS_WLAN}" -a -n "${ssid}" && start_wlan && wlan_ok="ok"
test -n "${OS_PPP}" -a -r /data/etc/ppp/modem && ifconfig | grep ${OS_PPP} &>/dev/null && ppp_ok="ok"
def_route_ok=$(ip route get 1.1.1.1 &>/dev/null && echo "ok")
test -n "$ssid" && start_wlan && wlan_ok="ok"
test -r /data/etc/ppp/modem && ifconfig | grep $os_ppp &>/dev/null && ppp_ok="ok"
if [[ -n "${OS_ETH}" ]]; then
# if wifi or ppp link ok, start eth in background
if [[ "${wlan_ok}" == "ok" ]] || [[ "${ppp_ok}" == "ok" ]] && [[ "${def_route_ok}" == "ok" ]]; then
if [[ "$wlan_ok" == "ok" ]] || [[ "$ppp_ok" == "ok" ]]; then
start_eth &>/dev/null &
else
start_eth && eth_ok="ok"
fi
fi
if [[ "${eth_ok}" != "ok" ]] && [[ "${wlan_ok}" != "ok" ]] && [[ "${ppp_ok}" != "ok" ]]; then
if [[ "${LINK_WATCH}" == "true" ]]; then
logger -t network "no network connection available, calling panic action"
if [[ "$eth_ok" != "ok" ]] && [[ "$wlan_ok" != "ok" ]] && [[ "$ppp_ok" != "ok" ]]; then
if [[ "$link_watch" == "true" ]]; then
logger -t network -s "no network connection available, calling panic action"
panic_action network
return 1
else
logger -t network "no network connection available"
logger -t network -s "no network connection available"
return 0
fi
fi
if [[ -r ${INTERFACES_CONF} ]]; then
# ifup doesn't set the DNS server, so we have to set it manually
STATIC_DNS=$(cat ${INTERFACES_CONF} | grep dns-nameserver | tr -s ' ' | cut -d ' ' -f 3 | head -n 11)
if [[ -n "${STATIC_DNS}" ]]; then
msg_begin "Setting static DNS server to ${STATIC_DNS}"
echo "nameserver ${STATIC_DNS}" > /etc/resolv.conf
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
# Make sure all auto interfaces are brought up
ifup -i ${INTERFACES_CONF} -a >/dev/null
else
if [[ -n "${STATIC_GW}" ]]; then
msg_begin "Setting static gateway to ${STATIC_GW}"
ip route add default via ${STATIC_GW}
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
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
fi
# re-evalutate default route, as it might have changed with start_eth or static IP
def_route_ok=$(ip route get 1.1.1.1 &>/dev/null && echo "ok")
if [[ "${def_route_ok}" != "ok" ]]; then
if [[ "${IP_WATCH}" == "true" ]]; then
logger -t network "no default route, calling panic action"
panic_action network
return 1
else
logger -t network "no default route"
return 0
fi
fi
}
stop() {
msg_begin "Stopping network"
if [[ -r ${INTERFACES_CONF} ]]; then
ifdown -i ${INTERFACES_CONF} -a 2>&1 | logger -t network
fi
ps | grep S40network | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
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
}

View File

@ -1,38 +1,34 @@
#!/bin/bash
CONF="/data/etc/watch.conf"
NETWATCH_RETRIES=3
NETWATCH_TIMEOUT=5
NETWATCH_INTERVAL=20
watch_conf="/data/etc/watch.conf"
netwatch_retries=3
netwatch_timeout=5
netwatch_interval=20
test -f $watch_conf && source $watch_conf || exit 0
# watch configuration is already prepared by wifi init script
if [[ -z "$netwatch_host" ]] || [[ -z "$netwatch_port" ]]; then
exit 0
fi
test -s ${CONF} || exit 0
source ${CONF}
test -n "${NETWATCH_HOST}" || exit 0
test -n "${NETWATCH_PORT}" || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test "${OS_NETWORKLESS}" == "true" && exit 0
test -n "$os_version" || source /etc/init.d/base
test "$os_networkless" == "true" && exit 0
watch() {
count=0
NETWATCH_RETRIES=$((${NETWATCH_RETRIES} - 1))
netwatch_retries=$(($netwatch_retries - 1))
while true; do
sleep ${NETWATCH_INTERVAL}
if nc -z -w ${NETWATCH_TIMEOUT} ${NETWATCH_HOST} ${NETWATCH_PORT} </dev/null >/dev/null 2>&1; then
sleep $netwatch_interval
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
logger -t netwatch "cannot connect to ${NETWATCH_HOST}:${NETWATCH_PORT}"
count=$((${count} + 1))
if [[ $count -lt $netwatch_retries ]]; then
logger -t netwatch -s "cannot connect to $netwatch_host:$netwatch_port"
count=$(($count + 1))
continue
else
logger -t netwatch "cannot connect to ${NETWATCH_HOST}:${NETWATCH_PORT}, calling panic action"
logger -t netwatch -s "cannot connect to $netwatch_host:$netwatch_port, calling panic action"
panic_action netwatch
fi
fi

View File

@ -1,20 +1,25 @@
#!/bin/bash
SYS_CONF="/etc/firewall.sh"
BOOT_CONF="/boot/firewall.sh"
CONF="/data/etc/firewall.sh"
sys_conf="/etc/firewall.sh"
boot_conf="/boot/firewall.sh"
conf="/data/etc/firewall.sh"
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 -n "${OS_VERSION}" || source /etc/init.d/base
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -s ${CONF} || exit 0
test -f $conf || exit 0
test -n "$os_version" || source /etc/init.d/base
start() {
msg_begin "Starting firewall"
bash ${CONF}
bash $conf
test $? == 0 && msg_done || msg_fail
}

View File

@ -1,37 +1,40 @@
#!/bin/bash
SYS_CONF="/etc/dnsmasq.conf"
BOOT_CONF="/boot/dnsmasq.conf"
CONF="/data/etc/dnsmasq.conf"
sys_conf="/etc/dnsmasq.conf"
boot_conf="/boot/dnsmasq.conf"
conf="/data/etc/dnsmasq.conf"
LOG="/var/log/dnsmasq.log"
PROG="/usr/sbin/dnsmasq"
log="/var/log/dnsmasq.log"
prog="/usr/sbin/dnsmasq"
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 -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -s ${CONF} || exit 0
test -f $conf || exit 0
test -n "$os_version" || source /etc/init.d/base
start() {
msg_begin "Starting dnsmasq"
iface=$(cat ${CONF} | grep interface | cut -d '=' -f 2)
ip=$(cat ${CONF} | grep range | cut -d '=' -f 2 | cut -d '.' -f 1,2,3).1
iface=$(cat $conf | grep interface | cut -d '=' -f 2)
ip=$(cat $conf | grep range | cut -d '=' -f 2 | cut -d '.' -f 1,2,3).1
ifconfig ${iface} ${ip}
ifconfig $iface $ip
${PROG} -C ${CONF} --log-facility=${LOG}
$prog -C $conf --log-facility=$log
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping dnsmasq"
killall -q $(basename ${PROG})
killall dnsmasq &>/dev/null
test $? == 0 && msg_done || msg_fail
}

View File

@ -1,148 +1,118 @@
#!/bin/bash
PROG_DATE="/bin/date"
PROG_NTPD="/usr/sbin/chronyd"
PROG_SNTP="/usr/bin/sntp"
LOG_SNTP="/var/log/sntp.log"
# Date executable points to /bin/busybox\ date explicitly in the cases that date binary gets overwritten
date_exec=/bin/busybox\ date
SYS_CONF="/etc/date.conf"
BOOT_CONF="/boot/date.conf"
CONF="/data/etc/date.conf"
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"
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
test -n "${OS_VERSION}" || source /etc/init.d/base
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
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
prepare_conf ${NTP_CONF} ${SYS_NTP_CONF} ${BOOT_NTP_CONF}
test -f $conf || exit 0
test -s ${CONF} || exit 0
test -n "$os_version" || source /etc/init.d/base
test "${OS_NETWORKLESS}" == "true" && exit 0
test "$os_networkless" == "true" && exit 0
DATE_TIMEOUT=10
DATE_METHOD=sntp
DATE_HOST="google.com"
DATE_INTERVAL="900"
DATE_NTP_SERVER=""
source ${CONF}
date_timeout=10
date_method=http
date_host="google.com"
date_interval="900"
source $conf
set_current_date_http() {
curl_args="-v -s -m ${DATE_TIMEOUT} -H \"Cache-Control: no-cache\" -X GET"
url="http://${DATE_HOST}?_=${RANDOM}"
date_str=$(curl ${curl_args} ${url} 2>&1 | grep Date | sed -e 's/< Date: //')
if [[ -n "${date_str}" ]]; then
${PROG_DATE} -u -D "%a, %d %b %Y %H:%M:%S" -s "${date_str}" > /dev/null
logger -t date "current system date/time set to $(date) via HTTP"
return 0
else
logger -t date "failed to set current system date/time via HTTP"
return 1
fi
date_str=$(curl -v -s -m $date_timeout -X GET http://$date_host 2>&1 | grep Date | sed -e 's/< Date: //')
test -z "$date_str" && return 1
$date_exec -u -D "%a, %d %b %Y %H:%M:%S" -s "$date_str" > /dev/null
return $?
}
set_current_date_ntp() {
if [[ -n "${DATE_NTP_SERVER}" ]]; then
sed -i "s/pool .*/pool ${DATE_NTP_SERVER} iburst/" ${NTP_CONF}
fi
${PROG_NTPD} -f ${NTP_CONF} -q -t ${DATE_TIMEOUT} &>/dev/null
if [[ $? == 0 ]]; then
logger -t date "current system date/time set to $(date) via NTP"
return 0
else
logger -t date "failed to set current system date/time via NTP"
return 1
fi
cat $ntp_conf | grep server | head -n 1 | cut -d ' ' -f 2 | xargs ntpdate -t $date_timeout -s
}
set_current_date_sntp() {
sntp_args="-t ${DATE_TIMEOUT} -K /dev/null -Ss"
server=$(cat ${NTP_CONF} | grep pool | head -n 1 | cut -d ' ' -f 2)
${PROG_SNTP} ${sntp_args} ${server} &>${LOG_SNTP}
if [[ $? == 0 ]]; then
logger -t date "current system date/time set to $(date) via SNTP"
return 0
else
logger -t date "failed to set current system date/time via SNTP"
return 1
fi
}
start_http() {
msg_begin "Setting current date using HTTP"
if set_current_date_http; then
sleep_interval=${DATE_INTERVAL}
msg_done "$(${PROG_DATE})"
else
sleep_interval=${DATE_TIMEOUT}
msg_fail
fi
msg_begin "Setting current date using http"
set_current_date_http || set_current_date_http
test $? == 0 && msg_done "$($date_exec)" || msg_fail
msg_begin "Starting http date updater"
while true; do
sleep ${sleep_interval}
if set_current_date_http; then
sleep_interval=${DATE_INTERVAL}
else
sleep_interval=${DATE_TIMEOUT}
fi
sleep $date_interval
set_current_date_http
done &
msg_done
}
start_ntp() {
if [[ -n "${DATE_NTP_SERVER}" ]]; then
sed -i "s/pool .*/pool ${DATE_NTP_SERVER} iburst/" ${NTP_CONF}
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
if [[ "${DATE_METHOD}" == "sntp" ]]; then
msg_begin "Setting current date using SNTP"
set_current_date_sntp
test $? == 0 && msg_done "$(${PROG_DATE})" || msg_fail
else # assuming ntp
msg_begin "Setting current date using NTP"
set_current_date_ntp
test $? == 0 && msg_done "$(${PROG_DATE})" || msg_fail
fi
cat ${ntp_conf}.tmp >> $ntp_conf
rm ${ntp_conf}.tmp
msg_begin "Setting current date using ntp"
set_current_date_ntp || set_current_date_ntp
test $? == 0 && msg_done "$($date_exec)" || msg_fail
msg_begin "Starting ntpd"
${PROG_NTPD} -f ${NTP_CONF}
ntpd -g -c $ntp_conf
test $? == 0 && msg_done || msg_fail
}
stop_http() {
msg_begin "Stopping date updater"
ps | grep S50date | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
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 -q $(basename ${PROG_NTPD})
killall ntpd &>/dev/null
test $? == 0 && msg_done || msg_fail
}
start() {
if [[ "${DATE_METHOD}" == "http" ]]; then
if [[ "$date_method" == "http" ]]; then
start_http
else # ntp or sntp
else
start_ntp
fi
echo "system date is $(${PROG_DATE} '+%Y-%m-%d %H:%M:%S')" > /dev/kmsg
echo "system date is $($date_exec '+%Y-%m-%d %H:%M:%S')" > /dev/kmsg
}
stop() {
if [[ "${DATE_METHOD}" == "http" ]]; then
if [[ "$date_method" == "http" ]]; then
stop_http
else # ntp or sntp
else
stop_ntp
fi
}
@ -167,3 +137,4 @@ case "$1" in
esac
exit $?

View File

@ -1,32 +1,26 @@
#!/bin/bash
SYS_CONF="/etc/crontabs"
CONF="/data/etc/crontabs"
PROG="/usr/sbin/crond"
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
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
${PROG} -c ${SYS_CONF}
if [[ -d $sys_conf ]]; then
/usr/sbin/crond -c $sys_conf
fi
mkdir -p ${CONF}
${PROG} -c ${CONF}
mkdir -p $conf
/usr/sbin/crond -c $conf
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping crond"
killall -q $(basename ${PROG})
killall crond &>/dev/null
test $? == 0 && msg_done || msg_fail
}

View File

@ -1,36 +0,0 @@
#!/bin/bash
POST_UPGRADE_NET_SCHEDULED="/data/.post-upgrade-net-scheduled"
LOG="/var/log/post-upgrade.log"
test -n "${OS_VERSION}" || source /etc/init.d/base
test -s ${POST_UPGRADE_NET_SCHEDULED} || exit 0
function run_post_upgrade() {
for script in $(cat ${POST_UPGRADE_NET_SCHEDULED}); do
msg_begin "Running post-upgrade script ${script}"
${script} >> ${LOG} 2>&1
test $? == 0 && msg_done || msg_fail
done
}
case "$1" in
start)
run_post_upgrade
rm ${POST_UPGRADE_NET_SCHEDULED}
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -1,60 +1,34 @@
#!/bin/bash
SYS_DIR=/etc/ssh
USER_DIR=/data/etc/ssh
RUN_DIR=/var/run/ssh
conf="/etc/sshd_config"
SYS_CONF="${SYS_DIR}/sshd_config"
USER_CONF="${USER_DIR}/sshd_config"
CONF="${RUN_DIR}/sshd_config"
test -f $conf || exit 0
PROG="/usr/sbin/sshd"
PROG_KG="/usr/bin/ssh-keygen"
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test -s ${SYS_CONF} || exit 0
test -n "$os_version" || source /etc/init.d/base
test "$os_networkless" == "true" && exit 0
start() {
# merge user and sys conf files; options in first file take precedence
mkdir -p $(dirname ${CONF})
if [[ -s ${USER_CONF} ]]; then
cat ${USER_CONF} ${SYS_CONF} > ${CONF}
else
cp ${SYS_CONF} ${CONF}
fi
# ensure various dirs existence
mkdir -p ${USER_DIR}
mkdir -p ${RUN_DIR}
msg_begin "Starting sshd"
# create any missing keys
if ! [[ -s ${USER_DIR}/ssh_host_rsa_key ]]; then
msg_begin "Generating ssh host keys"
for type in rsa dsa ecdsa ed25519; do
ssh-keygen -f ${USER_DIR}/ssh_host_${type}_key -N '' -t ${type} >/dev/null
done
test $? == 0 && msg_done || msg_fail
if ! /usr/bin/ssh-keygen -A >/dev/null; then
msg_fail
return 1
fi
msg_begin "Starting sshd"
umask 077
hostname=$(hostname)
echo "Welcome to ${hostname}!" > ${RUN_DIR}/sshd_banner
echo "Welcome to $hostname!" > /var/cache/sshd_banner
sync
${PROG} -f ${CONF}
/usr/sbin/sshd -f $conf
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping sshd"
killall -q $(basename ${PROG})
killall sshd &>/dev/null
test $? == 0 && msg_done || msg_fail
}
@ -76,3 +50,4 @@ case "$1" in
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

View File

@ -1,28 +1,23 @@
#!/bin/bash
CONF="/etc/proftpd.conf"
PROG="/usr/sbin/proftpd"
test -f /etc/proftpd.conf || exit 0
test -n "$os_version" || source /etc/init.d/base
test -n "$os_debug" || source /etc/init.d/conf
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test -n "${OS_DEBUG}" || source /etc/init.d/conf
test -s ${CONF} || exit 0
test "$os_networkless" == "true" && exit 0
start() {
msg_begin "Starting proftpd"
mkdir -p /var/run/proftpd
touch /var/log/wtmp
${PROG} &>/dev/null
/usr/sbin/proftpd &>/dev/null
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping proftpd"
killall -q $(basename ${PROG})
killall proftpd &>/dev/null
test $? == 0 && msg_done || msg_fail
}

View File

@ -1,39 +1,32 @@
#!/bin/bash
CONF="/etc/samba/smb.conf"
test -f /etc/samba/smb.conf || exit 0
PROG="/usr/sbin/smbd"
PROG_N="/usr/sbin/nmbd"
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test -n "${OS_DEBUG}" || source /etc/init.d/conf
test -s ${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() {
mkdir -p /var/log/samba
mkdir -p /var/lib/samba/private
msg_begin "Starting smbd"
${PROG} -D
smbd -D
test $? == 0 && msg_done || msg_fail
msg_begin "Starting nmbd"
${PROG_N} -D
nmbd -D
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping smbd"
killall -q $(basename ${PROG})
killall smbd &>/dev/null
test $? == 0 && msg_done || msg_fail
msg_begin "Stopping nmbd"
killall -q $(basename ${PROG_N})
killall nmbd &>/dev/null
test $? == 0 && msg_done || msg_fail
}

View File

@ -1,50 +0,0 @@
#!/bin/bash
SYS_CONF="/etc/mongodb.conf"
BOOT_CONF="/boot/mongodb.conf"
CONF="/data/etc/mongodb.conf"
PROG="/usr/bin/mongod"
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -s ${CONF} || exit 0
start() {
msg_begin "Starting mongod"
db_dir=$(cat ${CONF} | grep dbpath | cut -d '=' -f 2)
mkdir -p ${db_dir}
${PROG} -f ${CONF} --fork > /dev/null
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping mongod"
killall -q $(basename ${PROG})
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

@ -1,50 +0,0 @@
#!/bin/bash
SYS_CONF="/etc/redis.conf"
BOOT_CONF="/boot/redis.conf"
CONF="/data/etc/redis.conf"
PROG="/usr/bin/redis-server"
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -s ${CONF} || exit 0
start() {
msg_begin "Starting redis"
db_dir=$(cat ${CONF} | grep -E '^dir' | cut -d ' ' -f 2)
mkdir -p ${db_dir}
${PROG} ${CONF}
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping redis"
killall -q $(basename ${PROG})
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

@ -1,70 +0,0 @@
#!/bin/bash
BOOT_CONF="/boot/postgresql.conf"
SYS_CONF="/etc/postgresql.conf"
CONF="/data/etc/postgresql.conf"
PROG="/usr/bin/pg_ctl"
DB_DIR="/var/lib/postgresql"
USER="postgres"
LOG="/var/log/postgresql.log"
function run_pg_ctl() {
su ${USER} -c "pg_ctl $*"
}
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
start() {
mkdir -p ${DB_DIR}
chown -R ${USER} ${DB_DIR}
touch ${LOG}
chown ${USER} ${LOG}
cd ${DB_DIR}
if [[ ! -f ${DB_DIR}/PG_VERSION ]]; then
msg_begin "Initializing postgresql db"
run_pg_ctl initdb -s -D ${DB_DIR} &>> ${LOG}
test $? == 0 && msg_done || msg_fail
echo "include_if_exists = '${CONF}'" >> ${DB_DIR}/postgresql.conf
fi
msg_begin "Starting postgresql"
run_pg_ctl start -s -D ${DB_DIR} -l ${LOG}
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping postgresql"
run_pg_ctl stop -s -D ${DB_DIR} -m fast &>> ${LOG}
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

@ -1,30 +1,35 @@
#!/bin/bash
SYS_CONF="/etc/motioneye.conf"
BOOT_CONF="/boot/motioneye.conf"
CONF="/data/etc/motioneye.conf"
MOTION_CONF="/data/etc/motion.conf"
WATCH_CONF="/data/etc/watch.conf"
sys_conf="/etc/motioneye.conf"
boot_conf="/boot/motioneye.conf"
conf="/data/etc/motioneye.conf"
motion_conf="/data/etc/motion.conf"
watch_conf="/data/etc/watch.conf"
MEYEWATCH_TIMEOUT=120
MEYEWATCH_DISABLE="false"
DEV_V4L_BY_ID="/dev/v4l/by-id/"
MEDIA_DIR="/data/output"
meyewatch_timeout=120
meyewatch_disable="false"
dev_v4l_by_id="/dev/v4l/by-id/"
media_dir="/data/output"
test -n "${OS_VERSION}" || source /etc/init.d/base
if ! [ -f $conf ]; then
if [ -f $boot_conf ]; then
cp $boor_conf $conf
elif [ -f $sys_conf ]; then
cp $sys_conf $conf
fi
fi
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
test -f "$conf" || exit 0
test -f "${CONF}" || exit 0
test -r $watch_conf && source $watch_conf
test -r ${WATCH_CONF} && source ${WATCH_CONF}
test -n "$os_version" || source /etc/init.d/base
opts=$(cat "${CONF}" | while read line; do echo "--${line}"; done)
port=$(echo "${opts}" | grep -oE 'port [[:digit:]]+' | cut -d ' ' -f 2)
opts=$(cat "$conf" | while read line; do echo "--$line"; done)
port=$(echo "$opts" | grep -oE 'port [[:digit:]]+' | cut -d ' ' -f 2)
responsive() {
curl -m 2 --head http://127.0.0.1:${port} &>/dev/null && return 0 || return 1
curl -m 2 --head http://127.0.0.1:$port &>/dev/null && return 0 || return 1
}
watch() {
@ -34,10 +39,10 @@ watch() {
if responsive; then
count=0
else
if [ ${count} -lt ${MEYEWATCH_TIMEOUT} ]; then
count=$((${count} + 5))
if [ $count -lt $meyewatch_timeout ]; then
count=$(($count + 5))
else
logger -t motioneye -s "not responding for ${MEYEWATCH_TIMEOUT} seconds, rebooting"
logger -t motioneye -s "not responding for $meyewatch_timeout seconds, rebooting"
reboot
fi
fi
@ -47,61 +52,61 @@ watch() {
find_persistent_device() {
device=$1
if ! [ -d ${DEV_V4L_BY_ID} ]; then
echo ${device}
if ! [ -d $dev_v4l_by_id ]; then
echo $device
return
fi
for p in ${DEV_V4L_BY_ID}/*; do
if [ $(realpath "${p}") == ${device} ]; then
echo ${p} | sed 's#//*#/#g'
for p in $dev_v4l_by_id/*; do
if [ $(realpath "$p") == $device ]; then
echo $p | sed 's#//*#/#g'
return
fi
done
echo ${device}
echo $device
}
add_mmal_cameras() {
vcgencmd=$(which vcgencmd)
if [ -z "${vcgencmd}" ]; then
if [ -z "$vcgencmd" ]; then
return 1
fi
camera=$(${vcgencmd} get_camera 2>/dev/null)
if [ "${camera}" != "supported=1 detected=1" ]; then
camera=$($vcgencmd get_camera 2>/dev/null)
if [ "$camera" != "supported=1 detected=1" ]; then
return 1
fi
output_dir="/data/output/camera1/"
loc="/config/add/?_username=admin"
device="vc.ril.camera"
body="{\"path\": \"${device}\", \"proto\": \"mmal\"}"
signature=$(echo -n "POST:${loc}:${body}:" | sha1sum | cut -d ' ' -f 1)
body="{\"path\": \"$device\", \"proto\": \"mmal\"}"
signature=$(echo -n "POST:$loc:$body:" | sha1sum | cut -d ' ' -f 1)
curl -s -m 60 --data "${body}" "http://127.0.0.1:${port}${loc}&_signature=${signature}" > /dev/null
curl -s -m 60 --data "$body" "http://127.0.0.1:$port$loc&_signature=$signature" > /dev/null
return 0
}
add_v4l2_cameras() {
index=1
for device in $(ls /dev/video? 2>/dev/null); do
for device in $(ls /dev/video* 2>/dev/null); do
# filter out devices that don't look like cameras
if ! v4l2-ctl -d ${device} --list-formats-ext 2>/dev/null | grep -oE '[[:digit:]]+x[[:digit:]]+' &>/dev/null; then
if ! v4l2-ctl -d $device --list-formats-ext 2>/dev/null | grep -oE '[[:digit:]]+x[[:digit:]]+' &>/dev/null; then
continue
fi
output_dir="/data/output/camera${index}/"
output_dir="/data/output/camera$index/"
loc="/config/add/?_username=admin"
device=$(find_persistent_device ${device})
body="{\"path\": \"${device}\", \"proto\": \"v4l2\"}"
signature=$(echo -n "POST:${loc}:${body}:" | sha1sum | cut -d ' ' -f 1)
device=$(find_persistent_device $device)
body="{\"path\": \"$device\", \"proto\": \"v4l2\"}"
signature=$(echo -n "POST:$loc:$body:" | sha1sum | cut -d ' ' -f 1)
curl -s -m 60 --data "${body}" "http://127.0.0.1:${port}${loc}&_signature=${signature}" > /dev/null
index=$((${index} + 1))
curl -s -m 60 --data "$body" "http://127.0.0.1:$port$loc&_signature=$signature" > /dev/null
index=$(($index + 1))
done
if [ ${index} -gt 1 ]; then
if [ $index -gt 1 ]; then
return 0
else
return 1
@ -111,8 +116,8 @@ add_v4l2_cameras() {
start() {
msg_begin "Starting motioneye"
mkdir -p ${MEDIA_DIR}
meyectl startserver -b -c ${CONF} -l
mkdir -p $media_dir
meyectl startserver -b -c $conf -l
count=0
while true; do
@ -122,22 +127,22 @@ start() {
break
fi
if [ ${count} -gt ${MEYEWATCH_TIMEOUT} ]; then
if [ $count -gt $meyewatch_timeout ]; then
msg_fail
test "${MEYEWATCH_DISABLE}" == "false" && reboot
test "$meyewatch_disable" == "false" && reboot
return 1
fi
count=$((${count} + 1))
count=$(($count + 1))
done
# add connected camera(s) with default settings
if responsive && ! [ -f ${MOTION_CONF} ]; then
if responsive && ! [ -f $motion_conf ]; then
add_mmal_cameras || add_v4l2_cameras
sync
fi
if [ "${MEYEWATCH_DISABLE}" == "false" ]; then
if [ "$meyewatch_disable" == "false" ]; then
watch &
fi
@ -146,7 +151,7 @@ start() {
stop() {
msg_begin "Stopping motioneye"
meyectl stopserver -c ${CONF} &>/dev/null
meyectl stopserver -c $conf &>/dev/null
test $? == 0 && msg_done || msg_fail
ps | grep motioneye | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
}

View File

@ -1,27 +0,0 @@
#!/bin/bash
PROG="/usr/sbin/dyndns-update"
SCRIPT="/data/etc/dyndns-update.sh"
test -s ${SCRIPT} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Updating dynamic DNS"
${PROG} &>/dev/null
test $? == 0 && msg_done || msg_fail
;;
stop)
true
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?

View File

@ -1,16 +1,15 @@
#!/bin/bash
USERINIT="/data/etc/userinit.sh"
userinit_sh="/data/etc/userinit.sh"
test -f $userinit_sh || exit 0
test -s ${USERINIT} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test -n "$os_version" || source /etc/init.d/base
case "$1" in
start)
msg_begin "Executing user init script"
/bin/bash ${USERINIT}
/bin/bash $userinit_sh
test $? == 0 && msg_done || msg_fail
;;

View File

@ -1,33 +1,32 @@
#!/bin/bash
test -n "${OS_VERSION}" || source /etc/init.d/base
test -n "$os_version" || source /etc/init.d/base
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 | grep -iv fe80 | sed 'N;s/\n/, /')
test -n "${addr}" && msg_info "Interface $1 has IP address ${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}"
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}"
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_iface_ip_addr $os_eth
show_iface_ip_addr $os_wlan
show_iface_ip_addr $os_ppp
show_gateway
show_dns
;;

44
board/common/overlay/etc/init.d/base Normal file → Executable file
View File

@ -1,13 +1,13 @@
#!/bin/bash
source /etc/version
BOARD_SN=$(/etc/init.d/boardsn)
BOARD_NAME=$(cat /etc/board)
board_sn=$(/etc/init.d/boardsn)
board_name=$(cat /etc/board)
test -n "${OS_DEBUG}" || source /etc/init.d/os_conf
test -n "$os_debug" || source /etc/init.d/conf
source /etc/init.d/panic
msg_begin() {
echo -n " * $1: "
}
@ -24,39 +24,3 @@ msg_background() {
test -n "$1" && echo $1 || echo "pending"
}
prepare_conf() {
# $1 - actual config file
# $2 - system-provided config file
# $3 - user-provided config file
# long story short:
# * user conf file takes precedence, if present
# * system conf file is used by default, if actual file absent
actual_conf="$1"
system_conf="$2"
user_conf="$3"
if [[ -n "${user_conf}" && -e "${user_conf}" ]]; then
cp -rf "${user_conf}" "${actual_conf}"
# we want only Unix newlines in conf files
if [[ -f "${actual_conf}" ]]; then
sed -i 's/\r//g' "${actual_conf}"
elif [[ -d "${actual_conf}" ]]; then
find "${actual_conf}" -type f | xargs -L1 sed -i 's/\r//g'
fi
grep -E "/boot .*ro[\s,]" /proc/mounts &>/dev/null
RO=$?
test ${RO} == 0 && mount -o remount,rw /boot
rm -rf ${user_conf}
test ${RO} == 0 && mount -o remount,ro /boot
fi
if [[ ! -e "${actual_conf}" && -e "${system_conf}" ]]; then
mkdir -p $(dirname "${actual_conf}")
cp "${system_conf}" "${actual_conf}"
fi
}

View File

@ -3,5 +3,5 @@
source /etc/init.d/panic
# reset panic counter after a successful boot
echo 0 > ${PANIC_COUNTER_FILE}
echo 0 > ${_PANIC_COUNTER_FILE}

View File

@ -0,0 +1,29 @@
#!/bin/bash
_sys_conf="/etc/os.conf"
_boot_conf="/boot/os.conf"
_conf="/data/etc/os.conf"
if ! [[ -d /data/etc ]]; then
# use boot/system variants if we don't have the data partition mounted
if [[ -f $_boot_conf ]]; then
source $_boot_conf
elif [[ -f $_sys_conf ]]; then
source $_sys_conf
fi
return
fi
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 $_conf ]]; then
source $_conf
fi

View File

@ -3,4 +3,8 @@
/bin/mkdir -p /dev/pts
/bin/mkdir -p /dev/shm
/bin/mount --make-shared /
/bin/mount -T /etc/fstab.sys -a
/bin/mount -T /etc/fstab.sys -a -t proc
/bin/mount -T /etc/fstab.sys -a -t devpts
/bin/mount -T /etc/fstab.sys -a -t tmpfs
/bin/mount -T /etc/fstab.sys -a -t sysfs

View File

@ -1,21 +0,0 @@
_SYS_CONF="/etc/os.conf"
_BOOT_CONF="/boot/os.conf"
_DATA_CONF="/data/etc/os.conf"
# source in all conf files in order of precedence
if [[ -f ${_SYS_CONF} ]]; then
source ${_SYS_CONF}
fi
if [[ -f ${_DATA_CONF} ]]; then
source ${_DATA_CONF}
fi
if [[ -f ${_BOOT_CONF} ]]; then
source ${_BOOT_CONF}
fi
unset _SYS_CONF _BOOT_CONF _DATA_CONF

17
board/common/overlay/etc/init.d/panic Normal file → Executable file
View File

@ -1,19 +1,20 @@
#!/bin/bash
PANIC_COUNTER_FILE="/var/lib/panic_counter"
PANIC_REBOOT_DELAY_FACTOR=10
PANIC_REBOOT_DELAY_MAX=3600 # reboot at least once an hour in case of panic
_PANIC_COUNTER_FILE="/var/lib/panic_counter"
_PANIC_REBOOT_DELAY_FACTOR=10
_PANIC_REBOOT_DELAY_MAX=3600 # reboot at least once an hour in case of panic
panic_action() {
# read counter from file
panic_counter=$(cat ${PANIC_COUNTER_FILE} 2>/dev/null || echo 0)
panic_counter=$(cat ${_PANIC_COUNTER_FILE} 2>/dev/null || echo 0)
# write increased counter back to file
echo $((panic_counter + 1)) > ${PANIC_COUNTER_FILE}
echo $((panic_counter + 1)) > ${_PANIC_COUNTER_FILE}
delay=$((PANIC_REBOOT_DELAY_FACTOR * panic_counter))
if [[ "${delay}" -gt "${PANIC_REBOOT_DELAY_MAX}" ]]; then
delay=${PANIC_REBOOT_DELAY_MAX}
delay=$((_PANIC_REBOOT_DELAY_FACTOR * panic_counter))
if [[ "${delay}" -gt "${_PANIC_REBOOT_DELAY_MAX}" ]]; then
delay=${_PANIC_REBOOT_DELAY_MAX}
fi
if [[ "${delay}" -gt 0 ]]; then

View File

@ -1,22 +1,22 @@
#!/bin/sh
BOOT_LOG=/var/log/boot.log
PID_FILE=/tmp/rc.pid
boot_log=/var/log/boot.log
pid_file=/tmp/rc.pid
source /etc/init.d/base
echo
echo "---- shutting down ${OS_NAME} ${OS_VERSION} ----" | tee -a ${BOOT_LOG}
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
if ! [[ -x "${i}" ]]; then continue; fi
if [[ -f /data/etc/no_$(basename ${i}) ]]; then continue; fi
${i} stop
done& echo $! > ${PID_FILE}) | tee -a ${BOOT_LOG} &
if ! [[ -x "$i" ]]; then continue; fi
if [[ -f /data/etc/no_$(basename $i) ]]; then continue; fi
$i stop
done& echo $! > $pid_file) | tee -a $boot_log &
pid=$(cat ${PID_FILE})
while kill -0 ${pid} 2>/dev/null; do
pid=$(cat $pid_file)
while kill -0 $pid 2>/dev/null; do
sleep 1
done

View File

@ -1,30 +1,25 @@
#!/bin/sh
BOOT_LOG=/var/log/boot.log
TMP_BOOT_LOG=/tmp/_boot.log
PID_FILE=/tmp/rc.pid
set -a
test -s /etc/environment && source /etc/environment
test -s /data/etc/environment && source /data/etc/environment
test -s /boot/etc/environment && source /boot/etc/environment
set +a
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} ----" | tee -a ${TMP_BOOT_LOG}
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??* /etc/init.d/bootdone; do
if ! [[ -x "${i}" ]]; then continue; fi
if [[ -f /data/etc/no_$(basename ${i}) ]]; then continue; fi
${i} start || break
done& echo $! > ${PID_FILE}) | tee -a ${TMP_BOOT_LOG} &
if ! [[ -x "$i" ]]; then continue; fi
if [[ -f /data/etc/no_$(basename $i) ]]; then continue; fi
$i start || break
done& echo $! > $pid_file) | tee -a $tmp_boot_log &
pid=$(cat ${PID_FILE})
while kill -0 ${pid} 2>/dev/null; do
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}
test -d $(dirname $boot_log) && cat $tmp_boot_log >> $boot_log

View File

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

View File

@ -1,6 +1,13 @@
pool pool.ntp.org iburst
driftfile /var/lib/chrony.drift
makestep 1000 10
rtcsync
hwclockfile /data/etc/adjtime
log tracking
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

@ -1,12 +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/motioneyeos"
OS_FIRMWARE_USERNAME=""
OS_FIRMWARE_PASSWORD=""
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/motioneyeos"
os_firmware_username=""
os_firmware_password=""

View File

@ -2,11 +2,11 @@
resolv_conf=/etc/resolv.conf
echo -n > ${resolv_conf}
if [ -n "${DNS1}" ]; then
echo "nameserver ${DNS1}" >> ${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}
if [ -n "$DNS2" ]; then
echo "nameserver $DNS2" >> $resolv_conf
fi

View File

@ -27,14 +27,6 @@ if [ "$PS1" ]; then
export TERM=linux
fi;
export HISTFILE=/data/.bash_history
# custom local profile
test -f /data/etc/profile && source /data/etc/profile
# global environment variables
set -a
test -f /etc/environment && source /etc/environment
test -f /data/etc/environment && source /data/etc/environment
test -f /boot/etc/environment && source /boot/etc/environment
set +a
if [ -f /data/etc/profile ]; then
source /data/etc/profile
fi

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