Compare commits
3 Commits
c1d3127e8b
...
6fd598fabf
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fd598fabf | |||
| 8297499157 | |||
| 656e7147dc |
@@ -25,6 +25,8 @@ TOOLCHAIN_TARGET_TASK:append := " libgles3-mesa-dev "
|
|||||||
INITRAMFS_IMAGE="core-image-recovery"
|
INITRAMFS_IMAGE="core-image-recovery"
|
||||||
INITRAMFS_IMAGE_BUNDLE="0"
|
INITRAMFS_IMAGE_BUNDLE="0"
|
||||||
INITRAMFS_MAXSIZE="500000"
|
INITRAMFS_MAXSIZE="500000"
|
||||||
|
INITRAMFS_FSTYPES = "cpio.lz4.u-boot"
|
||||||
|
KERNEL_IMAGETYPE = "Image.gz"
|
||||||
|
|
||||||
# DISTRO_FEATURES:append := " vc4-gfx opengl directfb "
|
# DISTRO_FEATURES:append := " vc4-gfx opengl directfb "
|
||||||
|
|
||||||
|
|||||||
22
recipes-bsp/diya-resizefs/diya-resizefs.bb
Normal file
22
recipes-bsp/diya-resizefs/diya-resizefs.bb
Normal 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
|
||||||
|
}
|
||||||
14
recipes-bsp/diya-resizefs/files/expandfs
Normal file
14
recipes-bsp/diya-resizefs/files/expandfs
Normal 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}
|
||||||
0
recipes-bsp/diya-resizefs/files/firstboot
Normal file
0
recipes-bsp/diya-resizefs/files/firstboot
Normal file
12
recipes-bsp/diya-resizefs/files/resize2fs.service
Normal file
12
recipes-bsp/diya-resizefs/files/resize2fs.service
Normal 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
|
||||||
@@ -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 LD_LIBRARY_PATH=/home/$USER/lib:/home/$USER/.local/lib
|
||||||
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
|
export DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
|
||||||
export TERM=xterm-256color
|
export TERM=xterm-256color
|
||||||
|
export WAYLAND_DISPLAY=wayland-0
|
||||||
#if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
#if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
|
||||||
# eval $(dbus-launch --auto-syntax)
|
# eval $(dbus-launch --auto-syntax)
|
||||||
#fi
|
#fi
|
||||||
|
|||||||
Reference in New Issue
Block a user