diff --git a/README.rst b/README.rst index 15790565..bde1ae99 100644 --- a/README.rst +++ b/README.rst @@ -167,7 +167,7 @@ List of Distributions using CustomPiOS -------------------------------------- * `OctoPi `_ - The ready-to-go Raspberry Pi image with OctoPrint -* `FarmPi `_ - An Ubuntu ARM 64bit Raspbery Pi image running `OctoFarm `_ +* `FarmPi `_ - An Ubuntu ARM 64bit Raspberry Pi image running `OctoFarm `_ * `FullPageOS `_ - A Raspberry Pi distro to display a full page browser on boot * `Zynthian `_ - Open Synth Platform * `ElectricSheepPi `_ - A Raspberry Pi distribution to run Electric Sheep digital art @@ -183,6 +183,6 @@ List of Distributions using CustomPiOS * `FluiddPi `_ - Distro that packages `Fluidd `_, `Moonraker `_, and `Klipper `_ into the ultimate 3D printer firmware package. * `My Naturewatch Camera `_ - A Python / OpenCV camera server to stream Pi camera content to a remote client through a website. * `PiFireOS `_ - Distro for pellet grill/smoker control, running `PiFire `_. -* `MonsterPi `_ - An Ubuntu ARM 64bit Raspbery Pi image running `FDM Monster `_. This 3D Print server will help you connect 200+ OctoPrints together while providing a strong, professional workflow. +* `MonsterPi `_ - An Ubuntu ARM 64bit Raspberry Pi image running `FDM Monster `_. This 3D Print server will help you connect 200+ OctoPrints together while providing a strong, professional workflow. Code contribution would be appreciated! diff --git a/src/build_custom_os b/src/build_custom_os index 9d51cdfa..094dfcd9 100755 --- a/src/build_custom_os +++ b/src/build_custom_os @@ -1,8 +1,44 @@ #!/usr/bin/env bash set -e -set -x + + +usage() { + cat <] + + builds the current distro + +OPTIONS + -l write build-log to given file (instead of ${LOG:-build.log} + -h print this help and exit + +EOF + +} + +while getopts "hl:" opt; do + case "$opt" in + h) + usage + exit 0 + ;; + l) + export LOG="$OPTARG" + ;; + ?) + usage + exit 2 + ;; + esac +done +shift $(($OPTIND - 1)) + echo "Distro path: ${DIST_PATH}" echo "CustomPiOS path: ${CUSTOM_PI_OS_PATH}" echo "================================================================" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -${DIR}/build $1 + + +set -x + +${DIR}/build "$1" diff --git a/src/common.sh b/src/common.sh index eda5d8d0..25bc2aba 100755 --- a/src/common.sh +++ b/src/common.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash function die () { - echo >&2 "$@" + echo_red "$@" >&2 exit 1 } @@ -153,7 +153,7 @@ function detach_all_loopback(){ # Cleans up mounted loopback devices from the image name # NOTE: it might need a better way to grep for the image name, its might clash with other builds for img in $(losetup | grep $1 | awk '{ print $1 }' ); do - if [[ -f $img ]]; then + if [ -f "${img}" ] || [ -b "${img}" ]; then losetup -d $img fi done @@ -161,7 +161,7 @@ function detach_all_loopback(){ function test_for_image(){ if [ ! -f "$1" ]; then - echo "Warning, can't see image file: $image" + echo_red "Warning, can't see image file: $image" fi } @@ -189,16 +189,16 @@ function mount_image() { boot_offset=$(($(jq ".partitiontable.partitions[] | select(.node == \"$image_path$boot_partition\").start" <<< ${fdisk_output}) * 512)) root_offset=$(($(jq ".partitiontable.partitions[] | select(.node == \"$image_path$root_partition\").start" <<< ${fdisk_output}) * 512)) - echo "Mounting image $image_path on $mount_path, offset for boot partition is $boot_offset, offset for root partition is $root_offset" + echo_green "Mounting image $image_path on $mount_path, offset for boot partition is $boot_offset, offset for root partition is $root_offset" # mount root and boot partition detach_all_loopback $image_path - echo "Mounting root parition" + echo_green "Mounting root partition" sudo losetup -f sudo mount -o loop,offset=$root_offset $image_path $mount_path/ if [[ "$boot_partition" != "$root_partition" ]]; then - echo "Mounting boot partition" + echo_green "Mounting boot partition" sudo losetup -f sudo mount -o loop,offset=$boot_offset,sizelimit=$( expr $root_offset - $boot_offset ) "${image_path}" "${mount_path}"/"${boot_mount_path}" fi @@ -222,7 +222,7 @@ function unmount_image() { then for pid in $(sudo lsof -t $mount_path) do - echo "Killing process $(ps -p $pid -o comm=) with pid $pid..." + echo_green "Killing process $(ps -p $pid -o comm=) with pid $pid..." sudo kill -9 $pid done fi @@ -240,7 +240,7 @@ function unmount_image() { # Also we sort in reverse to get the deepest mounts first. for m in $(sudo mount | grep $mount_path | awk -F " on " '{print $2}' | awk '{print $1}' | sort -r) do - echo "Unmounting $m..." + echo_green "Unmounting $m..." sudo umount $m done } @@ -277,7 +277,7 @@ function enlarge_ext() { partition=$2 size=$3 - echo "Adding $size MB to partition $partition of $image" + echo_green "Adding $size MB to partition $partition of $image" start=$(sfdisk --json "${image}" | jq ".partitiontable.partitions[] | select(.node == \"$image$partition\").start") offset=$(($start*512)) dd if=/dev/zero bs=1M count=$size >> $image @@ -321,12 +321,12 @@ FDISK rmdir "$TDIR" fi else - echo "Could not determine the filesystem of the volume, output is: $(file -Ls $LODEV)" + echo_red "Could not determine the filesystem of the volume, output is: $(file -Ls $LODEV)" fi losetup -d $LODEV trap - EXIT - echo "Resized parition $partition of $image to +$size MB" + echo_green "Resized partition $partition of $image to +$size MB" } function shrink_ext() { @@ -337,7 +337,7 @@ function shrink_ext() { partition=$2 size=$3 - echo "Resizing file system to $size MB..." + echo_green "Resizing file system to $size MB..." start=$(sfdisk --json "${image}" | jq ".partitiontable.partitions[] | select(.node == \"$image$partition\").start") offset=$(($start*512)) @@ -351,14 +351,14 @@ function shrink_ext() { e2ftarget_bytes=$(($size * 1024 * 1024)) e2ftarget_blocks=$(($e2ftarget_bytes / 512 + 1)) - echo "Resizing file system to $e2ftarget_blocks blocks..." + echo_green "Resizing file system to $e2ftarget_blocks blocks..." resize2fs $LODEV ${e2ftarget_blocks}s losetup -d $LODEV trap - EXIT new_end=$(($start + $e2ftarget_blocks)) - echo "Resizing partition to end at $start + $e2ftarget_blocks = $new_end blocks..." + echo_green "Resizing partition to end at $start + $e2ftarget_blocks = $new_end blocks..." fdisk $image </dev/null; then systemctl "$@" else - echo "no systemctl, not running" + echo_red "no systemctl, not running" fi } diff --git a/src/config b/src/config index c307b984..ceabb3b1 100755 --- a/src/config +++ b/src/config @@ -1,79 +1,77 @@ -CONFIG_DIR=$(dirname $(realpath -s $BASH_SOURCE)) +CONFIG_DIR=$(dirname $(realpath -s "${BASH_SOURCE}")) -export BUILD_VARIANT=default -BUILD_FLAVOR=default WORKSPACE_POSTFIX= -if [ "$#" -gt 0 ]; then - export BUILD_VARIANT=$1 -fi +export BUILD_VARIANT="" +BUILD_VARIANT="$1" +: ${BUILD_VARIANT:=default} +export BUILD_FLAVOR="" # Disable flavor system -# if [ "$#" -gt 1 ]; then -# BUILD_FLAVOR=$2 -# fi +#BUILD_FLAVOR="$1" +: ${BUILD_FLAVOR:=default} echo -e "--> Building VARIANT $BUILD_VARIANT, FLAVOR $BUILD_FLAVOR" # Import the local config if we have one -if [ -f $CONFIG_DIR/config.local ] +if [ -f "${CONFIG_DIR}/config.local" ] then echo "Sourcing config.local..." - source $CONFIG_DIR/config.local + source "${CONFIG_DIR}/config.local" fi source ${DIST_PATH}/config -if [ $BUILD_VARIANT != 'default' ]; then - WORKSPACE_POSTFIX=-$BUILD_VARIANT +if [ "${BUILD_VARIANT}" != 'default' ]; then + WORKSPACE_POSTFIX="-${BUILD_VARIANT}" - if [ -d "${DIST_PATH}/variants/$BUILD_VARIANT" ]; then - export VARIANT_BASE="${DIST_PATH}/variants/$BUILD_VARIANT" - elif [ -d "${CUSTOM_PI_OS_PATH}/variants/$BUILD_VARIANT" ]; then - export VARIANT_BASE="${CUSTOM_PI_OS_PATH}/variants/$BUILD_VARIANT" + if [ -d "${DIST_PATH}/variants/${BUILD_VARIANT}" ]; then + export VARIANT_BASE="${DIST_PATH}/variants/${BUILD_VARIANT}" + elif [ -d "${CUSTOM_PI_OS_PATH}/variants/${BUILD_VARIANT}" ]; then + export VARIANT_BASE="${CUSTOM_PI_OS_PATH}/variants/${BUILD_VARIANT}" else - die "Could not find Variant $BUILD_VARIANT" + die "Could not find Variant ${BUILD_VARIANT}" fi - if [ $BUILD_FLAVOR == '' ] || [ $BUILD_FLAVOR == 'default' ] + if [ "${BUILD_FLAVOR}" = '' ] || [ "${BUILD_FLAVOR}" = 'default' ] then - VARIANT_CONFIG=$VARIANT_BASE/config + VARIANT_CONFIG=${VARIANT_BASE}/config FLAVOR_CONFIG= else - VARIANT_CONFIG=$VARIANT_BASE/config - FLAVOR_CONFIG=$VARIANT_BASE/config.$BUILD_FLAVOR + VARIANT_CONFIG=${VARIANT_BASE}/config + FLAVOR_CONFIG=${VARIANT_BASE}/config.${BUILD_FLAVOR} fi - if [ -n "$FLAVOR_CONFIG" ] && [ ! -f $FLAVOR_CONFIG ] + if [ -n "${FLAVOR_CONFIG}" ] && [ ! -f "${FLAVOR_CONFIG}" ] then - die "Could not find config file $FLAVOR_CONFIG" + die "Could not find config file ${FLAVOR_CONFIG}" fi fi echo Import the variant config if we have one -if [ -n "$VARIANT_CONFIG" ] && [ -f $VARIANT_CONFIG ] +if [ -n "${VARIANT_CONFIG}" ] && [ -f "${VARIANT_CONFIG}" ] then - echo "Sourcing variant config $VARIANT_CONFIG..." + echo "Sourcing variant config ${VARIANT_CONFIG}..." set -a - source $VARIANT_CONFIG + source "${VARIANT_CONFIG}" set +a fi # Import the flavor config if we have one -if [ -n "$FLAVOR_CONFIG" ] && [ -f $FLAVOR_CONFIG ] +if [ -n "${FLAVOR_CONFIG}" ] && [ -f "${FLAVOR_CONFIG}" ] then - echo "Sourcing flavor config $FLAVOR_CONFIG..." - source $FLAVOR_CONFIG + echo "Sourcing flavor config ${FLAVOR_CONFIG}..." + source "${FLAVOR_CONFIG}" fi -if [ -f ${DIST_PATH}/config.local ] +if [ -f "${DIST_PATH}/config.local" ] then echo "Sourcing distro config.local..." - source ${DIST_PATH}/config.local + source "${DIST_PATH}/config.local" fi # Get only a list @@ -89,9 +87,9 @@ do export MODULE_PATH="${CUSTOM_PI_OS_PATH}/modules/${module}" fi - echo loading $module config at ${MODULE_PATH}/config - if [ -f ${MODULE_PATH}/config ]; then - source ${MODULE_PATH}/config + echo "loading $module config at ${MODULE_PATH}/config" + if [ -f "${MODULE_PATH}/config" ]; then + source "${MODULE_PATH}/config" else echo "WARNING: module ${module} has no config file" fi diff --git a/src/custompios b/src/custompios index fc68bc16..0b310222 100755 --- a/src/custompios +++ b/src/custompios @@ -9,6 +9,8 @@ export LC_ALL=C source ${CUSTOM_PI_OS_PATH}/common.sh +echo_green -e "\nBUILD STARTED @ $(date)!\n" + function execute_chroot_script() { # In docker, these extra commands are required to enable this black-magic @@ -92,6 +94,17 @@ function execute_chroot_script() { fi } +# check prerequisites +if [ -n "$BASE_IMAGE_ENLARGEROOT" ] || [ -n "$BASE_IMAGE_RESIZEROOT" ]; then + # resizing the root partition requires 'sfdisk' in our path + which sfdisk >/dev/null 2>/dev/null || \ + die "'sfdisk' not found in PATH; did you mean to run the script as root?" +fi + + +# start! + + mkdir -p $BASE_WORKSPACE mkdir -p $BASE_MOUNT_PATH @@ -200,4 +213,4 @@ pushd $BASE_WORKSPACE fi popd -echo_green -e "\nBUILD SUCCEEDED!\n" +echo_green -e "\nBUILD SUCCEEDED @ $(date)!\n" diff --git a/src/dist_generators/dist_example/src/.gitignore b/src/dist_generators/dist_example/src/.gitignore new file mode 100644 index 00000000..f7f76e48 --- /dev/null +++ b/src/dist_generators/dist_example/src/.gitignore @@ -0,0 +1,2 @@ +/workspace +/config.local diff --git a/src/dist_generators/dist_example/src/image/.gitignore b/src/dist_generators/dist_example/src/image/.gitignore new file mode 100644 index 00000000..f8476208 --- /dev/null +++ b/src/dist_generators/dist_example/src/image/.gitignore @@ -0,0 +1,3 @@ +* +!README +!.gitignore diff --git a/src/hooks/post_push b/src/hooks/post_push index 1239afe5..7f36881d 100755 --- a/src/hooks/post_push +++ b/src/hooks/post_push @@ -53,7 +53,7 @@ then # Handle release else - echo "handeling: ${DOCKER_REPO}|${IMAGE_NAME}|${DOCKER_TAG}" + echo "handling: ${DOCKER_REPO}|${IMAGE_NAME}|${DOCKER_TAG}" RELEASE_TAG=${DOCKER_TAG%%-*} diff --git a/src/make_custom_pi_os b/src/make_custom_pi_os index fbb67798..bdecb7b5 100755 --- a/src/make_custom_pi_os +++ b/src/make_custom_pi_os @@ -9,7 +9,7 @@ parser.add_argument('dest', help="The destination folder") parser.add_argument('-g', '--get_image', action='store_true', help='Pick a number [default %(default)s]') parser.add_argument('-v', '--variant', action='store', - choices=['raspios_lite_armhf', 'raspios_lite_arm64'], + choices=['raspios_lite_armhf', 'raspios_lite_arm64', 'raspios_armhf', 'raspios_arm64', 'raspios_full_armhf', 'raspios_full_arm64'], default='raspios_lite_armhf', help='Which variant to use [default: %(default)s]') EOF diff --git a/src/modules/admin-toolkit/config b/src/modules/admin-toolkit/config index d7e35732..96bc1438 100644 --- a/src/modules/admin-toolkit/config +++ b/src/modules/admin-toolkit/config @@ -1,7 +1,7 @@ ######################################################################################## # # admin-toolkit helps to harden your pi, install other packages easily, and add files out of the box. -# Some things require a user to be added and others dont. Some things are indended to be used with FullPageOS +# Some things require a user to be added and others dont. Some things are intended to be used with FullPageOS # and the scripts that come with it, but there are uses outside of that, if you edit a bit of code. # This has only been used with FullPageOS, and Raspbian Buster on a pi4 # @@ -46,7 +46,7 @@ ADMIN_TOOLKIT_HOSTNAME_CHANGE_SCRIPT=no ######### SSH Section ##################################### # # If you didn't set a user in the above section SSH Settings won't be applied. -# If you don't set a ssh key, disabling passwords for ssh wont apply. +# If you don't set a ssh key, disabling passwords for ssh won't apply. # # Add the public ssh key that you wish to use for connections to the pi @@ -77,7 +77,7 @@ ADMIN_TOOLKIT_HOSTNAME_CHANGE_SCRIPT=no ######### Install Package(s) ############################## # This might not work for you. Some packages cannot be installed in chroot. # Keep in mind your image will be bigger and take longer to build. -# Use quotes if listing multiple packages (space Seperated list) ex. LIST="fortune cowsay..." +# Use quotes if listing multiple packages (space Separated list) ex. LIST="fortune cowsay..." [ -n "$ADMIN_TOOLKIT_INSTALL_LIST" ] || ADMIN_TOOLKIT_INSTALL_LIST=no @@ -87,7 +87,7 @@ ADMIN_TOOLKIT_HOSTNAME_CHANGE_SCRIPT=no # other ports will be closed by default. "yes" to configure [ -n "$ADMIN_TOOLKIT_UFW_INSTALL" ] || ADMIN_TOOLKIT_UFW_INSTALL=no -# To allow multiple open ports make a CSV(coma seperated list) to configure. +# To allow multiple open ports make a CSV(coma separated list) to configure. [ -n "$ADMIN_TOOLKIT_UFW_PORTS_TCP" ] || ADMIN_TOOLKIT_UFW_PORTS_TCP=no [ -n "$ADMIN_TOOLKIT_UFW_PORTS_UDP" ] || ADMIN_TOOLKIT_UFW_PORTS_UDP=no @@ -113,7 +113,7 @@ ADMIN_TOOLKIT_HOSTNAME_CHANGE_SCRIPT=no # Add a cron file to the /filesystem/tools/cron folder # cron files will be placed in /var/spool/cron/crontabs/ # CRON_USER and file name must be the same. pi is the most common(default) -# Your cron file must have a new line at the bottom or import wont work. +# Your cron file must have a new line at the bottom or import won't work. # "yes" to configure [ -n "$ADMIN_TOOLKIT_CRON_JOB" ] || ADMIN_TOOLKIT_CRON_JOB=no @@ -138,7 +138,7 @@ ADMIN_TOOLKIT_HOSTNAME_CHANGE_SCRIPT=no ######### Screen Rotation Script ####################### # **** REQUIRES THE GUI MODULE AND pi 4 **** # Rotates the screen after start up. Since there's some issues -# with rotation on certian diaplays at boot this section lets you +# with rotation on certain displays at boot this section lets you # add screen rotation after boot up. # Examples: "normal","inverted","left","right" # use a value other than normal to add rotation. diff --git a/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_off.sh b/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_off.sh index 1eb6def5..b36c22f6 100644 --- a/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_off.sh +++ b/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_off.sh @@ -1,5 +1,5 @@ #!/bin/bash # -# this scrpit is from the CustomPiOS admin-toolkit module +# this script is from the CustomPiOS admin-toolkit module -tvservice -o \ No newline at end of file +tvservice -o diff --git a/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_on.sh b/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_on.sh index ef16f560..da996882 100644 --- a/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_on.sh +++ b/src/modules/admin-toolkit/filesystem/tools/FullPageHdmiScripts/tv_on.sh @@ -1,8 +1,8 @@ #!/bin/bash # -# this scrpit is from the CustomPiOS admin-toolkit module. +# this script is from the CustomPiOS admin-toolkit module. # it is meant to be used in conjunction with FullPageOS fullscreen script tvservice -p sleep 5 -/home/pi/scripts/fullscreen \ No newline at end of file +/home/pi/scripts/fullscreen diff --git a/src/modules/auto-hotspot/filesystem/root/etc/dhcp/dhclient-exit-hooks.d/prefix_delegation b/src/modules/auto-hotspot/filesystem/root/etc/dhcp/dhclient-exit-hooks.d/prefix_delegation index 1a854a3a..a4972d76 100755 --- a/src/modules/auto-hotspot/filesystem/root/etc/dhcp/dhclient-exit-hooks.d/prefix_delegation +++ b/src/modules/auto-hotspot/filesystem/root/etc/dhcp/dhclient-exit-hooks.d/prefix_delegation @@ -1,6 +1,6 @@ # This script assigns a delegated IPv6 prefix obtained via DHCPv6 to another interface # -# Usage: This scrips is designed to be called from dhclient-script (isc-dhcp-client). +# Usage: This script is designed to be called from dhclient-script (isc-dhcp-client). # # LOCATION: /etc/dhcp/dhclient-exit-hooks.d/prefix_delegation # RECOMMENDED PACKAGES: ipv6calc diff --git a/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN b/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN index 913b5f9a..41cd7466 100755 --- a/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN +++ b/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN @@ -9,7 +9,7 @@ #Network Wifi & Hotspot with Network/Internet #A script to switch between a wifi network and an Network/Internet routed Hotspot #A Raspberry Pi with a network port required for Internet in hotspot mode. -#Works at startup or with a seperate timer or manually without a reboot +#Works at startup or with a separate timer or manually without a reboot #Other setup required find out more at #http://www.raspberryconnect.com @@ -31,7 +31,7 @@ IFS=$IFSdef #reset back to defaults # separated by a space, eg ('mySSID1' 'mySSID2') #ssids=('mySSID1' 'mySSID2' 'mySSID3') -#Enter the Routers Mac Addresses for hidden SSIDs, seperated by spaces ie +#Enter the Routers Mac Addresses for hidden SSIDs, separated by spaces ie #( '11:22:33:44:55:66' 'aa:bb:cc:dd:ee:ff' ) mac=() @@ -210,7 +210,7 @@ then else #ssid or MAC address not in range if systemctl status hostapd | grep "(running)" >/dev/null 2>&1 then - echo "Hostspot already active" + echo "Hotspot already active" # Extra tools to handle hotspot not working add_masquerade "${ethdev}" make_sure_master "${wifidev}" diff --git a/src/modules/base/config b/src/modules/base/config index a3d8abb8..22014a7d 100644 --- a/src/modules/base/config +++ b/src/modules/base/config @@ -55,10 +55,10 @@ else [ -n "${BASE_BOOT_MOUNT_PATH}" ] || BASE_BOOT_MOUNT_PATH=boot fi -# The root partiton of the image filesystem, 2 for raspbian +# The root partition of the image filesystem, 2 for raspbian [ -n "$BASE_ROOT_PARTITION" ] || BASE_ROOT_PARTITION=2 -# if set will enlarge root parition prior to build by provided size in MB +# if set will enlarge root partition prior to build by provided size in MB [ -n "$BASE_IMAGE_ENLARGEROOT" ] || BASE_IMAGE_ENLARGEROOT=200 # if set will resize root partition on image after build to minimum size + diff --git a/src/modules/base/start_chroot_script b/src/modules/base/start_chroot_script index f87ce5ea..c7febc64 100644 --- a/src/modules/base/start_chroot_script +++ b/src/modules/base/start_chroot_script @@ -165,7 +165,7 @@ then raspi-config nonint do_change_locale $BASE_CONFIG_LOCALE fi -# keybaord +# keyboard if [ $BASE_CONFIG_KEYBOARD != 'default' ] then echo "Configuring keyboard" diff --git a/src/modules/install-linux-modules-extra/start_chroot_script b/src/modules/install-linux-modules-extra/start_chroot_script index 763f7326..9783f856 100644 --- a/src/modules/install-linux-modules-extra/start_chroot_script +++ b/src/modules/install-linux-modules-extra/start_chroot_script @@ -16,7 +16,7 @@ install_cleanup_trap # unpack /filesystem/root / apt-get update --allow-releaseinfo-change -# workwround to intall linux-modules-extra-raspi +# workaround to install linux-modules-extra-raspi sudo umount /boot apt-get install -y flash-kernel diff --git a/src/modules/network/filesystem/usr/local/bin/pwrsave b/src/modules/network/filesystem/usr/local/bin/pwrsave index c9d9417c..3c18e7c9 100755 --- a/src/modules/network/filesystem/usr/local/bin/pwrsave +++ b/src/modules/network/filesystem/usr/local/bin/pwrsave @@ -58,7 +58,7 @@ function enable_pwr_save { function main { local arg if [ "$(id -u)" != "0" ]; then - echo -e "\n$(basename "${0}"): This script needs root priviledges!\n" + echo -e "\n$(basename "${0}"): This script needs root privileges!\n" exit 1 fi if [ "${#}" == "0" ]; then diff --git a/src/modules/network/filesystem/usr/local/bin/pwrsave-udev b/src/modules/network/filesystem/usr/local/bin/pwrsave-udev index 3afc9149..bd7f4f03 100755 --- a/src/modules/network/filesystem/usr/local/bin/pwrsave-udev +++ b/src/modules/network/filesystem/usr/local/bin/pwrsave-udev @@ -70,7 +70,7 @@ echo -e "Please 'reboot' to take changes effect.\n" function main { local arg if [ "$(id -u)" != "0" ]; then - echo -e "\n$(basename "${0}"): This script needs root priviledges!\n" + echo -e "\n$(basename "${0}"): This script needs root privileges!\n" exit 1 fi if [ "${#}" == "0" ]; then diff --git a/src/modules/pkgupgrade/config b/src/modules/pkgupgrade/config index 54196970..51ffd372 100644 --- a/src/modules/pkgupgrade/config +++ b/src/modules/pkgupgrade/config @@ -4,3 +4,5 @@ [ -n "$PKGUPGRADE_USE_PREINSTALLER" ] || PKGUPGRADE_USE_PREINSTALLER=n # y/n # Add Packages that should be PKGUPGRADEed. [ -n "$PKGUPGRADE_PRE_INSTALL_PKGS" ] || PKGUPGRADE_PRE_INSTALL_PKGS="" +# Cleanup apt-cache on exit +[ -n "$PKGUPGRADE_CLEANUP" ] || PKGUPGRADE_CLEANUP="y" diff --git a/src/modules/pkgupgrade/end_chroot_script b/src/modules/pkgupgrade/end_chroot_script index 476dd164..f3fdbd2a 100644 --- a/src/modules/pkgupgrade/end_chroot_script +++ b/src/modules/pkgupgrade/end_chroot_script @@ -6,6 +6,8 @@ ######## ### Cleanup -apt clean -y -apt autoclean -y +if [ "${PKGUPGRADE_CLEANUP}" = "y" ]; then + apt-get clean -y + apt-get autoclean -y +fi diff --git a/src/modules/pkgupgrade/start_chroot_script b/src/modules/pkgupgrade/start_chroot_script index 7c1b31bd..bae3c2f3 100644 --- a/src/modules/pkgupgrade/start_chroot_script +++ b/src/modules/pkgupgrade/start_chroot_script @@ -18,14 +18,14 @@ if [ -z "${DEBIAN_FRONTEND}" ]; then fi ## Force Update -apt update --allow-releaseinfo-change +apt-get update --allow-releaseinfo-change ### Pre Update Section if [ "${PKGUPGRADE_DISTUPGRADE}" = "y" ]; then - echo_green "Performing 'apt ${PKGUPGRADE_DISTUPGRADE_METHOD}' ... " - apt ${PKGUPGRADE_DISTUPGRADE_METHOD} -y + echo_green "Performing 'apt-get ${PKGUPGRADE_DISTUPGRADE_METHOD}' ... " + apt-get ${PKGUPGRADE_DISTUPGRADE_METHOD} -y else - echo_green "Skipping Dist Upgrade ['apt ${PKGUPGRADE_DISTUPGRADE_METHOD}']." + echo_green "Skipping Dist Upgrade ['apt-get ${PKGUPGRADE_DISTUPGRADE_METHOD}']." fi ### Pre Installer Section diff --git a/src/modules/usage-statistics/config b/src/modules/usage-statistics/config index 3c515fd0..81601874 100644 --- a/src/modules/usage-statistics/config +++ b/src/modules/usage-statistics/config @@ -8,8 +8,8 @@ # URL to the tracking server [ -n "$USAGE_STATISTICS_URL" ] || USAGE_STATISTICS_URL=https://custompios-tracking.gnethomelinux.com -# The file name that holds teh distro version +# The file name that holds the distro version [ -n "$USAGE_STATISTICS_VERSION_FILE" ] || USAGE_STATISTICS_VERSION_FILE=/etc/${DIST_NAME,,}_version -# The file name that holds teh distro version +# The file name that holds the distro version [ -n "$USAGE_STATISTICS_VARIANT_FILE" ] || USAGE_STATISTICS_VARIANT_FILE=/etc/dist_variant diff --git a/src/variants/armbian/config b/src/variants/armbian/config index e59c4809..826ad78c 100755 --- a/src/variants/armbian/config +++ b/src/variants/armbian/config @@ -3,7 +3,7 @@ BASE_ZIP_IMG=`ls -t ${DIST_PATH}/image-armbian/*.{zip,7z,xz} | head -n 1` BASE_APT_CACHE=no OCTOPI_INCLUDE_WIRINGPI=no export BASE_DISTRO=armbian -# The root partiton of the image filesystem, 2 for raspbian, 1 for armbian +# The root partition of the image filesystem, 2 for raspbian, 1 for armbian BASE_ROOT_PARTITION=1 BASE_IMAGE_RESIZEROOT=500 BASE_IMAGE_RASPBIAN=no