diff --git a/config/armbian/default b/config/armbian/default index 80ea95e19..f8efce374 100644 --- a/config/armbian/default +++ b/config/armbian/default @@ -23,7 +23,7 @@ BASE_IMAGE_RESIZEROOT=600 # Compress not needed due compression done in workflow BASE_RELEASE_COMPRESS=no # Modules are valid for 32bit and 64bit images -MODULES="base,pkgupgrade,armbian(armbian_net,opiconfig,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar)" +MODULES="base,armbian_pkgupgrade,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar)" # export Variables export DOWNLOAD_BASE_URL diff --git a/config/orangepi/default b/config/orangepi/default new file mode 100644 index 000000000..96a23ebbb --- /dev/null +++ b/config/orangepi/default @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Shebang for better file detection + +# Declare Variables before exporting. +# See https://www.shellcheck.net/wiki/SC2155 + +# Download Base Url +DOWNLOAD_BASE_URL="https://github.com/mainsail-crew/armbian-builds/releases/latest/download" + +# Base User +BASE_ADD_USER="yes" +BASE_USER="pi" +BASE_USER_PASSWORD="armbian" + +# Needed while building for non rpi sbc +BASE_DISTRO="armbian" +BASE_IMAGE_RASPBIAN="no" + +# partition resizing +BASE_ROOT_PARTITION="2" +BASE_IMAGE_ENLARGEROOT=2500 +BASE_IMAGE_RESIZEROOT=600 +# Compress not needed due compression done in workflow +BASE_RELEASE_COMPRESS=no +# Modules are valid for 32bit and 64bit images +MODULES="base,pkgupgrade,orangepi(orangepi_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar)" + +# export Variables +export DOWNLOAD_BASE_URL +export BASE_ADD_USER +export BASE_USER +export BASE_USER_PASSWORD +export BASE_DISTRO +export BASE_IMAGE_RASPBIAN +export BASE_ROOT_PARTITION +export BASE_IMAGE_ENLARGEROOT +export BASE_IMAGE_RESIZEROOT +export BASE_RELEASE_COMPRESS +export MODULES diff --git a/config/orangepi/orangepi_zero2 b/config/orangepi/orangepi_zero2 new file mode 100644 index 000000000..1ad1c1d18 --- /dev/null +++ b/config/orangepi/orangepi_zero2 @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Shebang for better file detection +# shellcheck enable=require-variable-braces + +BASE_ARCH="arm64" + +# Image source +DOWNLOAD_URL_CHECKSUM="${DOWNLOAD_BASE_URL}/orangepi-orangepi_zero2.img.xz.sha256" +DOWNLOAD_URL_IMAGE="${DOWNLOAD_BASE_URL}/orangepi-orangepi_zero2.img.xz" + +# export Variables +export BASE_ARCH +export DOWNLOAD_URL_CHECKSUM +export DOWNLOAD_URL_IMAGE diff --git a/src/modules/armbian/config b/src/modules/armbian/config index c74f954ca..c36fa8a01 100644 --- a/src/modules/armbian/config +++ b/src/modules/armbian/config @@ -1,5 +1,18 @@ -#!/bin/bash +#!/usr/bin/env bash +# Shebang for better file detection +#### MainsailOS Specific Tweaks for armbian images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + # shellcheck disable=all -[ -n "$ARMBIAN_DEPS" ] || ARMBIAN_DEPS="armbian-config avahi-daemon iptables \ +[[ -n "$ARMBIAN_DEPS" ]] || ARMBIAN_DEPS="armbian-config avahi-daemon iptables \ bash-completion" +[[ -n "$ARMBIAN_CONFIG_TXT_FILE" ]] || ARMBIAN_CONFIG_TXT_FILE="/boot/armbianEnv.txt" +[[ -n "$ARMBIAN_CONFIG_BAK_FILE" ]] || ARMBIAN_CONFIG_BAK_FILE="/boot/armbianEnv.txt.backup" +[[ -n "$ARMBIAN_MODULES_FILE" ]] || ARMBIAN_MODULES_FILE="/etc/modules" diff --git a/src/modules/armbian/end_chroot_script b/src/modules/armbian/end_chroot_script index 04d93f693..21a50cc6f 100644 --- a/src/modules/armbian/end_chroot_script +++ b/src/modules/armbian/end_chroot_script @@ -1,31 +1,49 @@ #!/usr/bin/env bash -# MainsailOS Specific Tweaks for armbian images -# written by Stephan Wendel aka KwadFan -# -# GPL V3 -######## +#### MainsailOS Specific Tweaks for armbian images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### -## functions +# shellcheck enable=require-variable-braces +# Source error handling, leave this in place +set -Ee + +# Source CustomPIOS common.sh +# shellcheck disable=SC1091 +source /common.sh +install_cleanup_trap + +## Helper functions gen_root_pw() { tr -dc "[:alnum:]" < /dev/urandom | head -c 50 } -# Clean up -# Remove autologin and lock root account -if [ -f "/etc/systemd/system/getty@.service.d/override.conf" ]; then +## Clean up +## Step 1: Remove autologin and lock root account +if [[ -f "/etc/systemd/system/getty@.service.d/override.conf" ]]; then rm -f /etc/systemd/system/getty@.service.d/override.conf fi +## END -# Disable autologin on serial console -if [ -f "/etc/systemd/system/serial-getty@.service.d/override.conf" ]; then +## Step 2: Disable autologin on serial console +if [[ -f "/etc/systemd/system/serial-getty@.service.d/override.conf" ]]; then sed -i 's/--autologin root //' /etc/systemd/system/serial-getty@.service.d/override.conf fi +## END -# Generate random root passwd -yes "$(gen_root_pw)" | passwd root +## Step 3: Delete root passwd +### Deleting root passwd doesn't let you unlock the account +sudo passwd -d root +## END -# lock root account -sudo -u "${BASE_USER}" passwd -l root +## Step 4: Lock root account +sudo passwd -l root +## END -# Remove passwdless sudo +## Step 5: Remove passwdless sudo sed -i '/'"${BASE_USER}"' ALL=(ALL:ALL) NOPASSWD:ALL/d' /etc/sudoers +## END diff --git a/src/modules/armbian/filesystem/root/etc/udev/rules.d/97-gpio.rules b/src/modules/armbian/filesystem/root/etc/udev/rules.d/97-gpio.rules new file mode 100644 index 000000000..a1adb0b51 --- /dev/null +++ b/src/modules/armbian/filesystem/root/etc/udev/rules.d/97-gpio.rules @@ -0,0 +1 @@ +SUBSYSTEM=="gpio", KERNEL=="gpiochip[0-4]", GROUP="gpio", MODE="0660" diff --git a/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos b/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos index 5c976f3c0..127314f74 100755 --- a/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos +++ b/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos @@ -23,7 +23,6 @@ if [[ -f /etc/armbian-distribution-status ]]; then [[ -f /etc/lsb-release ]] && DISTRIBUTION_CODENAME=$(grep CODENAME /etc/lsb-release | cut -d"=" -f2) [[ -z "${DISTRIBUTION_CODENAME}" && -f /etc/os-release ]] && DISTRIBUTION_CODENAME=$(grep VERSION_CODENAME /etc/os-release | cut -d"=" -f2) [[ -z "${DISTRIBUTION_CODENAME}" && -x /usr/bin/lsb_release ]] && DISTRIBUTION_CODENAME=$(/usr/bin/lsb_release -c | cut -d":" -f2 | tr -d "\t") - DISTRIBUTION_STATUS=$(grep "${DISTRIBUTION_CODENAME}" /etc/armbian-distribution-status | cut -d"=" -f2) fi [[ -f /etc/default/armbian-motd ]] && . /etc/default/armbian-motd @@ -44,23 +43,3 @@ echo -e "Version $(cut -d ' ' -f3 /etc/mainsailos-release), based on \ \e[34mArmbian ${VERSION} ${DISTRIBUTION_CODENAME^}\e[0m $([[ ${BRANCH} == edge ]])" echo -e "Running on \e[34m$(echo "${BOARD_NAME}" | sed 's/Orange Pi/OPi/' | \ sed 's/NanoPi/NPi/' | sed 's/Banana Pi/BPi/')\e[0m with \e[34mLinux ${KERNELID}\e[0m\n" - -# displaying status warnings - -if [[ "${IMAGE_TYPE}" != "stable" ]]; then - [[ "${IMAGE_TYPE}" == "user-built" ]] && UNSUPPORTED_TEXT="built from trunk" - [[ "${IMAGE_TYPE}" == "nightly" ]] && UNSUPPORTED_TEXT="untested automated build" -else - [[ "${BOARD_TYPE}" == "csc" || "${BOARD_TYPE}" == "tvb" ]] && UNSUPPORTED_TEXT="community creations" - [[ "${BOARD_TYPE}" == "wip" ]] && UNSUPPORTED_TEXT="work in progress" - [[ "${BOARD_TYPE}" == "eos" ]] && UNSUPPORTED_TEXT="end of life" -fi - -if [[ -n ${DISTRIBUTION_STATUS} && ${DISTRIBUTION_STATUS} != supported ]]; then - [[ -n ${UNSUPPORTED_TEXT} ]] && UNSUPPORTED_TEXT+=" & " - UNSUPPORTED_TEXT+="unsupported (${DISTRIBUTION_CODENAME}) userspace!" -fi - -if [[ -n ${UNSUPPORTED_TEXT} ]]; then - echo -e "\e[0;91mNo end-user support: \x1B[0m${UNSUPPORTED_TEXT}\n" -fi diff --git a/src/modules/armbian/start_chroot_script b/src/modules/armbian/start_chroot_script index 0a2aa965b..fa4744f51 100644 --- a/src/modules/armbian/start_chroot_script +++ b/src/modules/armbian/start_chroot_script @@ -1,26 +1,32 @@ #!/usr/bin/env bash -# MainsailOS Specific Tweaks for armbian images -# written by Stephan Wendel aka KwadFan -# -# GPL V3 -######## +#### MainsailOS Specific Tweaks for armbian images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### +# shellcheck enable=require-variable-braces # Source error handling, leave this in place -set -xe +set -Ee # Source CustomPIOS common.sh # shellcheck disable=SC1091 source /common.sh install_cleanup_trap -# Install armbian specific packages -apt update -# shellcheck disable=SC2086 -check_install_pkgs ${ARMBIAN_DEPS} - -# passwordless sudo during install -# Will be removed in cleanup -echo "${BASE_USER} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers +### Helper func +is_board_type() { + local board releasefile + board="" + releasefile="/etc/armbian-release-info.txt" + if [[ -f "${releasefile}" ]]; then + board="$(grep "BOARD=" "${releasefile}" | cut -d'=' -f2)" + fi + echo "${board}" +} # Base User groups # Shameless "stolen" from @@ -33,26 +39,93 @@ if_group_exists_run() { fi } -# set groups +# passwordless sudo during install +# Will be removed in cleanup +echo "${BASE_USER} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers + +## Step 1: Install armbian specific packages +apt update +# shellcheck disable=SC2086 +check_install_pkgs ${ARMBIAN_DEPS} + + + +## Step 1: Manage groups +### Substep 1: Create group for gpio usage +sudo groupadd gpio +### END Substep 1 + +### Substep 2: Set default groups if_group_exists_run i2c usermod -aG i2c "${BASE_USER}" -usermod -aG video,audio,plugdev,games,netdev,sudo "${BASE_USER}" +usermod -aG video,audio,plugdev,games,netdev,sudo,systemd-journal,gpio "${BASE_USER}" +### END Substep 2 -# Patch sshd_config +## Step 2: patch sshd_config sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config sed -i 's/^X11Forwarding/#X11Forwarding/' /etc/ssh/sshd_config sed -i 's/^#MaxAuthTries 6/MaxAuthTries 3/' /etc/ssh/sshd_config +## END -# Try patching first login in build stage -if [ -f "/root/.not_logged_in_yet" ]; then +## Step 4: Try patching first login in build stage +if [[ -f "/root/.not_logged_in_yet" ]]; then rm -f /root/.not_logged_in_yet fi +## END -# Move armbian-release to display mainsailos-release -mv /etc/armbian-release /etc/armbian-release-info.txt +## Step 5: Move armbian-release to display mainsailos-release +### Substep 1: Move armbian-release + if [[ -f "/etc/armbian-release" ]]; then + echo_green "Armbian release file found! moving to: 'armbian-release-info.txt'" + mv /etc/armbian-release /etc/armbian-release-info.txt + else + echo_red "Armbian release file not found! [SKIPPED]" + fi +### END Substep 1 +### Substep 2: patch Armbian scripts to new file location + echo_green "Patching armbian scripts (release file path) ..." + pushd "/usr/lib/armbian" &> /dev/null || exit 1 + files=() + while IFS='' read -r line; do + files+=("${line}") + done < <(grep -R "/etc/armbian-release" -- * | cut -d":" -f1) + for f in "${files[@]}"; do + sed -i "s|/etc/armbian-release|/etc/armbian-release-info.txt|g" "${f}" + done + popd &> /dev/null || exit 1 +## END -# update motd +## Step 6: Patch dynamic motd +echo_green "Patch dynamic motd ..." unpack /filesystem/root / chmod +x /etc/update-motd.d/* -if [ -f "/etc/default/armbian-motd" ]; then +if [[ -f "/etc/default/armbian-motd" ]]; then sed -i 's/MOTD_DISABLE=""/MOTD_DISABLE="header"/' /etc/default/armbian-motd fi +## END + +## Step 7: Enable SPI interface by default +echo_green "Enable SPI interface on Orange Pi SBC's ..." + +### Substep 1: Copy default config to backup file +cp "${ARMBIAN_CONFIG_TXT_FILE}" "${ARMBIAN_CONFIG_BAK_FILE}" +### END Substep 1 + +### Substep 2: Enable SPI in armbianEnv.txt depending on device +#### OrangePi 3 LTS +if [[ "$(is_board_type)" == "orangepi3-lts" ]]; then + echo "overlays=spi-spidev1" >> "${ARMBIAN_CONFIG_TXT_FILE}" +fi + +#### OrangePi 4 LTS +if [[ "$(is_board_type)" == "orangepi4-lts" ]]; then + echo "overlays=spi-spidev" >> "${ARMBIAN_CONFIG_TXT_FILE}" + echo "param_spidev_spi_bus=1" >> "${ARMBIAN_CONFIG_TXT_FILE}" +fi +### END Substep 2: + +### Substep 3: add spi-dev module to /etc/modules +echo "spi-dev" >> "${ARMBIAN_MODULES_FILE}" +### END Substep 3 + +echo_green "Enable SPI interface on Orange Pi SBC's ... DONE!" +## END diff --git a/src/modules/armbian_net/config b/src/modules/armbian_net/config index 6a0ab8317..d9a9ffa1e 100644 --- a/src/modules/armbian_net/config +++ b/src/modules/armbian_net/config @@ -1,6 +1,6 @@ #!/usr/bin/env bash -#Shebang for better file detection -#### mainsail module +# Shebang for better file detection +#### MainsailOS network configurator for armbian images #### #### Written by Stephan Wendel aka KwadFan #### Copyright 2023 - till today @@ -11,6 +11,6 @@ # shellcheck disable=all -[ -n "$ARMBIAN_NET_FIRSTRUN_FILE" ] || ARMBIAN_NET_FIRSTRUN_FILE="/boot/armbian_first_run.txt.template" -[ -n "$ARMBIAN_NET_FIRSTRUN_SCRIPT" ] || ARMBIAN_NET_FIRSTRUN_SCRIPT="/usr/lib/armbian/armbian-firstrun-config" -[ -n "$ARMBIAN_NET_NC_PATH" ] || ARMBIAN_NET_NC_PATH="/usr/local/bin/network-configurator" +[[ -n "$ARMBIAN_NET_FIRSTRUN_FILE" ]] || ARMBIAN_NET_FIRSTRUN_FILE="/boot/armbian_first_run.txt.template" +[[ -n "$ARMBIAN_NET_FIRSTRUN_SCRIPT" ]] || ARMBIAN_NET_FIRSTRUN_SCRIPT="/usr/lib/armbian/armbian-firstrun-config" +[[ -n "$ARMBIAN_NET_NC_PATH" ]] || ARMBIAN_NET_NC_PATH="/usr/local/bin/network-configurator" diff --git a/src/modules/armbian_net/start_chroot_script b/src/modules/armbian_net/start_chroot_script index 7797d17b7..997425bd5 100644 --- a/src/modules/armbian_net/start_chroot_script +++ b/src/modules/armbian_net/start_chroot_script @@ -1,9 +1,12 @@ #!/usr/bin/env bash -# MainsailOS network configurator for armbian images -# written by Stephan Wendel aka KwadFan -# -# GPL V3 -######## +#### MainsailOS network configurator for armbian images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### # shellcheck enable=require-variable-braces @@ -23,19 +26,23 @@ install_cleanup_trap ## Step 1: Install files unpack filesystem/root / root +## END ## Step 2: remove original template if [[ -f "${ARMBIAN_NET_FIRSTRUN_FILE}" ]]; then sudo rm -rf "${ARMBIAN_NET_FIRSTRUN_FILE}" fi +## END ## Step 3: Disable first run service systemctl_if_exists disable armbian-firstrun-config.service +## END ## Step 4: Copy original script to /usr/local/bin/network-configurator if [[ -f "${ARMBIAN_NET_FIRSTRUN_SCRIPT}" ]]; then sudo cp -p "${ARMBIAN_NET_FIRSTRUN_SCRIPT}" "${ARMBIAN_NET_NC_PATH}" fi +## END ## Step 5: patch /usr/local/bin/network-configurator if [[ -f "${ARMBIAN_NET_NC_PATH}" ]]; then @@ -50,6 +57,8 @@ if [[ -f "${ARMBIAN_NET_NC_PATH}" ]]; then sed -i '10 i # Original located at /usr/lib/armbian/armbian-firstrun-config' "${ARMBIAN_NET_NC_PATH}" sed -i '11 i # Changes made by https:\/\/github.com/mainsail-crew' "${ARMBIAN_NET_NC_PATH}" fi +## END ## Step 6: Enable systemd service systemctl_if_exists enable network-configurator.service +## END diff --git a/src/modules/armbian_pkgupgrade/start_chroot_script b/src/modules/armbian_pkgupgrade/start_chroot_script new file mode 100644 index 000000000..7090d0e5d --- /dev/null +++ b/src/modules/armbian_pkgupgrade/start_chroot_script @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +#### MainsailOS Specific procedure for armbian images to replace 'pkgupgrade' module +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + +#### Description: +#### Due missing packages in our armbian builds and +#### and buggy behaviour of kernel upgrades we have to skip +#### upgrading the kernel package during build time. +#### Kernel upgrade is possible after first boot. + +# shellcheck enable=require-variable-braces +# Source error handling, leave this in place +set -Ee + +# Source CustomPIOS common.sh +# shellcheck disable=SC1091 +source /common.sh +install_cleanup_trap + +### Helper func +is_board_type() { + local board releasefile + board="" + releasefile="/etc/armbian-release" + if [[ -f "${releasefile}" ]]; then + board="$(grep "BOARD=" "${releasefile}" | cut -d'=' -f2)" + fi + echo "${board}" +} + + +## Install some basic packages that are needed during build +## Package net-tools fixes module 'armbian_net' +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND +apt-get update --allow-releaseinfo-change +apt-get install --yes --assume-yes sudo apt-utils wget net-tools + +## Set kernel package on hold +### Orange Pi 3 LTS +if [[ "$(is_board_type)" == "orangepi3-lts" ]]; then + echo "armbian-firmware hold" | dpkg --set-selections + echo "linux-image-current-sunxi64 hold" | dpkg --set-selections + echo "linux-dtb-current-sunxi64 hold" | dpkg --set-selections +fi + +### Orange Pi 4 LTS +if [[ "$(is_board_type)" == "orangepi4-lts" ]]; then + echo "armbian-firmware hold" | dpkg --set-selections + echo "linux-image-current-rockchip64 hold" | dpkg --set-selections + echo "linux-dtb-current-rockchip64 hold" | dpkg --set-selections +fi + +## Run full upgrade +apt-get upgrade --yes --assume-yes + +## Revert hold status +### Orange Pi 3 LTS +if [[ "$(is_board_type)" == "orangepi3-lts" ]]; then + echo "armbian-firmware install" | dpkg --set-selections + echo "linux-image-current-sunxi64 install" | dpkg --set-selections + echo "linux-dtb-current-sunxi64 install" | dpkg --set-selections +fi + +### Orange Pi 4 LTS +if [[ "$(is_board_type)" == "orangepi4-lts" ]]; then + echo "armbian-firmware install" | dpkg --set-selections + echo "linux-image-current-rockchip64 install" | dpkg --set-selections + echo "linux-dtb-current-rockchip64 install" | dpkg --set-selections +fi + +unset DEBIAN_FRONTEND diff --git a/src/modules/opiconfig/config b/src/modules/opiconfig/config deleted file mode 100644 index 9c564b3ed..000000000 --- a/src/modules/opiconfig/config +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -#### opiconfig - OrangePi Configuration Module -#### -#### Written by Stephan Wendel aka KwadFan -#### Copyright 2021 -#### https://github.com/mainsail-crew/MainsailOS -#### -#### This File is distributed under GPLv3 -#### - -# Shebang for better file detection -# shellcheck disable=all - -[ -n "$OPICONFIG_CONFIG_TXT_FILE" ] || OPICONFIG_CONFIG_TXT_FILE="/boot/armbianEnv.txt" -[ -n "$OPICONFIG_CONFIG_BAK_FILE" ] || OPICONFIG_CONFIG_BAK_FILE="/boot/armbianEnv.txt.backup" -[ -n "$OPICONFIG_MODULES_FILE" ] || OPICONFIG_MODULES_FILE="/etc/modules" diff --git a/src/modules/opiconfig/start_chroot_script b/src/modules/opiconfig/start_chroot_script deleted file mode 100644 index ae8bd0c56..000000000 --- a/src/modules/opiconfig/start_chroot_script +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -#### opiconfig - OrangePi Configuration Module -#### -#### Written by Stephan Wendel aka KwadFan -#### Copyright 2021 -#### https://github.com/mainsail-crew/MainsailOS -#### -#### This File is distributed under GPLv3 -#### - -#### NOTE: This module has to be used after armbian module!!! - -# shellcheck enable=require-variable-braces - -## Source error handling, leave this in place -set -Ee - -# Set DEBIAN_FRONTEND to noninteractive -if [[ "${DEBIAN_FRONTEND}" != "noninteractive" ]]; then - export DEBIAN_FRONTEND=noninteractive -fi - -## Source CustomPIOS common.sh -# shellcheck disable=SC1091 -source /common.sh -install_cleanup_trap - -### Helper func -is_board_type() { - local board releasefile - board="" - releasefile="/etc/armbian-release-info.txt" - if [[ -f "${releasefile}" ]]; then - board="$(grep "BOARD=" "${releasefile}" | cut -d'=' -f2)" - fi - echo "${board}" -} - - -echo_green "Enable SPI interface on Orange Pi SBC's ..." - -# Step 1: Copy default config to backup file -cp "${OPICONFIG_CONFIG_TXT_FILE}" "${OPICONFIG_CONFIG_BAK_FILE}" - -# Step 2: Enable SPI in armbianEnv.txt depending on device - -## OrangePi 3 LTS -if [[ "$(is_board_type)" == "orangepi3-lts" ]]; then - echo "overlays=spi-spidev1" >> "${OPICONFIG_CONFIG_TXT_FILE}" -fi - -## OrangePi 4 LTS -if [[ "$(is_board_type)" == "orangepi4-lts" ]]; then - echo "overlays=spi-spidev" >> "${OPICONFIG_CONFIG_TXT_FILE}" - echo "param_spidev_spi_bus=1" >> "${OPICONFIG_CONFIG_TXT_FILE}" -fi - -# Step 3: add spi-dev module to /etc/modules -echo "spi-dev" >> "${OPICONFIG_MODULES_FILE}" - -echo_green "Enable SPI interface on Orange Pi SBC's ... DONE!" diff --git a/src/modules/orangepi/config b/src/modules/orangepi/config new file mode 100644 index 000000000..6196ce5f7 --- /dev/null +++ b/src/modules/orangepi/config @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Shebang for better file detection +#### MainsailOS Specific Tweaks for orangepi images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + +# shellcheck disable=all + +## General module configuration +[[ -n "$ORANGEPI_DEPS" ]] || ORANGEPI_DEPS="avahi-daemon iptables unzip \ +bash-completion" +[[ -n "$ORANGEPI_CONFIG_TXT_FILE" ]] || ORANGEPI_CONFIG_TXT_FILE="/boot/orangepiEnv.txt" +[[ -n "$ORANGEPI_CONFIG_BAK_FILE" ]] || ORANGEPI_CONFIG_BAK_FILE="/boot/orangepiEnv.txt.backup" +[[ -n "$ORANGEPI_MODULES_FILE" ]] || ORANGEPI_MODULES_FILE="/etc/modules" + +## Orange Pi Zero 2 additional configuration +[[ -n "$ORANGEPI_ENABLE_OVERLAYS_OPIZ2" ]] || ORANGEPI_ENABLE_OVERLAYS_OPIZ2="true" +[[ -n "$ORANGEPI_ADD_OVERLAYS_OPIZ2" ]] || ORANGEPI_ADD_OVERLAYS_OPIZ2="i2c3 uart5 spi-spidev" +[[ -n "$ORANGEPI_ADD_OVERLAYS_OPIZ2_PARAMS" ]] || ORANGEPI_ADD_OVERLAYS_OPIZ2_PARAMS="param_spidev_spi_bus=1 param_spidev_spi_cs=1" + +### EXPERIMENTAL: Install orangepi-config from source git repo +[[ -n "$ORANGEPI_INSTALL_OPI_CONFIG" ]] || ORANGEPI_INSTALL_OPI_CONFIG="true" +[[ -n "$ORANGEPI_OPI_CONFIG_URL" ]] || ORANGEPI_OPI_CONFIG_URL="https://raw.githubusercontent.com/orangepi-xunlong/orangepi-build/next/external/cache/sources/orangepi-config/" +[[ -n "$ORANGEPI_OPI_CONFIG_FILES" ]] || ORANGEPI_OPI_CONFIG_FILES="debian-config debian-config-functions debian-config-functions-network debian-config-jobs debian-config-submenu" diff --git a/src/modules/orangepi/end_chroot_script b/src/modules/orangepi/end_chroot_script new file mode 100644 index 000000000..1a872a189 --- /dev/null +++ b/src/modules/orangepi/end_chroot_script @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +#### MainsailOS Specific Tweaks for orangepi images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + +# shellcheck enable=require-variable-braces +# Source error handling, leave this in place +set -Ee + +# Source CustomPIOS common.sh +# shellcheck disable=SC1091 +source /common.sh +install_cleanup_trap + +## Clean up +## Step 1: Remove autologin and lock root account +if [ -f "/etc/systemd/system/getty@.service.d/override.conf" ]; then + rm -f /etc/systemd/system/getty@.service.d/override.conf +fi +## END + +## Step 2: Disable autologin on serial console +if [ -f "/etc/systemd/system/serial-getty@.service.d/override.conf" ]; then + sed -i 's/--autologin root //' /etc/systemd/system/serial-getty@.service.d/override.conf +fi +## END + +## Step 3: Delete root passwd +### Deleting root passwd doesn't let you unlock the account +sudo passwd -d root +## END + +## Step 4: Lock root account +sudo passwd -l root +## END + +## Step 5: Remove passwdless sudo +sed -i '/'"${BASE_USER}"' ALL=(ALL:ALL) NOPASSWD:ALL/d' /etc/sudoers +## END diff --git a/src/modules/orangepi/filesystem/root/etc/udev/rules.d/97-gpio.rules b/src/modules/orangepi/filesystem/root/etc/udev/rules.d/97-gpio.rules new file mode 100644 index 000000000..a1adb0b51 --- /dev/null +++ b/src/modules/orangepi/filesystem/root/etc/udev/rules.d/97-gpio.rules @@ -0,0 +1 @@ +SUBSYSTEM=="gpio", KERNEL=="gpiochip[0-4]", GROUP="gpio", MODE="0660" diff --git a/src/modules/orangepi/filesystem/root/etc/update-motd.d/10-mainsailos b/src/modules/orangepi/filesystem/root/etc/update-motd.d/10-mainsailos new file mode 100755 index 000000000..a5f22022c --- /dev/null +++ b/src/modules/orangepi/filesystem/root/etc/update-motd.d/10-mainsailos @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +# +# Based on: +# https://github.com/armbian/build/blob/master/packages/bsp/common/etc/update-motd.d/10-armbian-header + +# Copyright (c) Authors: https://www.armbian.com/authors +# +# This file is licensed under the terms of the GNU General Public +# License version 2. This program is licensed "as is" without any +# warranty of any kind, whether express or implied. + +# Modified by Stephan Wendel aka KwadFan +# All changes made are public at +# https://github.com/mainsail-crew/MainsailOS + +# shellcheck enable=require-variable-braces + +# shellcheck disable=SC1091 +[[ -f /etc/orangepi-release-info.txt ]] && . /etc/orangepi-release-info.txt + +if [[ -f /etc/orangepi-distribution-status ]]; then + . /etc/orangepi-distribution-status + [[ -f /etc/lsb-release ]] && DISTRIBUTION_CODENAME=$(grep CODENAME /etc/lsb-release | cut -d"=" -f2) + [[ -z "${DISTRIBUTION_CODENAME}" && -f /etc/os-release ]] && DISTRIBUTION_CODENAME=$(grep VERSION_CODENAME /etc/os-release | cut -d"=" -f2) + [[ -z "${DISTRIBUTION_CODENAME}" && -x /usr/bin/lsb_release ]] && DISTRIBUTION_CODENAME=$(/usr/bin/lsb_release -c | cut -d":" -f2 | tr -d "\t") + DISTRIBUTION_STATUS=$(grep "${DISTRIBUTION_CODENAME}" /etc/orangepi-distribution-status | cut -d"=" -f2) +fi +[[ -f /etc/default/orangepi-motd ]] && . /etc/default/orangepi-motd + +for f in ${MOTD_DISABLE}; do + [[ "${f}" == "${THIS_SCRIPT}" ]] && exit 0 +done + + +KERNELID=$(uname -r) + +# Odroid N2 exception +ODROID_EXCEPTION="$(tr -d '\000' < /proc/device-tree/model | grep ODROID | grep Plus)" +[[ -f /proc/device-tree/model ]] && [[ -n "${ODROID_EXCEPTION}" ]] && BOARD_NAME+="+" + + +echo -e "\e[31m$(toilet -f big MainsailOS)\e[0m" +echo -e "Version $(cut -d ' ' -f3 /etc/mainsailos-release), based on \ +\e[34mOrange Pi OS ${VERSION} ${DISTRIBUTION_CODENAME^}\e[0m $([[ ${BRANCH} == edge ]])" +echo -e "Running on \e[34m$(echo "${BOARD_NAME}" | sed 's/Orange Pi/OPi/' | \ +sed 's/NanoPi/NPi/' | sed 's/Banana Pi/BPi/')\e[0m with \e[34mLinux ${KERNELID}\e[0m\n" + +# displaying status warnings + +if [[ "${IMAGE_TYPE}" != "stable" ]]; then + [[ "${IMAGE_TYPE}" == "user-built" ]] && UNSUPPORTED_TEXT="built from trunk" + [[ "${IMAGE_TYPE}" == "nightly" ]] && UNSUPPORTED_TEXT="untested automated build" +else + [[ "${BOARD_TYPE}" == "csc" || "${BOARD_TYPE}" == "tvb" ]] && UNSUPPORTED_TEXT="community creations" + [[ "${BOARD_TYPE}" == "wip" ]] && UNSUPPORTED_TEXT="work in progress" + [[ "${BOARD_TYPE}" == "eos" ]] && UNSUPPORTED_TEXT="end of life" +fi + +if [[ -n ${DISTRIBUTION_STATUS} && ${DISTRIBUTION_STATUS} != supported ]]; then + [[ -n ${UNSUPPORTED_TEXT} ]] && UNSUPPORTED_TEXT+=" & " + UNSUPPORTED_TEXT+="unsupported (${DISTRIBUTION_CODENAME}) userspace!" +fi + +if [[ -n ${UNSUPPORTED_TEXT} ]]; then + echo -e "\e[0;91mNo end-user support: \x1B[0m${UNSUPPORTED_TEXT}\n" +fi diff --git a/src/modules/orangepi/start_chroot_script b/src/modules/orangepi/start_chroot_script new file mode 100644 index 000000000..cb2596e55 --- /dev/null +++ b/src/modules/orangepi/start_chroot_script @@ -0,0 +1,194 @@ +#!/usr/bin/env bash +#### MainsailOS Specific Tweaks for orangepi images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + +#### NOTE: udev rules file is applied in Step 6! +#### This is based on https://github.com/Arksine/moonraker/issues/562 + + +# shellcheck enable=require-variable-braces +# Source error handling, leave this in place +set -Ee + +## Uncomment for deeper debugging +# set -x + +# Source CustomPIOS common.sh +# shellcheck disable=SC1091 +source /common.sh +install_cleanup_trap + +# Helper func +is_board_type() { + local board releasefile + board="" + releasefile="/etc/orangepi-release-info.txt" + if [[ -f "${releasefile}" ]]; then + board="$(grep "BOARD=" "${releasefile}" | cut -d'=' -f2)" + fi + echo "${board}" +} + +# Base User groups +# Shameless "stolen" from +# https://github.com/guysoft/CustomPiOS/blob/devel/src/variants/armbian/pre_chroot_script + +if_group_exists_run() { + group=$1 + if grep -q "${group}" /etc/group; then + "${@:2}" + fi +} + +# passwordless sudo during install +# Will be removed in cleanup +echo "${BASE_USER} ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers + +## Step 1: Install armbian specific packages +apt update +# shellcheck disable=SC2086 +check_install_pkgs ${ORANGEPI_DEPS} +## END Step 1 + +## Step 2: Manage groups and default user + +### Substep 1: Create group for gpio usage +sudo groupadd gpio +### END Substep 1 + +### Substep 2: Set default groups +if_group_exists_run i2c usermod -aG i2c "${BASE_USER}" +usermod -aG video,audio,plugdev,games,netdev,sudo,systemd-journal,gpio "${BASE_USER}" +### END Substep 2 + +### Substep 3: Remove user "orangepi" +sudo userdel orangepi +sudo rm -rf /home/orangepi +### END Substep 3 +## END Step 2 + +## Step 3: Patch sshd_config (Limit retrys, disable root login via ssh) +sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config +sed -i 's/^X11Forwarding/#X11Forwarding/' /etc/ssh/sshd_config +sed -i 's/^#MaxAuthTries 6/MaxAuthTries 3/' /etc/ssh/sshd_config +## END Step 3 + +## Step 4: Try patching first login in build stage +if [ -f "/root/.not_logged_in_yet" ]; then + rm -f /root/.not_logged_in_yet +fi +## END Step 4 + +## Step 5: Move armbian-release to display mainsailos-release +if [[ -f "/etc/orangepi-release" ]]; then + echo_green "OrangePi release file found! moving to: 'orangepi-release-info.txt'" + mv /etc/orangepi-release /etc/orangepi-release-info.txt +else + echo_red "OrangePi release file not found! [SKIPPED]" +fi +## END Step 5 + +## Step 6: Patch dynamic motd +echo_green "Patch dynamic motd ..." +unpack /filesystem/root / +chmod +x /etc/update-motd.d/* +if [ -f "/etc/default/orangepi-motd" ]; then + sed -i 's/^MOTD_DISABLE=""/MOTD_DISABLE="header tips"/' /etc/default/orangepi-motd +fi +## END Step 6 + +## Step 7: Enable SPI interface by default +echo_green "Enable interfaces on Orange Pi SBC's ..." + +### Substep 1: Copy default config to backup file +cp "${ORANGEPI_CONFIG_TXT_FILE}" "${ORANGEPI_CONFIG_BAK_FILE}" +### END Substep 1 + +### Substep 2: Enable SPI in armbianEnv.txt depending on device + +#### Orangepi Zero2 +if [[ "$(is_board_type)" == "orangepizero2" ]] && +[[ "${ORANGEPI_ENABLE_OVERLAYS_OPIZ2}" == "true" ]]; then + + if [[ -n "${ORANGEPI_ADD_OVERLAYS_OPIZ2}" ]]; then + echo_green "Adding overlays '${ORANGEPI_ADD_OVERLAYS_OPIZ2}' to ${ORANGEPI_CONFIG_TXT_FILE} ..." + echo "overlays=${ORANGEPI_ADD_OVERLAYS_OPIZ2}" >> "${ORANGEPI_CONFIG_TXT_FILE}" + fi + + if [[ -n "${ORANGEPI_ADD_OVERLAYS_OPIZ2_PARAMS}" ]]; then + for param in ${ORANGEPI_ADD_OVERLAYS_OPIZ2_PARAMS}; do + echo_green "Add ${param} to ${ORANGEPI_CONFIG_TXT_FILE} ..." + echo "${param}" >> "${ORANGEPI_CONFIG_TXT_FILE}" + done + fi +fi +#### END + +### END Substep 2 + +# Substep 3: add spi-dev module to /etc/modules +echo "spi-dev" >> "${ORANGEPI_MODULES_FILE}" + +echo_green "Enable SPI interface on Orange Pi SBC's ... DONE!" +## END Step 7 + +## Step 8: Install orangepi-config from git source repository +if [[ "${ORANGEPI_INSTALL_OPI_CONFIG}" == "true" ]]; then + echo_green "Install orangepi-config from git sources ..." + + ### Substep 1: Create temporary dir 'src/workspace/opi-config-src' + ORANGEPI_OPI_CONFIG_TEMP="src/workspace/opi-config-src" + if [[ ! -d "${ORANGEPI_OPI_CONFIG_TEMP}" ]]; then + mkdir -p "${ORANGEPI_OPI_CONFIG_TEMP}" + fi + ### END Substep 1 + + ### Substep 2: Create array from ORANGEPI_OPI_CONFIG_FILES + for name in ${ORANGEPI_OPI_CONFIG_FILES}; do + ORANGEPI_OPI_CONFIG_FILES_ARR+=("${name}") + done + ### END Substep 2 + + ### Substep 3: curl sources from git repo to src/workspace/opi-config + for file in "${ORANGEPI_OPI_CONFIG_FILES_ARR[@]}"; do + curl -sL "${ORANGEPI_OPI_CONFIG_URL}"/"${file}" --output "${ORANGEPI_OPI_CONFIG_TEMP}"/"${file}" + done + ### END Substep 3 + + ### Substep 4: Create subdir 'orangepi-config' in /usr/lib/ + if [[ ! -d "/usr/lib/orangepi-config" ]]; then + mkdir -p "/usr/lib/orangepi-config" + fi + ### END Substep 4 + + ### Substep 5: Copy main script to /usr/sbin (orangepi-config) + cp -f "src/workspace/opi-config-src/${ORANGEPI_OPI_CONFIG_FILES_ARR[*]:0:1}" "/usr/sbin/orangepi-config" + ### END Substep 5 + + ### Substep 6: Add executable flag + if [[ ! -x "/usr/sbin/orangepi-config" ]]; then + chmod +x "/usr/sbin/orangepi-config" + fi + ### END Substep 6 + + ### Substep 7: Link main script to /usr/bin/orangepi-config + ln -sf "/usr/sbin/orangepi-config" "/usr/bin/orangepi-config" + ### END Substep 7 + + ### Substep 7: Install script librarys to /usr/lib/orangepi-config + for i in "${ORANGEPI_OPI_CONFIG_FILES_ARR[@]:1}"; do + stripped="${i##debian-config-}" + cp -f "${ORANGEPI_OPI_CONFIG_TEMP}/${i}" "/usr/lib/orangepi-config/${stripped}.sh" + done + ### END Substep 7 + +else + echo_red "WARN: orangepi-config install not configured ... [SKIPPED]" +fi +## END Step 8 diff --git a/src/modules/orangepi_net/config b/src/modules/orangepi_net/config new file mode 100644 index 000000000..3bd31bb1f --- /dev/null +++ b/src/modules/orangepi_net/config @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Shebang for better file detection +#### MainsailOS network configurator for orange images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + +# shellcheck disable=all + +[[ -n "$ORANGEPI_NET_FIRSTRUN_FILE" ]] || ORANGEPI_NET_FIRSTRUN_FILE="/boot/orangepi_first_run.txt.template" +[[ -n "$ORANGEPI_NET_FIRSTRUN_SCRIPT" ]] || ORANGEPI_NET_FIRSTRUN_SCRIPT="/usr/lib/orangepi/orangepi-firstrun-config" +[[ -n "$ORANGEPI_NET_NC_PATH" ]] || ORANGEPI_NET_NC_PATH="/usr/local/bin/network-configurator" diff --git a/src/modules/orangepi_net/filesystem/root/boot/network_config.txt.template b/src/modules/orangepi_net/filesystem/root/boot/network_config.txt.template new file mode 100644 index 000000000..f3173c054 --- /dev/null +++ b/src/modules/orangepi_net/filesystem/root/boot/network_config.txt.template @@ -0,0 +1,49 @@ +#----------------------------------------------------------------- +# +# MainsailOS (orangepi edition) Network Configuration +# Set optional end user configuration +# - Rename this file from /boot/network_config.txt.template to /boot/network_config.txt +# - Settings below will be applied every time you reboot your machine. +# Be aware, old configurations will be deleted! +# +# This file is based on work of the armbian developer team +# https://github.com/armbian/build/blob/master/packages/bsp/armbian_first_run.txt.template +#----------------------------------------------------------------- + +#----------------------------------------------------------------- +# General: +# 1 = delete this file, after first run setup is completed. + +NC_general_delete_this_file_after_completion=1 + +#----------------------------------------------------------------- +#Networking: +# Change default network settings +# Set to 1 to apply any network related settings below + +NC_net_change_defaults=0 + +# Enable WiFi or Ethernet. +# NB: If both are enabled, WiFi will take priority and Ethernet will be disabled. + +NC_net_ethernet_enabled=1 +NC_net_wifi_enabled=0 + +#Enter your WiFi creds +# SECURITY WARN: Your wifi keys will be stored in plaintext, no encryption. + +NC_net_wifi_ssid='MySSID' +NC_net_wifi_key='MyWiFiKEY' + +# Country code to enable power ratings and channels for your country. eg: GB US DE | https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + +NC_net_wifi_countrycode='GB' + +# If you want to use a static ip, set it here + +NC_net_use_static=0 +NC_net_static_ip='192.168.0.100' +NC_net_static_mask='255.255.255.0' +NC_net_static_gateway='192.168.0.1' +NC_net_static_dns='8.8.8.8 8.8.4.4' # Two entries max, seperated by a space. +#----------------------------------------------------------------- diff --git a/src/modules/orangepi_net/filesystem/root/etc/systemd/system/network-configurator.service b/src/modules/orangepi_net/filesystem/root/etc/systemd/system/network-configurator.service new file mode 100644 index 000000000..6568ee6d4 --- /dev/null +++ b/src/modules/orangepi_net/filesystem/root/etc/systemd/system/network-configurator.service @@ -0,0 +1,20 @@ +# MainsailOS network-configurator +# This service will run in parallel with other services +# This is based on +# https://github.com/armbian/build/blob/master/packages/bsp/common/lib/systemd/system/armbian-firstrun-config.service + + +[Unit] +Description=MainsailOS network configurator +Wants=network-online.target +After=network.target network-online.target +ConditionPathExists=/boot/network_config.txt + +[Service] +Type=idle +RemainAfterExit=yes +ExecStart=/usr/local/bin/network-configurator +TimeoutStartSec=2min + +[Install] +WantedBy=multi-user.target diff --git a/src/modules/orangepi_net/start_chroot_script b/src/modules/orangepi_net/start_chroot_script new file mode 100644 index 000000000..792754a58 --- /dev/null +++ b/src/modules/orangepi_net/start_chroot_script @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +#### MainsailOS network configurator for orange images +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2023 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + +# shellcheck enable=require-variable-braces + +# Description: +# This file installs a service based on armbians armbian_firstrun_config +# The original work is done by the armbian developer's team +# sources of files can be found here: https://github.com/armbian/build + +# Source error handling, leave this in place +set -Ee + +# Source CustomPIOS common.sh +# shellcheck disable=SC1091 +source /common.sh +install_cleanup_trap + + +## Step 1: Install files +unpack filesystem/root / root +## END + +## Step 2: remove original template +if [[ -f "${ORANGEPI_NET_FIRSTRUN_FILE}" ]]; then + sudo rm -rf "${ORANGEPI_NET_FIRSTRUN_FILE}" +fi +## END + +## Step 3: Disable first run service +systemctl_if_exists disable orangepi-firstrun-config.service +## END + +## Step 4: Copy original script to /usr/local/bin/network-configurator +if [[ -f "${ORANGEPI_NET_FIRSTRUN_SCRIPT}" ]]; then + sudo cp -p "${ORANGEPI_NET_FIRSTRUN_SCRIPT}" "${ORANGEPI_NET_NC_PATH}" +fi +## END + +## Step 5: patch /usr/local/bin/network-configurator +if [[ -f "${ORANGEPI_NET_NC_PATH}" ]]; then + ### Substep 1: replace any orangepi_first_run.txt with network_config.txt + sed -i 's|orangepi_first_run.txt|network_config.txt|g' "${ORANGEPI_NET_NC_PATH}" + ### Substep 2: replace any FR* Variable name with NC* + sed -i 's|FR|NC|g' "${ORANGEPI_NET_NC_PATH}" + ### Supstep 3: Rename function + sed -i 's|do_firstrun_automated_user_configuration|do_network_configuration|g' "${ORANGEPI_NET_NC_PATH}" + ### Substep 4: Add a patch note + sed -i '8 i \\n\# This is a patched version of orangepi-firstrun-config for MainsailOS' "${ORANGEPI_NET_NC_PATH}" + sed -i '10 i # Original located at /usr/lib/orangepi/orangepi-firstrun-config' "${ORANGEPI_NET_NC_PATH}" + sed -i '11 i # Changes made by https:\/\/github.com/mainsail-crew' "${ORANGEPI_NET_NC_PATH}" +fi +## END + +## Step 6: Enable systemd service +systemctl_if_exists enable network-configurator.service +## END diff --git a/src/version b/src/version index 7dea76edb..1c6f7dee7 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -1.0.1 +1.1.0-alpha