Compare commits

...

3 Commits

Author SHA1 Message Date
6fd598fabf fix: diya-resizefs install error 2026-04-09 01:09:41 +02:00
8297499157 feat: add resizefs service 2026-04-09 01:05:39 +02:00
656e7147dc fix(#1): export WAYLAND_DISPLAY in profile 2026-04-09 00:57:54 +02:00
6 changed files with 51 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ TOOLCHAIN_TARGET_TASK:append := " libgles3-mesa-dev "
INITRAMFS_IMAGE="core-image-recovery"
INITRAMFS_IMAGE_BUNDLE="0"
INITRAMFS_MAXSIZE="500000"
INITRAMFS_FSTYPES = "cpio.lz4.u-boot"
KERNEL_IMAGETYPE = "Image.gz"
# DISTRO_FEATURES:append := " vc4-gfx opengl directfb "

View File

@@ -0,0 +1,22 @@
DESCRIPTION = "Auto resize file system on first boot"
DEPENDS = ""
RDEPENDS:${PN} = "bash"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI += " file://resize2fs.service file://firstboot file://expandfs \
"
inherit systemd
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "resize2fs.service"
do_install() {
install -d ${D}/${sysconfdir}
install -d ${D}/usr/sbin
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${UNPACKDIR}/firstboot ${D}${sysconfdir}/firstboot
install -m 0755 ${UNPACKDIR}/expandfs ${D}/usr/sbin/expandfs
install -D -p -m0644 ${UNPACKDIR}/resize2fs.service \
${D}${systemd_unitdir}/system/resize2fs.service
}

View File

@@ -0,0 +1,14 @@
#! /bin/sh
. /etc/profile
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PARTNO=4
if [ -z "$DISK" ]; then
DISK="mmcblk0"
fi
if [ "$(/usr/bin/id -u)" -ne 0 ]; then
echo "$0 shall be run as root"
exit 1
fi
yes | parted ---pretend-input-tty /dev/mmcblk0 resizepart ${PARTNO} 100%
resize2fs /dev/${DISK}p${PARTNO}

View File

@@ -0,0 +1,12 @@
[Unit]
Description=Resize home partition
ConditionPathExists=/etc/firstboot
[Service]
Type=oneshot
ExecStart=/sbin/expandfs
ExecStartPost=rm /etc/firstboot
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@@ -11,6 +11,7 @@ export PATH=$PATH:/home/$USER/bin:/home/$USER/.local/bin
export LD_LIBRARY_PATH=/home/$USER/lib:/home/$USER/.local/lib
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
export TERM=xterm-256color
export WAYLAND_DISPLAY=wayland-0
#if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
# eval $(dbus-launch --auto-syntax)
#fi