From 7978bdd32639dc4c9ec9d725681b191d101d3887 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Wed, 2 Aug 2023 09:51:11 +0200 Subject: [PATCH] use sysvinit --- recipes-core/base-files/base-files_%.bbappend | 4 ++++ recipes-core/images/core-image-minimal.bbappend | 8 +++++++- recipes-diya/diya-overlay/diya-overlay.bb | 7 ++++--- recipes-diya/diya-overlay/files/cmd.recovery | 1 - recipes-diya/diya-overlay/files/extraconfig.txt | 1 - recipes-diya/initramfs/files/confd | 5 +++++ recipes-diya/initramfs/files/init | 2 +- recipes-diya/initramfs/recovery-boot_0.1.bb | 4 +++- 8 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 recipes-diya/diya-overlay/files/cmd.recovery delete mode 100644 recipes-diya/diya-overlay/files/extraconfig.txt diff --git a/recipes-core/base-files/base-files_%.bbappend b/recipes-core/base-files/base-files_%.bbappend index 23af2ea..e7f8611 100644 --- a/recipes-core/base-files/base-files_%.bbappend +++ b/recipes-core/base-files/base-files_%.bbappend @@ -12,4 +12,8 @@ if [ ! -e "$XDG_RUNTIME_DIR" ]; then fi export TERM=xterm-256color EOF + +cat << EOF >> "${D}${sysconfdir}/profile" +export MACHINE=$MACHINE +EOF } diff --git a/recipes-core/images/core-image-minimal.bbappend b/recipes-core/images/core-image-minimal.bbappend index 6cc6f7c..1d151c4 100644 --- a/recipes-core/images/core-image-minimal.bbappend +++ b/recipes-core/images/core-image-minimal.bbappend @@ -12,7 +12,7 @@ EXTRA_USERS_PARAMS = "usermod -p 2Pe/4xyFxsokE diya; \ usermod -a -G avahi diya; \ usermod -a -G sudo diya \ " -IMAGE_BOOT_FILES:append = "fs_resize extraconfig.txt cmd.recovery recovery-${MACHINE}.cpio.gz " +IMAGE_BOOT_FILES:append = "fs_resize extraconfig.txt recovery-${MACHINE}.cpio.gz " IMAGE_INSTALL:append = "libcurl \ libdrm \ @@ -57,3 +57,9 @@ IMAGE_INSTALL:append = "libcurl \ gdbserver \ " +IMAGE_PREPROCESS_COMMAND += "image_patch;" + +image_patch () { + # delete unused kernel image + rm -rf ${IMAGE_ROOTFS}/boot/* +} \ No newline at end of file diff --git a/recipes-diya/diya-overlay/diya-overlay.bb b/recipes-diya/diya-overlay/diya-overlay.bb index 92d0140..10de312 100644 --- a/recipes-diya/diya-overlay/diya-overlay.bb +++ b/recipes-diya/diya-overlay/diya-overlay.bb @@ -7,7 +7,6 @@ SRC_URI += "file://confd \ file://expandfs.sh \ file://80_diya \ file://fs_resize \ - file://cmd.recovery \ file://extraconfig.txt" @@ -30,8 +29,10 @@ do_install() { # install -m 0644 ${WORKDIR}/80_diya ${D}${sysconfdir}/default/volatiles install -m 0755 ${WORKDIR}/expandfs.sh ${D}/usr/bin/expandfs.sh install -m 0755 ${WORKDIR}/fs_resize ${DEPLOY_DIR_IMAGE}/ - install -m 0755 ${WORKDIR}/cmd.recovery ${DEPLOY_DIR_IMAGE}/ - install -m 0755 ${WORKDIR}/extraconfig.txt ${DEPLOY_DIR_IMAGE}/ + + cat << EOF >> ${DEPLOY_DIR_IMAGE}/extraconfig.txt +# initramfs recovery-${MACHINE}.cpio.gz followkernel +EOF install -d ${D}/var/etc install -d ${D}/var/etc/upper diff --git a/recipes-diya/diya-overlay/files/cmd.recovery b/recipes-diya/diya-overlay/files/cmd.recovery deleted file mode 100644 index 025b976..0000000 --- a/recipes-diya/diya-overlay/files/cmd.recovery +++ /dev/null @@ -1 +0,0 @@ -dwc_otg.lpm_enable=0 root=/dev/ram0 console=tty0,115200 bootparam_init_fatal_sh=1 rootwait logo.nologo \ No newline at end of file diff --git a/recipes-diya/diya-overlay/files/extraconfig.txt b/recipes-diya/diya-overlay/files/extraconfig.txt deleted file mode 100644 index 903cf05..0000000 --- a/recipes-diya/diya-overlay/files/extraconfig.txt +++ /dev/null @@ -1 +0,0 @@ -# initramfs recovery.cpio.gz followkernel \ No newline at end of file diff --git a/recipes-diya/initramfs/files/confd b/recipes-diya/initramfs/files/confd index 7e81731..69db6b7 100644 --- a/recipes-diya/initramfs/files/confd +++ b/recipes-diya/initramfs/files/confd @@ -2,6 +2,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DESC="Custom configuration" +. /etc/profile case "$1" in start) @@ -13,6 +14,10 @@ case "$1" in echo "diya-recovery" > /proc/sys/kernel/hostname # mount boot mount /dev/mmcblk0p1 /boot + + cat << EOF >> /boot/extraconfig.txt +# initramfs recovery-${MACHINE}.cpio.gz followkernel +EOF ;; *) N=/etc/init.d/$NAME diff --git a/recipes-diya/initramfs/files/init b/recipes-diya/initramfs/files/init index 8ae5d11..905aaad 100755 --- a/recipes-diya/initramfs/files/init +++ b/recipes-diya/initramfs/files/init @@ -61,7 +61,7 @@ EFI_DIR=/sys/firmware/efi # place to store device firmware information touch /etc/fstab # initialize /proc, /sys, /run/lock and /var/lock -mkdir -p /proc /sys /run/lock /var/lock +mkdir -p /proc /sys /run/lock /var/lock /var/run mount -t proc proc /proc mount -t sysfs sysfs /sys diff --git a/recipes-diya/initramfs/recovery-boot_0.1.bb b/recipes-diya/initramfs/recovery-boot_0.1.bb index dd448eb..e121b26 100644 --- a/recipes-diya/initramfs/recovery-boot_0.1.bb +++ b/recipes-diya/initramfs/recovery-boot_0.1.bb @@ -25,7 +25,9 @@ do_install() { # base install -m 0755 ${WORKDIR}/init ${D}/init install -m 0755 ${WORKDIR}/confd ${D}/etc/init.d/confd - +cat << EOF >> ${D}/etc/profile +export MACHINE=${MACHINE} +EOF # Create device nodes expected by some kernels in initramfs # before even executing /init. install -d ${D}/dev