Compare commits

...

3 Commits

Author SHA1 Message Date
Jens Maus
4a2e53cda4
updated generic_raw_uart to latest 1.28 version and updated rpi-rf-mod (#2431)
package to latest version as well.
2023-03-27 20:28:40 +02:00
Stefan Agner
c0d0d48c45
Fix swapfile creation for all memory sizes (#2427)
* Fix swapfile creation for all memory sizes

In certain situation awk prints the swapfile size in scientific
notation. The script can't deal with that, in which case swap file
creation fails.

Use int to convert the number to an integer.

Since pages are 4k, also make sure swapsize is aligned to 4k blocks.

* Add info message
2023-03-27 20:28:35 +02:00
Stefan Agner
76b14baa20
Set deployment type to production 2023-03-24 18:45:15 +01:00
6 changed files with 11 additions and 13 deletions

View File

@ -4,4 +4,4 @@ VERSION_BUILD=0
HASSOS_NAME="Home Assistant OS"
HASSOS_ID="haos"
DEPLOYMENT="development"
DEPLOYMENT="production"

View File

@ -1,3 +1,3 @@
# Locally computed
sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE
sha256 07a0de82e6bf25d35df3520beaea886644160bac4077c3ccb9bb615f5d266972 generic_raw_uart-b787f3d84b311bd3e07b0ca8f2aa63330030746e.tar.gz
sha256 bea4b61fb1ca9f85ed080344709f48c0fd8ab8950cd370506d822b14d287744e generic_raw_uart-610c9cf1e6b84720b638e12ffc192dbc150aed84.tar.gz

View File

@ -13,15 +13,11 @@
#
################################################################################
GENERIC_RAW_UART_VERSION = b787f3d84b311bd3e07b0ca8f2aa63330030746e
GENERIC_RAW_UART_VERSION = 610c9cf1e6b84720b638e12ffc192dbc150aed84
GENERIC_RAW_UART_SITE = $(call github,alexreinert,piVCCU,$(GENERIC_RAW_UART_VERSION))
GENERIC_RAW_UART_LICENSE = GPL2
GENERIC_RAW_UART_LICENSE_FILES = LICENSE
GENERIC_RAW_UART_MODULE_SUBDIRS = kernel
define GENERIC_RAW_UART_LINUX_CONFIG_FIXUPS
$(call KCONFIG_DISABLE_OPT,CONFIG_WERROR)
endef
$(eval $(kernel-module))
$(eval $(generic-package))

View File

@ -1,2 +1,2 @@
sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE
sha256 df22bcebb72f1ce7dc01504e2a1d097dd09fed20a461b36c2dd273f6ba7f8c96 rpi-rf-mod-de15b40fe87116c14c810b25d3b5107091e8946b.tar.gz
sha256 92e90678e7305486625777322c576a0a5a124a9199b5515e65ae72cbdb1ca534 rpi-rf-mod-b472ab34508e8de6ad152ba81b0059fab3e77d38.tar.gz

View File

@ -14,7 +14,7 @@
#
################################################################################
RPI_RF_MOD_VERSION = de15b40fe87116c14c810b25d3b5107091e8946b
RPI_RF_MOD_VERSION = b472ab34508e8de6ad152ba81b0059fab3e77d38
RPI_RF_MOD_SITE = $(call github,jens-maus,RaspberryMatic,$(RPI_RF_MOD_VERSION))
RPI_RF_MOD_LICENSE = Apache-2.0
RPI_RF_MOD_DEPENDENCIES = host-dtc

View File

@ -2,17 +2,19 @@
set -e
swapfile="/mnt/data/swapfile"
swapsize="$(awk '/MemTotal/{ print $2 * 0.33 }' /proc/meminfo)"
# Swap space in 4k blocks
swapsize="$(awk '/MemTotal/{ print int($2 * 0.33 / 4) }' /proc/meminfo)"
if [ ! -s "${swapfile}" ] || [ "$(stat "${swapfile}" -c '%s')" -lt $((swapsize * 1024)) ]; then
if [ ! -s "${swapfile}" ] || [ "$(stat "${swapfile}" -c '%s')" -lt $((swapsize * 4096)) ]; then
# Check free space (in 4k blocks)
if [ "$(stat -f /mnt/data -c '%f')" -lt $((swapsize / 4)) ]; then
if [ "$(stat -f /mnt/data -c '%f')" -lt "${swapsize}" ]; then
echo "[WARNING] Not enough space to allocate swapfile"
exit 1
fi
dd if=/dev/zero of="${swapfile}" bs=1k count="${swapsize}"
echo "[INFO] Creating swapfile of size $((swapsize *4))k"
dd if=/dev/zero of="${swapfile}" bs=4k count="${swapsize}"
fi
if ! swaplabel "${swapfile}" > /dev/null 2>&1; then