diff options
| author | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2020-05-21 22:22:15 +0300 |
|---|---|---|
| committer | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2020-05-21 22:22:15 +0300 |
| commit | 4547de32517aac4a6cc63b5ae65664017cd88a76 (patch) | |
| tree | 2d3b0024daf20485876c47180ac4b35cd89e46db | |
| parent | ca5c55acb366ff5f80af00737a8110673ccf252b (diff) | |
| download | meta-mlinux-atmel-4547de32517aac4a6cc63b5ae65664017cd88a76.tar.gz meta-mlinux-atmel-4547de32517aac4a6cc63b5ae65664017cd88a76.tar.bz2 meta-mlinux-atmel-4547de32517aac4a6cc63b5ae65664017cd88a76.zip | |
Remove duplicates
35 files changed, 0 insertions, 2369 deletions
diff --git a/contrib/env-oe.sh b/contrib/env-oe.sh deleted file mode 100644 index 53a3297..0000000 --- a/contrib/env-oe.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -export OETREE=$(pwd) - -OECORE="${OETREE}/layers/openembedded-core" - -if [[ ! "${PATH}" =~ ${OETREE}/bitbake/bin ]]; then - export PATH="${OECORE}/scripts:${OETREE}/bitbake/bin:${PATH}" -fi - -# define if you wish to create soft links to the image in the tftpboot dir -#export TFTPBOOT_DIR=/tftpboot - -export BUILDDIR="${OETREE}" -export BBPATH="${OETREE}:${OECORE}/meta" -export BB_ENV_EXTRAWHITE="MACHINE DISTRO OETREE TFTPBOOT_DIR TCLIBC TCMODE GIT_PROXY_COMMAND http_proxy ftp_proxy https_proxy all_proxy ALL_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY SDKMACHINE BB_NUMBER_THREADS" diff --git a/contrib/local.conf b/contrib/local.conf deleted file mode 100644 index 6f5c0a1..0000000 --- a/contrib/local.conf +++ /dev/null @@ -1,72 +0,0 @@ -# CONF_VERSION is increased each time build/conf/ changes incompatibly -CONF_VERSION = "1" - -# Use MultiTech mLinux distribution -DISTRO = "mlinux" -MACHINE ?= "mtcdt" - -# Where to store downloaded sources -DL_DIR = "${TOPDIR}/downloads" - -# Where to save shared state -SSTATE_DIR = "${TOPDIR}/sstate-cache" -# bitbake cache location -PERSISTENT_DIR = "${TOPDIR}/cache" -# build output -TMPDIR = "${TOPDIR}/tmp" - -# Which files do we want to parse: -BBFILES ?= "${TOPDIR}/layers/openembedded-core/meta/recipes-*/*/*.bb" - -# Go through the Firewall -#HTTP_PROXY = "http://:/" - -# Uncomment this to remove unpacked source and intermediate work -# after successfully building a package. -# Saves a LOT of disk space, but leaving work around is useful for debugging. -INHERIT += "rm_work" - -# skip parsing of masked files -BBMASK = "" - -# Make use of SMP: -# PARALLEL_MAKE specifies how many concurrent compiler threads are spawned per bitbake process -# BB_NUMBER_THREADS specifies how many concurrent bitbake tasks will be run -BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()*2}" -PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()*2}" - -# Don't generate the mirror tarball for SCM repos, the snapshot is enough -BB_GENERATE_MIRROR_TARBALLS = "0" - -# Disable build time patch resolution. This would lauch a devshell -# and wait for manual intervention. We disable it. -PATCHRESOLVE = "noop" - -# enable local PR server -PRSERV_HOST = "localhost:0" - -# enable buildhistory for images -INHERIT += "buildhistory" -BUILDHISTORY_COMMIT = "0" -BUILDHISTORY_FEATURES = "image" - -IMAGE_FSTYPES =+ "jffs2 tar.gz" - -# OpenJDK Java runtime -# Uncomment for a bigger image with java. -# Java requires using tftp or a flash drive -# for updating. -# IMAGE_INSTALL += "openjdk-8" -# OpenJDK with JamVM VM (Multi-Tech default) -# IMAGE_INSTALL += "jamvm" -# OpenJDK with CACAO VM (run with 'java -cacao') -# IMAGE_INSTALL += "openjdk-7-vm-cacao" -# OpenJDK Zero VM (run with 'java -zero') -# IMAGE_INSTALL += "openjdk-7-vm-zero" - -PACKAGECONFIG_append_pn-boost = " python" - -OVERRIDES .= ":${MTBSP}" - -# This is populated in the respective kernel recipe -MLINUX_KERNEL_EXTRA_VERSION = "${@base_read_file('${STAGING_KERNEL_BUILDDIR}/mlinux_pr')}" diff --git a/contrib/user-layer.conf b/contrib/user-layer.conf deleted file mode 100644 index 609f95b..0000000 --- a/contrib/user-layer.conf +++ /dev/null @@ -1,10 +0,0 @@ -# We have a conf and classes directory, add to BBPATH -BBPATH .= ":${LAYERDIR}" - -# We have recipes-* directories, add to BBFILES -BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ - ${LAYERDIR}/recipes-*/*/*.bbappend" - -BBFILE_COLLECTIONS += "user" -BBFILE_PATTERN_user = "^${LAYERDIR}/" -BBFILE_PRIORITY_user = "99" diff --git a/recipes-core/init-ifupdown/files/bonding.post-down b/recipes-core/init-ifupdown/files/bonding.post-down deleted file mode 100644 index 13ed4fd..0000000 --- a/recipes-core/init-ifupdown/files/bonding.post-down +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -[ "$IF_VERBOSITY" = 1 ] && set -x - -sysfs() -{ - # Called with : - # $1 = value to write. Won't write if $1 is empty. - # $2 = basename of the file in bonding/ to write to. - if [ "$1" ] ; then - echo "$1" > "/sys/class/net/$IFACE/master/bonding/$2" - return $? - fi - return 0 -} - -sysfs_remove_all() -{ - # Called with: - # $1 = target filename - read values < "/sys/class/net/$IFACE/bonding/$1" - for value in $values ; do - echo "-$value" > "/sys/class/net/$IFACE/bonding/$1" - done -} - -BOND_PARAMS="/sys/class/net/$IFACE/bonding" -IFSTATE=/var/run/ifstate - -# free $IFACE if it is currently enslaved to a bonding device. -if [ -f "/sys/class/net/$IFACE/master/bonding/slaves" ] ; then - echo "-$IFACE" > "/sys/class/net/$IFACE/master/bonding/slaves" - - # The first slave in bond-primary found in current slaves becomes the primary. - # If no slave in bond-primary is found, then primary does not change and might be undefined if just removed. - for slave in $IF_BOND_PRIMARY ; do - if grep -sq "\\<$slave\\>" "/sys/class/net/$IFACE/master/bonding/slaves" ; then - sysfs "$slave" primary - break - fi - done -fi - -# If $IFACE is not a master, exit. -[ ! -f "$BOND_PARAMS/slaves" ] && exit - -# Unset multivalue sysfs entries, so that re-enabling the interface later won't cause error. - -sysfs_remove_all arp_ip_target - -# Remove any slaves of $IFACE. - -[ "$IF_VERBOSITY" = 1 ] && v=-v -read slaves < "$BOND_PARAMS/slaves" -for slave in $slaves ; do - # If $slave is currently up in $IFSTATE, then bring it down, to keep $IFSTATE consistent. - # This is supposed to have the side effect of freeing the interface. - grep -q "^$slave=" $IFSTATE && ifdown $v $slave - - # Anyway, ensure $slave is free. - if [ -f "/sys/class/net/$slave/master/bonding/slaves" ] ; then - echo "-$slave" > "$BOND_PARAMS/slaves" 2> /dev/null - fi -done - -# make sure that the link is set to down -ip link set dev $IFACE down diff --git a/recipes-core/init-ifupdown/files/bonding.pre-up b/recipes-core/init-ifupdown/files/bonding.pre-up deleted file mode 100644 index 39011b6..0000000 --- a/recipes-core/init-ifupdown/files/bonding.pre-up +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/sh - -[ "$IF_VERBOSITY" = 1 ] && set -x - -IFSTATE=/var/run/ifstate - -add_master() -{ - # Return if $BOND_MASTER is already a bonding interface. - [ -f "/sys/class/net/$BOND_MASTER/bonding/slaves" ] && return - - # If the bonding module is not yet loaded, load it. - if [ ! -r /sys/class/net/bonding_masters ]; then - modprobe -q bonding - fi - - # Create the master interface. - if ! grep -sq "\\<$BOND_MASTER\\>" /sys/class/net/bonding_masters; then - echo "+$BOND_MASTER" > /sys/class/net/bonding_masters - fi -} - -sysfs() -{ - # Called with : - # $1 = value to write. Won't write if $1 is empty. - # $2 = basename of the file in bonding/ to write to. - if [ "$1" ] ; then - echo "$1" > "/sys/class/net/$BOND_MASTER/bonding/$2" - return $? - fi - return 0 -} - -sysfs_add() -{ - # Called with : - # $1 = values to write. - # $2 = target filename. - for value in $1; do - # Do not add $1 to $2 if already present. - if ! grep -sq "\\<$value\\>" /sys/class/net/$BOND_MASTER/bonding/$2 - then - sysfs "+$value" "$2" - fi - done -} - -ifup_once() -{ - local v= - [ "$IF_VERBOSITY" = 1 ] && v=-v - if [ "$1" != "$IFACE" ] && ! grep -q "^$1=" $IFSTATE && ifup -n "$1" >/dev/null 2>&1; then - ifup $v $1 - fi -} - -enslave_slaves() -{ - case "$BOND_SLAVES" in - none) - BOND_SLAVES="" - ;; - all) - BOND_SLAVES=`sed -ne 's/ *\(eth[^:]*\):.*/\1/p' /proc/net/dev` - AUTOIF="yes" - ;; - esac - - for slave in $BOND_SLAVES ; do - if ( [ "$AUTOIF" ] && grep -q "^$slave=" $IFSTATE ) ; then - echo "Not enslaving interface $slave since it is already configured" - else - # Ensure $slave is down. - ip link set "$slave" down 2>/dev/null - if ! sysfs_add "$slave" slaves 2>/dev/null ; then - echo "Failed to enslave $slave to $BOND_MASTER. Is $BOND_MASTER ready and a bonding interface ?" >&2 - else - # Bring up slave if it is defined in interfaces - # This is usefull to bring up slaves that need extra setup. - ifup_once $slave - fi - fi - done -} - -setup_master() -{ - sysfs "$IF_BOND_MODE" mode - sysfs "$IF_BOND_MIIMON" miimon - sysfs "$IF_BOND_USE_CARRIER" use_carrier - sysfs "$IF_BOND_UPDELAY" updelay - sysfs "$IF_BOND_DOWNDELAY" downdelay - sysfs "$IF_BOND_ARP_INTERVAL" arp_interval - sysfs "$IF_BOND_ARP_VALIDATE" arp_validate - sysfs "$IF_BOND_FAIL_OVER_MAC" fail_over_mac - sysfs "$IF_BOND_XMIT_HASH_POLICY" xmit_hash_policy - sysfs "$IF_BOND_LACP_RATE" lacp_rate - sysfs_add "$IF_BOND_ARP_IP_TARGET" arp_ip_target -} - -setup_slaves() -{ - # The first slave in bond-primary found in current slaves becomes the primary. - # If no slave in bond-primary is found, then primary does not change. - for slave in $IF_BOND_PRIMARY ; do - if grep -sq "\\<$slave\\>" "/sys/class/net/$BOND_MASTER/bonding/slaves" ; then - sysfs "$slave" primary - break - fi - done - - if [ "$IF_BOND_ACTIVE_SLAVE" ] ; then - # Need to force interface up before. Bonding will refuse to activate a down interface. - ip link set "$IF_BOND_ACTIVE_SLAVE" up - sysfs "$IF_BOND_ACTIVE_SLAVE" active_slave - fi -} - -# Are there anything to do ? - -# Option slaves deprecated, replaced by bond-slaves, but still supported for backward compatibility. -IF_BOND_SLAVES=${IF_BOND_SLAVES:-$IF_SLAVES} - -if [ "$IF_BOND_MASTER" ] ; then - BOND_MASTER="$IF_BOND_MASTER" - BOND_SLAVES="$IFACE" - if ! [ -e /sys/class/net/$IFACE/master ]; then - ifup_once $BOND_MASTER - fi -else - if [ "$IF_BOND_SLAVES$IF_BOND_MODE" ]; then - BOND_MASTER="$IFACE" - BOND_SLAVES="$IF_BOND_SLAVES" - fi -fi - -# Exit if nothing to do... -[ -z "$BOND_MASTER$BOND_SLAVES" ] && exit - -add_master -setup_master -enslave_slaves -setup_slaves diff --git a/recipes-core/init-ifupdown/files/bonding.up b/recipes-core/init-ifupdown/files/bonding.up deleted file mode 100644 index f10152c..0000000 --- a/recipes-core/init-ifupdown/files/bonding.up +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -[ "$IF_VERBOSITY" = 1 ] && set -x - -sysfs() -{ - # Called with : - # $1 = value to write. Won't write if $1 is empty. - # $2 = basename of the file in bonding/ to write to. - if [ "$1" ] ; then - echo "$1" > "/sys/class/net/$IFACE/master/bonding/$2" - return $? - fi - return 0 -} - -# If the stanza bond-give-a-chance is set for a slave interface, -# then force $IFACE to be the primary for some time, then restore primary to it previous value. - -# This stanza is designed to workaround a bug in wpa_supplicant, when used with bonding : - -# wpa_supplicant expect wifi authentication packets on the bond interface, but also send wifi authentication packets on the bond interface. -# If the active interface is not the wifi interface at the time wpa_supplicant try to authenticate, the wifi AP won't receive anything, causing the authentication to fail. - -# In order for the wifi authentication to succeed, one need to give a chance to the wifi interface to send authentication packets. -# "bond-give-a-chance 10" will set the wifi interface as the primary interface for 10 seconds, then restore the previous primary interface. -# This is supposed to be enought to give a chance to wifi to authenticate properly. - -if [ "$IF_BOND_GIVE_A_CHANCE" ] ; then - read primary < "/sys/class/net/$IFACE/master/bonding/primary" - # Set the temporary primary. - sysfs "$IFACE" primary - - # Wait for the link to be setup, but not longer that $IF_BOND_GIVE_A_CHANGE seconds. - while [ "$IF_BOND_GIVE_A_CHANCE" -gt 0 ] ; do - if ip link show $IFACE | grep -sq 'state UP'; then - break - fi - sleep 1 - IF_BOND_GIVE_A_CHANCE=`expr $IF_BOND_GIVE_A_CHANCE - 1` - done - - # Restore the previous primary. - sysfs "$primary" primary -fi diff --git a/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend b/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend deleted file mode 100644 index 9d000d6..0000000 --- a/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend +++ /dev/null @@ -1,13 +0,0 @@ -PR = "r8" - -SRC_URI += "file://bonding.pre-up \ - file://bonding.up \ - file://bonding.post-down" - -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -do_install_append () { - install -m 0755 ${WORKDIR}/bonding.pre-up ${D}${sysconfdir}/network/if-pre-up.d/bonding - install -m 0755 ${WORKDIR}/bonding.up ${D}${sysconfdir}/network/if-up.d/bonding - install -m 0755 ${WORKDIR}/bonding.post-down ${D}${sysconfdir}/network/if-post-down.d/bonding -} diff --git a/recipes-core/initrdscripts/COPYING.MIT b/recipes-core/initrdscripts/COPYING.MIT deleted file mode 100644 index 89de354..0000000 --- a/recipes-core/initrdscripts/COPYING.MIT +++ /dev/null @@ -1,17 +0,0 @@ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/recipes-core/initrdscripts/README.md b/recipes-core/initrdscripts/README.md deleted file mode 100644 index a038dfa..0000000 --- a/recipes-core/initrdscripts/README.md +++ /dev/null @@ -1,162 +0,0 @@ -# meta-readonly-rootfs-overlay - -This OpenEmbedded layer provides the necessary scripts and configurations to -setup a writable root file system overlay on top of a read-only root file system. - -## Why does this exists? - -Having a read-only root file system is useful for many scenarios: - -- Separate user specific changes from system configuration, and being able to -find differences -- Allow factory reset, by deleting the user specific changes -- Have a fallback image in case the user specific changes made the root file -system no longer bootable. - -Because some data on the root file system changes on first boot or while the -system is running, just mounting the complete root file system as read-only -breaks many applications. There are different solutions to this problem: - -- Symlinking/Bind mounting files and directories that could potentially change -while the system is running to a writable partition -- Instead of having a read-only root files system, mounting a writable overlay -root file system, that uses a read-only file system as its base and writes -changed data to another writable partition. - -To implement the first solution, the developer needs to analyse which file -needs to change and then create symlinks for them. When doing factory reset, -the developer needs to overwrite every file that is linked with the factory -configuration, to avoid dangling symlinks/binds. While this is more work on the -developer side, it might increase the security, because only files that are -symlinked/bind-mounted can be changed. However, IMO that is better left to file -permissions. - -This meta-layer provides the second solution. Here no investigation of writable -files are needed and factory reset can be done by just deleting all files or -formatting the writable volume. - -# Dependencies - -This layer depends on: - -``` - URI: git://git.openembedded.org/bitbake - branch: krogoth -``` - -``` - URI: git://git.openembedded.org/openembedded-core - layers: meta - branch: krogoth -``` - -# Patches - -Please submit any patches against the readonly-rootfs-overlay layer via pull -request. - - -# Table of Contents - -1. [Adding the readonly-rootfs-overlay layer to your build](#adding-the-readonly-rootfs-overlay-layer-to-your-build) -1. [Read-only root filesystem](#read-only-root-filesystem) -1. [Kernel command line parameters](#kernel-command-line-parameters) - - -## Adding the readonly-rootfs-overlay layer to your build - -In order to use this layer, you need to make the build system aware of -it. - -Assuming the readonly-rootfs-overlay layer exists at the top-level of your -OpenEmbedded source tree, you can add it to the build system by adding the -location of the readonly-rootfs-overlay layer to bblayers.conf, along with any -other layers needed. e.g.: - -``` - BBLAYERS ?= " \ - /path/to/layers/meta \ - /path/to/layers/meta-poky \ - /path/to/layers/meta-yocto-bsp \ - /path/to/layers/meta-readonly-rootfs-overlay \ - " -``` - -To add the script to your image, just add: - -``` - IMAGE_INSTALL_append = " initscripts-readonly-rootfs-overlay" -``` - -to your `local.conf` or image recipe. Or use -`core-image-rorootfs-overlay-initramfs` as initrd. - -## Read-only root filesystem - -If you use this layer you do *not* need to set `read-only-rootfs` in the -`IMAGE_FEATURES` or `EXTRA_IMAGE_FEATURES` variable. - -## Kernel command line parameters - -These examples are not meant to be complete. They just contain parameters that -are used by the initscript of this repository. Some additional paramters might -be necessary. - -### Example using initrd: - -``` -root=/dev/sda1 rootrw=/dev/sda2 -``` - -This cmd line start `/sbin/init` with the `/dev/sda1` partition as the read-only -rootfs and the `/dev/sda2` partition as the read-write persistent state. - -``` -root=/dev/sda1 rootrw=/dev/sda2 init=/bin/sh -``` - -The same as before but it now starts `/bin/sh` instead of `/sbin/init`. - -### Example without initrd: - -``` -root=/dev/sda1 rootrw=/dev/sda2 init=/init -``` - -This cmd line starts `/sbin/init` with `/dev/sda1` partition as the read-only -rootfs and the `/dev/sda2` partition as the read-write persistent state. When -using this init script without an initrd, `init=/init` has to be set. - -``` -root=/dev/sda1 rootrw=/dev/sda2 init=/init rootinit=/bin/sh -``` - -The same as before but it now starts `/bin/sh` instead of `/sbin/init` - -### Details - -`root=` specifies the read-only root file system device. If this is not -specified, the current rootfs is used. - -`rootfstype=` if support for the read-only file system is not build into the -kernel, you can specify the required module name here. It will also be used in -the mount command. - -`rootoptions=` specifies the mount options of the read-only file system. -Defaults to `noatime,nodiratime`. - -`rootinit=` if the `init` parameter was used to specify this init script, -`rootinit` can be used to overwrite the default (`/sbin/init`). - -`rootrw=` specifies the read-write file system device. If this is not -specified, `tmpfs` is used. - -`rootrwfstype=` if support for the read-write file system is not build into the -kernel, you can specify the required module name here. It will also be used in -the mount command. - -`rootrwoptions=` specifies the mount options of the read-write file system. -Defaults to `rw,noatime,mode=755`. - -`rootrwreset=` set to `yes` if you want to delete all the files in the -read-write file system prior to building the overlay root files system. diff --git a/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh b/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh deleted file mode 100755 index 199fc17..0000000 --- a/recipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh +++ /dev/null @@ -1,356 +0,0 @@ -#!/bin/bash -# fsck output of the upper file system (rw) is -# written to /dev/kmsg - -# Kernel arguments for this script: -# This script allows one to specify the root read-only device with -# kernel argument: -# root= -# What follows can be a PARTUUID, PARTLABEL, or some other mechanism -# understood by findfs, including the plain device name. -# -# The rw file system overlayed on top of root defaults to: -# rootrw='PARTLABEL=user_data' -# This is the first GPT partition found with the name user_data. -# -# Another file system can be specified by PARTUUID, or the -# plain device name, or anything understood by findfs. -# For instance: -# rootrw=/dev/mmcblk0p10 -# to use the SD card. -# -# fsck is not done to the root file system. It is assumed it cannot be -# corrupted. -# By default, fsck -p [rootrw device] is done. -# -# There are two kernel options governing fsck: -# -# fsck.repair=true|false|force -# false skips fsck, force adds the -f option. -# true is the default (fsck with no -f option) -# fsck.mode=preen|yes|no -# These represent -p, -y, and -n options. -# Preen (-p) is the default -# -# Additional options exist to specify the init program -# mount options, file system type. rootrwreset="yes" -# will cause the read/write file system to be erased. -# -# shintramfs starts a shell. To continue boot from -# shell: -# -# bash-4.4# export ROOT_MOUNT=/mnt -# bash-4.4# export INIT=/sbin/init -# bash-4.4# exec switch_root $ROOT_MOUNT $INIT -# -# -# U-Boot environment example to add an init overlay parameter: -# -# => printenv args_mmc -# args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype} -# -# => setenv args_mmc 'run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype} rootrwreset=yes' - - -# Enable strict shell mode -set -euo pipefail - -PATH=/sbin:/bin:/usr/sbin:/usr/bin - -MOUNT="/bin/mount" -UMOUNT="/bin/umount" - -INIT="/sbin/init" -ROOT_ROINIT="/sbin/init" - -ROOT_MOUNT="/mnt" -ROOT_RODEVICE="" -ROOT_RWDEVICE="" -ROOT_ROMOUNT="/run/media/rfs/ro" -ROOT_RWMOUNT="/run/media/rfs/rw" -ROOT_RWRESET="no" - -ROOT_ROFSTYPE="" -ROOT_ROMOUNTOPTIONS="bind" -ROOT_ROMOUNTOPTIONS_DEVICE="noatime,nodiratime,discard,ro" - -ROOT_RWFSTYPE="" -ROOT_RWMOUNTOPTIONS="rw,noatime,mode=755 tmpfs" -ROOT_RWMOUNTOPTIONS_DEVICE="rw,noatime,nodiratime,discard" - -# Arithmetic assignments of 0 are false, and then -# script uses set -e, so use let instead. -DO_FSCK=1 -DO_STOP=0 -FSCKOPT="-p" - - -finddevice() { - DEVICE="$1" - if dev=$(findfs "${DEVICE}") && ((${#dev})) ; then - # Replace the rootfs string with the findfs device result - log "Searched for ${DEVICE} and found $dev" - echo "$dev" - return 0 - fi - log "Could not find $DEVICE" - return 1 -} - -early_setup() { - mkdir -p /proc - mkdir -p /sys - $MOUNT -t proc proc /proc - $MOUNT -t sysfs sysfs /sys - grep -w "/dev" /proc/mounts >/dev/null || $MOUNT -t devtmpfs none /dev -} - -read_args() { - # Default is to do fsck with -p option on user_data partition. - [ -z "${CMDLINE+x}" ] && CMDLINE=`cat /proc/cmdline` - for arg in $CMDLINE; do - # Set optarg to option parameter, and '' if no parameter was - # given - optarg=`expr "x$arg" : 'x[^=]*=\(.*\)' || echo ''` - case $arg in - shinitramfs) - ((DO_STOP=1)) ;; - root=*) - ROOT_RODEVICE=$optarg - if rootdev=$(finddevice "${ROOT_RODEVICE}") ; then - # Replace the rootfs string with the findfs device result - ROOT_RODEVICE="${rootdev}" - log "Actual root device to be used: $ROOT_RODEVICE" - fi - ;; - rootfstype=*) - ROOT_ROFSTYPE="$optarg" ;; - rootinit=*) - ROOT_ROINIT=$optarg ;; - rootoptions=*) - ROOT_ROMOUNTOPTIONS_DEVICE="$optarg" ;; - rootrw=*) - ROOT_RWDEVICE=$optarg - if rootrwdev="$(finddevice ${ROOT_RWDEVICE})" ; then - # Replace the rootfs string with the findfs device result - ROOT_RWDEVICE="${rootrwdev}" - fi - ;; - rootrwfstype=*) - ROOT_RWFSTYPE="$optarg" ;; - rootrwreset=*) - ROOT_RWRESET=$optarg ;; - rootrwoptions=*) - ROOT_RWMOUNTOPTIONS_DEVICE="$optarg" ;; - init=*) - INIT=$optarg ;; - fsck.mode=*) - fsck_mode=$optarg - case $fsck_mode in - preen) - FSCKOPT="-p" ;; - yes) - FSCKOPT="-y" ;; - no) - FSCKOPT="-n" ;; - esac - ;; - fsck.repair=*) - fsck_repair=$optarg - case $fsck_repair in - force) - if ((${#FSCKOPT})) ; then - FSCKOPT+="f" - else - |
