mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-03-02 10:37:51 +01:00
[DONE] Implementation of own growdisk architecture.
This is temporarily till we switch to A/B mirrored rootfs and data-overlay for all writable mounts.
This commit is contained in:
parent
1d42e2b31f
commit
6a59dcb1e1
@ -7,6 +7,7 @@ menu "Additional drivers, libraries and/or applications"
|
||||
source "$BR2_EXTERNAL_OPENVOICEOS_PATH/package/docbook-xml/Config.in"
|
||||
source "$BR2_EXTERNAL_OPENVOICEOS_PATH/package/docbook-xsl/Config.in"
|
||||
source "$BR2_EXTERNAL_OPENVOICEOS_PATH/package/fann/Config.in"
|
||||
source "$BR2_EXTERNAL_OPENVOICEOS_PATH/package/growdisk-service/Config.in"
|
||||
source "$BR2_EXTERNAL_OPENVOICEOS_PATH/package/hostname-service/Config.in"
|
||||
menu "KDE Framework and Plasma"
|
||||
source "$BR2_EXTERNAL_OPENVOICEOS_PATH/package/kf5-attica/Config.in"
|
||||
|
@ -288,6 +288,10 @@ BR2_PACKAGE_WILC1000_FIRMWARE=y
|
||||
BR2_PACKAGE_WILINK_BT_FIRMWARE=y
|
||||
BR2_PACKAGE_ZD1211_FIRMWARE=y
|
||||
BR2_PACKAGE_DBUS_CPP=y
|
||||
BR2_PACKAGE_GPTFDISK=y
|
||||
BR2_PACKAGE_GPTFDISK_GDISK=y
|
||||
BR2_PACKAGE_GPTFDISK_SGDISK=y
|
||||
BR2_PACKAGE_GPTFDISK_CGDISK=y
|
||||
BR2_PACKAGE_KBD=y
|
||||
BR2_PACKAGE_PARTED=y
|
||||
BR2_PACKAGE_RASPI_GPIO=y
|
||||
@ -409,7 +413,6 @@ BR2_PACKAGE_LINUX_PAM=y
|
||||
BR2_PACKAGE_PROTOBUF=y
|
||||
BR2_PACKAGE_LIBESTR=y
|
||||
BR2_PACKAGE_LIBUNISTRING=y
|
||||
BR2_PACKAGE_NCURSES_WCHAR=y
|
||||
BR2_PACKAGE_NCURSES_TARGET_PROGS=y
|
||||
BR2_PACKAGE_PCRE_16=y
|
||||
BR2_PACKAGE_PCRE_32=y
|
||||
@ -464,6 +467,7 @@ BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
|
||||
BR2_PACKAGE_SYSTEMD_REPART=y
|
||||
# BR2_PACKAGE_SYSTEMD_RESOLVED is not set
|
||||
BR2_PACKAGE_TAR=y
|
||||
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
|
||||
BR2_PACKAGE_UTIL_LINUX_HWCLOCK=y
|
||||
BR2_PACKAGE_UTIL_LINUX_KILL=y
|
||||
BR2_PACKAGE_UTIL_LINUX_MORE=y
|
||||
@ -494,6 +498,7 @@ BR2_PACKAGE_ALSA_PLUGINS=y
|
||||
BR2_PACKAGE_BARESIP=y
|
||||
BR2_PACKAGE_BTSPEAKER=y
|
||||
BR2_PACKAGE_FANN=y
|
||||
BR2_PACKAGE_GROWDISK_SERVICE=y
|
||||
BR2_PACKAGE_HOSTNAME_SERVICE=y
|
||||
BR2_PACKAGE_KF5_BREEZE_ICONS=y
|
||||
BR2_PACKAGE_KF5_KACTIVITIES=y
|
||||
|
6
buildroot-external/package/growdisk-service/Config.in
Normal file
6
buildroot-external/package/growdisk-service/Config.in
Normal file
@ -0,0 +1,6 @@
|
||||
config BR2_PACKAGE_GROWDISK_SERVICE
|
||||
bool "growdisk-service"
|
||||
help
|
||||
A systemd service that only runs on file flag
|
||||
to auto expand the filesystem over the full size
|
||||
of the used disk.
|
24
buildroot-external/package/growdisk-service/growdisk
Executable file
24
buildroot-external/package/growdisk-service/growdisk
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Get active block device
|
||||
DEVICE_ROOTFS="$(findfs UUID=c0932a41-44cf-463b-8152-d43188553ed4)"
|
||||
DEVICE="/dev/$(lsblk -no pkname "${DEVICE_ROOTFS}")"
|
||||
|
||||
# Fix GPT header backup file
|
||||
sgdisk -e "${DEVICE}" &&
|
||||
partprobe "${DEVICE}" &&
|
||||
|
||||
# Resize needed?
|
||||
UNUSED=$(sfdisk -Fq "${DEVICE}" | cut -d " " -f 3 | tail -1)
|
||||
if [ -z "${UNUSED}" ] || [ "${UNUSED}" -le "16384" ]; then
|
||||
echo "[INFO] No resize of rootfs partition needed"
|
||||
exit 0
|
||||
else
|
||||
echo "[INFO] Resizing the rootfs partition"
|
||||
parted "${DEVICE}" unit % resizepart 2 100% &&
|
||||
partprobe "${DEVICE}" &&
|
||||
sync &&
|
||||
resize2fs "${DEVICE_ROOTFS}" &&
|
||||
echo "[OK]"
|
||||
fi
|
||||
|
@ -0,0 +1,20 @@
|
||||
################################################################################
|
||||
#
|
||||
# growdisk-service
|
||||
#
|
||||
################################################################################
|
||||
|
||||
GROWDISK_SERVICE_VERSION = 0.1.0
|
||||
GROWDISK_SERVICE_SITE = $(BR2_EXTERNAL_OPENVOICEOS_PATH)/package/growdisk-service
|
||||
GROWDISK_SERVICE_SITE_METHOD = local
|
||||
GROWDISK_SERVICE_LICENSE = Apache License 2.0
|
||||
GROWDISK_SERVICE_LICENSE_FILES = LICENSE
|
||||
|
||||
define GROWDISK_SERVICE_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -m 0755 $(@D)/growdisk $(TARGET_DIR)/usr/sbin/
|
||||
$(INSTALL) -D -m 644 $(@D)/growdisk.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/growdisk.service
|
||||
touch $(TARGET_DIR)/etc/growdisk
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
14
buildroot-external/package/growdisk-service/growdisk.service
Normal file
14
buildroot-external/package/growdisk-service/growdisk.service
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Growdisk service to auto expand the rootfs partition
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
After=systemd-remount-fs.service
|
||||
Before=sysinit.target shutdown.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/sbin/growdisk
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
@ -1,2 +0,0 @@
|
||||
[Partition]
|
||||
Type=root
|
@ -1,5 +1,5 @@
|
||||
enable systemd-repart.service
|
||||
enable prepare_system.service
|
||||
enable growdisk.service
|
||||
enable hostname.service
|
||||
enable sshd.service
|
||||
enable brcm_bt.service
|
||||
|
Loading…
x
Reference in New Issue
Block a user