mirror of
https://github.com/lxsang/meta-rpi-diya.git
synced 2025-07-31 05:00:42 +02:00
initial commit
This commit is contained in:
31
recipes-diya/diya-overlay/diya-overlay.bb
Normal file
31
recipes-diya/diya-overlay/diya-overlay.bb
Normal file
@ -0,0 +1,31 @@
|
||||
DESCRIPTION = "Auto configuration deployment from media"
|
||||
DEPENDS = ""
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
SRC_URI += "file://confd \
|
||||
file://expandfs.sh \
|
||||
file://80_diya \
|
||||
file://fs_resize"
|
||||
|
||||
|
||||
inherit update-rc.d useradd
|
||||
|
||||
USERADD_PACKAGES = "${PN}"
|
||||
GROUPADD_PACKAGES = "${PN}"
|
||||
|
||||
USERADD_PARAM:${PN} = "-u 1000 -d /home/diya -r -s /bin/sh diya"
|
||||
|
||||
INITSCRIPT_NAME = "confd"
|
||||
INITSCRIPT_PARAMS = "start 80 S ."
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/${sysconfdir}/init.d/
|
||||
install -m 0755 ${WORKDIR}/confd ${D}/${sysconfdir}/init.d/confd
|
||||
install -d ${D}/usr/bin/
|
||||
install -d ${D}/etc/default/volatiles
|
||||
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}/
|
||||
}
|
||||
|
2
recipes-diya/diya-overlay/files/80_diya
Normal file
2
recipes-diya/diya-overlay/files/80_diya
Normal file
@ -0,0 +1,2 @@
|
||||
l root root 0644 /etc/network/interfaces /home/diya/etc/network/interfaces
|
||||
l root root 0644 /etc/dropbear /home/diya/etc/dropbear
|
39
recipes-diya/diya-overlay/files/confd
Normal file
39
recipes-diya/diya-overlay/files/confd
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="Auto deployment configuration from media"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Start $DESC: "
|
||||
if [ -f "/boot/fs_resize" ]; then
|
||||
/usr/bin/expandfs.sh
|
||||
touch /boot/home_partition_should_be_formated
|
||||
rm /boot/fs_resize
|
||||
reboot
|
||||
fi
|
||||
if [ -f "/boot/home_partition_should_be_formated" ]; then
|
||||
echo "Trying to format the home partition"
|
||||
umount /dev/mmcblk0p3
|
||||
yes | mkfs.ext4 /dev/mmcblk0p3
|
||||
mount /dev/mmcblk0p3 /home
|
||||
mkdir -p /home/diya/etc/network
|
||||
mkdir -p /home/diya/etc/dropbear
|
||||
chown -R diya:diya /home/diya
|
||||
rm /boot/home_partition_should_be_formated
|
||||
fi
|
||||
if [ -e "/boot/install" ];then
|
||||
cp -rf /boot/install/* /home/diya
|
||||
rm -rf /boot/install
|
||||
reboot
|
||||
fi
|
||||
# display information
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
31
recipes-diya/diya-overlay/files/expandfs.sh
Normal file
31
recipes-diya/diya-overlay/files/expandfs.sh
Normal file
@ -0,0 +1,31 @@
|
||||
#! /bin/sh
|
||||
line=$(
|
||||
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk0 | grep /dev/mmcblk0p3
|
||||
p
|
||||
q
|
||||
EOF
|
||||
)
|
||||
|
||||
echo "Partition: $line"
|
||||
#start_sector=$(echo "$line" | cut -d' ' -f14)
|
||||
start_sector=$(echo "$line" | cut -d' ' -f15)
|
||||
echo "Start sector is: $start_sector"
|
||||
|
||||
if [ -z "$start_sector" ]; then
|
||||
echo "Cannot find the start sector"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Expanding the partition"
|
||||
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/mmcblk0
|
||||
d
|
||||
3
|
||||
n # new partition
|
||||
p # primary partition
|
||||
3 # partition number 3
|
||||
$start_sector
|
||||
# default - end of disk
|
||||
p # print the in-memory partition table
|
||||
w # write the partition table
|
||||
q # and we're done
|
||||
EOF
|
1
recipes-diya/diya-overlay/files/fs_resize
Normal file
1
recipes-diya/diya-overlay/files/fs_resize
Normal file
@ -0,0 +1 @@
|
||||
resize the partition
|
@ -0,0 +1,73 @@
|
||||
From 7117dbf8b8defcf69f7aac3f7daf97ec00e5e73a Mon Sep 17 00:00:00 2001
|
||||
From: Xuan Sang LE <xsang.le@gmail.com>
|
||||
Date: Wed, 15 Dec 2021 02:24:37 +0100
|
||||
Subject: [PATCH] Update configure
|
||||
|
||||
---
|
||||
platforms/unix/config/configure | 53 ---------------------------------
|
||||
1 file changed, 53 deletions(-)
|
||||
|
||||
diff --git a/platforms/unix/config/configure b/platforms/unix/config/configure
|
||||
index f9e8c24aa5..85aacaa5e6 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -13292,59 +13292,6 @@ fi
|
||||
|
||||
|
||||
|
||||
-# Check size assumptions of basic data types
|
||||
-
|
||||
-
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking \"size of int\"" >&5
|
||||
-$as_echo_n "checking \"size of int\"... " >&6; }
|
||||
- if test "$cross_compiling" = yes; then :
|
||||
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
-as_fn_error $? "cannot run test program while cross compiling
|
||||
-See \`config.log' for more details" "$LINENO" 5; }
|
||||
-else
|
||||
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
-/* end confdefs.h. */
|
||||
-#include <sys/types.h>
|
||||
- int main(){return(sizeof(int) == 4)?0:1;}
|
||||
-_ACEOF
|
||||
-if ac_fn_c_try_run "$LINENO"; then :
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"okay\"" >&5
|
||||
-$as_echo "\"okay\"" >&6; }
|
||||
-else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"bad\"" >&5
|
||||
-$as_echo "\"bad\"" >&6; }
|
||||
- as_fn_error $? "\"one or more basic data types has an incompatible size: giving up\"" "$LINENO" 5
|
||||
-fi
|
||||
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
- conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
-fi
|
||||
-
|
||||
-
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking \"size of double\"" >&5
|
||||
-$as_echo_n "checking \"size of double\"... " >&6; }
|
||||
- if test "$cross_compiling" = yes; then :
|
||||
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
-as_fn_error $? "cannot run test program while cross compiling
|
||||
-See \`config.log' for more details" "$LINENO" 5; }
|
||||
-else
|
||||
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
-/* end confdefs.h. */
|
||||
-#include <sys/types.h>
|
||||
- int main(){return(sizeof(double) == 8)?0:1;}
|
||||
-_ACEOF
|
||||
-if ac_fn_c_try_run "$LINENO"; then :
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"okay\"" >&5
|
||||
-$as_echo "\"okay\"" >&6; }
|
||||
-else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"bad\"" >&5
|
||||
-$as_echo "\"bad\"" >&6; }
|
||||
- as_fn_error $? "\"one or more basic data types has an incompatible size: giving up\"" "$LINENO" 5
|
||||
-fi
|
||||
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
- conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
-fi
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
2
recipes-diya/opensmalltalk-cog-vm/files/svm
Normal file
2
recipes-diya/opensmalltalk-cog-vm/files/svm
Normal file
@ -0,0 +1,2 @@
|
||||
#! /bin/sh
|
||||
LD_LIBRARY_PATH=/opt/squeak /opt/squeak/squeak $@
|
48
recipes-diya/opensmalltalk-cog-vm/opensmalltalk-cog-vm.bb
Normal file
48
recipes-diya/opensmalltalk-cog-vm/opensmalltalk-cog-vm.bb
Normal file
@ -0,0 +1,48 @@
|
||||
DESCRIPTION = "Pharo VM"
|
||||
# DEPENDS = ""
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
#FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||
|
||||
DEPENDS = "libsdl2 "
|
||||
|
||||
# pharo 9.0
|
||||
# SRCREV = "${AUTOREV}"
|
||||
SRCREV = "27d2d9f0c76b5805ff43578272e809aeb665a498"
|
||||
SRC_URI = "git://github.com/OpenSmalltalk/opensmalltalk-vm.git;branch=Cog;"
|
||||
SRC_URI += "file://001-disable-run-test-in-cross-compile.patch"
|
||||
SRC_URI += "file://svm"
|
||||
|
||||
S="${WORKDIR}/git/platforms/unix/config"
|
||||
B="${WORKDIR}/build"
|
||||
inherit autotools
|
||||
|
||||
TARGET_CFLAGS += " -D__ARM_ARCH_6__ -DDEBUGVM=0 "
|
||||
|
||||
EXTRA_OECONF:append=" --with-src=src/spur32.cog \
|
||||
--with-sysroot=${STAGING_DIR_TARGET} \
|
||||
--without-npsqueak"
|
||||
INSANE_SKIP += " configure-unsafe "
|
||||
|
||||
do_configure() {
|
||||
cd ${WORKDIR}/git/ && ./scripts/updateSCCSVersions
|
||||
cp ${WORKDIR}/git/building/linux32ARMv6/pharo.cog.spur/plugins.* ${B}/
|
||||
cd ${B}
|
||||
oe_runconf
|
||||
}
|
||||
|
||||
do_compile() {
|
||||
cd ${B}
|
||||
mkdir -p ${B}/output
|
||||
ROOT=${B}/output make -j 4 install-squeak install-plugins
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/opt/squeak
|
||||
install -d ${D}/usr/bin
|
||||
install -m 0755 ${B}/output/usr/lib/squeak/* ${D}/opt/squeak
|
||||
install -m 0755 ${WORKDIR}/svm ${D}/usr/bin
|
||||
}
|
||||
PACKAGES = "${PN} ${PN}-dbg"
|
||||
FILES:${PN} += "/opt/squeak/*"
|
19
recipes-diya/pharo/files/001-patch-vm-maker.patch
Normal file
19
recipes-diya/pharo/files/001-patch-vm-maker.patch
Normal file
@ -0,0 +1,19 @@
|
||||
--- a/cmake/vmmaker.cmake
|
||||
+++ b/cmake/vmmaker.cmake
|
||||
@@ -62,16 +62,6 @@ if(GENERATE_SOURCES)
|
||||
set(VMMAKER_VM ${VMMAKER_DIR}/vm/PharoConsole.exe)
|
||||
set(VM_URL https://files.pharo.org/vm/pharo-spur64/win/PharoVM-8.6.1-e829a1da-StockReplacement-win64-bin_signed.zip)
|
||||
set(VM_URL_HASH SHA256=d24a2fb5d8d744a4c8ce0bc332051960d6f5d8db9f75754317b5aee8eafb7cb1)
|
||||
- elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"))
|
||||
- message("Defining Linux AARCH64 VM to download for code generation")
|
||||
- set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
|
||||
- set(VM_URL https://files.pharo.org/vm/pharo-spur64/Linux-aarch64/stable.zip)
|
||||
- set(VM_URL_HASH SHA256=924e5a25f8e2d51773e8571ebefa2404da9561418af2b54af1330357b75ae865)
|
||||
- elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l"))
|
||||
- message("Defining Linux ARM 32 VM to download for code generation")
|
||||
- set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
|
||||
- set(VM_URL https://files.pharo.org/vm/pharo-spur32/Linux-armv7l/stable.zip)
|
||||
- set(VM_URL_HASH SHA256=1816e44523e08e7effe3226a3cabc4ea701fb9582c00456ab90936efb5c645c4)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message("Defining Linux VM x86_64 to download for code generation")
|
||||
set(VMMAKER_VM ${VMMAKER_DIR}/vm/pharo)
|
35
recipes-diya/pharo/pharo-vm_9.0.bbbackup
Normal file
35
recipes-diya/pharo/pharo-vm_9.0.bbbackup
Normal file
@ -0,0 +1,35 @@
|
||||
DESCRIPTION = "Pharo VM"
|
||||
# DEPENDS = ""
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
#FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||
|
||||
DEPENDS = "libsdl2 libdrm tslib mesa mesa-demos"
|
||||
|
||||
# pharo 9.0
|
||||
SRCREV = "${AUTOREV}"
|
||||
IMAGE_FILE ?= "latest-64.zip;sha256sum=5fcb782c39663391402d915d29251815be3fa378f1398a41a702387b5fcc8577;"
|
||||
# TODO add checksum form 64 bits images
|
||||
IMAGE_FILE:raspberrypi = "latest-32.zip;sha256sum=660e9fd0c6bd5650574cbbea0773d17a75f05be14ce68a119727dc9200a49a30;"
|
||||
#SRCREV = "961e9c4589540b2cccb924f17bb051bc8c9ae5c1"
|
||||
SRC_URI = "git://github.com/pharo-project/opensmalltalk-vm.git;branch=pharo-9;"
|
||||
SRC_URI += "http://files.pharo.org/image/90/${IMAGE_FILE};"
|
||||
SRC_URI += "file://001-patch-vm-maker.patch"
|
||||
S="${WORKDIR}/git"
|
||||
|
||||
EXTRA_OECMAKE += "-DFEATURE_LIB_GIT2=off -DFEATURE_LIB_CAIRO=off "
|
||||
TARGET_CFLAGS:raspberrypi += "-D__ARM_ARCH_6__"
|
||||
inherit cmake
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/opt/pharo
|
||||
install -d ${D}/opt/pharo/images
|
||||
install -m 0755 ${B}/build/vm/* ${D}/opt/pharo
|
||||
install -m 0755 ${WORKDIR}/*.image ${D}/opt/pharo/images/
|
||||
install -m 0755 ${WORKDIR}/*.changes ${D}/opt/pharo/images/
|
||||
install -m 0755 ${WORKDIR}/*.sources ${D}/opt/pharo/images/
|
||||
}
|
||||
PACKAGES = "${PN} ${PN}-dbg"
|
||||
FILES:${PN} += "/opt/pharo/*"
|
||||
# FILES:${PN} += "/opt/images/*"
|
Reference in New Issue
Block a user