summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorAndrii Pientsov <andrii.pientsov@globallogic.com>2020-05-21 22:22:15 +0300
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2020-05-21 22:22:15 +0300
commit4547de32517aac4a6cc63b5ae65664017cd88a76 (patch)
tree2d3b0024daf20485876c47180ac4b35cd89e46db /recipes-core
parentca5c55acb366ff5f80af00737a8110673ccf252b (diff)
downloadmeta-mlinux-atmel-4547de32517aac4a6cc63b5ae65664017cd88a76.tar.gz
meta-mlinux-atmel-4547de32517aac4a6cc63b5ae65664017cd88a76.tar.bz2
meta-mlinux-atmel-4547de32517aac4a6cc63b5ae65664017cd88a76.zip
Remove duplicates
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/init-ifupdown/files/bonding.post-down67
-rw-r--r--recipes-core/init-ifupdown/files/bonding.pre-up144
-rw-r--r--recipes-core/init-ifupdown/files/bonding.up45
-rw-r--r--recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend13
-rw-r--r--recipes-core/initrdscripts/COPYING.MIT17
-rw-r--r--recipes-core/initrdscripts/README.md162
-rwxr-xr-xrecipes-core/initrdscripts/files/init-readonly-rootfs-overlay-boot.sh356
-rw-r--r--recipes-core/initrdscripts/initramfs-readonly-rootfs-overlay_1.0.bb8
-rw-r--r--recipes-core/initrdscripts/initscripts-readonly-rootfs-overlay_1.0.bb1
-rw-r--r--recipes-core/initrdscripts/readonly-rootfs-overlay-init-script.inc36
-rw-r--r--recipes-core/startpar/startpar_0.64.bb25
11 files changed, 0 insertions, 874 deletions
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
- FSCKOPT="-f"
- fi
- DO_FSCK=1
- ;;
- yes)
- DO_FSCK=1
- ;;
- no)
- DO_FSCK=0
- ;;
- esac
-
- ;;
- esac
- done
-}
-
-fatal() {
- echo "rorootfs-overlay: $1" >$CONSOLE
- echo >$CONSOLE
- exec bash
-}
-
-log() {
- echo "rorootfs-overlay: ${BASH_LINENO[*]}: ${*-""}" >$CONSOLE
-}
-
-early_setup
-
-[ -z "${CONSOLE+x}" ] && CONSOLE="/dev/kmsg"
-
-log "Kernel args are:"
-log "$(cat /proc/cmdline)"
-read_args
-
-
-mount_and_boot() {
- mkdir -p $ROOT_MOUNT $ROOT_ROMOUNT $ROOT_RWMOUNT
-
- # Build mount options for read only root file system.
- # If no read-only device was specified via kernel command line, use
- # current root file system via bind mount.
- ROOT_ROMOUNTPARAMS_BIND="-o ${ROOT_ROMOUNTOPTIONS} /"
- if [ -n "${ROOT_RODEVICE}" ]; then
- ROOT_ROMOUNTPARAMS="-o ${ROOT_ROMOUNTOPTIONS_DEVICE} $ROOT_RODEVICE"
- if [ -n "${ROOT_ROFSTYPE}" ]; then
- ROOT_ROMOUNTPARAMS="-t $ROOT_ROFSTYPE $ROOT_ROMOUNTPARAMS"
- fi
- else
- log "ROOT_RODEVICE: empty: ${ROOT_RODEVICE}"
- ROOT_ROMOUNTPARAMS="$ROOT_ROMOUNTPARAMS_BIND"
- fi
-
- mountlog=$($MOUNT $ROOT_ROMOUNTPARAMS "$ROOT_ROMOUNT" 2>&1)
- mountresult=$?
- if ((mountresult != 0)) ; then
- log "Failed root mount (result $mountresult): $mountlog"
- else
- log "Mounted root: $MOUNT $ROOT_ROMOUNTPARAMS "$ROOT_ROMOUNT": $mountlog"
- log "Mounted ro root: $(grep "$ROOT_ROMOUNT" /proc/mounts)"
- fi
-
- # If future init is the same as current file, use $ROOT_ROINIT
- # Tries to avoid loop to infinity if init is set to current file via
- # kernel command line
- if cmp -s "$0" "$INIT"; then
- INIT="$ROOT_ROINIT"
- fi
-
- # find user_data
- if [[ -z ${ROOT_RWDEVICE} ]] ; then
- userdata=$(findfs PARTLABEL=user_data)
- blkid_out=$(blkid $userdata)
- if [[ -n $userdata ]] ; then
- if [[ $blkid_out =~ TYPE=\"([^\"]+)\" ]]; then
- log "Detected user_data partition with ${BASH_REMATCH[1]} file system"
- else
- log "Create new user_data partition ext4 file system"
- mkfs.ext4 -O 64bit $userdata
- fi
- ROOT_RWDEVICE="$userdata"
- fi # Found user_data GPT partition
- fi # Empty ROOT_RWDEVICE
-
- # Build mount options for read write root file system.
- # If a read-write device was specified via kernel command line
- # or partition table, use it, otherwise default to tmpfs.
- if [ -n "${ROOT_RWDEVICE}" ]; then
- ROOT_RWMOUNTPARAMS="-o $ROOT_RWMOUNTOPTIONS_DEVICE $ROOT_RWDEVICE"
- if [ -n "${ROOT_RWFSTYPE}" ]; then
- ROOT_RWMOUNTPARAMS="-t $ROOT_RWFSTYPE $ROOT_RWMOUNTPARAMS"
- fi
- else
- ROOT_RWMOUNTPARAMS="-t tmpfs -o $ROOT_RWMOUNTOPTIONS"
- fi
-
- if ((DO_FSCK == 1)) ; then
- if log_result=$(fsck $FSCKOPT $ROOT_RWDEVICE 2>&1) ; then
- log "OK fsck user_data: fsck $FSCKOPT $ROOT_RWDEVICE:"
- log "fsck user_data: $log_result"
- else
- log "ERR fsck user_data: fsck $FSCKOPT $ROOT_RWDEVICE:"
- log "$log_result"
- fi
- fi
-
- log "user_data: $MOUNT $ROOT_RWMOUNTPARAMS $ROOT_RWMOUNT"
- # Mount read-write file system into initram root file system
- if ! $MOUNT $ROOT_RWMOUNTPARAMS $ROOT_RWMOUNT ; then
- fatal "Could not mount read-write rootfs"
- fi
-
- # Reset read-write file system if specified
- log "ROOT_RWRESET=$ROOT_RWRESET ROOT_RWMOUNT=$ROOT_RWMOUNT"
- if [ "yes" == "$ROOT_RWRESET" -a -n "${ROOT_RWMOUNT}" ]; then # JAK
- log "Removing user_data files"
- rm -rf $ROOT_RWMOUNT/*
- log "Completed removal of user_data files"
- fi
-
- # Determine which unification file system to use
- union_fs_type=""
- if grep -w "overlay" /proc/filesystems >/dev/null; then
- union_fs_type="overlay"
- elif grep -w "aufs" /proc/filesystems >/dev/null; then
- union_fs_type="aufs"
- else
- union_fs_type=""
- fi
-
- # Create/Mount overlay root file system
- case $union_fs_type in
- "overlay")
- mkdir -p $ROOT_RWMOUNT/upperdir $ROOT_RWMOUNT/work
- if ! $MOUNT -t overlay overlay \
- -o "$(printf "%s%s%s" \
- "lowerdir=$ROOT_ROMOUNT," \
- "upperdir=$ROOT_RWMOUNT/upperdir," \
- "workdir=$ROOT_RWMOUNT/work")" \
- $ROOT_MOUNT ; then
- log "$MOUNT -t overlay overlay \
- -o \"$(printf \"%s%s%s\" \
- \"lowerdir=$ROOT_ROMOUNT,\" \
- \"upperdir=$ROOT_RWMOUNT/upperdir,\" \
- \"workdir=$ROOT_RWMOUNT/work\")\" \
- $ROOT_MOUNT"
- fatal "Cound not mount overlay"
- fi
- ;;
- "aufs")
- $MOUNT -t aufs i\
- -o "dirs=$ROOT_RWMOUNT=rw:$ROOT_ROMOUNT=ro" \
- aufs $ROOT_MOUNT
- ;;
- "")
- fatal "No overlay filesystem type available"
- ;;
- esac
-
- # Move read-only and read-write root file system into the overlay
- # file system
- mkdir -p $ROOT_MOUNT/$ROOT_ROMOUNT $ROOT_MOUNT/$ROOT_RWMOUNT
-
- $MOUNT -n --move $ROOT_ROMOUNT ${ROOT_MOUNT}/$ROOT_ROMOUNT
- $MOUNT -n --move $ROOT_RWMOUNT ${ROOT_MOUNT}/$ROOT_RWMOUNT
-
-
- # Create persistent storage directory and bind-mount it as /var/persistent.
- # The directory name starts with "." so "rm -rf" will skip it on read-write file system reset.
- mkdir -p ${ROOT_MOUNT}/$ROOT_RWMOUNT/.persistent
- mkdir -p ${ROOT_MOUNT}/var/persistent
- $MOUNT -n --bind ${ROOT_MOUNT}/$ROOT_RWMOUNT/.persistent ${ROOT_MOUNT}/var/persistent
-
- if ((DO_STOP)) ; then
- fatal "Initramfs Shell mode selected -- bash shell"
- fi
-
- $MOUNT -n --move /proc ${ROOT_MOUNT}/proc
- $MOUNT -n --move /sys ${ROOT_MOUNT}/sys
- $MOUNT -n --move /dev ${ROOT_MOUNT}/dev
-
- CONSOLE="${ROOT_MOUNT}/dev/kmsg"
- log "Mounted filesystems:"
- log "$(cat ${ROOT_MOUNT}/proc/mounts)"
- cd $ROOT_MOUNT
-
- # switch to actual init in the overlay root file system
- exec switch_root $ROOT_MOUNT $INIT ||
- fatal "Couldn't chroot, dropping to shell"
-}
-
-mount_and_boot
diff --git a/recipes-core/initrdscripts/initramfs-readonly-rootfs-overlay_1.0.bb b/recipes-core/initrdscripts/initramfs-readonly-rootfs-overlay_1.0.bb
deleted file mode 100644
index 164d394..0000000
--- a/recipes-core/initrdscripts/initramfs-readonly-rootfs-overlay_1.0.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require readonly-rootfs-overlay-init-script.inc
-
-do_install_append() {
- install -d ${D}/dev
- mknod -m 622 ${D}/dev/console c 5 1
-}
-
-FILES_${PN} += "/dev"
diff --git a/recipes-core/initrdscripts/initscripts-readonly-rootfs-overlay_1.0.bb b/recipes-core/initrdscripts/initscripts-readonly-rootfs-overlay_1.0.bb
deleted file mode 100644
index 9428356..0000000
--- a/recipes-core/initrdscripts/initscripts-readonly-rootfs-overlay_1.0.bb
+++ /dev/null
@@ -1 +0,0 @@
-require readonly-rootfs-overlay-init-script.inc
diff --git a/recipes-core/initrdscripts/readonly-rootfs-overlay-init-script.inc b/recipes-core/initrdscripts/readonly-rootfs-overlay-init-script.inc
deleted file mode 100644
index d1b8104..0000000
--- a/recipes-core/initrdscripts/readonly-rootfs-overlay-init-script.inc
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "Read only rootfs with overlay init script"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-DEPENDS = "virtual/kernel"
-
-# This was derived from https://github.com/cmhe/meta-readonly-rootfs-overlay
-
-# script uses bash, findfs, busybox is problematic, so use real fsck,
-# and add ext4 utilities in case some one needs to try to recover the
-# user_data file system
-RDEPENDS_${PN} = " \
- bash \
- util-linux-findfs \
- util-linux-fsck \
- e2fsprogs \
- e2fsprogs-mke2fs \
- e2fsprogs-badblocks \
- e2fsprogs-e2fsck \
- e2fsprogs-tune2fs \
- e2fsprogs-resize2fs \
- "
-
-SRC_URI = "file://init-readonly-rootfs-overlay-boot.sh"
-
-S = "${WORKDIR}"
-
-do_install() {
- install -m 0755 ${WORKDIR}/init-readonly-rootfs-overlay-boot.sh ${D}/init
- install -d "${D}/run/media/rfs/ro"
- install -d "${D}/run/media/rfs/rw"
-}
-
-FILES_${PN} += " /init /run"
-
-# Due to kernel dependency
-PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/recipes-core/startpar/startpar_0.64.bb b/recipes-core/startpar/startpar_0.64.bb
deleted file mode 100644
index 608fe20..0000000
--- a/recipes-core/startpar/startpar_0.64.bb
+++ /dev/null
@@ -1,25 +0,0 @@
-SUMMARY = "run processes in parallel and multiplex their output"
-DESCRIPTION = "startpar is used to run multiple run-level scripts in parallel."
-HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit"
-SECTION = "base"
-LICENSE = "GPLv2+"
-LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-PR = "r0"
-
-RDEPENDS_${PN} = "sysvinit-inittab"
-
-SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/startpar-${PV}.tar.xz"
-
-# TODO - need to add dependency files
-
-SRC_URI[md5sum] = "0fe57dcef653d87650133d6d25a90f97"
-SRC_URI[sha256sum] = "482a6869a5a5413d305f3073a0d831cca14bf7634554194419ca7015d5dd5731"
-
-S = "${WORKDIR}/${PN}"
-
-FILES_${PN} = "${base_sbindir}/startpar"
-
-do_install_append () {
- install -d ${D}${base_sbindir}
- install -m 755 ${S}/startpar ${D}${base_sbindir}/
-}