From 281a7fcd5924e749a96967393828421caea68e93 Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Fri, 22 Dec 2023 18:59:19 +0800 Subject: [PATCH] Add meta-igkboard for igkboard-imx8mp in yocto --- yocto/meta-igkboard/README.md | 20 +- yocto/meta-igkboard/recipes-misc/ifup-ppp/ifup-ppp_1.0.bb | 19 ++ yocto/meta-igkboard/conf/machine/igkboard-imx8mp.conf | 31 +-- yocto/meta-igkboard/recipes-misc/ifup-ppp/files/gprs-chat | 18 ++ yocto/meta-igkboard/recipes-misc/wpa-conf/files/20-wlan0.network | 6 yocto/meta-igkboard/recipes-core/base-files/base-files_%.bbappend | 4 yocto/meta-igkboard/recipes-misc/packagegroups/packagegroup-misc-utils.bb | 2 yocto/meta-igkboard/recipes-misc/wpa-conf/wpa-conf_1.0.bb | 15 - yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service | 10 yocto/meta-igkboard/recipes-misc/wpa-conf/files/10-eth0.network | 11 + /dev/null | 13 - yocto/meta-igkboard/images/yocto-image-full.bb | 134 +++++++++------- yocto/meta-igkboard/recipes-misc/ifup-ppp/files/ifup-ppp | 175 +++++++++++++++++++++ 13 files changed, 341 insertions(+), 117 deletions(-) diff --git a/yocto/meta-igkboard/README.md b/yocto/meta-igkboard/README.md index fedafdf..daf64c7 100644 --- a/yocto/meta-igkboard/README.md +++ b/yocto/meta-igkboard/README.md @@ -4,7 +4,7 @@ A meta-layer for igkboard series boards -- Yocto Mickledore(4.2) support : igkboard-8mp +- Yocto Mickledore(4.2) support : igkboard-imx8mp @@ -100,16 +100,16 @@ ``` * MACHINE=<machine configuration name> is the machine name which points to the configuration file in conf/machine in - meta-igkboard. Which should be `igkboard-8mp`. + meta-igkboard. Which should be `igkboard-imx8mp`. * -b <build dir> specifies the name of the build directory created by the ***igkboard-setup.sh*** script. -Take igkboard-8mp board as example, we can use following command to setup the Yocto build environment. +Take igkboard-imx8mp board as example, we can use following command to setup the Yocto build environment. ```bash $ cd ~/imx-yocto-bsp -$ MACHINE=igkboard-8mp source sources/meta-igkboard/tools/igkboard-setup.sh -b igkboard-8mp +$ MACHINE=igkboard-imx8mp source sources/meta-igkboard/tools/igkboard-setup.sh -b igkboard-imx8mp ``` @@ -119,7 +119,7 @@ ```bash $ cd ~/imx-yocto-bsp -$ source sources/poky/oe-init-build-env igkboard-8mp +$ source sources/poky/oe-init-build-env igkboard-imx8mp ``` @@ -133,13 +133,13 @@ The bitbake image build gathers all the components required by the image and build in order of the dependency per task. The first build is the toolchain along with the tools required for the components to build. The following command is an example on how to build an image: ```bash -$ bitbake yocto-image-full +$ bitbake coherent-image-full ``` After building, the output system images are located in `tmp/deploy/images/igkboard` : -* ***yocto-image-full.wic*** Yocto system image will be flashed into SD card or eMMC. +* ***coherent-image-full-igkboard.wic*** Yocto system image will be flashed into SD card or eMMC. * ***imx-boot*** Bootloader u-boot image @@ -151,15 +151,15 @@ After building Yocto BSP, if you want to continue to build the toolchain installer and populate the SDK image, use the following command: ```bash -$ bitbake yocto-image-full -c populate_sdk +$ bitbake coherent-image-full -c populate_sdk ``` -When building finished, you can get the yocto-image-full based SDK at *`tmp/deploy/sdk/fsl-imx-wayland-lite-glibc-x86_64-yocto-image-full-armv8a-igkboard-toolchain-6.1-mickledore.sh`*. Later, if you want to to install the SDK, just run: +When building finished, you can get the coherent-image-full based SDK at *`tmp/deploy/sdk/fsl-imx-wayland-lite-glibc-x86_64-coherent-image-full-armv8a-igkboard-toolchain-6.1-mickledore.sh`*. Later, if you want to to install the SDK, just run: ```bash -$ sudo bash tmp/deploy/sdk/fsl-imx-wayland-lite-glibc-x86_64-yocto-image-full-armv8a-igkboard-toolchain-6.1-mickledore.sh +$ sudo bash tmp/deploy/sdk/fsl-imx-wayland-lite-glibc-x86_64-coherent-image-full-armv8a-igkboard-toolchain-6.1-mickledore.sh NXP i.MX Release Distro SDK installer version 6.1-mickledore ============================================================ Enter target directory for SDK (default: /opt/fsl-imx-wayland-lite/6.1-mickledore): diff --git a/yocto/meta-igkboard/conf/machine/igkboard-imx8mp.conf b/yocto/meta-igkboard/conf/machine/igkboard-imx8mp.conf index c885267..fec84b0 100644 --- a/yocto/meta-igkboard/conf/machine/igkboard-imx8mp.conf +++ b/yocto/meta-igkboard/conf/machine/igkboard-imx8mp.conf @@ -1,42 +1,42 @@ #@TYPE: Machine -#@NAME: LingYun IoT System Studio, IGKBord-8MP +#@NAME: IoT Gatway Kits Boards based on i.MX8M Plus #@SOC: i.MX8M Plus -#@DESCRIPTION: Machine configuration for igkboard-8mp LPDDR4 2GB, eMMC 8GB. +#@DESCRIPTION: Machine configuration for LingYun IGKBoard-IMX8MP 2GB LPDDR4, 8GB eMMC #@MAINTAINER: Wenxue Guo <guowenxue@gmail.com> #@REFERENCE: meta-freescale/conf/machine/imx8mp-lpddr4-evk.conf MACHINEOVERRIDES =. "mx8:mx8m:mx8mp:" MACHINEOVERRIDES =. "igkboardbase:igkboard-imx8mp:" -BOARD_NAME = "igkboard-imx8mp" - require conf/machine/include/imx-base.inc require conf/machine/include/arm/armv8a/tune-cortexa53.inc -MACHINE_FEATURES += " wifi bluetooth " +MACHINE_FEATURES:append = " wifi bluetooth ppp " +MACHINE_FEATURES:remove = " nxp8801-sdio nxp8987-sdio nxp8997-pcie nxp8997-sdio nxp9098-pcie nxp9098-sdio nxpiw416-sdio nxpiw612-sdio qemu-usermode " -# Set DDR FIRMWARE, Refer to: -# meta-imx/meta-bsp/recipes-bsp/imx-mkimage/imx-boot_1.0.bb -# meta-imx/meta-bsp/recipes-bsp/firmware-imx/firmware-imx-8_8.18.bb +# Set DDR FIRMWARE, Refer to: +# meta-imx/meta-bsp/recipes-bsp/imx-mkimage/imx-boot_*.bb +# meta-imx/meta-bsp/recipes-bsp/firmware-imx/firmware-imx_*.bb DDR_FIRMWARE_VERSION = "202006" -DDR_FIRMWARE_NAME = " \ +DDR_FIRMWARE_NAME = " \ lpddr4_pmu_train_1d_dmem_${DDR_FIRMWARE_VERSION}.bin \ lpddr4_pmu_train_1d_imem_${DDR_FIRMWARE_VERSION}.bin \ lpddr4_pmu_train_2d_dmem_${DDR_FIRMWARE_VERSION}.bin \ lpddr4_pmu_train_2d_imem_${DDR_FIRMWARE_VERSION}.bin \ " + # Set linux DTB -KERNEL_DEVICETREE = "freescale/${BOARD_NAME}.dtb" +KERNEL_DEVICETREE = "freescale/igkboard-imx8mp.dtb" KERNEL_IMAGETYPE = "Image" -# Set u-boot DTB -UBOOT_DTB_NAME = "${BOARD_NAME}.dtb" +# Set u-boot DTB +UBOOT_DTB_NAME = "igkboard-imx8mp.dtb" LOADADDR = "" UBOOT_SUFFIX = "bin" UBOOT_MAKE_TARGET = "" SPL_BINARY = "spl/u-boot-spl.bin" UBOOT_CONFIG ??= "sd" -UBOOT_CONFIG[sd] = "${BOARD_NAME}_defconfig,sdcard" +UBOOT_CONFIG[sd] = "igkboard-imx8mp_defconfig,sdcard" SERIAL_CONSOLES = "115200;ttymxc1" # Set ATF platform name @@ -50,12 +50,9 @@ SOC_DEFAULT_IMAGE_FSTYPES:append = " wic" -# Remove unused QT example program -#CORE_IMAGE_EXTRA_INSTALL:remove += " qtbase-ptest qtbase-examples" - # Boot partition size [in KiB] for kernel and other data # More refer to: meta-freescale/classes/image_types_fsl.bbclass BOOT_SPACE = "65536" # /etc/hostname -hostname:pn-base-files = "igkboard8mp" +hostname:pn-base-files = "igkboard" diff --git a/yocto/meta-igkboard/images/yocto-image-full.bb b/yocto/meta-igkboard/images/yocto-image-full.bb index c87830a..dec0f09 100644 --- a/yocto/meta-igkboard/images/yocto-image-full.bb +++ b/yocto/meta-igkboard/images/yocto-image-full.bb @@ -7,68 +7,86 @@ #IMAGE_OVERHEAD_FACTOR = "1.0" #IMAGE_ROOTFS_EXTRA_SPACE = "512000" -## Select Image Features -IMAGE_FEATURES += " \ - ssh-server-openssh \ - hwcodecs \ - package-management \ -" - -CORE_IMAGE_EXTRA_INSTALL += " \ - packagegroup-base-wifi \ - packagegroup-core-full-cmdline \ - packagegroup-tools-bluetooth \ - packagegroup-fsl-tools-audio \ - packagegroup-imx-isp \ - packagegroup-imx-security \ - packagegroup-fsl-gstreamer1.0 \ - packagegroup-fsl-gstreamer1.0-full \ - packagegroup-core-ssh-openssh \ - openssh-sftp openssh-sftp-server \ - firmwared \ -" - -inherit populate_sdk_qt6_base - -CONFLICT_DISTRO_FEATURES = "directfb" -CORE_IMAGE_EXTRA_INSTALL:append = " packagegroup-qt6-imx tzdata " - -CORE_IMAGE_EXTRA_INSTALL:append = " \ - opencv zbar \ - gnupg \ - parted \ - v4l-utils \ - inetutils \ - hostapd \ - wireless-tools \ - spitools \ - alsa-state \ - expand-rootfs \ - wpa-conf \ - pulseaudio-server \ - xz lrzsz \ - yavta \ - libgpiod libgpiod-tools \ - powertop \ - dos2unix \ - rsync \ - python3 \ - python3-pip \ -" - -# Modify default environment -modify_env() { - echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile -} -ROOTFS_POSTPROCESS_COMMAND += "modify_env; " - inherit extrausers # Create the password hash with following command on host: -# >> mkpasswd -m sha256crypt igkboard -S abcd6789 +# >> mkpasswd -m sha256crypt password -S abcd6789 # Remember to escape the character $ in the resulting hash -# Set the root password: igkboard -#PASSWD="\$5\$abcd6789\$vlMo5CC1IJlipoXWQifbiMJ8fZqRIV26EXIi97RxPjC" +# Set the root password: +#PASSWD="\$5\$abcd6789\$Vuv1aLz04ZwhxgsB3lOQbwy1XUS6PJ.8h2A7.9HoUd3" EXTRA_USERS_PARAMS = "\ usermod -p '${PASSWD}' root; \ " + +## Select Image Features +IMAGE_FEATURES += " \ + hwcodecs \ + ssh-server-openssh \ + package-management \ +" + +CONFLICT_DISTRO_FEATURES = "directfb" + +CORE_IMAGE_EXTRA_INSTALL += " \ + packagegroup-base-wifi \ + packagegroup-imx-isp \ + packagegroup-imx-security \ + packagegroup-fsl-tools-audio \ + packagegroup-core-full-cmdline \ + packagegroup-tools-bluetooth \ + packagegroup-core-ssh-openssh \ + packagegroup-fsl-gstreamer1.0 \ + packagegroup-fsl-gstreamer1.0-full \ + packagegroup-qt6-modules \ + packagegroup-misc-utils \ +" + +CORE_IMAGE_EXTRA_INSTALL += " \ + kernel-modules \ + firmwared linux-firmware \ + powertop tzdata ppp vim \ + xz lrzsz rsync dos2unix \ + gnupg parted inetutils \ + hostapd wireless-tools iw \ + i2c-tools spidev-test \ + libgpiod libgpiod-tools \ + opencv zbar v4l-utils yavta \ + alsa-state pulseaudio-server \ + python3 python3-pip \ + openssh-sftp openssh-sftp-server \ + memtester pcsc-tools stunnel ntp \ + curl evtest cpufrequtils \ + dosfstools ethtool iproute2 \ + e2fsprogs-mke2fs e2fsprogs-resize2fs \ +" + +modify_rootfs() { + + # Modify default environment + echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile + + # Update wpa_supplicant service + sed -i "/^After=/d" ${IMAGE_ROOTFS}/lib/systemd/system/wpa_supplicant@.service +} + +# Remove unused files in rootfs +doclean_rootfs() { + + # remove unsed test apps + rm -rf ${IMAGE_ROOTFS}/unit_tests + + # remove unsed firmware + mkdir -p ${IMAGE_ROOTFS}/lib/firmware/.bak + + mv ${IMAGE_ROOTFS}/lib/firmware/imx* ${IMAGE_ROOTFS}/lib/firmware/.bak + mv ${IMAGE_ROOTFS}/lib/firmware/nxp* ${IMAGE_ROOTFS}/lib/firmware/.bak + mv ${IMAGE_ROOTFS}/lib/firmware/mediatek ${IMAGE_ROOTFS}/lib/firmware/.bak + mv ${IMAGE_ROOTFS}/lib/firmware/mt76* ${IMAGE_ROOTFS}/lib/firmware/.bak + mv ${IMAGE_ROOTFS}/lib/firmware/rtl* ${IMAGE_ROOTFS}/lib/firmware/.bak + + rm -rf ${IMAGE_ROOTFS}/lib/firmware/* + mv ${IMAGE_ROOTFS}/lib/firmware/.bak/* ${IMAGE_ROOTFS}/lib/firmware/ + rm -rf ${IMAGE_ROOTFS}/lib/firmware/.bak +} + +ROOTFS_POSTPROCESS_COMMAND += "modify_rootfs; doclean_rootfs; " diff --git a/yocto/meta-igkboard/recipes-core/base-files/base-files_%.bbappend b/yocto/meta-igkboard/recipes-core/base-files/base-files_%.bbappend index a40fadb..4eb674e 100644 --- a/yocto/meta-igkboard/recipes-core/base-files/base-files_%.bbappend +++ b/yocto/meta-igkboard/recipes-core/base-files/base-files_%.bbappend @@ -4,10 +4,10 @@ do_install_basefilesissue:append() { # Overwrite /etc/issue with a custom string - printf "Welcome to LingYun IoT Gateway Kits Board GNU/Linux Yocto System, Default Password '12345'.\n" > ${D}${sysconfdir}/issue + printf "STE ORCHID TRANSIT CONTACTLESS READER\n" > ${D}${sysconfdir}/issue # Overwrite /etc/issue.net with a custom string - printf "Welcome to LingYun IoT Gateway Kits Board GNU/Linux Yocto System, Default Password '12345'.\n" > ${D}${sysconfdir}/issue.net + printf "STE ORCHID TRANSIT CONTACTLESS READER\n" > ${D}${sysconfdir}/issue.net } do_install:append() { diff --git a/yocto/meta-igkboard/recipes-misc/ifup-ppp/files/gprs-chat b/yocto/meta-igkboard/recipes-misc/ifup-ppp/files/gprs-chat new file mode 100755 index 0000000..cd6df09 --- /dev/null +++ b/yocto/meta-igkboard/recipes-misc/ifup-ppp/files/gprs-chat @@ -0,0 +1,18 @@ +# FILE:/etc/ppp/gprs-chat +# Copyright (C) 2011 GuoWenxue <guowenxue@gmail.com> +# This is second part of the ppp dial script. It will perform the connection +# protocol for the desired connection by chat with modem. +# + ABORT 'BUSY' + ABORT 'NO ANSWER' + ABORT 'NO CARRIER' + ABORT 'NO DIALTONE' + ABORT 'ERROR' + ABORT '\nRING\r\n\r\nRING\r' + TIMEOUT 20 + '' ATE0 + OK AT+CGDCONT=1,"IP","$APN" + OK ATD$DIALNUM + SAY " + requesting data connection\n" + CONNECT '' + SAY " + connected\n" diff --git a/yocto/meta-igkboard/recipes-misc/ifup-ppp/files/ifup-ppp b/yocto/meta-igkboard/recipes-misc/ifup-ppp/files/ifup-ppp new file mode 100755 index 0000000..156a18c --- /dev/null +++ b/yocto/meta-igkboard/recipes-misc/ifup-ppp/files/ifup-ppp @@ -0,0 +1,175 @@ +#!/bin/sh +# FILE:/usr/sbin/ifup-ppp +# Copyright (C) 2011 GuoWenxue <guowenxue@gmail.com> +# This file used to do PPP dial up. + +#-------------------------------------------------- +# Function definition here +#-------------------------------------------------- +usage() +{ + prog=`basename $0` + echo "$prog Usage: $prog [-d /dev/ttyUSB0] [-a apn] [-u username] [-p password] [-v chap/pap] [-i ipaddr] pppXX" + echo "" + echo " This shell script used to do pppd dial up on GPRS/3G modem, if no options gived, it" + echo "will use the default configure file \"$network_cfg_dir/ifcfg-pppXX\". If get options" + echo "in this command, it will use the option from the command line, and be careful the -d" + echo "option must be given to specify the modem device." + echo "" + + echo "pppXX: Required, specify the dial up generated PPP device, such as ppp10." + echo "-d: Required, if use command line options, specify the modem TTY device." + echo "-a: Option, APN(Access Point Name) for the SIM card provider." + echo "-u: Option, username for the GPRS login if needed." + echo "-p: Option, password for the GPRS login if needed." + echo "-v: Option, authenticate method, pap or chap." + echo "-i: Option, <local_IP_address>:<remote_IP_address> such as 0.0.0.0:0.0.0.0 " + echo "Example: ifup-ppp -d /dev/ttyUSB0 -a 3gnet -u uid -p pwd ppp10" + + echo "" + echo "Copyright (C) 2011 GuoWenxue <guowenxue@gmail.com>" + exit +} + +#=============================== +# Global variable declare = +#=============================== +modem= +inf= +apn= +uid= +pwd= + + +# Configure file +if [ -z "$network_cfg_dir" ]; then + export network_cfg_dir=/apps/etc/network +fi + +#=============================== +# Shell body start here = +#=============================== + +if [ $# -lt 1 ] ; then + usage; +elif [ $# -eq 1 ] ; then + inf=$1 + conf=ifcfg-$inf + + cd $network_cfg_dir + + if [ ! -f $conf ]; then + echo "=================================================================================" + echo "ERROR: $inf dial up configure file \"$network_cfg_dir/$conf\" not found!" + echo "=================================================================================" + echo "" + usage; + exit; + fi + + . $conf + modem=$MODEM + apn=$APN + uid=$USERNAME + pwd=$PASSWORD + vrfy=$VERIFY + ipaddr=$IPADDR + cd - +else + while getopts "a:d:u:p:v:hi:" Option + do + case $Option in + d) modem=$OPTARG ;; + i) ipaddr=$OPTARG ;; + a) apn=$OPTARG ;; + u) uid=$OPTARG ;; + p) pwd=$OPTARG ;; + v) vrfy=$OPTARG ;; + h) pwd=$OPTARG; usage ;; + esac + done + shift $(($OPTIND - 1)) + inf=$* +fi + +if [ -z "$modem" ] ; then + usage; + exit; +fi + +if [ ! -c "$modem" ] ; then + echo "ERROR: Modem device $modem doesn't exist!" + exit +fi + +inf=$( echo $inf | tr -cd '[0-9]\n' ) + + +# Chat script need these two variable +export APN=$apn +export DIALNUM="*99***1#" +chat_script="/etc/ppp/gprs-chat" + +#====================== +# The pppd options # +#====================== + +options="$modem 115200" + +if [ -n "$uid" -a -n "pwd" ]; then + options=$options" name $uid" + options=$options" password $pwd" +fi + +if [ -n "$inf" ] ; then + options=$options" unit $inf" +fi + +if [ "$vrfy" == "chap" ] ; then + options=$options" require-chap" +else + options=$options" require-pap" +fi + +# Restart after idle X second +options=$options" idle 86400" + +options=$options" refuse-mschap refuse-mschap-v2 refuse-eap" + +options=$options" nodefaultroute updetach" +options=$options" debug" + +options=$options" lcp-echo-failure 3 lcp-echo-interval 5" +options=$options" ipcp-accept-local ipcp-accept-remote ipcp-restart 50" + +options=$options" modem crtscts" + + +if [ -n "$ipaddr" ] ; then + options=$options" $ipaddr" +fi + +# Let the phone figure out all the IP addresses +options=$options" noipdefault" + +options=$options" noauth" + +# No ppp compression +options=$options" novj noccp novjccomp" + +# For sanity, keep a lock on the serial line +options=$options" lock" + +#================================= +# PPP dial up command start up # +#================================= +set -x + +#chat option should can be: -v -E -V -f +pppd $options connect "/usr/sbin/chat -v -E -f $chat_script" + +if [ -d /sys/class/net/ppp$inf ] ; then + ip route add default dev ppp$inf metric 10 + #ip route add default dev ppp$inf + /apps/tools/gatewayD > /dev/null 2>&1 +fi diff --git a/yocto/meta-igkboard/recipes-misc/ifup-ppp/ifup-ppp_1.0.bb b/yocto/meta-igkboard/recipes-misc/ifup-ppp/ifup-ppp_1.0.bb new file mode 100644 index 0000000..be18f4b --- /dev/null +++ b/yocto/meta-igkboard/recipes-misc/ifup-ppp/ifup-ppp_1.0.bb @@ -0,0 +1,19 @@ +DESCRIPTION = "4G Modem ppp dial up tools" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI += " file://ifup-ppp " +SRC_URI += " file://gprs-chat " +FILES:${PN} += "${sbindir}/ifup-ppp" +FILES:${PN} += "${sysconfdir}/ppp/gprs-chat" + +do_install() { + install -d ${D}/${sbindir}/ + install -d ${D}/${sysconfdir}/ppp + install -m 0755 ${WORKDIR}/ifup-ppp ${D}/${sbindir}/ + install -m 0755 ${WORKDIR}/gprs-chat ${D}/${sysconfdir}/ppp +} + +RDEPENDS:expand-rootfs = "bash" diff --git a/yocto/meta-igkboard/recipes-misc/packagegroups/packagegroup-misc-utils.bb b/yocto/meta-igkboard/recipes-misc/packagegroups/packagegroup-misc-utils.bb index 6562bc8..e43a535 100644 --- a/yocto/meta-igkboard/recipes-misc/packagegroups/packagegroup-misc-utils.bb +++ b/yocto/meta-igkboard/recipes-misc/packagegroups/packagegroup-misc-utils.bb @@ -3,4 +3,4 @@ inherit packagegroup -RDEPENDS:${PN} = "expand-rootfs sshswitch wpa-conf" +RDEPENDS:${PN} = "expand-rootfs wpa-conf ifup-ppp" diff --git a/yocto/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.service b/yocto/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.service deleted file mode 100644 index 1446aa2..0000000 --- a/yocto/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Turn on SSH if /run/media/boot-mmcblk0p1/ssh is present -ConditionPathExists=/run/media/boot-mmcblk0p1/ssh -After=weston.service - -[Service] -Type=oneshot -ExecStart=/bin/sh -c "/bin/sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config && rm -f /run/media/boot-mmcblk0p1/ssh" - -[Install] -WantedBy=multi-user.target diff --git a/yocto/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.timer b/yocto/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.timer deleted file mode 100644 index 996d9fe..0000000 --- a/yocto/meta-igkboard/recipes-misc/sshswitch/files/sshswitch.timer +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Timer for the sshswitch service - -[Timer] -OnBootSec=20 - -[Install] -WantedBy=timers.target diff --git a/yocto/meta-igkboard/recipes-misc/sshswitch/sshswitch_1.0.bb b/yocto/meta-igkboard/recipes-misc/sshswitch/sshswitch_1.0.bb deleted file mode 100644 index 445d927..0000000 --- a/yocto/meta-igkboard/recipes-misc/sshswitch/sshswitch_1.0.bb +++ /dev/null @@ -1,20 +0,0 @@ -DESCRIPTION = "Turn on SSH if /boot/ssh is present" -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" - -inherit systemd - -SYSTEMD_AUTO_ENABLE = "enable" -SYSTEMD_SERVICE:${PN} = "sshswitch.timer" - -SRC_URI += " file://sshswitch.service " -SRC_URI += " file://sshswitch.timer " - -FILES:${PN} += "${systemd_unitdir}/system/sshswitch.service" -FILES:${PN} += "${systemd_unitdir}/system/sshswitch.timer" - -do_install() { - install -d ${D}/${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/sshswitch.service ${D}/${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/sshswitch.timer ${D}/${systemd_unitdir}/system -} diff --git a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/10-eth0.network b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/10-eth0.network new file mode 100644 index 0000000..a3980f3 --- /dev/null +++ b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/10-eth0.network @@ -0,0 +1,11 @@ +[Match] +Name=eth0 + +#[Network] +#DHCP=yes + +[Network] +Address=192.168.1.188/24 +Gateway=192.168.1.1 +DNS=8.8.8.8 +DNS=4.2.2.2 diff --git a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/20-wlan0.network b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/20-wlan0.network index 36d3a47..6b0660b 100644 --- a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/20-wlan0.network +++ b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/20-wlan0.network @@ -3,3 +3,9 @@ [Network] DHCP=yes + +#[Network] +#Address=192.168.5.188/24 +#Gateway=192.168.5.1 +#DNS=8.8.8.8 +#DNS=4.2.2.2 diff --git a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service index bb68ca2..34bc0ca 100644 --- a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service +++ b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.service @@ -1,15 +1,11 @@ [Unit] -Description=Copy user wpa_supplicant.conf -ConditionPathExists=/run/media/boot-mmcblk0p1/wpa_supplicant.conf -After=getty.target +Description=Enable wpa_supplicant service +Requires=sys-subsystem-net-devices-wlan0.device [Service] Type=oneshot RemainAfterExit=yes -ExecStartPre=/bin/mkdir -p /etc/wpa_supplicant/ -ExecStart=/bin/mv /run/media/boot-mmcblk0p1/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant-wlan0.conf -ExecStartPost=/bin/chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf -ExecStartPost=/bin/sh -c "systemctl enable --now wpa_supplicant@wlan0" +ExecStart=/bin/sh -c "systemctl enable --now wpa_supplicant@wlan0" [Install] WantedBy=multi-user.target diff --git a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.timer b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.timer deleted file mode 100644 index 43e789c..0000000 --- a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa-conf.timer +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Timer for the wpa-conf service - -[Timer] -OnBootSec=20 - -[Install] -WantedBy=timers.target diff --git a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa_supplicant@.service b/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa_supplicant@.service deleted file mode 100644 index 5bdf3dd..0000000 --- a/yocto/meta-igkboard/recipes-misc/wpa-conf/files/wpa_supplicant@.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=WPA supplicant daemon (interface-specific version) -Before=network.target -Wants=network.target - -# NetworkManager users will probably want the dbus version instead. - -[Service] -Type=simple -ExecStart=/usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -i%I - -[Install] -WantedBy=multi-user.target diff --git a/yocto/meta-igkboard/recipes-misc/wpa-conf/wpa-conf_1.0.bb b/yocto/meta-igkboard/recipes-misc/wpa-conf/wpa-conf_1.0.bb index d2c288a..0833653 100644 --- a/yocto/meta-igkboard/recipes-misc/wpa-conf/wpa-conf_1.0.bb +++ b/yocto/meta-igkboard/recipes-misc/wpa-conf/wpa-conf_1.0.bb @@ -1,34 +1,31 @@ -DESCRIPTION = "Copy user wpa_supplicant.conf" +DESCRIPTION = "Default eth0 and wlan0 network service" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" inherit systemd SYSTEMD_AUTO_ENABLE = "enable" -SYSTEMD_SERVICE:${PN} = "wpa-conf.timer" +SYSTEMD_SERVICE:${PN} = "wpa-conf.service" WLAN_DEV ?= "wlan0" +SRC_URI += " file://10-eth0.network " SRC_URI += " file://20-wlan0.network " SRC_URI += " file://wpa-conf.service " -SRC_URI += " file://wpa-conf.timer " -SRC_URI += " file://wpa_supplicant@.service " +FILES:${PN} += "${sysconfdir}/systemd/network/10-eth0.network" FILES:${PN} += "${sysconfdir}/systemd/network/20-wlan0.network" FILES:${PN} += "${systemd_unitdir}/system/wpa-conf.service" -FILES:${PN} += "${systemd_unitdir}/system/wpa-conf.timer" -FILES:${PN} += "${systemd_unitdir}/system/wpa_supplicant@.service" do_install() { install -d ${D}/${systemd_unitdir}/system install -d ${D}${sysconfdir}/systemd/network + + install -m 0644 ${WORKDIR}/10-eth0.network ${D}${sysconfdir}/systemd/network install -m 0644 ${WORKDIR}/20-wlan0.network ${D}${sysconfdir}/systemd/network sed -i "s|wlan0|${WLAN_DEV}|g" ${D}${sysconfdir}/systemd/network/20-wlan0.network install -m 0644 ${WORKDIR}/wpa-conf.service ${D}/${systemd_unitdir}/system sed -i "s|wlan0|${WLAN_DEV}|g" ${D}/${systemd_unitdir}/system/wpa-conf.service - - install -m 0644 ${WORKDIR}/wpa-conf.timer ${D}/${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/wpa_supplicant@.service ${D}/${systemd_unitdir}/system } -- Gitblit v1.9.1