diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2016-08-17 15:12:40 +0200 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2016-09-28 14:14:23 -0700 |
commit | 2e01657c7435ad629731f2be3ca842773ff3b939 (patch) | |
tree | 4040d50f1dda3199c32d2ae21062424de882bd05 /recipes-images | |
parent | 4b914089531c92620d4a2f7b5e04c65c4b4d5753 (diff) |
images: mv all files into recipes-image/image
This requires to adjust the path to include files, e.g.:
-require recipes/images/trdx-image-fstype.inc
+require recipes-images/images/trdx-image-fstype.inc
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Acked-by: Stefan Agner <stefan.agner@toradex.com>
Diffstat (limited to 'recipes-images')
100 files changed, 3779 insertions, 0 deletions
diff --git a/recipes-images/images/angstrom-lxde-image.bb b/recipes-images/images/angstrom-lxde-image.bb new file mode 100644 index 0000000..678bf09 --- /dev/null +++ b/recipes-images/images/angstrom-lxde-image.bb @@ -0,0 +1,263 @@ +#Angstrom image +SUMMARY = "Image based on the LXDE desktop" + +LICENSE = "MIT" + +PV = "V2.6" +PR = "r0" + +#start of the resulting deployable tarball name +IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxImage" +IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxImage" +IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxImage" +IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxImage" +IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxImage" +IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxImage" +IMAGE_NAME_colibri-t20 = "Colibri_T20_LinuxImage" +IMAGE_NAME_colibri-t30 = "Colibri_T30_LinuxImage" +IMAGE_NAME_colibri-vf = "Colibri_VF_LinuxImage" +IMAGE_NAME = "${MACHINE}_LinuxImage" + +SYSTEMD_DEFAULT_TARGET = "graphical.target" + +#create the deployment directory-tree +require recipes-images/images/trdx-image-fstype.inc + +#remove interfering sysv scripts, connman systemd service +do_mkrmscript () { + echo "for i in ${IMAGE_ROOTFS}/etc/rc0.d ${IMAGE_ROOTFS}/etc/rc1.d ${IMAGE_ROOTFS}/etc/rc2.d ${IMAGE_ROOTFS}/etc/rc3.d ${IMAGE_ROOTFS}/etc/rc4.d ${IMAGE_ROOTFS}/etc/rc5.d ${IMAGE_ROOTFS}/etc/rc6.d ${IMAGE_ROOTFS}/etc/rcS.d ; do" > ${WORKDIR}/rmscript + echo " rm -f \$i/*dropbear \$i/*avahi-daemon \$i/*dbus-1 \$i/*lxdm \$i/*ntpd \$i/*syslog \$i/*ofono \$i/*alsa-state \$i/*networking \$i/*udev-late-mount \$i/*sendsigs \$i/*save-rtc.sh \$i/*umountnfs.sh \$i/*portmap \$i/*umountfs \$i/*halt \$i/*rmnologin.sh \$i/*reboot; rm -f \$i/*banner.sh \$i/*sysfs.sh \$i/*checkroot.sh \$i/*alignment.sh \$i/*mountall.sh \$i/*populate-volatile.sh \$i/*devpts.sh \$i/*hostname.sh \$i/*portmap \$i/*mountnfs.sh \$i/*bootmisc.sh" >> ${WORKDIR}/rmscript + echo "done" >> ${WORKDIR}/rmscript + chmod +x ${WORKDIR}/rmscript + readlink -e ${WORKDIR}/rmscript + cat ${WORKDIR}/rmscript +} +addtask mkrmscript after do_rootfs before do_imagedeploy + +IMAGE_LINGUAS = "en-us" +#IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in" +#ROOTFS_POSTPROCESS_COMMAND += 'install_linguas; ' + +DISTRO_UPDATE_ALTERNATIVES ??= "" +ROOTFS_PKGMANAGE_PKGS ?= '${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${ROOTFS_PKGMANAGE} ${DISTRO_UPDATE_ALTERNATIVES}", d)}' + +CONMANPKGS ?= "connman connman-client connman-gnome" +CONMANPKGS_libc-uclibc = "" + +DEPENDS_append_tegra = " gst-plugins-good gst-plugins-bad gst-plugins-ugly" +#do not build plugins-ugly because it would require to whitelist LICENCES without deploying them +DEPENDS += "gstreamer1.0-plugins-good gstreamer1.0-plugins-bad" +DEPENDS_remove_tegra = "gstreamer1.0-plugins-good gstreamer1.0-plugins-bad" + +#deploy the OpenGL ES headers to the sysroot +DEPENDS_append_tegra = " nvsamples" + +IMAGE_BROWSER = "firefox" +#keep the rootfs size small +IMAGE_BROWSER_colibri-vf = "" + +# don't install some packages bloating the vybrid image +BAD_RECOMMENDATIONS_append_colibri-vf = " udev-hwdb cpufrequtils" + +# don't install a second icon theme +BAD_RECOMMENDATIONS_append = " adwaita-icon-theme adwaita-icon-theme-symbolic" + +# this would pull in a large amount of gst-plugins, we only add a selected few +# gstreamer1.0-plugins-base-meta +# gstreamer1.0-plugins-good-meta +# gstreamer1.0-plugins-bad-meta +# gst-ffmpeg +GSTREAMER = " \ + gstreamer1.0 \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-base-alsa \ + gstreamer1.0-plugins-base-audioconvert \ + gstreamer1.0-plugins-base-audioresample \ + gstreamer1.0-plugins-base-audiotestsrc \ + gstreamer1.0-plugins-base-typefindfunctions \ + gstreamer1.0-plugins-base-ivorbisdec \ + gstreamer1.0-plugins-base-ogg \ + gstreamer1.0-plugins-base-theora \ + gstreamer1.0-plugins-base-videotestsrc \ + gstreamer1.0-plugins-base-vorbis \ + gstreamer1.0-plugins-good-audioparsers \ + gstreamer1.0-plugins-good-autodetect \ + gstreamer1.0-plugins-good-avi \ + gstreamer1.0-plugins-good-deinterlace \ + gstreamer1.0-plugins-good-id3demux \ + gstreamer1.0-plugins-good-isomp4 \ + gstreamer1.0-plugins-good-matroska \ + gstreamer1.0-plugins-good-rtp \ + gstreamer1.0-plugins-good-rtpmanager \ + gstreamer1.0-plugins-good-udp \ + gstreamer1.0-plugins-good-video4linux2 \ + gstreamer1.0-plugins-good-wavenc \ + gstreamer1.0-plugins-good-wavparse \ +" +# No longer available +# gst-plugins-base-decodebin \ +# gst-plugins-base-decodebin2 \ +# gst-plugins-base-playbin \ +# gst-plugins-ugly-asf \ +#" + +GSTREAMER_append_mx6 = " \ + gstreamer1.0-plugins-base-ximagesink \ + gstreamer1.0-plugins-imx \ + gst1.0-fsl-plugin \ + gst1.0-fsl-plugin-gplay \ + gst1.0-fsl-plugin-grecorder \ +" +GSTREAMER_append_mx7 = " \ + gstreamer1.0-plugins-base-ximagesink \ + gst1.0-fsl-plugin \ +" +# No longer available +# gst-plugins-gl \ +# gst-fsl-plugin \ +# + +# use gstreamer-0.10 for tegra +GSTREAMER_tegra = " \ + gstreamer \ + gst-plugins-base \ + gst-plugins-base-alsa \ + gst-plugins-base-audioconvert \ + gst-plugins-base-audioresample \ + gst-plugins-base-audiotestsrc \ + gst-plugins-base-decodebin \ + gst-plugins-base-decodebin2 \ + gst-plugins-base-playbin \ + gst-plugins-base-typefindfunctions \ + gst-plugins-base-ivorbisdec \ + gst-plugins-base-ogg \ + gst-plugins-base-theora \ + gst-plugins-base-videotestsrc \ + gst-plugins-base-vorbis \ + gst-plugins-good-audioparsers \ + gst-plugins-good-autodetect \ + gst-plugins-good-avi \ + gst-plugins-good-deinterlace \ + gst-plugins-good-id3demux \ + gst-plugins-good-isomp4 \ + gst-plugins-good-matroska \ + gst-plugins-good-rtp \ + gst-plugins-good-rtpmanager \ + gst-plugins-good-udp \ + gst-plugins-good-video4linux2 \ + gst-plugins-good-wavenc \ + gst-plugins-good-wavparse \ + gst-plugins-ugly-asf \ +" +GSTREAMER_append_tegra3 = " \ + gst-plugins-good-jpeg \ +" +GSTREAMER_append_tegra124 = " \ + gstreamer1.0-libav \ + gstreamer1.0-plugins-bad-videoparsersbad \ + libgstcodecparsers-1.0 \ + libgstnvegl \ + libgstomx \ +" +GSTREAMER_colibri-vf = "" + +IMAGE_INSTALL_append_tegra = " \ + gpioconfig \ + tegrastats-gtk \ + gnome-disk-utility \ + mime-support \ + eglinfo-x11 \ + xvinfo \ +" +IMAGE_INSTALL_append_tegra124 = " \ + eglinfo-x11 \ + gnome-disk-utility \ + libglu \ + mesa-glut \ + mime-support \ + tiff \ + xvinfo \ +" +IMAGE_INSTALL_append_mx6 = " \ + gpioconfig \ + packagegroup-fsl-tools-gpu \ + gnome-disk-utility \ + mime-support \ + eglinfo-x11 \ +" +IMAGE_INSTALL_append_mx7 = " \ + gnome-disk-utility \ + mime-support \ +" +IMAGE_INSTALL_append_vf = " \ + gpioconfig \ + xf86-video-modesetting \ +" + +# Packages which might be empty or no longer available +RRECOMMENDS_${PN} += " \ + xserver-xorg-multimedia-modules \ + xserver-xorg-extension-dbe \ + xserver-xorg-extension-extmod \ +" + +IMAGE_INSTALL += " \ + gconf \ + gnome-vfs \ + gnome-vfs-plugin-file \ + gvfs \ + gvfsd-trash \ + xdg-utils \ + \ + initscripts \ + libgsf \ + libwnck \ + libxres \ + makedevs \ + xcursor-transparent-theme \ + zeroconf \ + angstrom-packagegroup-boot \ + packagegroup-basic \ + udisks \ + udev-extra-rules \ + ${CONMANPKGS} \ + ${ROOTFS_PKGMANAGE_PKGS} \ + timestamp-service \ + packagegroup-base-extended \ + ${XSERVER} \ + xserver-common \ + xauth \ + xhost \ + xset \ + setxkbmap \ + \ + xrdb \ + xorg-minimal-fonts xserver-xorg-utils \ + scrot \ + unclutter \ + \ + libxdamage libxvmc libxinerama \ + libxcursor \ + \ + florence \ + bash \ + \ + ${GSTREAMER} \ + v4l-utils \ + libpcre \ + libpcreposix \ + libxcomposite \ + alsa-states \ + ${IMAGE_BROWSER} \ +" +require recipes-images/images/lx.inc +require recipes-images/images/trdx-extra.inc + +IMAGE_DEV_MANAGER = "udev" +IMAGE_INIT_MANAGER = "systemd" +IMAGE_INITSCRIPTS = " " +IMAGE_LOGIN_MANAGER = "busybox shadow" + +export IMAGE_BASENAME = "LXDE-image" + +inherit core-image diff --git a/recipes-images/images/angstrom-qt-x11-image.bb b/recipes-images/images/angstrom-qt-x11-image.bb new file mode 100644 index 0000000..39cc9b2 --- /dev/null +++ b/recipes-images/images/angstrom-qt-x11-image.bb @@ -0,0 +1,266 @@ +#Angstrom image +SUMMARY = "Image based on qt4-x11-free" + +LICENSE = "MIT" + +PV = "V2.6" +PR = "r0" + +#start of the resulting deployable tarball name +IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxImage-qt" +IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxImage-qt" +IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxImage-qt" +IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxImage-qt" +IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxImage-qt" +IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxImage-qt" +IMAGE_NAME_colibri-t20 = "Colibri_T20_LinuxImage-qt" +IMAGE_NAME_colibri-t30 = "Colibri_T30_LinuxImage-qt" +IMAGE_NAME_colibri-vf = "Colibri_VF_LinuxImage-qt" +IMAGE_NAME = "${MACHINE}_LinuxImage-qt" + +SYSTEMD_DEFAULT_TARGET = "graphical.target" + +#create the deployment directory-tree +require recipes-images/images/trdx-image-fstype.inc + +#remove interfering sysv scripts, connman systemd service +do_mkrmscript () { + echo "for i in ${IMAGE_ROOTFS}/etc/rc0.d ${IMAGE_ROOTFS}/etc/rc1.d ${IMAGE_ROOTFS}/etc/rc2.d ${IMAGE_ROOTFS}/etc/rc3.d ${IMAGE_ROOTFS}/etc/rc4.d ${IMAGE_ROOTFS}/etc/rc5.d ${IMAGE_ROOTFS}/etc/rc6.d ${IMAGE_ROOTFS}/etc/rcS.d ; do" > ${WORKDIR}/rmscript + echo " rm -f \$i/*dropbear \$i/*avahi-daemon \$i/*dbus-1 \$i/*lxdm \$i/*ntpd \$i/*syslog \$i/*ofono \$i/*alsa-state \$i/*networking \$i/*udev-late-mount \$i/*sendsigs \$i/*save-rtc.sh \$i/*umountnfs.sh \$i/*portmap \$i/*umountfs \$i/*halt \$i/*rmnologin.sh \$i/*reboot; rm -f \$i/*banner.sh \$i/*sysfs.sh \$i/*checkroot.sh \$i/*alignment.sh \$i/*mountall.sh \$i/*populate-volatile.sh \$i/*devpts.sh \$i/*hostname.sh \$i/*portmap \$i/*mountnfs.sh \$i/*bootmisc.sh" >> ${WORKDIR}/rmscript + echo "done" >> ${WORKDIR}/rmscript + chmod +x ${WORKDIR}/rmscript + readlink -e ${WORKDIR}/rmscript + cat ${WORKDIR}/rmscript +} +addtask mkrmscript before do_rootfs + +IMAGE_LINGUAS = "en-us" +#IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in" +#ROOTFS_POSTPROCESS_COMMAND += 'install_linguas; ' + +DISTRO_UPDATE_ALTERNATIVES ??= "" +ROOTFS_PKGMANAGE_PKGS ?= '${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${ROOTFS_PKGMANAGE} ${DISTRO_UPDATE_ALTERNATIVES}", d)}' + +CONMANPKGS ?= "connman connman-systemd connman-plugin-loopback connman-plugin-ethernet connman-plugin-wifi connman-client" +CONMANPKGS_libc-uclibc = "" + +DEPENDS += "gst-plugins-good gst-plugins-bad gst-plugins-ugly" + +#deploy the OpenGL ES headers to the sysroot +DEPENDS_append_tegra = " nvsamples" + +#don't install some id databases +#BAD_RECOMMENDATIONS_append_colibri-vf = " udev-hwdb cpufrequtils " + +# this would pull in a large amount of gst-plugins, we only add a selected few +# gstreamer1.0-plugins-base-meta +# gstreamer1.0-plugins-good-meta +# gstreamer1.0-plugins-bad-meta +# gst-ffmpeg +GSTREAMER = " \ + gstreamer1.0 \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-base-alsa \ + gstreamer1.0-plugins-base-audioconvert \ + gstreamer1.0-plugins-base-audioresample \ + gstreamer1.0-plugins-base-audiotestsrc \ + gstreamer1.0-plugins-base-typefindfunctions \ + gstreamer1.0-plugins-base-ivorbisdec \ + gstreamer1.0-plugins-base-ogg \ + gstreamer1.0-plugins-base-theora \ + gstreamer1.0-plugins-base-videotestsrc \ + gstreamer1.0-plugins-base-vorbis \ + gstreamer1.0-plugins-good-audioparsers \ + gstreamer1.0-plugins-good-autodetect \ + gstreamer1.0-plugins-good-avi \ + gstreamer1.0-plugins-good-deinterlace \ + gstreamer1.0-plugins-good-id3demux \ + gstreamer1.0-plugins-good-isomp4 \ + gstreamer1.0-plugins-good-matroska \ + gstreamer1.0-plugins-good-rtp \ + gstreamer1.0-plugins-good-rtpmanager \ + gstreamer1.0-plugins-good-udp \ + gstreamer1.0-plugins-good-video4linux2 \ + gstreamer1.0-plugins-good-wavenc \ + gstreamer1.0-plugins-good-wavparse \ +" +# No longer available +# gst-plugins-base-decodebin \ +# gst-plugins-base-decodebin2 \ +# gst-plugins-base-playbin \ +# gst-plugins-ugly-asf \ +#" + +GSTREAMER_append_mx6 = " \ + gstreamer1.0-plugins-base-ximagesink \ + gstreamer1.0-plugins-imx \ + gst1.0-fsl-plugin \ + gst1.0-fsl-plugin-gplay \ + gst1.0-fsl-plugin-grecorder \ +" +GSTREAMER_append_mx7 = " \ + gstreamer1.0-plugins-base-ximagesink \ + gst1.0-fsl-plugin \ + gst1.0-fsl-plugin-gplay \ + gst1.0-fsl-plugin-grecorder \ +" +# No longer available +# gst-plugins-gl \ +# gst-fsl-plugin \ +# + +# use gstreamer-0.10 for tegra +GSTREAMER_tegra = " \ + gstreamer \ + gst-plugins-base \ + gst-plugins-base-alsa \ + gst-plugins-base-audioconvert \ + gst-plugins-base-audioresample \ + gst-plugins-base-audiotestsrc \ + gst-plugins-base-decodebin \ + gst-plugins-base-decodebin2 \ + gst-plugins-base-playbin \ + gst-plugins-base-typefindfunctions \ + gst-plugins-base-ivorbisdec \ + gst-plugins-base-ogg \ + gst-plugins-base-theora \ + gst-plugins-base-videotestsrc \ + gst-plugins-base-vorbis \ + gst-plugins-good-audioparsers \ + gst-plugins-good-autodetect \ + gst-plugins-good-avi \ + gst-plugins-good-deinterlace \ + gst-plugins-good-id3demux \ + gst-plugins-good-isomp4 \ + gst-plugins-good-matroska \ + gst-plugins-good-rtp \ + gst-plugins-good-rtpmanager \ + gst-plugins-good-udp \ + gst-plugins-good-video4linux2 \ + gst-plugins-good-wavenc \ + gst-plugins-good-wavparse \ + gst-plugins-ugly-asf \ +" +GSTREAMER_append_tegra3 = " \ + gst-plugins-good-jpeg \ +" +GSTREAMER_append_tegra124 = " \ + gstreamer1.0-libav \ + gstreamer1.0-plugins-bad-videoparsersbad \ + libgstcodecparsers-1.0 \ + libgstnvegl \ + libgstomx \ +" +GSTREAMER_colibri-vf = "" + + +IMAGE_INSTALL_QT4 = " \ + qt4-x11-free \ + qt4-xmlpatterns \ + libqt3support4 \ + libqtclucene4 \ + libqtcore4 \ + libqtdbus4 \ + libqtgui4 \ + libqthelp4 \ + libqtmultimedia4 \ + libqtnetwork4 \ + libqtscript4 \ + libqtscripttools4 \ + libqtsql4 \ + libqtsvg4 \ + libqttest4 \ + libqtwebkit4 \ + libqtxml4 \ + qt4-plugin-iconengine-svgicon \ + qt4-plugin-imageformat-gif \ + qt4-plugin-imageformat-ico \ + qt4-plugin-imageformat-jpeg \ + qt4-plugin-imageformat-mng \ + qt4-plugin-imageformat-svg \ + qt4-plugin-imageformat-tga \ + qt4-plugin-imageformat-tiff \ + qt4-plugin-script-dbus \ + qt4-plugin-sqldriver-sqlite \ + qt4-demos \ + qt4-x11-free-systemd \ + qt4-examples \ + qt4-assistant \ + icu \ +" + +IMAGE_INSTALL_append_tegra = " \ + eglinfo-x11 \ + xvinfo \ +" +IMAGE_INSTALL_append_tegra124 = " \ + eglinfo-x11 \ + libglu \ + mesa-glut \ + tiff \ + xvinfo \ +" +IMAGE_INSTALL_append_mx6 = " \ + packagegroup-fsl-tools-gpu \ + eglinfo-x11 \ +" + +# Packages which might no longer exist +RRECOMMENDS_${PN} += "xserver-xorg-multimedia-modules" + +IMAGE_INSTALL += " \ + ${IMAGE_INSTALL_QT4} \ + \ + xdg-utils \ + \ + initscripts \ + libgsf \ + libxres \ + makedevs \ + mime-support \ + xcursor-transparent-theme \ + zeroconf \ + angstrom-packagegroup-boot \ + packagegroup-basic \ + udev-extra-rules \ + ${CONMANPKGS} \ + ${ROOTFS_PKGMANAGE_PKGS} \ + timestamp-service \ + packagegroup-base-extended \ + ${XSERVER} \ + xserver-common \ + xserver-xorg-extension-dbe \ + xserver-xorg-extension-extmod \ + xauth \ + xhost \ + xset \ + setxkbmap \ + \ + xrdb \ + xorg-minimal-fonts xserver-xorg-utils \ + scrot \ + unclutter \ + \ + libxdamage libxvmc libxinerama \ + libxcursor \ + \ + bash \ + \ + ${GSTREAMER} \ + v4l-utils \ + libpcre \ + libpcreposix \ + libxcomposite \ + alsa-states \ +" + +require recipes-images/images/trdx-extra.inc + +IMAGE_DEV_MANAGER = "udev" +IMAGE_INIT_MANAGER = "systemd" +IMAGE_INITSCRIPTS = " " +IMAGE_LOGIN_MANAGER = "busybox shadow" + +export IMAGE_BASENAME = "qt-image" + +inherit core-image diff --git a/recipes-images/images/angstrom-qt5-x11-image.bb b/recipes-images/images/angstrom-qt5-x11-image.bb new file mode 100644 index 0000000..0c57505 --- /dev/null +++ b/recipes-images/images/angstrom-qt5-x11-image.bb @@ -0,0 +1,239 @@ +SUMMARY = "Qt5 demo image with X11 backend" +# after the boot systemd starts X and then a qt5 application +# check recipes-qt/qt5/qt5-x11-free-systemd.bb for the systemd service +# responsible for this + +LICENSE = "MIT" + +PV = "V2.6" +PR = "r0" + +#start of the resulting deployable tarball name +IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxImage-qt5" +IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxImage-qt5" +IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxImage-qt5" +IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxImage-qt5" +IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxImage-qt5" +IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxImage-qt5" +IMAGE_NAME_colibri-t20 = "Colibri_T20_LinuxImage-qt5" +IMAGE_NAME_colibri-t30 = "Colibri_T30_LinuxImage-qt5" +IMAGE_NAME_colibri-vf = "Colibri_VF_LinuxImage-qt5" +IMAGE_NAME = "${MACHINE}_LinuxImage-qt5" + +SYSTEMD_DEFAULT_TARGET = "graphical.target" + +#create the deployment directory-tree +require recipes-images/images/trdx-image-fstype.inc + +#remove interfering sysv scripts, connman systemd service +do_mkrmscript () { + echo "for i in ${IMAGE_ROOTFS}/etc/rc0.d ${IMAGE_ROOTFS}/etc/rc1.d ${IMAGE_ROOTFS}/etc/rc2.d ${IMAGE_ROOTFS}/etc/rc3.d ${IMAGE_ROOTFS}/etc/rc4.d ${IMAGE_ROOTFS}/etc/rc5.d ${IMAGE_ROOTFS}/etc/rc6.d ${IMAGE_ROOTFS}/etc/rcS.d ; do" > ${WORKDIR}/rmscript + echo " rm -f \$i/*dropbear \$i/*avahi-daemon \$i/*dbus-1 \$i/*lxdm \$i/*ntpd \$i/*syslog \$i/*ofono \$i/*alsa-state \$i/*networking \$i/*udev-late-mount \$i/*sendsigs \$i/*save-rtc.sh \$i/*umountnfs.sh \$i/*portmap \$i/*umountfs \$i/*halt \$i/*rmnologin.sh \$i/*reboot; rm -f \$i/*banner.sh \$i/*sysfs.sh \$i/*checkroot.sh \$i/*alignment.sh \$i/*mountall.sh \$i/*populate-volatile.sh \$i/*devpts.sh \$i/*hostname.sh \$i/*portmap \$i/*mountnfs.sh \$i/*bootmisc.sh" >> ${WORKDIR}/rmscript + echo "done" >> ${WORKDIR}/rmscript + chmod +x ${WORKDIR}/rmscript + readlink -e ${WORKDIR}/rmscript + cat ${WORKDIR}/rmscript +} +addtask mkrmscript before do_rootfs + +IMAGE_LINGUAS = "en-us" +#IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in" +#ROOTFS_POSTPROCESS_COMMAND += 'install_linguas; ' + +DISTRO_UPDATE_ALTERNATIVES ??= "" +ROOTFS_PKGMANAGE_PKGS ?= '${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${ROOTFS_PKGMANAGE} ${DISTRO_UPDATE_ALTERNATIVES}", d)}' + +CONMANPKGS ?= "connman connman-systemd connman-plugin-loopback connman-plugin-ethernet connman-plugin-wifi connman-client" +CONMANPKGS_libc-uclibc = "" + +DEPENDS += "gst-plugins-good gst-plugins-bad gst-plugins-ugly" + +#deploy the OpenGL ES headers to the sysroot +DEPENDS_append_tegra = " nvsamples" + +#don't install some id databases +#BAD_RECOMMENDATIONS_append_colibri-vf = " udev-hwdb cpufrequtils " + +# this would pull in a large amount of gst-plugins, we only add a selected few +# gstreamer1.0-plugins-base-meta +# gstreamer1.0-plugins-good-meta +# gstreamer1.0-plugins-bad-meta +# gst-ffmpeg +GSTREAMER = " \ + gstreamer1.0 \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-base-alsa \ + gstreamer1.0-plugins-base-audioconvert \ + gstreamer1.0-plugins-base-audioresample \ + gstreamer1.0-plugins-base-audiotestsrc \ + gstreamer1.0-plugins-base-typefindfunctions \ + gstreamer1.0-plugins-base-ivorbisdec \ + gstreamer1.0-plugins-base-ogg \ + gstreamer1.0-plugins-base-theora \ + gstreamer1.0-plugins-base-videotestsrc \ + gstreamer1.0-plugins-base-vorbis \ + gstreamer1.0-plugins-good-audioparsers \ + gstreamer1.0-plugins-good-autodetect \ + gstreamer1.0-plugins-good-avi \ + gstreamer1.0-plugins-good-deinterlace \ + gstreamer1.0-plugins-good-id3demux \ + gstreamer1.0-plugins-good-isomp4 \ + gstreamer1.0-plugins-good-matroska \ + gstreamer1.0-plugins-good-rtp \ + gstreamer1.0-plugins-good-rtpmanager \ + gstreamer1.0-plugins-good-udp \ + gstreamer1.0-plugins-good-video4linux2 \ + gstreamer1.0-plugins-good-wavenc \ + gstreamer1.0-plugins-good-wavparse \ +" +# No longer available +# gst-plugins-base-decodebin \ +# gst-plugins-base-decodebin2 \ +# gst-plugins-base-playbin \ +# gst-plugins-ugly-asf \ +#" + +GSTREAMER_append_mx6 = " \ + gstreamer1.0-plugins-base-ximagesink \ + gstreamer1.0-plugins-imx \ + gst1.0-fsl-plugin \ + gst1.0-fsl-plugin-gplay \ + gst1.0-fsl-plugin-grecorder \ +" +GSTREAMER_append_mx7 = " \ + gstreamer1.0-plugins-base-ximagesink \ + gst1.0-fsl-plugin \ + gst1.0-fsl-plugin-gplay \ + gst1.0-fsl-plugin-grecorder \ +" +# No longer available +# gst-plugins-gl \ +# gst-fsl-plugin \ +# + +# use gstreamer-0.10 for tegra +GSTREAMER_tegra = " \ + gstreamer \ + gst-plugins-base \ + gst-plugins-base-alsa \ + gst-plugins-base-audioconvert \ + gst-plugins-base-audioresample \ + gst-plugins-base-audiotestsrc \ + gst-plugins-base-decodebin \ + gst-plugins-base-decodebin2 \ + gst-plugins-base-playbin \ + gst-plugins-base-typefindfunctions \ + gst-plugins-base-ivorbisdec \ + gst-plugins-base-ogg \ + gst-plugins-base-theora \ + gst-plugins-base-videotestsrc \ + gst-plugins-base-vorbis \ + gst-plugins-good-audioparsers \ + gst-plugins-good-autodetect \ + gst-plugins-good-avi \ + gst-plugins-good-deinterlace \ + gst-plugins-good-id3demux \ + gst-plugins-good-isomp4 \ + gst-plugins-good-matroska \ + gst-plugins-good-rtp \ + gst-plugins-good-rtpmanager \ + gst-plugins-good-udp \ + gst-plugins-good-video4linux2 \ + gst-plugins-good-wavenc \ + gst-plugins-good-wavparse \ + gst-plugins-ugly-asf \ +" +GSTREAMER_append_tegra3 = " \ + gst-plugins-good-jpeg \ +" +GSTREAMER_append_tegra124 = " \ + gstreamer1.0-libav \ + gstreamer1.0-plugins-bad-videoparsersbad \ + libgstcodecparsers-1.0 \ + libgstnvegl \ + libgstomx \ +" +GSTREAMER_colibri-vf = "" + + +IMAGE_INSTALL_QT5 = " \ + packagegroup-qt5 \ + qtsmarthome \ + qt5-x11-free-systemd \ +" + +IMAGE_INSTALL_append_tegra = " \ + eglinfo-x11 \ + xvinfo \ +" +IMAGE_INSTALL_append_tegra124 = " \ + eglinfo-x11 \ + libglu \ + mesa-glut \ + tiff \ + xvinfo \ +" +IMAGE_INSTALL_append_mx6 = " \ + packagegroup-fsl-tools-gpu \ + eglinfo-x11 \ +" + +# Packages which might no longer exist +RRECOMMENDS_${PN} += "xserver-xorg-multimedia-modules" + +IMAGE_INSTALL += " \ + ${IMAGE_INSTALL_QT5} \ + \ + xdg-utils \ + \ + initscripts \ + libgsf \ + libxres \ + makedevs \ + mime-support \ + xcursor-transparent-theme \ + zeroconf \ + angstrom-packagegroup-boot \ + packagegroup-basic \ + udev-extra-rules \ + ${CONMANPKGS} \ + ${ROOTFS_PKGMANAGE_PKGS} \ + timestamp-service \ + packagegroup-base-extended \ + ${XSERVER} \ + xserver-common \ + xserver-xorg-extension-dbe \ + xserver-xorg-extension-extmod \ + xauth \ + xhost \ + xset \ + setxkbmap \ + \ + xrdb \ + xorg-minimal-fonts xserver-xorg-utils \ + scrot \ + unclutter \ + \ + libxdamage libxvmc libxinerama \ + libxcursor \ + \ + bash \ + \ + ${GSTREAMER} \ + v4l-utils \ + libpcre \ + libpcreposix \ + libxcomposite \ + alsa-states \ +" + +require recipes-images/images/trdx-extra.inc + +IMAGE_DEV_MANAGER = "udev" +IMAGE_INIT_MANAGER = "systemd" +IMAGE_INITSCRIPTS = " " +IMAGE_LOGIN_MANAGER = "busybox shadow" + +export IMAGE_BASENAME = "qt-image" + +inherit core-image diff --git a/recipes-images/images/console-trdx-image.bb b/recipes-images/images/console-trdx-image.bb new file mode 100644 index 0000000..e778427 --- /dev/null +++ b/recipes-images/images/console-trdx-image.bb @@ -0,0 +1,73 @@ +#Angstrom image +SUMMARY = "Image booting to a console" + +LICENSE = "MIT" + +PV = "V2.6" +PR = "r0" + +#start of the resulting deployable tarball name +IMAGE_NAME_apalis-imx6 = "Apalis_iMX6_LinuxConsoleImage" +IMAGE_NAME_apalis-t30 = "Apalis_T30_LinuxConsoleImage" +IMAGE_NAME_apalis-tk1 = "Apalis_TK1_LinuxConsoleImage" +IMAGE_NAME_colibri-imx6 = "Colibri_iMX6_LinuxConsoleImage" +IMAGE_NAME_colibri-imx7 = "Colibri_iMX7_LinuxConsoleImage" +IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxConsoleImage" +IMAGE_NAME_colibri-t20 = "Colibri_T20_LinuxConsoleImage" +IMAGE_NAME_colibri-t30 = "Colibri_T30_LinuxConsoleImage" +IMAGE_NAME_colibri-vf = "Colibri_VF_LinuxConsoleImage" +IMAGE_NAME = "${MACHINE}_LinuxConsoleImage" + +#create the deployment directory-tree +require recipes-images/images/trdx-image-fstype.inc + +#remove interfering sysv scripts, connman systemd service +do_mkrmscript () { + echo "for i in ${IMAGE_ROOTFS}/etc/rc0.d ${IMAGE_ROOTFS}/etc/rc1.d ${IMAGE_ROOTFS}/etc/rc2.d ${IMAGE_ROOTFS}/etc/rc3.d ${IMAGE_ROOTFS}/etc/rc4.d ${IMAGE_ROOTFS}/etc/rc5.d ${IMAGE_ROOTFS}/etc/rc6.d ${IMAGE_ROOTFS}/etc/rcS.d ; do" > ${WORKDIR}/rmscript + echo " rm -f \$i/*dropbear \$i/*avahi-daemon \$i/*dbus-1 \$i/*lxdm \$i/*ntpd \$i/*syslog \$i/*ofono \$i/*alsa-state \$i/*networking \$i/*udev-late-mount \$i/*sendsigs \$i/*save-rtc.sh \$i/*umountnfs.sh \$i/*portmap \$i/*umountfs \$i/*halt \$i/*rmnologin.sh \$i/*reboot; rm -f \$i/*banner.sh \$i/*sysfs.sh \$i/*checkroot.sh \$i/*alignment.sh \$i/*mountall.sh \$i/*populate-volatile.sh \$i/*devpts.sh \$i/*hostname.sh \$i/*portmap \$i/*mountnfs.sh \$i/*bootmisc.sh" >> ${WORKDIR}/rmscript + echo "done" >> ${WORKDIR}/rmscript + chmod +x ${WORKDIR}/rmscript + readlink -e ${WORKDIR}/rmscript + cat ${WORKDIR}/rmscript +} +addtask mkrmscript before do_rootfs + +IMAGE_LINGUAS = "en-us" +#IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in" +#ROOTFS_POSTPROCESS_COMMAND += 'install_linguas; ' + +DISTRO_UPDATE_ALTERNATIVES ??= "" +ROOTFS_PKGMANAGE_PKGS ?= '${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${ROOTFS_PKGMANAGE} ${DISTRO_UPDATE_ALTERNATIVES}", d)}' + +CONMANPKGS ?= "connman connman-systemd connman-plugin-loopback connman-plugin-ethernet connman-plugin-wifi connman-client" +CONMANPKGS_libc-uclibc = "" + +#don't install some id databases +#BAD_RECOMMENDATIONS_append_colibri-vf += " udev-hwdb cpufrequtils " + +#deploy the X server for the tegras +#this adds a few MB to the image, but all graphical HW acceleration is +#available only on top of X +IMAGE_INSTALL_append_tegra = " ${XSERVER} xterm xclock" +IMAGE_INSTALL_append_tegra124 = " ${XSERVER} xterm xclock" + +IMAGE_INSTALL += " \ + angstrom-packagegroup-boot \ + packagegroup-basic \ + udev-extra-rules \ + ${CONMANPKGS} \ + ${ROOTFS_PKGMANAGE_PKGS} \ + timestamp-service \ + packagegroup-base-extended \ +" + +require recipes-images/images/trdx-extra.inc + +IMAGE_DEV_MANAGER = "udev" +IMAGE_INIT_MANAGER = "systemd" +IMAGE_INITSCRIPTS = " " +IMAGE_LOGIN_MANAGER = "busybox shadow" + +export IMAGE_BASENAME = "console-trdx-image" + +inherit image diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr new file mode 100644 index 0000000..398c4de --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_blk.scr @@ -0,0 +1,45 @@ +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 + +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3' + +setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv migrate_uboot_old 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}' +setenv migrate_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0' + +setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1' +setenv update_uboot_it 'setenv module_type -it; run update_uboot' + +setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' + +setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done; true' + +setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update" +setenv echo_migrate-it echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_it\" to complete update" +setenv migrate 'run migrate_configblock; run update_latest; reset' +setenv migrate_it 'setenv module_type -it; run migrate' +setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate${module_type}' +setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate${module_type}' + +setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3' +setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3' +setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1' +setenv update_it 'setenv module_type -it; run update' + +echo 'enter "run update" or "run update_it" to update the entire module' diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr new file mode 100644 index 0000000..2f64288 --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/flash_eth.scr @@ -0,0 +1,46 @@ +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +#workaround U-Boot counting in hex and split did in decimal +setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true' +setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3' + +setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv migrate_uboot_old 'tftpboot ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}' +setenv migrate_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0' + +setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx${module_type} && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1' +setenv update_uboot_it 'setenv module_type -it; run update_uboot' + +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' + +setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'tftpboot ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +#split root.ext3 into multiple 64M chunks before copying to TFTP folder as follows +#split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3- +setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done; true' + +setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update" +setenv echo_migrate-it echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_it\" to complete update" +setenv migrate 'run migrate_configblock; run update_latest; reset' +setenv migrate_it 'setenv module_type -it; run migrate' +setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate${module_type}' +setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate${module_type}' + +setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3' +setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3' +setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1' +setenv update_it 'setenv module_type -it; run update' + +echo 'enter "run update" or "run update_it" to update the entire module' diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_blk.scr b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_eth.scr b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_mmc.scr b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_mmc.scr new file mode 120000 index 0000000..3848cfa --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/fwd_mmc.scr @@ -0,0 +1 @@ +../../library/fwd_mmc.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/apalis-imx6_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-imx6/imx_flash/genext3fs.sh b/recipes-images/images/files/apalis-imx6/imx_flash/genext3fs.sh new file mode 120000 index 0000000..cc716db --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/imx_flash/genext3fs.sh @@ -0,0 +1 @@ +../../library/genext3fs.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-imx6/update.sh b/recipes-images/images/files/apalis-imx6/update.sh new file mode 120000 index 0000000..fc60d21 --- /dev/null +++ b/recipes-images/images/files/apalis-imx6/update.sh @@ -0,0 +1 @@ +../library/imx6/update.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/Apalis_T30_2GB_800Mhz.bct b/recipes-images/images/files/apalis-t30/apalis-t30_bin/Apalis_T30_2GB_800Mhz.bct Binary files differnew file mode 100644 index 0000000..f228cd2 --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/Apalis_T30_2GB_800Mhz.bct diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/apalis_t30.img.cfg b/recipes-images/images/files/apalis-t30/apalis-t30_bin/apalis_t30.img.cfg new file mode 100644 index 0000000..6fbdc0d --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/apalis_t30.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2014 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = Apalis_T30_2GB_800Mhz.bct; +BootLoader = u-boot-dtb-tegra.bin,0x80108000,0x80108000,Complete; diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/apalis_t30_12MHz_MT41K512M8RH-125_533MHz.bct b/recipes-images/images/files/apalis-t30/apalis-t30_bin/apalis_t30_12MHz_MT41K512M8RH-125_533MHz.bct Binary files differnew file mode 100644 index 0000000..423aad1 --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/apalis_t30_12MHz_MT41K512M8RH-125_533MHz.bct diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr b/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr new file mode 100644 index 0000000..44d98a2 --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_blk.scr @@ -0,0 +1,42 @@ +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 + +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232' + +setenv migrate_1 'mmc dev 0 0; mmc read ${loadaddr} 6000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_2 'mmc dev 0 0; mmc read ${loadaddr} 8000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_3 'mmc dev 0 0; mmc read ${loadaddr} 9000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_4 'mmc dev 0 0; mmc read ${loadaddr} 34000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' + +setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' + +setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${soc}-apalis-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-apalis-${fdt_board}.dtb ${filesize}' + +setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done' + +setenv echo_v2.3b2 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b2\" to complete update" +setenv migrate_v2.3b2 'run migrate_configblock; run update_new' +setenv update_v2.3b2 'run update_uboot && run echo_v2.3b2' + +setenv update_new 'run check_configblock || run migrate_configblock; run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3; reset' +setenv update 'if test -v ${ver}; then run update_new; else run update_v2.3b2; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr b/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr new file mode 100644 index 0000000..873e166 --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/flash_eth.scr @@ -0,0 +1,43 @@ +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +#workaround U-Boot counting in hex and split did in decimal +setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true' +setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232' + +setenv migrate_1 'mmc dev 0 0; mmc read ${loadaddr} 6000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_2 'mmc dev 0 0; mmc read ${loadaddr} 8000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_3 'mmc dev 0 0; mmc read ${loadaddr} 9000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_4 'mmc dev 0 0; mmc read ${loadaddr} 34000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' + +setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' + +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${soc}-apalis-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-apalis-${fdt_board}.dtb ${filesize}' + +setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'tftpboot ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +#split root.ext3 into multiple 64M chunks before copying to TFTP folder as follows +#split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3- +setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done' + +setenv echo_v2.3b2 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b2\" to complete update" +setenv migrate_v2.3b2 'run migrate_configblock; run update_new' +setenv update_v2.3b2 'run update_uboot && run echo_v2.3b2' + +setenv update_new 'run check_configblock || run migrate_configblock; run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3; reset' +setenv update 'if test -v ${ver}; then run update_new; else run update_v2.3b2; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_blk.scr b/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_eth.scr b/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_mmc.scr b/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_mmc.scr new file mode 120000 index 0000000..3848cfa --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/fwd_mmc.scr @@ -0,0 +1 @@ +../../library/fwd_mmc.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-t30/apalis-t30_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/apalis-t30/apalis-t30_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/apalis-t30/apalis-t30_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-t30/tegra-uboot-flasher/genext3fs.sh b/recipes-images/images/files/apalis-t30/tegra-uboot-flasher/genext3fs.sh new file mode 120000 index 0000000..cc716db --- /dev/null +++ b/recipes-images/images/files/apalis-t30/tegra-uboot-flasher/genext3fs.sh @@ -0,0 +1 @@ +../../library/genext3fs.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-t30/update.sh b/recipes-images/images/files/apalis-t30/update.sh new file mode 120000 index 0000000..6ebea84 --- /dev/null +++ b/recipes-images/images/files/apalis-t30/update.sh @@ -0,0 +1 @@ +../library/tegra/update.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct Binary files differnew file mode 100644 index 0000000..556a40e --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/apalis-tk1.img.cfg b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/apalis-tk1.img.cfg new file mode 100644 index 0000000..b9d203c --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/apalis-tk1.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2016 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00400001; +Bctcopy = 1; +Bctfile = PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct; +BootLoader = u-boot-dtb-tegra.bin,0x80108000,0x80108000,Complete; diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr new file mode 100644 index 0000000..994e480 --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_blk.scr @@ -0,0 +1,29 @@ +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 + +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232' + +setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' + +setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${soc}-apalis-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-apalis-${fdt_board}.dtb ${filesize}' + +setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +setenv update_rootfs 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done' + +setenv update 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_rootfs; reset' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr new file mode 100644 index 0000000..6f92554 --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/flash_eth.scr @@ -0,0 +1,30 @@ +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +#workaround U-Boot counting in hex and split did in decimal +setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true' +setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232' + +setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' + +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${soc}-apalis-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-apalis-${fdt_board}.dtb ${filesize}' + +setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'tftpboot ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +#split root.ext3 into multiple 64M chunks before copying to TFTP folder as follows +#split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3- +setenv update_rootfs 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done' + +setenv update 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_rootfs; reset' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_blk.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_eth.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_mmc.scr b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_mmc.scr new file mode 120000 index 0000000..3848cfa --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/fwd_mmc.scr @@ -0,0 +1 @@ +../../library/fwd_mmc.scr
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/apalis-tk1_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext3fs.sh b/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext3fs.sh new file mode 120000 index 0000000..cc716db --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/tegra-uboot-flasher/genext3fs.sh @@ -0,0 +1 @@ +../../library/genext3fs.sh
\ No newline at end of file diff --git a/recipes-images/images/files/apalis-tk1/update.sh b/recipes-images/images/files/apalis-tk1/update.sh new file mode 120000 index 0000000..6ebea84 --- /dev/null +++ b/recipes-images/images/files/apalis-tk1/update.sh @@ -0,0 +1 @@ +../library/tegra/update.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr new file mode 100644 index 0000000..23c5b72 --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_blk.scr @@ -0,0 +1,41 @@ +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 + +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3' + +setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv migrate_uboot_old 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}; patch_ddr_size' +setenv migrate_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0' + +setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1' + +setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' + +setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done; true' + +setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update" +setenv migrate 'run migrate_configblock; run update_latest; reset' +setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate' +setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate' + +setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3' +setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3' +setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr new file mode 100644 index 0000000..14f4104 --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/flash_eth.scr @@ -0,0 +1,42 @@ +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +#workaround U-Boot counting in hex and split did in decimal +setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true' +setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mw.l ${kernel_addr_r} 0x002d1400; mmc dev 0 1; run check_1 || run check_2 || run check_3; cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3' + +setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loadaddr} 0x500 1 && cmp.b ${kernel_addr_r} ${toradex_oui_addr} 3 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv migrate_uboot_old 'tftpboot ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 2 ${blkcnt}; patch_ddr_size' +setenv migrate_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0' + +setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot.imx && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 2 ${blkcnt} && patch_ddr_size && updt_fuse && mmc bootbus 0 2 0 1 && mmc partconf 0 1 1 0 && mmc rst-function 0 1' + +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${fdt_file} && fatwrite mmc 0:1 ${loadaddr} ${fdt_file} ${filesize}' + +setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'tftpboot ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +#split root.ext3 into multiple 64M chunks before copying to TFTP folder as follows +#split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3- +setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done; true' + +setenv echo_migrate echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate\" to complete update" +setenv migrate 'run migrate_configblock; run update_latest; reset' +setenv update_v2.4b1 'run check_configblock || run migrate_configblock; run migrate_uboot_old && run echo_migrate' +setenv update_v2.5b3 'run check_configblock || run migrate_configblock; run migrate_uboot && run echo_migrate' + +setenv update_latest 'run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3' +setenv update_new 'updt_fuse -n && run update_latest && reset; run update_v2.5b3' +setenv update 'mmc bootbus 0 2 0 1 && run update_new && exit; run update_v2.4b1' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_blk.scr b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_eth.scr b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_mmc.scr b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_mmc.scr new file mode 120000 index 0000000..3848cfa --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/fwd_mmc.scr @@ -0,0 +1 @@ +../../library/fwd_mmc.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/colibri-imx6_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx6/imx_flash/genext3fs.sh b/recipes-images/images/files/colibri-imx6/imx_flash/genext3fs.sh new file mode 120000 index 0000000..cc716db --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/imx_flash/genext3fs.sh @@ -0,0 +1 @@ +../../library/genext3fs.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx6/update.sh b/recipes-images/images/files/colibri-imx6/update.sh new file mode 120000 index 0000000..fc60d21 --- /dev/null +++ b/recipes-images/images/files/colibri-imx6/update.sh @@ -0,0 +1 @@ +../library/imx6/update.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr new file mode 100644 index 0000000..b63366a --- /dev/null +++ b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_blk.scr @@ -0,0 +1,19 @@ +setenv create_bcb 'nand erase.part mx7-bcb && writebcb 80000 200000' +setenv update_configblock 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/configblock.bin && nand write ${loadaddr} 0x800 ${filesize} && nand write ${loadaddr} 0x20800 ${filesize}' + +# Migrate to UBI volume based boot schema +setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static' +setenv prepare_m4firmware 'ubi create m4firmware 0xe0000 static' +setenv prepare_rootfs 'ubi create rootfs 0 dynamic' +setenv prepare_ubi 'ubi part ubi && if ubi check rootfs; then if ubi check kernel; then else ubi remove rootfs && run prepare_kernel_fdt && run prepare_m4firmware && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_m4firmware && run prepare_rootfs; fi' + +setenv update_uboot 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && writeboot ${loadaddr} 80000 200000 $filesize' +setenv update_kernel 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}' +setenv update_fdt 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && ubi write ${loadaddr} dtb ${filesize}' +setenv update_rootfs 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/ubifs.img && ubi write ${loadaddr} rootfs ${filesize}' + +setenv upgrade_alpha1_msg 'Updated U-Boot, please reset the board and use "run setupdate && run update" again.' +setenv prepare_alpha1_uboot 'if test "${soc}" = "mx7"; then run update_uboot && echo ${upgrade_alpha1_msg} && reset; fi' +setenv update 'mtdparts default && run prepare_alpha1_uboot; run update_uboot && run prepare_ubi && run update_kernel && run update_fdt && run update_rootfs && reset' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr new file mode 100644 index 0000000..13025de --- /dev/null +++ b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/flash_eth.scr @@ -0,0 +1,19 @@ +setenv create_bcb 'nand erase.part mx7-bcb && writebcb 80000 200000' +setenv update_configblock 'tftpboot ${loadaddr} ${board_name}/configblock.bin && nand write ${loadaddr} 0x800 ${filesize} && nand write ${loadaddr} 0x20800 ${filesize}' + +# Migrate to UBI volume based boot schema +setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static' +setenv prepare_m4firmware 'ubi create m4firmware 0xe0000 static' +setenv prepare_rootfs 'ubi create rootfs 0 dynamic' +setenv prepare_ubi 'ubi part ubi && if ubi check rootfs; then if ubi check kernel; then else ubi remove rootfs && run prepare_kernel_fdt && run prepare_m4firmware && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_m4firmware && run prepare_rootfs; fi' + +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && writeboot ${loadaddr} 80000 200000 $filesize' +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}' +setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && ubi write ${loadaddr} dtb ${filesize}' +setenv update_rootfs 'tftpboot ${loadaddr} ${board_name}/ubifs.img && ubi write ${loadaddr} rootfs ${filesize}' + +setenv upgrade_alpha1_msg 'Updated U-Boot, please reset the board and use "run setupdate && run update" again.' +setenv prepare_alpha1_uboot 'if test "${soc}" = "mx7"; then run update_uboot && echo ${upgrade_alpha1_msg} && reset; fi' +setenv update 'mtdparts default && run prepare_alpha1_uboot; run update_uboot && run prepare_ubi && run update_kernel && run update_fdt && run update_rootfs && reset' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/fwd_blk.scr b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/fwd_eth.scr b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/colibri-imx7/colibri-imx7_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-imx7/update.sh b/recipes-images/images/files/colibri-imx7/update.sh new file mode 100755 index 0000000..b9a6e3f --- /dev/null +++ b/recipes-images/images/files/colibri-imx7/update.sh @@ -0,0 +1,222 @@ +#! /bin/sh +# Prepare files needed for flashing a Colibri iMX7 module and +# copy them to a convenient location for using from a running U-Boot + +set -e + +Flash() +{ + echo "To flash the Colibri iMX7 module a running U-Boot is required. Boot the" + echo "module to the U-Boot prompt and" + echo "" + echo "insert the SD card, USB flash drive or when using TFTP connect Ethernet only" + echo "and enter:" + echo "'run setupdate'" + echo "" + echo "then to update all components enter:" + echo "'run update'" + echo "" + echo "Alternatively, to update U-Boot enter:" + echo "'run update_uboot'" + echo "to update a component stored in UBI enter:" + echo "'run prepare_ubi'" + echo "followed by one of:" + echo "'run update_kernel'" + echo "'run update_fdt'" + echo "'run update_rootfs'" + echo "" + echo "" + echo "If you don't have a working U-Boot anymore, connect your PC to the module's" + echo "USB client port, bring the module into the serial download mode and start the update.sh" + echo "script with the -d option. This will copy U-Boot into the module's RAM and" + echo "execute it." + echo "" + echo "Then use the following command to get U-Boot running:" + echo "'./update.sh -d'" + echo "" + echo "Next, recreate the Boot Configuration Block and the Toradex Config Block:" + echo "'run setupdate'" + echo "'run update_uboot'" + echo "'run create_bcb'" + echo "'cfgblock create'" +} + +Usage() +{ + echo "" + echo "Prepares and copies files for flashing internal NAND of Colibri iMX7" + echo "" + echo "The recommended way is to copy the files on a SD card or USB flash drive." + echo "The script format_sd.sh may be used to format the SD card." + echo "" + echo "The flash step requires a running U-Boot on the target. Either one already" + echo "flashed on the NAND or downloaded using serial downloader (argument -d)." + echo "" + echo "-d : use a USB connection to copy/execute U-Boot to/from module's RAM" + echo "-f : flash instructions" + echo "-h : prints this message" + echo "-m : module type: 0: autodetect from ./rootfs/etc/issues (default)" + echo " 1: Colibri iMX7" + echo "-o directory : output directory" + echo "" + echo "Example \"./update.sh -o /media/KERNEL/\" copies the required files to SD card" + echo "" + echo "*** For detailed recovery/update procedures, refer to the following website: ***" + echo "http://developer.toradex.com/knowledge-base/flashing-embedded-linux-to-imx7-modules" + echo "" +} + +# initialise options +KERNEL_DEVICETREE="imx7s-colibri-eval-v3.dtb imx7d-colibri-eval-v3.dtb" +KERNEL_IMAGETYPE="zImage" +MODTYPE_DETECT=0 + +# NAND parameters +BLOCK=124KiB +MAXLEB=8112 +PAGE=2KiB + +OUT_DIR="" +UBOOT_RECOVERY=0 + +while getopts "dfhm:o:" Option ; do + case $Option in + d) UBOOT_RECOVERY=1 + ;; + f) Flash + exit 0 + ;; + h) Usage + exit 0 + ;; + m) MODTYPE_DETECT=$OPTARG + ;; + o) OUT_DIR=$OPTARG + ;; + esac +done + +if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + Usage + exit 1 +fi + +# is OUT_DIR an existing directory? +if [ ! -d "$OUT_DIR" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + echo "$OUT_DIR" "does not exist, exiting" + exit 1 +fi + +case $MODTYPE_DETECT in + 0) # auto detect MODTYPE from rootfs directory + if [ -f rootfs/etc/issue ] ; then + CNT=`grep -c "MX7" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Colibri iMX7 rootfs detected" + MODTYPE=colibri-imx7 + fi + fi + if [ -e $MODTYPE ] ; then + echo "can not detect module type from ./rootfs/etc/issue" + echo "please specify the module type with the -m parameter" + echo "see help: '$ ./update.sh -h'" + echo "exiting" + exit 1 + fi + ;; + 1) MODTYPE=colibri-imx7 + echo "Colibri iMX7 rootfs specified" + ;; + *) echo "-m paramter specifies an unknown value" + exit 1 + ;; +esac + +case "$MODTYPE" in + "colibri-imx7") + IMAGEFILE=ubifs.img + LOCPATH="imx_flash" + OUT_DIR="$OUT_DIR/colibri_imx7" + ;; + *) echo "script internal error, unknown module type set" + exit 1 + ;; +esac + +BINARIES=${MODTYPE}_bin + +#is only U-Boot to be copied to RAM? +if [ "$UBOOT_RECOVERY" -eq 1 ] ; then + echo "Put the module in recovery mode and press [ENTER]..." + read RESULT + sudo ${LOCPATH}/imx_usb ${BINARIES}/u-boot.imx + exit +fi + +#sanity check for correct untared rootfs +DEV_OWNER=`ls -ld rootfs/dev | awk '{print $3}'` +if [ "${DEV_OWNER}x" != "rootx" ] +then + printf "rootfs/dev is not owned by root, but it should!\n" + printf "\033[1mPlease unpack the tarball with root rights.\033[0m\n" + printf "e.g. sudo tar xjvf Colibri_iMX7_LinuxImageV2.6_20160331.tar.bz2\n" + exit 1 +fi + +#sanity check, can we execute mkfs.ubifs, e.g. see the help text? +CNT=`sudo $LOCPATH/mkfs.ubifs -h | grep -c space-fixup || true` +if [ "$CNT" -eq 0 ] ; then + echo "The program mkfs.ubifs can not be executed or does not provide --space-fixup" + echo "option." + echo "Are you on a 64bit Linux host without installed 32bit execution environment?" + printf "\033[1mPlease install e.g. ia32-libs on 64-bit Ubuntu\033[0m" + printf "\033[1mMaybe others are needed e.g. liblzo2:i386 on 64-bit Ubuntu\033[0m" + exit 1 +fi + +#Install trap to write a sensible message in case any of the commands below +#exit premature... +trap '{ printf "\033[31mScript aborted unexpectedly...\033[0m\n"; }' EXIT + +# Prepare full flashing +sudo $LOCPATH/mkfs.ubifs --space-fixup -c ${MAXLEB} -e ${BLOCK} -m ${PAGE} -o ${BINARIES}/${IMAGEFILE} -r rootfs/ -v + +echo "" +echo "UBI image of root file system generated, copying data to target folder..." + +#make a file with the used versions for U-Boot, kernel and rootfs +sudo touch ${BINARIES}/versions.txt +sudo chmod ugo+w ${BINARIES}/versions.txt +echo "Component Versions" > ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/u-boot.imx`" >> ${BINARIES}/versions.txt +ROOTFSVERSION=`grep MX7 rootfs/etc/issue || echo "Version Unknown"` +echo "Rootfs ${ROOTFSVERSION}" >> ${BINARIES}/versions.txt + +#create subdirectory for this module type +sudo mkdir -p "$OUT_DIR" + +# Copy device tree file +COPIED=false +if test -n "${KERNEL_DEVICETREE}"; then + for DTB_FILE in ${KERNEL_DEVICETREE}; do + if [ -e "${BINARIES}/${KERNEL_IMAGETYPE}-${DTB_FILE}" ]; then + sudo cp ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_FILE} "$OUT_DIR/${DTB_FILE}" + COPIED=true + fi + done + [ $COPIED = true ] || { echo "Did not find the devicetrees from KERNEL_DEVICETREE, ${KERNEL_DEVICETREE}. Aborting."; exit 1; } +fi + +#copy to $OUT_DIR +sudo cp ${BINARIES}/u-boot-nand.imx ${BINARIES}/zImage ${BINARIES}/ubifs.img ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR" +sudo cp ${BINARIES}/fwd_blk.img "$OUT_DIR/../flash_blk.img" +sudo cp ${BINARIES}/fwd_eth.img "$OUT_DIR/../flash_eth.img" +#cleanup intermediate files +sudo rm ${BINARIES}/ubifs.img ${BINARIES}/versions.txt +sync + +#Remove trap and report success! +trap - EXIT +printf "\033[32mSuccessfully copied data to target folder.\033[0m\n\n" + +Flash diff --git a/recipes-images/images/files/colibri-pxa/colibri-pxa_bin/README b/recipes-images/images/files/colibri-pxa/colibri-pxa_bin/README new file mode 100644 index 0000000..2d597f4 --- /dev/null +++ b/recipes-images/images/files/colibri-pxa/colibri-pxa_bin/README @@ -0,0 +1 @@ +u-boot and kernel for pxa
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.bct b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.bct Binary files differnew file mode 100644 index 0000000..bcef8b1 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.bct diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.img.cfg b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.img.cfg new file mode 100644 index 0000000..6fc664d --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-hsmmc.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2015 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = colibri_t20-256-hsmmc.bct; +BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete; diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.bct b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.bct Binary files differnew file mode 100644 index 0000000..7ddd5d8 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.bct diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.img.cfg b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.img.cfg new file mode 100644 index 0000000..3ce017e --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v11-nand.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2015 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = colibri_t20-256-v11-nand.bct; +BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete; diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.bct b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.bct Binary files differnew file mode 100644 index 0000000..365877f --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.bct diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.img.cfg b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.img.cfg new file mode 100644 index 0000000..41ed535 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-256-v12-nand.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2015 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = colibri_t20-256-v12-nand.bct; +BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete; diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.bct b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.bct Binary files differnew file mode 100644 index 0000000..09eb434 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.bct diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.img.cfg b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.img.cfg new file mode 100644 index 0000000..60760fc --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-hsmmc.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2015 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = colibri_t20-512-hsmmc.bct; +BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete; diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.bct b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.bct Binary files differnew file mode 100644 index 0000000..5d68994 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.bct diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.img.cfg b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.img.cfg new file mode 100644 index 0000000..992f47a --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v11-nand.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2015 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = colibri_t20-512-v11-nand.bct; +BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete; diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.bct b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.bct Binary files differnew file mode 100644 index 0000000..f9db8fc --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.bct diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.img.cfg b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.img.cfg new file mode 100644 index 0000000..cb96289 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/colibri_t20-512-v12-nand.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2015 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = colibri_t20-512-v12-nand.bct; +BootLoader = u-boot-dtb-tegra.bin,0x00108000,0x00108000,Complete; diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr b/recipes-images/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr new file mode 100644 index 0000000..54c3d4d --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/flash_blk.scr @@ -0,0 +1,34 @@ +test -n ${interface} || setenv interface mmc + +test -n ${hw-version} || if test $lnxoffset = 0x1200000; then setenv hw-version v11; else setenv hw-version v12; fi + +setenv check_configblock 'setexpr toradex_oui_addr $loadaddr + 8; nand read $loadaddr 0x300000 0x64; crc32 -v $toradex_oui_addr 3 94305232' + +setenv migrate_1 'nand read $loadaddr 0x15C0000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_2 'nand read $loadaddr 0x1C80000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_3 'nand read $loadaddr 0x7380000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_4 'nand read $loadaddr 0x7900000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4' + +# Migrate to UBI volume based boot schema +setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static' +setenv prepare_rootfs 'ubi create rootfs - dynamic' +setenv prepare_ubi 'ubi part ubi && if ubi check rootfs; then if ubi check kernel; then else ubi remove rootfs && run prepare_kernel_fdt && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_rootfs; fi' + +setenv update_configblock 'load ${interface} 0:1 ${loadaddr} ${board_name}/configblock.bin && nand erase.part cfgblock && nand write ${loadaddr} cfgblock ${filesize}' +setenv update_uboot 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/${board_name}-${ram-size}-${hw-version}-nand.img && nand erase 0x0 0x300000 && nand write ${loadaddr} 0x0 ${filesize}' + +setenv update_kernel 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}' +#Writting data to invalidate current device tree +setenv update_fdt 'mw.w ${loadaddr} 0xFF 16 && ubi write ${loadaddr} dtb 16 && fatload ${interface} 0:1 ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && +ubi write ${loadaddr} dtb ${filesize}' +setenv update_rootfs 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/ubifs_${leb-size}.img && ubi write ${loadaddr} rootfs ${filesize}' + +setenv echo_v2.3b7 echo "successfully updated U-Boot," \${note} "power-cycle and enter \"run setupdate\; run migrate_v2.3b7\" to complete update" +setenv migrate_v2.3b7 'run migrate_configblock; nand erase.part ubi; run update_new' +setenv update_v2.3b7 'setenv ram-size 256; run update_uboot && setenv note "wait a sec," && run echo_v2.3b7 && md 0x1ffffffc 1 && setenv ram-size 512 && run update_uboot && setenv note && run echo_v2.3b7' + +setenv update_new 'run check_configblock || run migrate_configblock; run update_uboot; run prepare_ubi && run update_kernel && run update_rootfs && run update_fdt; reset' +setenv update 'if test -v $ver; then run update_new; else run update_v2.3b7; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/flash_eth.scr b/recipes-images/images/files/colibri-t20/colibri-t20_bin/flash_eth.scr new file mode 100644 index 0000000..bc4360d --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/flash_eth.scr @@ -0,0 +1,33 @@ +test -n ${hw-version} || if test $lnxoffset = 0x1200000; then setenv hw-version v11; else setenv hw-version v12; fi + +setenv check_configblock 'setexpr toradex_oui_addr $loadaddr + 8; nand read $loadaddr 0x300000 0x64; crc32 -v $toradex_oui_addr 3 94305232' + +setenv migrate_1 'nand read $loadaddr 0x15C0000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_2 'nand read $loadaddr 0x1C80000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_3 'nand read $loadaddr 0x7380000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_4 'nand read $loadaddr 0x7900000 0x40; crc32 -v $toradex_oui_addr 3 94305232 && nand erase.part cfgblock && nand write $loadaddr 0x300000 0x64' +setenv migrate_configblock 'setexpr toradex_oui_addr $loadaddr + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4' + +# Migrate to UBI volume based boot schema +setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static' +setenv prepare_rootfs 'ubi create rootfs - dynamic' +setenv prepare_ubi 'ubi part ubi && if ubi check rootfs; then if ubi check kernel; then else ubi remove rootfs && run prepare_kernel_fdt && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_rootfs; fi' + +setenv update_configblock 'tftpboot ${loadaddr} ${board_name}/configblock.bin && nand erase.part cfgblock && nand write ${loadaddr} cfgblock ${filesize}' +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/${board_name}-${ram-size}-${hw-version}-nand.img && nand erase 0x0 0x300000 && nand write ${loadaddr} 0x0 ${filesize}' + +setenv update_rootfs 'tftpboot ${loadaddr} ${board_name}/ubifs_${leb-size}.img && run prepare_rootfs && ubi write ${loadaddr} rootfs ${filesize}' +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}' +#Writting data to invalidate current device tree +setenv update_fdt 'mw.w ${loadaddr} 0xFF 16 && ubi write ${loadaddr} dtb 16 && tftpboot ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && +ubi write ${loadaddr} dtb ${filesize}' +setenv update_rootfs 'tftpboot ${loadaddr} ${board_name}/ubifs_${leb-size}.img && ubi write ${loadaddr} rootfs ${filesize}' + +setenv echo_v2.3b7 echo "successfully updated U-Boot," \${note} "power-cycle and enter \"run setupdate\; run migrate_v2.3b7\" to complete update" +setenv migrate_v2.3b7 'run migrate_configblock; nand erase.part ubi; run update_new' +setenv update_v2.3b7 'setenv ram-size 256; run update_uboot && setenv note "wait a sec," && run echo_v2.3b7 && md 0x1ffffffc 1 && setenv ram-size 512 && run update_uboot && setenv note && run echo_v2.3b7' + +setenv update_new 'run check_configblock || run migrate_configblock; run update_uboot; run prepare_ubi && run update_kernel && run update_rootfs && run update_fdt; reset' +setenv update 'if test -v $ver; then run update_new; else run update_v2.3b7; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_blk.scr b/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_eth.scr b/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_mmc.scr b/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_mmc.scr new file mode 120000 index 0000000..3848cfa --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/fwd_mmc.scr @@ -0,0 +1 @@ +../../library/fwd_mmc.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/colibri-t20/colibri-t20_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t20/tegra-uboot-flasher/genext3fs.sh b/recipes-images/images/files/colibri-t20/tegra-uboot-flasher/genext3fs.sh new file mode 120000 index 0000000..cc716db --- /dev/null +++ b/recipes-images/images/files/colibri-t20/tegra-uboot-flasher/genext3fs.sh @@ -0,0 +1 @@ +../../library/genext3fs.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t20/update.sh b/recipes-images/images/files/colibri-t20/update.sh new file mode 120000 index 0000000..6ebea84 --- /dev/null +++ b/recipes-images/images/files/colibri-t20/update.sh @@ -0,0 +1 @@ +../library/tegra/update.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30.img.cfg b/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30.img.cfg new file mode 100644 index 0000000..d797a13 --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30.img.cfg @@ -0,0 +1,22 @@ +# Copyright (C) 2013-2014 Toradex, Inc. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +Version = 0x00020001; +Bctcopy = 1; +Bctfile = colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct; +BootLoader = u-boot-dtb-tegra.bin,0x80108000,0x80108000,Complete; diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct b/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct Binary files differnew file mode 100755 index 0000000..109f0c0 --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30_12MHz_NT5CC256M16CP-DI_533MHz.bct b/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30_12MHz_NT5CC256M16CP-DI_533MHz.bct Binary files differnew file mode 100644 index 0000000..0349242 --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/colibri_t30_12MHz_NT5CC256M16CP-DI_533MHz.bct diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr b/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr new file mode 100644 index 0000000..02a920a --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_blk.scr @@ -0,0 +1,42 @@ +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 + +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +setenv set_nextpos 'setexpr filepos ${filepos} + ${filesize}; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232' + +setenv migrate_1 'mmc dev 0 0; mmc read ${loadaddr} 6000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_2 'mmc dev 0 0; mmc read ${loadaddr} 8000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_3 'mmc dev 0 0; mmc read ${loadaddr} 9000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_4 'mmc dev 0 0; mmc read ${loadaddr} 34000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' + +setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3 ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' + +setenv update_kernel 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-colibri-${fdt_board}.dtb ${filesize}' + +setenv update_configblock 'run check_configblock; load ${interface} ${drive}:1 ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +setenv update_3 'setenv filesize 4000000; setenv filepos 0; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextpos; done' + +setenv echo_v2.3b1 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b1\" to complete update" +setenv migrate_v2.3b1 'run migrate_configblock; run update_new' +setenv update_v2.3b1 'run update_uboot && run echo_v2.3b1' + +setenv update_new 'run check_configblock || run migrate_configblock; run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3; reset' +setenv update 'if test -v ${ver}; then run update_new; else run update_v2.3b1; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr b/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr new file mode 100644 index 0000000..cad7b5a --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/flash_eth.scr @@ -0,0 +1,43 @@ +setenv set_blkcnt 'setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200' +#workaround U-Boot counting in hex and split did in decimal +setenv incr_decimal 'setexpr filenum ${filenum} + 1; setexpr filenrlow ${filenum} % 0x10; test ${filenrlow} -eq "a" && setexpr filenum ${filenum} + 0x6; true' +setenv set_nextnum 'run incr_decimal; setexpr blkstart ${blkstart} + ${blkcnt}' + +setenv check_1 'setenv conf_blk_offset 0x1fff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_2 'setenv conf_blk_offset 0xfff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_3 'setenv conf_blk_offset 0x7ff; mmc read ${loadaddr} ${conf_blk_offset} 1' +setenv check_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; mmc dev 0 1; run check_1 || run check_2 || run check_3; crc32 -v ${toradex_oui_addr} 3 94305232' + +setenv migrate_1 'mmc dev 0 0; mmc read ${loadaddr} 6000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_2 'mmc dev 0 0; mmc read ${loadaddr} 8000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_3 'mmc dev 0 0; mmc read ${loadaddr} 9000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_4 'mmc dev 0 0; mmc read ${loadaddr} 34000 1; setenv conf_blk_offset 0x1fff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_5 'mmc dev 0 0; mmc read ${loadaddr} 36000 1; setenv conf_blk_offset 0xfff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_6 'mmc dev 0 0; mmc read ${loadaddr} 37000 1; setenv conf_blk_offset 0x7ff; crc32 -v ${toradex_oui_addr} 3 94305232 && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' +setenv migrate_configblock 'setexpr toradex_oui_addr ${loadaddr} + 8; run migrate_1; run migrate_2; run migrate_3; run migrate_4; run migrate_5; run migrate_6' + +setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}' + +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/${board_name}.img && run set_blkcnt && mmc dev 0 1 && mmc write ${loadaddr} 0x0 ${blkcnt}' + +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/uImage && fatwrite mmc 0:1 ${loadaddr} uImage ${filesize}' + +setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && fatwrite mmc 0:1 ${loadaddr} ${soc}-colibri-${fdt_board}.dtb ${filesize}' + +setenv update_configblock 'run check_configblock; tftpboot ${loadaddr} ${board_name}/configblock.bin && mmc dev 0 1 && mmc write ${loadaddr} ${conf_blk_offset} 1' + +setenv update_1 'tftpboot ${loadaddr} ${board_name}/mbr.bin && mmc dev 0 0 && mmc write ${loadaddr} 0x0 0x1' +setenv update_2 'tftpboot ${loadaddr} ${board_name}/boot.vfat && run set_blkcnt && mmc dev 0 0 && mmc write ${loadaddr} 0x2000 ${blkcnt}' +#do it in chunks of 64M to fit into DDR RAM of the smallest module +#split root.ext3 into multiple 64M chunks before copying to TFTP folder as follows +#split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 root.ext3 root.ext3- +setenv update_3 'setenv filesize 4000000; setenv filenum 10; setenv blkstart a000; while test ${filesize} -eq "4000000"; do run cp_file_chunk; run set_nextnum; done' + +setenv echo_v2.3b1 echo "successfully updated U-Boot, power-cycle and enter \"run setupdate\; run migrate_v2.3b1\" to complete update" +setenv migrate_v2.3b1 'run migrate_configblock; run update_new' +setenv update_v2.3b1 'run update_uboot && run echo_v2.3b1' + +setenv update_new 'run check_configblock || run migrate_configblock; run update_uboot; run update_1; run update_2; run update_kernel; run update_fdt; run update_3; reset' +setenv update 'if test -v ${ver}; then run update_new; else run update_v2.3b1; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_blk.scr b/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_eth.scr b/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_mmc.scr b/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_mmc.scr new file mode 120000 index 0000000..3848cfa --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/fwd_mmc.scr @@ -0,0 +1 @@ +../../library/fwd_mmc.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t30/colibri-t30_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/colibri-t30/colibri-t30_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/colibri-t30/colibri-t30_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t30/tegra-uboot-flasher/genext3fs.sh b/recipes-images/images/files/colibri-t30/tegra-uboot-flasher/genext3fs.sh new file mode 120000 index 0000000..cc716db --- /dev/null +++ b/recipes-images/images/files/colibri-t30/tegra-uboot-flasher/genext3fs.sh @@ -0,0 +1 @@ +../../library/genext3fs.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-t30/update.sh b/recipes-images/images/files/colibri-t30/update.sh new file mode 120000 index 0000000..6ebea84 --- /dev/null +++ b/recipes-images/images/files/colibri-t30/update.sh @@ -0,0 +1 @@ +../library/tegra/update.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-vf/README b/recipes-images/images/files/colibri-vf/README new file mode 100644 index 0000000..8d283da --- /dev/null +++ b/recipes-images/images/files/colibri-vf/README @@ -0,0 +1,6 @@ +Toradex Linux BSP +================= + +Use the update.sh script to update your module. Check the Release Notes for +detailed instruction how to use flash your module. The Release Notes is located +in the same directory of the BSP release tarball. diff --git a/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr b/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr new file mode 100644 index 0000000..8fa5af9 --- /dev/null +++ b/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_blk.scr @@ -0,0 +1,28 @@ +setenv create_bcb 'nand erase.part vf-bcb && writebcb 0x20000 0x20000' +setenv update_configblock 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/configblock.bin && nand write ${loadaddr} 0x800 ${filesize}' + +# Migrate to UBI volume based boot schema +setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static' +setenv prepare_rootfs 'ubi create rootfs 0 dynamic' +setenv prepare_ubi 'ubi part ubi && if ubi check rootfs; then if ubi check kernel; then else ubi remove rootfs && run prepare_kernel_fdt && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_rootfs; fi' + +setenv update_uboot 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && nand write ${loadaddr} u-boot' +setenv update_kernel 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}' +setenv update_fdt 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && ubi write ${loadaddr} dtb ${filesize}' +setenv update_rootfs 'fatload ${interface} 0:1 ${loadaddr} ${board_name}/ubifs.img && ubi write ${loadaddr} rootfs ${filesize}' + +setenv update_new 'run update_uboot; run prepare_ubi && run update_kernel && run update_fdt && run update_rootfs; reset' + +# Upgrade part 1, write new U-Boot, but with old ECC format still... +# Store config block temporarly in memory at kernel_addr_r. +setenv upgrade_part1 'run update_uboot && nand read ${kernel_addr_r} 0x800 0x20 && echo "${upgrade_part1_msg}"' +setenv upgrade_part1_msg 'Successfully updated U-Boot, NAND upgrade required. Enter "reset", interrupt boot process and enter "run setupdate; run upgrade_part2" to complete upgrade.' + +# Upgrade part 2, use new ECC format for the whole device... +setenv upgrade_part2 'run create_bcb && nand write ${kernel_addr_r} 0x800 0x20 && run update_uboot && nand erase.part ubi && run update_rootfs && echo ${upgrade_part2_msg}' +setenv upgrade_part2_msg 'Successfully upgraded module, enter "reset" to restart the module.' + +# fsl_nfc indicates old NAND format (24-bit ECC), start migration process +setenv update 'mtdparts default && if test "${mtdids}" = "nand0=fsl_nfc"; then; run upgrade_part1; else run update_new; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_eth.scr b/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_eth.scr new file mode 100644 index 0000000..aa98b3a --- /dev/null +++ b/recipes-images/images/files/colibri-vf/colibri-vf_bin/flash_eth.scr @@ -0,0 +1,28 @@ +setenv create_bcb 'nand erase.part vf-bcb && writebcb 0x20000 0x20000' +setenv update_configblock 'tftpboot ${loadaddr} ${board_name}/configblock.bin && nand write ${loadaddr} 0x800 ${filesize}' + +# Migrate to UBI volume based boot schema +setenv prepare_kernel_fdt 'ubi create kernel 0x800000 static && ubi create dtb 0x20000 static' +setenv prepare_rootfs 'ubi create rootfs 0 dynamic' +setenv prepare_ubi 'ubi part ubi && if ubi check rootfs; then if ubi check kernel; then else ubi remove rootfs && run prepare_kernel_fdt && run prepare_rootfs; fi; else run prepare_kernel_fdt && run prepare_rootfs; fi' + +setenv update_uboot 'tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx && nand erase.part u-boot && nand erase.part u-boot-env && nand write ${loadaddr} u-boot' +setenv update_kernel 'tftpboot ${loadaddr} ${board_name}/zImage && ubi write ${loadaddr} kernel ${filesize}' +setenv update_fdt 'tftpboot ${loadaddr} ${board_name}/${soc}-colibri-${fdt_board}.dtb && ubi write ${loadaddr} dtb ${filesize}' +setenv update_rootfs 'tftpboot ${loadaddr} ${board_name}/ubifs.img && ubi write ${loadaddr} rootfs ${filesize}' + +setenv update_new 'run update_uboot; run prepare_ubi && run update_kernel && run update_fdt && run update_rootfs; reset' + +# Upgrade part 1, write new U-Boot, but with old ECC format still... +# Store config block temporarly in memory at kernel_addr_r. +setenv upgrade_part1 'run update_uboot && nand read ${kernel_addr_r} 0x800 0x20 && echo "${upgrade_part1_msg}"' +setenv upgrade_part1_msg 'Successfully updated U-Boot, NAND upgrade required. Enter "reset", interrupt boot process and enter "run setupdate; run upgrade_part2" to complete upgrade.' + +# Upgrade part 2, use new ECC format for the whole device... +setenv upgrade_part2 'run create_bcb && nand write ${kernel_addr_r} 0x800 0x20 && run update_uboot && nand erase.part ubi && run update_rootfs && echo ${upgrade_part2_msg}' +setenv upgrade_part2_msg 'Successfully upgraded module, enter "reset" to restart the module.' + +# fsl_nfc indicates old NAND format (24-bit ECC), start migration process +setenv update 'mtdparts default && if test "${mtdids}" = "nand0=fsl_nfc"; then; run upgrade_part1; else run update_new; fi' + +echo 'enter "run update" to update the entire module' diff --git a/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_blk.scr b/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_blk.scr new file mode 120000 index 0000000..5954646 --- /dev/null +++ b/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_blk.scr @@ -0,0 +1 @@ +../../library/fwd_blk.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_eth.scr b/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_eth.scr new file mode 120000 index 0000000..decc214 --- /dev/null +++ b/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_eth.scr @@ -0,0 +1 @@ +../../library/fwd_eth.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_mmc.scr b/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_mmc.scr new file mode 120000 index 0000000..3848cfa --- /dev/null +++ b/recipes-images/images/files/colibri-vf/colibri-vf_bin/fwd_mmc.scr @@ -0,0 +1 @@ +../../library/fwd_mmc.scr
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-vf/colibri-vf_bin/mk-u-boot-scripts.sh b/recipes-images/images/files/colibri-vf/colibri-vf_bin/mk-u-boot-scripts.sh new file mode 120000 index 0000000..ce71dbd --- /dev/null +++ b/recipes-images/images/files/colibri-vf/colibri-vf_bin/mk-u-boot-scripts.sh @@ -0,0 +1 @@ +../../library/mk-u-boot-scripts.sh
\ No newline at end of file diff --git a/recipes-images/images/files/colibri-vf/format_sd.sh b/recipes-images/images/files/colibri-vf/format_sd.sh new file mode 100755 index 0000000..79cc985 --- /dev/null +++ b/recipes-images/images/files/colibri-vf/format_sd.sh @@ -0,0 +1,115 @@ +#! /bin/sh +# Format a SD card to be used for flashing a Colibri VFxx module +# Then calls update.sh to add needed files + +# sometimes we need the binary echo, not the shell builtin +ECHO=`which echo` + +Usage() +{ + echo "" + echo "Formats and fills a SD card with files for flashing the internal NAND of a" + echo "Colibri VFxx. Optionally creates a rootfs partition to allow booting and taking" + echo "kernel and rootfs from SD card." + echo "ALL DATA ON THE DEVICE GIVEN WITH -d WILL BE DELETED!!" + echo + echo "Requires a running U-Boot on the target. Either one already flashed on the NAND" + echo "or strapping the board to boot from SD card and booting U-Boot from the card" + echo "(only possible on older samples without blown boot fuses)." + echo "" + echo "-h : Prints this message" + echo "" + echo "-d FILE : device file of the SD card" + echo "-f : additionally copy the rootfs into the second partition" + echo "-s : optimise file system for 128MB NAND, increases usable space" + echo " on VF50 module a little, but on VF61 uses also only 128MB" + echo "" + echo "Example \"./format_sd.sh -d /dev/mmcblk0\" prepares the SD card /dev/mmcblk0" + echo "" +} + +#initialise options +DEV="/dev/null" +CFGBLOCK_ONLY=0 +DEBUG_ONLY=0 +KERNEL_ONLY=0 +UBOOT_ONLY=0 +CP_ROOTFS=0 + +while getopts "hd:fs" Option ; do + case $Option in + h) Usage + # Exit if only usage (-h) was specified. + if [[ $# -eq 1 ]] ; then + exit 10 + fi + exit 0 + ;; + d) DEV=$OPTARG + ;; + f) CP_ROOTFS=1 + ;; + s) UPDATE_OPTS="-s" + esac +done + +DEVNAME=`basename $DEV` +DEVNAMESTART=`echo $DEVNAME | cut -c 1-3` + +# sanity checks to try and not touch one of the users hard drives or other issues +if [ ! -b $DEV ] ; then + echo $DEV "is not a block device, " + echo "please specify the device file representing your SD card" + exit 1 +fi +if [ "$DEVNAMESTART" = "sda" ] ; then + echo $DEV "seems to be your primary hard disk," + echo "please specify the device file representing your SD card" + exit 1 +fi +if [ ! -d /sys/block/$DEVNAME ] ; then + echo "/sys/block/$DEVNAME" + echo $DEV "seems to not be a disk, please specify the device file" + echo "representing your SD card (without any trailing number)" + exit 1 +fi +IS_USB_MMC=`ls -l /sys/block/$DEVNAME | grep -c "usb\|mmc"` +if [ $IS_USB_MMC -eq 0 ] ; then + echo $DEV "seems not to be connected over USB or MMC, please specify the device file" + echo "representing your SD card (without any trailing number)" + exit 1 +fi + +if [ "$DEVNAMESTART" = "mmc" ] ; then + PART_PREFIX="p" +else + PART_PREFIX="" +fi +# make sure the partitions are unmounted +sudo umount ${DEV}${PART_PREFIX}? + +# partition and format the vfat partition +sudo parted -s $DEV mklabel msdos mkpart primary fat32 1MB 512MB mkpart primary ext3 512MB 100% +sudo umount ${DEV}${PART_PREFIX}1 +sudo mkfs.fat -n UPDATE ${DEV}${PART_PREFIX}1 + +# dd U-Boot onto the SD card +sudo dd if=colibri-vf_bin/u-boot.imx of=${DEV} bs=512 seek=2 + +sudo mkdir -p mntpoint1 +sudo mount -t vfat ${DEV}${PART_PREFIX}1 mntpoint1 -o umask=0 + +# now copy U-Boot, kernel and ubi-img to the KERNEL partition +DEST=`readlink -e mntpoint1` +./update.sh -o "$DEST" $UPDATE_OPTS + +#copy the rootfs +if [ "$CP_ROOTFS" -eq 1 ] ; then + sudo umount ${DEV}${PART_PREFIX}2 + sudo mkfs.ext3 -L RFS ${DEV}${PART_PREFIX}2 && sync + sudo mkdir -p mntpoint2 + sudo mount -t ext3 ${DEV}${PART_PREFIX}2 mntpoint2 + sudo cp -pPr rootfs/* mntpoint2/ +fi + +sudo umount ${DEV}${PART_PREFIX}? diff --git a/recipes-images/images/files/colibri-vf/update.sh b/recipes-images/images/files/colibri-vf/update.sh new file mode 100755 index 0000000..2c04342 --- /dev/null +++ b/recipes-images/images/files/colibri-vf/update.sh @@ -0,0 +1,236 @@ +#! /bin/sh +# Prepare files needed for flashing a Colibri VF50/VF61 module and +# copy them to a convenient location for using from a running U-Boot + +set -e + +Flash() +{ + echo "To flash the Colibri VF50/VF61 module a running U-Boot is required. Boot the" + echo "module to the U-Boot prompt and" + echo "" + echo "insert the SD card, USB flash drive or when using TFTP connect Ethernet only" + echo "and enter:" + echo "'run setupdate'" + echo "" + echo "then to update all components enter:" + echo "'run update'" + echo "" + echo "Alternatively, to update U-Boot enter:" + echo "'run update_uboot'" + echo "to update a component stored in UBI enter:" + echo "'run prepare_ubi'" + echo "followed by one of:" + echo "'run update_kernel'" + echo "'run update_fdt'" + echo "'run update_rootfs'" + echo "" + echo "" + echo "If you don't have a working U-Boot anymore, connect your PC to the module's" + echo "UART, bring the module into the serial download mode and start the update.sh" + echo "script with the -d option. This will copy U-Boot into the module's RAM and" + echo "execute it. Don't forget to also bridge RTS/CTS if using an USB-to-serial" + echo "converter without handshake signals." + echo "" + echo "Then use the following command to get U-Boot running:" + echo "'./update.sh -n -d /dev/ttyUSB0'" + echo "" + echo "Next, recreate the Boot Configuration Block and the Toradex Config Block:" + echo "'run setupdate'" + echo "'run update_uboot'" + echo "'run create_bcb'" + echo "'cfgblock create'" +} + +Usage() +{ + echo "" + echo "Prepares and copies files for flashing internal NAND of Colibri VF50/VF61" + echo "" + echo "The recommended way is to copy the files on a SD card or USB flash drive." + echo "The script format_sd.sh may be used to format the SD card." + echo "" + echo "The flash step requires a running U-Boot on the target. Either one already" + echo "flashed on the NAND or downloaded using serial downloader (argument -d)." + echo "" + echo "-d uart_dev : use UART connection to copy/execute U-Boot to/from module's RAM" + echo "-f : flash instructions" + echo "-h : prints this message" + echo "-m : module type: 0: autodetect from ./rootfs/etc/issues (default)" + echo " 1: Colibri VF50/VF61" + echo "-n : disable hardware flow control (bridge RTS/CTS!)" + echo "-o directory : output directory" + echo "-s : optimise file system for 128MB NAND, increases usable space" + echo " on VF50 module a little, but on VF61 uses also only 128MB" + echo "" + echo "Example \"./update.sh -o /media/KERNEL/\" copies the required files to SD card" + echo "" + echo "*** For detailed recovery/update procedures, refer to the following website: ***" + echo "http://developer.toradex.com/knowledge-base/flashing-linux-on-vybrid-modules" + echo "" +} + +# initialise options +KERNEL_DEVICETREE="vf500-colibri-eval-v3.dtb vf610-colibri-eval-v3.dtb" +KERNEL_IMAGETYPE="zImage" +MODTYPE_DETECT=0 +NORTSCTS=0 +OUT_DIR="" +UBOOT_RECOVERY=0 +# NAND parameters +PAGE=2KiB +BLOCK=124KiB +MAXLEB=8112 + +while getopts "d:fhm:no:s" Option ; do + case $Option in + d) UBOOT_RECOVERY=1 + UARTDEV=$OPTARG + ;; + f) Flash + exit 0 + ;; + h) Usage + exit 0 + ;; + m) MODTYPE_DETECT=$OPTARG + ;; + n) NORTSCTS=1 + ;; + o) OUT_DIR=$OPTARG + ;; + s) MAXLEB=982 + ;; + esac +done + +if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + Usage + exit 1 +fi + +# is OUT_DIR an existing directory? +if [ ! -d "$OUT_DIR" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + echo "$OUT_DIR" "does not exist, exiting" + exit 1 +fi + +case $MODTYPE_DETECT in + 0) # auto detect MODTYPE from rootfs directory + if [ -f rootfs/etc/issue ] ; then + CNT=`grep -c "VF" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Colibri VF rootfs detected" + MODTYPE=colibri-vf + fi + fi + if [ -e $MODTYPE ] ; then + echo "can not detect module type from ./rootfs/etc/issue" + echo "please specify the module type with the -m parameter" + echo "see help: '$ ./update.sh -h'" + echo "exiting" + exit 1 + fi + ;; + 1) MODTYPE=colibri-vf + echo "Colibri VF rootfs specified" + ;; + *) echo "-m paramter specifies an unknown value" + exit 1 + ;; +esac + +case "$MODTYPE" in + "colibri-vf") + IMAGEFILE=ubifs.img + LOCPATH="vf_flash" + OUT_DIR="$OUT_DIR/colibri_vf" + ;; + *) echo "script internal error, unknown module type set" + exit 1 + ;; +esac + +BINARIES=${MODTYPE}_bin + +#is only U-Boot to be copied to RAM? +if [ "$UBOOT_RECOVERY" -eq 1 ] ; then + LOADEROPTS="" + if [ ${NORTSCTS} = 1 ]; then + LOADEROPTS="--no-rtscts" + fi + + echo "Put the module in recovery mode and press [ENTER]..." + read RESULT + sudo ${LOCPATH}/imx_uart ${LOADEROPTS} ${UARTDEV} ${LOCPATH}/vybrid_usb_work.conf ${BINARIES}/u-boot.imx + exit +fi + +#sanity check for correct untared rootfs +DEV_OWNER=`ls -ld rootfs/dev | awk '{print $3}'` +if [ "${DEV_OWNER}x" != "rootx" ] +then + printf "rootfs/dev is not owned by root, but it should!\n" + printf "\033[1mPlease unpack the tarball with root rights.\033[0m\n" + printf "e.g. sudo tar xjvf Colibri_VF_LinuxImageV2.6_20160331.tar.bz2\n" + exit 1 +fi + +#sanity check, can we execute mkfs.ubifs, e.g. see the help text? +CNT=`sudo $LOCPATH/mkfs.ubifs -h | grep -c space-fixup || true` +if [ "$CNT" -eq 0 ] ; then + echo "The program mkfs.ubifs can not be executed or does not provide --space-fixup" + echo "option." + echo "Are you on a 64bit Linux host without installed 32bit execution environment?" + printf "\033[1mPlease install e.g. ia32-libs on 64-bit Ubuntu\033[0m\n" + printf "\033[1mMaybe others are needed e.g. liblzo2:i386 on 64-bit Ubuntu\033[0m\n" + exit 1 +fi + +#Install trap to write a sensible message in case any of the commands below +#exit premature... +trap '{ printf "\033[31mScript aborted unexpectedly...\033[0m\n"; }' EXIT + +#Prepare full flashing +sudo $LOCPATH/mkfs.ubifs --space-fixup -c ${MAXLEB} -e ${BLOCK} -m ${PAGE} -o ${BINARIES}/${IMAGEFILE} -r rootfs/ -v + +echo "" +echo "UBI image of root file system generated, copying data to target folder..." + +#make a file with the used versions for U-Boot, kernel and rootfs +sudo touch ${BINARIES}/versions.txt +sudo chmod ugo+w ${BINARIES}/versions.txt +echo "Component Versions" > ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/u-boot.imx`" >> ${BINARIES}/versions.txt +ROOTFSVERSION=`grep VF rootfs/etc/issue || echo "Version Unknown"` +echo "Rootfs ${ROOTFSVERSION}" >> ${BINARIES}/versions.txt + +#create subdirectory for this module type +sudo mkdir -p "$OUT_DIR" + +# Copy device tree file +COPIED=false +if test -n "${KERNEL_DEVICETREE}"; then + for DTB_FILE in ${KERNEL_DEVICETREE}; do + if [ -e "${BINARIES}/${KERNEL_IMAGETYPE}-${DTB_FILE}" ]; then + sudo cp ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_FILE} "$OUT_DIR/${DTB_FILE}" + COPIED=true + fi + done + [ $COPIED = true ] || { echo "Did not find the devicetrees from KERNEL_DEVICETREE, ${KERNEL_DEVICETREE}. Aborting."; exit 1; } +fi + +#copy to $OUT_DIR +sudo cp ${BINARIES}/u-boot-nand.imx ${BINARIES}/zImage ${BINARIES}/ubifs.img ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR" +sudo cp ${BINARIES}/fwd_blk.img "$OUT_DIR/../flash_blk.img" +sudo cp ${BINARIES}/fwd_eth.img "$OUT_DIR/../flash_eth.img" +sudo cp ${BINARIES}/fwd_mmc.img "$OUT_DIR/../flash_mmc.img" +#cleanup intermediate files +sudo rm ${BINARIES}/ubifs.img ${BINARIES}/versions.txt +sync + +#Remove trap and report success! +trap - EXIT +printf "\033[32mSuccessfully copied data to target folder.\033[0m\n\n" + +Flash diff --git a/recipes-images/images/files/library/create_configblock.sh b/recipes-images/images/files/library/create_configblock.sh new file mode 100755 index 0000000..3829fbb --- /dev/null +++ b/recipes-images/images/files/library/create_configblock.sh @@ -0,0 +1,247 @@ +#! /bin/sh + +# exit on error +set -e + +Usage() +{ + echo "create_configblock creates a configblock binary from the info on the module sticker." + echo "This can be used when the configblock got lost during a failed update attempt." + echo "" + echo "The created config-block will be copied to the choosen output directory when running" + echo "the update.sh command." + echo "" + echo "In order to write the config block enter on the U-Boot commandline:" + echo "run update" + echo "run update_configblock" + echo "" + echo "For Colibri VF modules the boot configuration block needs to be recreated first:" + echo "run update" + echo "run create_bcb" + echo "run update_configblock" + echo "" +} + +while getopts "h" Option ; do + case $Option in + h) Usage + # Exit if only usage (-h) was specfied. + if [[ $# -eq 1 ]] ; then + exit 10 + fi + exit 0 + ;; + esac +done + +#sanity check for some programs +AWKTEST=`echo 12345678abcdefgh | awk 'BEGIN{ FIELDWIDTHS = "8 8"} {print $2}'` || true +[ "${AWKTEST}x" = "abcdefghx" ] || { echo >&2 "Program gawk not available. Aborting."; exit 1; } + +# autotect MODTYPE from from rootfs directory +CNT=`grep -c "T20" rootfs/etc/issue || true` +if [ ${CNT} -ge 1 ] ; then + echo "Colibri T20 rootfs detected" + MODTYPE=colibri-t20 + BOOT_DEVICE=nand +else + CNT=`grep -c "T30" rootfs/etc/issue || true` + if [ ${CNT} -ge 1 ] ; then + CNT=`grep -c "Apalis" rootfs/etc/issue || true` + if [ ${CNT} -ge 1 ] ; then + echo "Apalis T30 rootfs detected" + MODTYPE=apalis-t30 + else + echo "Colibri T30 rootfs detected" + MODTYPE=colibri-t30 + fi + else + CNT=`grep -c "VF" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Colibri VF rootfs detected" + MODTYPE=colibri-vf + else + CNT=`grep -c "Colibri_iMX6" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Colibri iMX6 rootfs detected" + MODTYPE=colibri-imx6 + else + CNT=`grep -ic "imx6" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Apalis iMX6 rootfs detected" + MODTYPE=apalis-imx6 + else + echo "can not detect modulue type from ./rootfs/etc/issue" + echo "exiting" + exit 1 + fi + fi + fi + fi +fi + +echo "Enter the modules serial number on the modules sticker or" +echo "use a barcode scanner to enter the content of the stickers barcode" + +# read a barcode and test it to be 8 or 16 numbers only 0025100102489109 0115100000000024 +# 1234567890123456 1234567890123456 +until [ "${BARCODE}x" != "x" ] +do + read BARCODE + #remove all whitespace + BARCODE=`echo $BARCODE | tr -d ' '` + #get strlen and the number of numeric characters + STRLEN=`echo $BARCODE | wc -c` + NUMCNT=`echo $BARCODE | sed 's/[^0-9]//g' | wc -c` + if [ $STRLEN -ne 17 ] ; then + if [ $STRLEN -ne 9 ] ; then + echo "The serial number must be 8 numbers long (the barcode 16)" + BARCODE="" + fi + fi + if [ $NUMCNT -ne $STRLEN ] ; then + echo "The serial number must contain all numeric characters" + BARCODE="" + fi +done +DATECODE=19700101000000 +if [ $STRLEN -eq 17 ] ; then + SERIALNR=`echo $BARCODE | awk 'BEGIN{ FIELDWIDTHS = "8 8"} {print $2}'` + PRODUCTNR=`echo $BARCODE | awk 'BEGIN{ FIELDWIDTHS = "8 8"} {print $1}'` +else + SERIALNR=$BARCODE + case ${MODTYPE} in + "apalis-imx6") + RAM_SIZE=1024 + echo "Enter the RAM size ( 512 / 1024 / 2048 ):" + read RAM_SIZE + case ${RAM_SIZE} in + "512") + PROD_ID="0029" + ;; + "1024") + PROD_ID="0027" + ;; + "2048") + PROD_ID="0028" + ;; + esac + ;; + "apalis-t30") + RAM_SIZE=1024 + echo "Enter the RAM size ( 1024 / 2048 ):" + read RAM_SIZE + case ${RAM_SIZE} in + "1024") + PROD_ID="0026" + ;; + "2048") + PROD_ID="0025" + ;; + esac + ;; + "colibri-imx6") + RAM_SIZE=256 + echo "Enter the RAM size ( 256 / 512 ):" + read RAM_SIZE + echo "Enter I for IT version, nothing otherwise" + read IT + if [ $RAM_SIZE -eq 512 ] ; then + if [ "$IT"x = "Ix" ] ; then + PROD_ID="0017" + else + PROD_ID="0015" + fi + else + if [ "$IT"x = "Ix" ] ; then + PROD_ID="0016" + else + PROD_ID="0014" + fi + fi + ;; + "colibri-t20") + RAM_SIZE=256 + echo "Enter the RAM size ( 256 / 512 ):" + read RAM_SIZE + echo "Enter I for IT version, nothing otherwise" + read IT + if [ $RAM_SIZE -eq 512 ] ; then + if [ "$IT"x = "Ix" ] ; then + PROD_ID="0022" + else + PROD_ID="0021" + fi + else + if [ "$IT"x = "Ix" ] ; then + PROD_ID="0024" + else + PROD_ID="0020" + fi + fi + ;; + "colibri-t30") + PROD_ID="0023" + ;; + "colibri-vf") + VF_TYPE=50 + echo "Enter the Module Type (50 for a Colibri VF50 or 61 for a Colibri VF61)" + read VF_TYPE + + echo "Enter I for IT version, nothing otherwise" + read IT + if [ "$VF_TYPE" = "50" ] ; then + if [ "$IT"x = "Ix" ] ; then + PROD_ID="0013" + else + PROD_ID="0010" + fi + elif [ "$VF_TYPE" = "61" ] ; then + if [ "$IT"x = "I"x ] ; then + PROD_ID="0012" + else + PROD_ID="0011" + fi + fi + ;; + esac + + echo "Enter the module version, e.g. V1.2 C" + read PRODVERSION + VER_MAJ=`echo $PRODVERSION | awk 'BEGIN{ FIELDWIDTHS = "1 1 1 1 1 1"} {print $2}'` + VER_MIN=`echo $PRODVERSION | awk 'BEGIN{ FIELDWIDTHS = "1 1 1 1 1 1"} {print $4}'` + #VARIANT: A=0, B=1 ... + VARIANT=`echo $PRODVERSION | awk 'BEGIN{ FIELDWIDTHS = "1 1 1 1 1 1"} {print $6}'` + VARIANT=`printf "%d\n" "'$VARIANT"` + VARIANT=`expr $VARIANT - 65` + if [ "$VARIANT" -lt 10 ] ; then + VARIANT=0$VARIANT + fi + PRODUCTNR=${PROD_ID}${VER_MAJ}${VER_MIN}${VARIANT} +fi + +#write the config block file +if [ "${MODTYPE}" = "colibri-t20" ] ; then + PROD_ID=`echo $PRODUCTNR | awk 'BEGIN{ FIELDWIDTHS = "4 4"} {print $1}'` + CONFIGBLOCK_FILE=${MODTYPE}_bin/configblock_256.bin + if [ ${PROD_ID} = "0021" ] ; then + CONFIGBLOCK_FILE=${MODTYPE}_bin/configblock_512.bin + fi + if [ ${PROD_ID} = "0022" ] ; then + CONFIGBLOCK_FILE=${MODTYPE}_bin/configblock_512.bin + fi +else + CONFIGBLOCK_FILE=${MODTYPE}_bin/configblock.bin +fi +sudo chown ${USER}: `dirname $CONFIGBLOCK_FILE` +sudo rm -f $CONFIGBLOCK_FILE +#file header +awk 'function sc(c) {return (c<128?c:(c-256))} BEGIN{printf "%c%c%c%c",0,64,1,-49}' > $CONFIGBLOCK_FILE +#mac addr / serial +echo $SERIALNR | awk 'function sc(c) {return (c<128?c:(c-256))} {printf "%c%c%c%c%c%c%c%c%c%c%c%c",2,64,0,0, 0,20,45, sc(int($0/256/256)), sc(int($0/256)%256), sc($0%256),0,0 }' >> $CONFIGBLOCK_FILE +#product describtion, $1 char 0/1: ??, $2 char 2/3: ProdID, $3 char 4:VerMaj, $4 char 5:VerMin, $5 char 6/7:Variant +echo $PRODUCTNR | awk 'BEGIN{ FIELDWIDTHS = "2 2 1 1 2"} function sc(c) {return (c<128?c:(c-256))} {printf "%c%c%c%c%c%c%c%c%c%c%c%c",2,64,8,0 ,sc($3),0, sc($4),0, sc($5),0, sc($2),0 }' >> $CONFIGBLOCK_FILE +#fill to 32 bytes +awk 'function sc(c) {return (c<128?c:(c-256))} BEGIN{printf "%c%c%c%c",-1,-1,-1,-1}' >> $CONFIGBLOCK_FILE + +exit 0 diff --git a/recipes-images/images/files/library/fwd_blk.scr b/recipes-images/images/files/library/fwd_blk.scr new file mode 100644 index 0000000..7af72e6 --- /dev/null +++ b/recipes-images/images/files/library/fwd_blk.scr @@ -0,0 +1,11 @@ +#the update.sh script renames this. fwd_blk.scr -> ../flash_blk.img +test -n ${interface} || setenv interface mmc +test -n ${drive} || setenv drive 1 +test -z "${board_name}" && test "${soc}" = "vf500" && setenv board_name colibri_vf +test -z "${board_name}" && test "${soc}" = "vf610" && setenv board_name colibri_vf +test "${board_name}" = "colibri_imx7" && setenv drive 0 +test "${board_name}" = "colibri_t20" && setenv drive 0 +test "${board_name}" = "colibri_vf" && setenv drive 0 + +test -n ${board_name} || echo "board_name env not set!" && exit +fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img && source ${loadaddr} diff --git a/recipes-images/images/files/library/fwd_eth.scr b/recipes-images/images/files/library/fwd_eth.scr new file mode 100644 index 0000000..d7ea35c --- /dev/null +++ b/recipes-images/images/files/library/fwd_eth.scr @@ -0,0 +1,6 @@ +#the update.sh script renames this. fwd_eth.scr -> ../flash_eth.img +test -z "${board_name}" && test "${soc}" = "vf500" && setenv board_name colibri_vf +test -z "${board_name}" && test "${soc}" = "vf610" && setenv board_name colibri_vf + +test -n ${board_name} || echo "board_name env not set!" && exit +tftpboot ${loadaddr} "${board_name}/flash_eth.img" && source ${loadaddr} diff --git a/recipes-images/images/files/library/fwd_mmc.scr b/recipes-images/images/files/library/fwd_mmc.scr new file mode 100644 index 0000000..4c8f666 --- /dev/null +++ b/recipes-images/images/files/library/fwd_mmc.scr @@ -0,0 +1,3 @@ +#the update.sh script renames this. fwd_mmc.scr -> ../flash_mmc.img +#flash_mmc has been renamed to flash_blk, ensure compatibilty when updating from older versions +fatload mmc ${drive}:1 ${loadaddr} flash_blk.img && source ${loadaddr} diff --git a/recipes-images/images/files/library/genext3fs.sh b/recipes-images/images/files/library/genext3fs.sh new file mode 100755 index 0000000..ffcf060 --- /dev/null +++ b/recipes-images/images/files/library/genext3fs.sh @@ -0,0 +1,80 @@ +#!/bin/sh +#creates a file containing a ext3 binary blob of the content of the ../rootfs folder + +# sometimes we need the binary echo, not the shell builtin +ECHO=`which echo` + +MOUNTPOINT="mnt/trdx-rootfs" + +Usage() +{ + echo "creates a file containing a ext3 binary blob. Output file name taken from command line" + echo "Usage: genext3fs.sh [OPTION]... dest_file_name" + echo "-h : Prints this message" + echo "-b : Sets the partition size in MBytes, default 256" + echo "-d : Selects the directory which contains the partition content, default ../rootfs" + echo "" +} + +PARTITIONSIZE=256 +SRCPATH=../rootfs + +while getopts "b:d:h" Option ; do + case $Option in + h) Usage + # Exit if only usage (-h) was specfied. + if [[ "$#" -eq "1" ]] ; then + exit 10 + fi + exit 0 + ;; + b) PARTITIONSIZE=$OPTARG + ;; + d) SRCPATH=$OPTARG + ;; + esac +done +#adjust the commandline arg for the now used options +shift $(($OPTIND - 1)) + +#create the file used for the loopbackdevice and format it for ext3 +#answer y to "is not a block special device" +dd if=/dev/zero of=$@ bs=1024k count=$PARTITIONSIZE +mkfs.ext3 -F -L rootfs $@ +#disable fsck checks based on mount count or time interval +tune2fs -c 0 -i 0 $@ + +#prepare mountpoint for the loopdevice +sudo mkdir -p $MOUNTPOINT +sudo umount $MOUNTPOINT &> /dev/null +sudo rm -rf $MOUNTPOINT/* +#mount the file as a loopdevice +#there seems to be a race between mkfs.ext3 not yet finished and mount already trying to mount, so try until it works +MOUNTED=0 +while [ "$MOUNTED" -eq "0" ] ; do + sync + sleep 1 + sudo mount $@ $MOUNTPOINT/ -o loop -t ext3 + MOUNTED=`mount | grep -c "$MOUNTPOINT"` +done +#extract rootfs into the file +sudo cp -rpP $SRCPATH/* $MOUNTPOINT +if [ "$?" -ne "0" ] ; then + $ECHO -e "\033[1mCopying the rootfs failed.\033[0m" + echo "Check for error messages from cp" + sudo rm $@ + exit 1 +fi + +#unmount again +sudo umount $MOUNTPOINT + +#if the mounting was unsuccesful all rootfs data now still is in MOUNTPOINT, and $@ contains an empty fs +#delete $@ in that case to fail early +sync +FAILED=`ls $MOUNTPOINT | wc -l` +if [ "$FAILED" -ne "0" ] ; then + $ECHO -e "\033[1mMounting the loopdevice $@ failed.\033[0m" + sudo rm $@ + exit 1 +fi diff --git a/recipes-images/images/files/library/imx6/update.sh b/recipes-images/images/files/library/imx6/update.sh new file mode 100755 index 0000000..230e678 --- /dev/null +++ b/recipes-images/images/files/library/imx6/update.sh @@ -0,0 +1,323 @@ +#!/bin/sh +# Prepare files needed for flashing a Apalis/Colibri iMX6 module +# +# inspired by meta-fsl-arm/classes/image_types_fsl.bbclass + +# exit on error +set -e + +Flash() +{ + echo "To flash the Apalis/Colibri iMX6 module a running U-Boot is required. Boot the" + echo "module to the U-Boot prompt and" + echo "" + echo "insert the SD card, USB flash drive or when using TFTP connect Ethernet only" + echo "and enter:" + echo "'run setupdate'" + echo "" + echo "then to update all components enter:" + echo "'run update' or 'run update_it'" + echo "" + echo "to update a single component enter one of:" + echo "'run update_uboot' or 'run update_uboot_it'" + echo "'run update_kernel'" + echo "'run update_fdt'" + echo "'run update_rootfs'" + echo "" + echo "for 'Apalis iMX6Q 2GB IT' use the version with '_it'." + echo "" + echo "If you don't have a working U-Boot anymore, connect your PC to the module's USB" + echo "client port, bring the module in the serial download mode and start the" + echo "update.sh script with the -d option. This will copy U-Boot into the modules RAM" + echo "and execute it." +} + +Usage() +{ + echo "" + echo "Prepares and copies files for flashing internal eMMC of Apalis/Colibri iMX6" + echo "" + echo "Will require a running U-Boot on the target. Either one already flashed on the" + echo "eMMC or one copied over USB into the module's RAM" + echo "" + echo "-c : split resulting rootfs into chunks usable for TFTP transmission" + echo "-d : use USB connection to copy/execute U-Boot to/from module's RAM" + echo "-f : flash instructions" + echo "-h : prints this message" + echo "-m : module type: 0: autodetect from ./rootfs/etc/issues (default)" + echo " 1: Apalis iMX6" + echo " 2: Colibri iMX6" + echo "-o directory : output directory" + echo "" + echo "Example \"./update.sh -o /srv/tftp/\" copies the required files to /srv/tftp/" + echo "" + echo "*** For detailed recovery/update procedures, refer to the following website: ***" + echo "http://developer.toradex.com/knowledge-base/flashing-linux-on-imx6-modules" + echo "" +} + +# initialise options +KERNEL_IMAGETYPE="uImage" +MIN_PARTITION_FREE_SIZE=100 +MODTYPE_DETECT=0 +OUT_DIR="" +ROOTFSPATH=rootfs +SPLIT=0 +UBOOT_RECOVERY=0 + +while getopts "cdfhm:o:" Option ; do + case $Option in + c) SPLIT=1 + ;; + d) UBOOT_RECOVERY=1 + ;; + f) Flash + exit 0 + ;; + h) Usage + exit 0 + ;; + m) MODTYPE_DETECT=$OPTARG + ;; + o) OUT_DIR=$OPTARG + ;; + esac +done + +if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + Usage + exit 1 +fi + +# is OUT_DIR an existing directory? +if [ ! -d "$OUT_DIR" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + echo "$OUT_DIR" "does not exist, exiting" + exit 1 +fi + +case $MODTYPE_DETECT in + 0) # auto detect MODTYPE from rootfs directory + if [ -f rootfs/etc/issue ] ; then + CNT=`grep -ic "Colibri.iMX6" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Colibri iMX6 rootfs detected" + MODTYPE=colibri-imx6 + else + CNT=`grep -ic "imx6" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Apalis iMX6 rootfs detected" + MODTYPE=apalis-imx6 + fi + fi + fi + if [ -e $MODTYPE ] ; then + echo "can not detect module type from ./rootfs/etc/issue" + echo "please specify the module type with the -m parameter" + echo "see help: '$ ./update.sh -h'" + echo "exiting" + exit 1 + fi + ;; + 1) MODTYPE=apalis-imx6 + echo "Apalis iMX6 rootfs specified" + ;; + 2) MODTYPE=colibri-imx6 + echo "Colibri iMX6 rootfs specified" + ;; + *) echo "-m paramter specifies an unknown value" + exit 1 + ;; +esac + +case "$MODTYPE" in + "apalis-imx6") + # assumed minimal eMMC size [in sectors of 512] + EMMC_SIZE=$(expr 1024 \* 3500 \* 2) + IMAGEFILE=root.ext3 + KERNEL_DEVICETREE="imx6q-apalis-eval.dtb imx6q-apalis_v1_0-eval.dtb \ + imx6q-apalis-ixora.dtb imx6q-apalis_v1_0-ixora.dtb " + LOCPATH="imx_flash" + OUT_DIR="$OUT_DIR/apalis_imx6" + U_BOOT_BINARY=u-boot.imx + U_BOOT_BINARY_IT=u-boot.imx-it + ;; + "colibri-imx6") + # assumed minimal eMMC size [in sectors of 512] + EMMC_SIZE=$(expr 1024 \* 3500 \* 2) + IMAGEFILE=root.ext3 + KERNEL_DEVICETREE="imx6dl-colibri-eval-v3.dtb imx6dl-colibri-cam-eval-v3.dtb" + LOCPATH="imx_flash" + OUT_DIR="$OUT_DIR/colibri_imx6" + U_BOOT_BINARY=u-boot.imx + U_BOOT_BINARY_IT=u-boot.imx + ;; + *) echo "script internal error, unknown module type set" + exit 1 + ;; +esac + +BINARIES=${MODTYPE}_bin + +#is only U-Boot to be copied to RAM? +if [ "$UBOOT_RECOVERY" -ge 1 ] ; then + cd ${LOCPATH} + #the IT timings work for all modules, so use it during recovery + sudo ./imx_usb ../${BINARIES}/${U_BOOT_BINARY_IT} + exit +fi + +#sanity check for awk programs +AWKTEST=`echo 100000000 | awk -v min=100 -v f=10000 '{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'` || true +[ "${AWKTEST}x" = "204x" ] || { echo >&2 "Program awk not available. Aborting."; exit 1; } + +#sanity check for correct untared rootfs +DEV_OWNER=`ls -ld rootfs/dev | awk '{print $3}'` +if [ "${DEV_OWNER}x" != "rootx" ] +then + printf "rootfs/dev is not owned by root, but it should!\n" + printf "\033[1mPlease unpack the tarball with root rights.\033[0m\n" + printf "e.g. sudo tar xjvf Apalis_iMX6_LinuxImageV2.6_20160331.tar.bz2\n" + exit 1 +fi + +#sanity check for existence of U-Boot and kernel +[ -e ${BINARIES}/${U_BOOT_BINARY} ] || { echo "${BINARIES}/${U_BOOT_BINARY} does not exist"; exit 1; } +[ -e ${BINARIES}/${U_BOOT_BINARY_IT} ] || { echo "${BINARIES}/${U_BOOT_BINARY_IT} does not exist"; exit 1; } +[ -e ${BINARIES}/${KERNEL_IMAGETYPE} ] || { echo "${BINARIES}/${KERNEL_IMAGETYPE} does not exist"; exit 1; } + +#Sanity check for some programs. Some distros have fs tools only in root's path +MCOPY=`command -v mcopy` || { echo >&2 "Program mcopy not available. Aborting."; exit 1; } +PARTED=`command -v parted` || PARTED=`sudo -s command -v parted` || { echo >&2 "Program parted not available. Aborting."; exit 1; } +MKFSVFAT=`command -v mkfs.fat` || MKFSVFAT=`sudo -s command -v mkfs.fat` || { echo >&2 "Program mkfs.fat not available. Aborting."; exit 1; } +MKFSEXT3=`command -v mkfs.ext3` || MKFSEXT3=`sudo -s command -v mkfs.ext3` || { echo >&2 "Program mkfs.ext3 not available. Aborting."; exit 1; } +dd --help >/dev/null 2>&1 || { echo >&2 "Program dd not available. Aborting."; exit 1; } + +#Install trap to write a sensible message in case any of the commands below +#exit premature... +trap '{ printf "\033[31mScript aborted unexpectedly...\033[0m\n"; }' EXIT + +#make the directory with the outputfiles writable +sudo chown $USER: ${BINARIES} + +#make a file with the used versions for U-Boot, kernel and rootfs +sudo touch ${BINARIES}/versions.txt +sudo chmod ugo+w ${BINARIES}/versions.txt +echo "Component Versions" > ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/${U_BOOT_BINARY}`" >> ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/${U_BOOT_BINARY_IT}`" >> ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/${KERNEL_IMAGETYPE}`" >> ${BINARIES}/versions.txt +ROOTFSVERSION=`grep -i imx6 rootfs/etc/issue || echo "Version Unknown"` +echo "Rootfs ${ROOTFSVERSION}" >> ${BINARIES}/versions.txt + +#create subdirectory for this module type +sudo mkdir -p "$OUT_DIR" + +# The eMMC layout used is: +# +# boot area partition 1 aka primary eMMC boot sector: +# with U-Boot boot loader and the U-Boot environment before the configblock at +# the end of that boot area partition +# +# boot area partition 2 aka secondary eMMC boot sector: +# reserved +# +# user area aka general purpose eMMC region: +# +# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved (not partitioned) +# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - kernel and other data +# BOOT_SPACE -> SDIMG_SIZE - rootfs +# +# 4MiB 16MiB SDIMG_ROOTFS +# <-----------------------> <----------> <----------------------> +# ------------------------ ------------ ------------------------ +# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE | +# ------------------------ ------------ ------------------------ +# ^ ^ ^ ^ +# | | | | +# 0 4MiB 4MiB + 16MiB EMMC_SIZE + + +# Boot partition [in sectors of 512] +BOOT_START=$(expr 4096 \* 2) +# Rootfs partition [in sectors of 512] +ROOTFS_START=$(expr 20480 \* 2) +# Boot partition volume id +BOOTDD_VOLUME_ID="boot" + +echo "" +echo "Creating MBR file and do the partitioning" +# Initialize a sparse file +dd if=/dev/zero of=${BINARIES}/mbr.bin bs=512 count=0 seek=${EMMC_SIZE} +${PARTED} -s ${BINARIES}/mbr.bin mklabel msdos +${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary fat32 ${BOOT_START} $(expr ${ROOTFS_START} - 1 ) +# the partition spans to the end of the disk, even though the fs size will be smaller +# on the target the fs is then grown to the full size +${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary ext2 ${ROOTFS_START} $(expr ${EMMC_SIZE} \- ${ROOTFS_START} \- 1) +${PARTED} -s ${BINARIES}/mbr.bin unit s print +# get the size of the VFAT partition +BOOT_BLOCKS=$(LC_ALL=C ${PARTED} -s ${BINARIES}/mbr.bin unit b print \ + | awk '/ 1 / { print int(substr($4, 1, length($4 -1)) / 1024) }') +# now crop the file to only the MBR size +IMG_SIZE=512 +truncate -s $IMG_SIZE ${BINARIES}/mbr.bin + + +echo "" +echo "Creating VFAT partition image with the kernel" +rm -f ${BINARIES}/boot.vfat +${MKFSVFAT} -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${BINARIES}/boot.vfat $BOOT_BLOCKS +export MTOOLS_SKIP_CHECK=1 +mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/${KERNEL_IMAGETYPE} ::/${KERNEL_IMAGETYPE} + +# Copy device tree file +COPIED=false +if test -n "${KERNEL_DEVICETREE}"; then + for DTS_FILE in ${KERNEL_DEVICETREE}; do + DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` + if [ -e "${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then + kernel_bin="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}`" + kernel_bin_for_dtb="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb | sed "s,$DTS_BASE_NAME,${MODTYPE},g;s,\.dtb$,.bin,g"`" + if [ "$kernel_bin" = "$kernel_bin_for_dtb" ]; then + mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb + #copy also to out_dir + sudo cp ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb "$OUT_DIR/${DTS_BASE_NAME}.dtb" + COPIED=true + fi + fi + done + [ $COPIED = true ] || { echo "Did not find the devicetrees from KERNEL_DEVICETREE, ${KERNEL_DEVICETREE}. Aborting."; exit 1; } +fi + +echo "" +echo "Creating rootfs partition image" +#make the filesystem size size(rootfs used + MIN_PARTITION_FREE_SIZE) +#add about 4% to the rootfs to account for fs overhead. (/1024/985 instead of /1024/1024). +#add 512 bytes per file to account for small files +#(resize it later on target to fill the size of the partition it lives in) +NUMBER_OF_FILES=`sudo find ${ROOTFSPATH} | wc -l` +EXT_SIZE=`sudo du -DsB1 ${ROOTFSPATH} | awk -v min=$MIN_PARTITION_FREE_SIZE -v f=${NUMBER_OF_FILES} \ + '{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'` +rm -f ${BINARIES}/${IMAGEFILE} +sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || exit 1 + + +#copy to $OUT_DIR +sudo cp ${BINARIES}/${U_BOOT_BINARY} ${BINARIES}/${KERNEL_IMAGETYPE} ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat \ + ${BINARIES}/${IMAGEFILE} ${BINARIES}/flash*.img ${BINARIES}/versions.txt "$OUT_DIR" +[ "${U_BOOT_BINARY}x" != "${U_BOOT_BINARY_IT}x" ] && sudo cp ${BINARIES}/${U_BOOT_BINARY_IT} "$OUT_DIR" +sudo cp ${BINARIES}/fwd_blk.img "$OUT_DIR/../flash_blk.img" +sudo cp ${BINARIES}/fwd_eth.img "$OUT_DIR/../flash_eth.img" +sudo cp ${BINARIES}/fwd_mmc.img "$OUT_DIR/../flash_mmc.img" +#cleanup intermediate files +sudo rm ${BINARIES}/mbr.bin ${BINARIES}/boot.vfat ${BINARIES}/${IMAGEFILE} ${BINARIES}/versions.txt + +if [ "$SPLIT" -ge 1 ] ; then +sudo split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 "$OUT_DIR/root.ext3" "$OUT_DIR/root.ext3-" +fi +sync + +#Remove trap and report success! +trap - EXIT +printf "\033[32mSuccessfully copied data to target folder.\033[0m\n\n" + +Flash diff --git a/recipes-images/images/files/library/mk-u-boot-scripts.sh b/recipes-images/images/files/library/mk-u-boot-scripts.sh new file mode 100755 index 0000000..dda47d5 --- /dev/null +++ b/recipes-images/images/files/library/mk-u-boot-scripts.sh @@ -0,0 +1,5 @@ +#!/bin/sh +for f in *.scr +do + mkimage -T script -C none -n 'Flash Apalis/Colibri module' -d $f `basename $f .scr`.img +done diff --git a/recipes-images/images/files/library/tegra/update.sh b/recipes-images/images/files/library/tegra/update.sh new file mode 100755 index 0000000..5b4e1b8 --- /dev/null +++ b/recipes-images/images/files/library/tegra/update.sh @@ -0,0 +1,464 @@ +#!/bin/sh +# Prepare files needed for flashing an Apalis/Colibri T20/T30/TK1 module and +# copy them to a convenient location for using from a running U-Boot + +# exit on error +set -e + +Flash() +{ + echo "To flash the Apalis/Colibri T20/T30/TK1 module a running U-Boot is required. Boot" + echo "the module to the U-Boot prompt and" + echo "" + echo "insert the SD card, USB flash drive or when using TFTP connect Ethernet only" + echo "and enter:" + echo "'run setupdate'" + echo "" + echo "then to update all components enter:" + echo "'run update'" + echo "" + echo "Alternatively, to update U-Boot enter:" + echo "'run update_uboot'" + echo "to update a component stored in UBI enter:" + echo "'run prepare_ubi' (for Colibri T20)" + echo "followed by one of:" + echo "'run update_kernel'" + echo "'run update_fdt' (for device tree enabled kernels)" + echo "'run update_rootfs'" + echo "" + echo "" + echo "If you don't have a working U-Boot anymore, connect your PC to the module's USB" + echo "client port, bring the module into the recovery mode and start the update.sh" + echo "script with the -d option. This will copy U-Boot into the module's RAM and" + echo "execute it." +} + +Usage() +{ + echo "" + echo "Prepares and copies files for flashing internal eMMC/NAND of Apalis T30/TK1 and" + echo "Colibri T20/T30" + echo "" + echo "Will require a running U-Boot on the target. Either one already flashed on the" + echo "eMMC/NAND or one copied over USB into the module's RAM" + echo "" + echo "-b : T20: selects boot device (hsmmc/nand) (default: nand)" + echo "-c : split resulting rootfs into chunks usable for TFTP transmission" + echo "-d : use USB recovery mode to copy/execute U-Boot to/from module's RAM" + echo "-f : flash instructions" + echo "-h : prints this message" + echo "-m : module type: 0: autodetect from ./rootfs/etc/issues (default)" + echo " 1: Apalis T30" + echo " 2: Apalis TK1" + echo " 3: Colibri T20" + echo " 4: Colibri T30" + echo "-o directory : output directory" + echo "-r : T20 recovery mode: select RAM size (256 | 512)" + echo "-s : T20: optimise file system for V1.1 or 256MB V1.2 modules," + echo " increases usable space a little, but limits 512MB V1.2 modules" + echo " to 512MB usable NAND space" + echo "-v : T20 recovery mode: select Colibri version (V1_1 | V1_2)" + echo "" + echo "Example \"./update.sh -o /srv/tftp/\" copies the required files to /srv/tftp/" + echo "" + echo "*** For detailed recovery/update procedures, refer to the following website: ***" + echo "http://developer.toradex.com/knowledge-base/flashing-linux-on-tegra-modules" + echo "" +} + +# initialise options +BOOT_DEVICE=nand +EMMC_PARTS="mbr.bin boot.vfat" +# no devicetree by default +KERNEL_DEVICETREE="" +KERNEL_IMAGETYPE="uImage" +MIN_PARTITION_FREE_SIZE=100 +MODTYPE_DETECT=0 + +# NAND parameters +BLOCK="248KiB 504KiB" +MAXLEB=4084 +PAGE="4KiB" + +OUT_DIR="" +ROOTFSPATH=rootfs +SPLIT=0 +UBOOT_RECOVERY=0 + +# don't provide working defaults which may lead to wrong HW/SW combination +MODVERSION=Add_Version_-v +RAM_SIZE=Add_RAMsize_-r + +while getopts "b:cdfhm:o:r:sv:" Option ; do + case $Option in + b) BOOT_DEVICE=$OPTARG + ;; + c) SPLIT=1 + ;; + d) UBOOT_RECOVERY=1 + ;; + f) Flash + exit 0 + ;; + h) Usage + exit 0 + ;; + m) MODTYPE_DETECT=$OPTARG + ;; + o) OUT_DIR=$OPTARG + ;; + r) RAM_SIZE=$OPTARG + ;; + s) MAXLEB=2042 + ;; + v) if [ "${OPTARG}" = "V1_1" ] ; then MODVERSION=v11; fi + if [ "${OPTARG}" = "V1_2" ] ; then MODVERSION=v12; fi + ;; + esac +done + +if [ "$OUT_DIR" = "" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + Usage + exit 1 +fi + +# is OUT_DIR an existing directory? +if [ ! -d "$OUT_DIR" ] && [ "$UBOOT_RECOVERY" = "0" ] ; then + echo "$OUT_DIR" "does not exist, exiting" + exit 1 +fi + +case $MODTYPE_DETECT in + 0) # auto detect MODTYPE from rootfs directory + if [ -f rootfs/etc/issue ] ; then + CNT=`grep -ic "apalis" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + CNT=`grep -ic "t30" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Apalis T30 rootfs detected" + MODTYPE=apalis-t30 + else + CNT=`grep -ic "tk1" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Apalis TK1 rootfs detected" + MODTYPE=apalis-tk1 + fi + fi + else + CNT=`grep -ic "colibri" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + CNT=`grep -ic "t20" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Colibri T20 rootfs detected" + MODTYPE=colibri-t20 + else + CNT=`grep -ic "t30" rootfs/etc/issue || true` + if [ "$CNT" -ge 1 ] ; then + echo "Colibri T30 rootfs detected" + MODTYPE=colibri-t30 + fi + fi + fi + fi + fi + if [ -e $MODTYPE ] ; then + echo "can not detect module type from ./rootfs/etc/issue" + echo "please specify the module type with the -m parameter" + echo "see help: '$ ./update.sh -h'" + echo "exiting" + exit 1 + fi + ;; + 1) MODTYPE=apalis-t30 + echo "Apalis T30 rootfs specified" + ;; + 2) MODTYPE=apalis-tk1 + echo "Apalis TK1 rootfs specified" + ;; + 3) MODTYPE=colibri-t20 + echo "Colibri T20 rootfs specified" + ;; + 4) MODTYPE=colibri-t30 + echo "Colibri T30 rootfs specified" + ;; + *) echo "-m paramter specifies an unknown value" + exit 1 + ;; +esac + +case "$MODTYPE" in + "apalis-t30") +# BCT=apalis_t30_12MHz_MT41K512M8RH-125_533MHz.bct + BCT=Apalis_T30_2GB_800Mhz.bct + CBOOT_IMAGE=apalis_t30.img + CBOOT_IMAGE_TARGET=tegra30 + # assumed minimal eMMC size [in sectors of 512] + EMMC_SIZE=$(expr 1024 \* 7450 \* 2) + IMAGEFILE=root.ext3 + KERNEL_DEVICETREE="tegra30-apalis-eval.dtb" + LOCPATH="tegra-uboot-flasher" + OUT_DIR="$OUT_DIR/apalis_t30" + U_BOOT_BINARY=u-boot-dtb-tegra.bin + ;; + "apalis-tk1") + BCT=PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct + CBOOT_IMAGE=apalis-tk1.img + CBOOT_IMAGE_TARGET=tegra124 + # assumed minimal eMMC size [in sectors of 512] + EMMC_SIZE=$(expr 1024 \* 7450 \* 2) + IMAGEFILE=root.ext3 + KERNEL_DEVICETREE="tegra124-apalis-eval.dtb" + LOCPATH="tegra-uboot-flasher" + OUT_DIR="$OUT_DIR/apalis-tk1" + U_BOOT_BINARY=u-boot-dtb-tegra.bin + ;; + "colibri-t20") + BCT=colibri_t20-${RAM_SIZE}-${MODVERSION}-${BOOT_DEVICE}.bct + CBOOT_IMAGE="colibri_t20-256-v11-nand.img colibri_t20-256-v12-nand.img colibri_t20-512-v11-nand.img colibri_t20-512-v12-nand.img" + CBOOT_IMAGE_TARGET=tegra20 + EMMC_PARTS="" + IMAGEFILE=ubifs + KERNEL_DEVICETREE="tegra20-colibri-eval-v3.dtb" + KERNEL_IMAGETYPE="zImage" + LOCPATH="tegra-uboot-flasher" + OUT_DIR="$OUT_DIR/colibri_t20" + U_BOOT_BINARY=u-boot-dtb-tegra.bin + ;; + "colibri-t30") + # with new kernel, boot with 400MHz, then switch between 400 & 800 + BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_400MHz.bct +# BCT=colibri_t30_12MHz_NT5CC256M16CP-DI_533MHz.bct + CBOOT_IMAGE=colibri_t30.img + CBOOT_IMAGE_TARGET=tegra30 + EMMC_SIZE=$(expr 1024 \* 2000 \* 2) + IMAGEFILE=root.ext3 + KERNEL_DEVICETREE="tegra30-colibri-eval-v3.dtb" + LOCPATH="tegra-uboot-flasher" + OUT_DIR="$OUT_DIR/colibri_t30" + U_BOOT_BINARY=u-boot-dtb-tegra.bin + ;; + *) echo "script internal error, unknown module type set" + exit 1 + ;; +esac + +BINARIES=${MODTYPE}_bin + +#is only U-Boot to be copied to RAM? +if [ "$UBOOT_RECOVERY" -eq 1 ] ; then + if [ "${MODTYPE}" = "colibri-t20" ] ; then + #some sanity test, we really need RAM_SIZE and MODVERSION set + echo "" + SANITY_CHECK=1 + if [ "256" != ${RAM_SIZE} ] && [ "512" != ${RAM_SIZE} ]; then + printf "\033[1mplease specify your RAM size with the -r parameter\033[0m\n" + SANITY_CHECK=0 + fi + + if [ "v11" != ${MODVERSION} ] && [ "v12" != ${MODVERSION} ]; then + printf "\033[1mplease specify your module version with the -v parameter\033[0m\n" + SANITY_CHECK=0 + fi + + if [ ${SANITY_CHECK} -eq 0 ] ; then + Usage + exit 1 + fi + fi + + cd ${LOCPATH} + sudo ./tegrarcm --bct=../${BINARIES}/${BCT} --bootloader=../${BINARIES}/${U_BOOT_BINARY} --loadaddr=0x80108000 + exit +fi + +#sanity check for awk programs +AWKTEST=`echo 100000000 | awk -v min=100 -v f=10000 '{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'` || true +[ "${AWKTEST}x" = "204x" ] || { echo >&2 "Program awk not available. Aborting."; exit 1; } + +#sanity check for correct untared rootfs +DEV_OWNER=`ls -ld rootfs/dev | awk '{print $3}'` +if [ "${DEV_OWNER}x" != "rootx" ] +then + printf "rootfs/dev is not owned by root, but it should!\n" + printf "\033[1mPlease unpack the tarball with root rights.\033[0m\n" + printf "e.g. sudo tar xjvf Apalis_T30_LinuxImageV2.6Beta1_20160331.tar.bz2\n" + exit 1 +fi + +#sanity check for existence of U-Boot and kernel +[ -e ${BINARIES}/${U_BOOT_BINARY} ] || { echo "${BINARIES}/${U_BOOT_BINARY} does not exist"; exit 1; } +[ -e ${BINARIES}/${KERNEL_IMAGETYPE} ] || { echo "${BINARIES}/${KERNEL_IMAGETYPE} does not exist"; exit 1; } + +#Sanity check for some programs. Some distros have fs tools only in root's path +MCOPY=`command -v mcopy` || { echo >&2 "Program mcopy not available. Aborting."; exit 1; } +PARTED=`command -v parted` || PARTED=`sudo -s command -v parted` || { echo >&2 "Program parted not available. Aborting."; exit 1; } +MKFSVFAT=`command -v mkfs.fat` || MKFSVFAT=`sudo -s command -v mkfs.fat` || { echo >&2 "Program mkfs.fat not available. Aborting."; exit 1; } +MKFSEXT3=`command -v mkfs.ext3` || MKFSEXT3=`sudo -s command -v mkfs.ext3` || { echo >&2 "Program mkfs.ext3 not available. Aborting."; exit 1; } +dd --help >/dev/null 2>&1 || { echo >&2 "Program dd not available. Aborting."; exit 1; } + +CBOOT_CNT=`tegra-uboot-flasher/cbootimage -h | grep -c outputimage || true` +[ "$CBOOT_CNT" -gt 0 ] || { echo >&2 "Program cbootimage not available. 32bit compatibility libs? Aborting."; exit 1; } + +if [ "${MODTYPE}" = "colibri-t20" ] ; then + #sanity check, can we execute mkfs.ubifs, e.g. see the help text? + CNT=`sudo $LOCPATH/mkfs.ubifs -h | grep -c space-fixup || true` + if [ "$CNT" -eq 0 ] ; then + echo "The program mkfs.ubifs can not be executed or does not provide --space-fixup" + echo "option." + echo "Are you on a 64-bit Linux host without installed 32-bit execution environment?" + printf "\033[1mPlease install e.g. ia32-libs on 64-bit Ubuntu\033[0m\n" + printf "\033[1mMaybe others are needed e.g. liblzo2:i386 on 64-bit Ubuntu\033[0m\n" + exit 1 + fi +fi + +#Install trap to write a sensible message in case any of the commands below +#exit premature... +trap '{ printf "\033[31mScript aborted unexpectedly...\033[0m\n"; }' EXIT + +#make the directory with the outputfiles writable +sudo chown $USER: ${BINARIES} + +#make a file with the used versions for U-Boot, kernel and rootfs +sudo touch ${BINARIES}/versions.txt +sudo chmod ugo+w ${BINARIES}/versions.txt +echo "Component Versions" > ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/${U_BOOT_BINARY}`" >> ${BINARIES}/versions.txt +basename "`readlink -e ${BINARIES}/${KERNEL_IMAGETYPE}`" >> ${BINARIES}/versions.txt +ROOTFSVERSION=`egrep -i 't([2-3]0|k1)' rootfs/etc/issue || echo "Version Unknown"` +echo "Rootfs ${ROOTFSVERSION}" >> ${BINARIES}/versions.txt + +#create subdirectory for this module type +sudo mkdir -p "$OUT_DIR" + +# The eMMC layout used is: +# +# boot area partition 1 aka primary eMMC boot sector: +# with cbootimage containing BCT and U-Boot boot loader and the U-Boot +# environment before the configblock at the end of that boot area partition +# +# boot area partition 2 aka secondary eMMC boot sector: +# reserved +# +# user area aka general purpose eMMC region: +# +# 0 -> IMAGE_ROOTFS_ALIGNMENT - reserved (not partitioned) +# IMAGE_ROOTFS_ALIGNMENT -> BOOT_SPACE - kernel and other data +# BOOT_SPACE -> SDIMG_SIZE - rootfs +# +# 4MiB 16MiB SDIMG_ROOTFS +# <-----------------------> <----------> <----------------------> +# ------------------------ ------------ ------------------------ +# | IMAGE_ROOTFS_ALIGNMENT | BOOT_SPACE | ROOTFS_SIZE | +# ------------------------ ------------ ------------------------ +# ^ ^ ^ ^ +# | | | | +# 0 4MiB 4MiB + 16MiB EMMC_SIZE + +# generate cbootimage(s) containing BCT(s) and U-Boot boot loader +cd ${BINARIES} +for cbootimage in ${CBOOT_IMAGE}; do + sudo ../${LOCPATH}/cbootimage -s ${CBOOT_IMAGE_TARGET} ${cbootimage}.cfg ${cbootimage} +done +cd .. + +if [ "${MODTYPE}" = "colibri-t20" ] ; then + # Prepare full flashing + #build ${IMAGEFILE} if it does not exist + for blocksize in ${BLOCK}; do + sudo $LOCPATH/mkfs.ubifs --space-fixup -c ${MAXLEB} -e ${blocksize} -m ${PAGE} -o ${BINARIES}/${IMAGEFILE}_${blocksize}.img -r rootfs/ -v + done + + echo "" + echo "UBI image of root file system generated, copying data to target folder..." +else + if [ "${MODTYPE}" = "apalis-t30" ] || [ "${MODTYPE}" = "apalis-tk1" ] || [ "${MODTYPE}" = "colibri-t30" ] ; then + # Boot partition [in sectors of 512] + BOOT_START=$(expr 4096 \* 2) + # Rootfs partition [in sectors of 512] + ROOTFS_START=$(expr 20480 \* 2) + # Boot partition volume id + BOOTDD_VOLUME_ID="boot" + + echo "" + echo "Creating MBR file and do the partitioning" + # Initialize a sparse file + dd if=/dev/zero of=${BINARIES}/mbr.bin bs=512 count=0 seek=${EMMC_SIZE} + ${PARTED} -s ${BINARIES}/mbr.bin mklabel msdos + ${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary fat32 ${BOOT_START} $(expr ${ROOTFS_START} - 1 ) + # the partition spans to the end of the disk, even though the fs size will be smaller + # on the target the fs is then grown to the full size + ${PARTED} -a none -s ${BINARIES}/mbr.bin unit s mkpart primary ext2 ${ROOTFS_START} $(expr ${EMMC_SIZE} \- ${ROOTFS_START} \- 1) + ${PARTED} -s ${BINARIES}/mbr.bin unit s print + # get the size of the VFAT partition + BOOT_BLOCKS=$(LC_ALL=C ${PARTED} -s ${BINARIES}/mbr.bin unit b print \ + | awk '/ 1 / { print int(substr($4, 1, length($4 -1)) / 1024) }') + # now crop the file to only the MBR size + IMG_SIZE=512 + truncate -s $IMG_SIZE ${BINARIES}/mbr.bin + + + echo "" + echo "Creating VFAT partition image with the kernel" + rm -f ${BINARIES}/boot.vfat + ${MKFSVFAT} -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${BINARIES}/boot.vfat $BOOT_BLOCKS + export MTOOLS_SKIP_CHECK=1 + mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/${KERNEL_IMAGETYPE} ::/${KERNEL_IMAGETYPE} + + # Copy device tree file + COPIED=false + if test -n "${KERNEL_DEVICETREE}"; then + for DTS_FILE in ${KERNEL_DEVICETREE}; do + DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'` + if [ -e "${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then + kernel_bin="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}`" + kernel_bin_for_dtb="`readlink ${BINARIES}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb | sed "s,$DTS_BASE_NAME,${MODTYPE},g;s,\.dtb$,.bin,g"`" + if [ "$kernel_bin" = "$kernel_bin_for_dtb" ]; then + mcopy -i ${BINARIES}/boot.vfat -s ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb + #copy also to out_dir + sudo cp ${BINARIES}/${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb "$OUT_DIR/${DTS_BASE_NAME}.dtb" + COPIED=true + fi + fi + done + [ "${MODTYPE}" = "apalis-tk1" ] && ([ $COPIED = true ] || { echo "Did not find the devicetrees from KERNEL_DEVICETREE, ${KERNEL_DEVICETREE}. Aborting."; exit 1; }) + fi + + echo "" + echo "Creating rootfs partition image" + #make the partition size size(rootfs used + MIN_PARTITION_FREE_SIZE) + #add about 4% to the rootfs to account for fs overhead. (/1024/985 instead of /1024/1024). + #add 512 bytes per file to account for small files + #(resize it later on target to fill the size of the partition it lives in) + NUMBER_OF_FILES=`sudo find ${ROOTFSPATH} | wc -l` + EXT_SIZE=`sudo du -DsB1 ${ROOTFSPATH} | awk -v min=$MIN_PARTITION_FREE_SIZE -v f=${NUMBER_OF_FILES} \ + '{rootfs_size=$1+f*512;rootfs_size=int(rootfs_size/1024/985); print (rootfs_size+min) }'` + + rm -f ${BINARIES}/${IMAGEFILE} + sudo $LOCPATH/genext3fs.sh -d rootfs -b ${EXT_SIZE} ${BINARIES}/${IMAGEFILE} || exit 1 + fi +fi + +#copy to $OUT_DIR +OUT_DIR=`readlink -f $OUT_DIR` +cd ${BINARIES} +sudo cp ${CBOOT_IMAGE} ${KERNEL_IMAGETYPE} ${EMMC_PARTS} ${IMAGEFILE}* flash*.img versions.txt "$OUT_DIR" +sudo cp fwd_blk.img "$OUT_DIR/../flash_blk.img" +sudo cp fwd_eth.img "$OUT_DIR/../flash_eth.img" +sudo cp fwd_mmc.img "$OUT_DIR/../flash_mmc.img" +#cleanup intermediate files +sudo rm ${CBOOT_IMAGE} ${EMMC_PARTS} ${IMAGEFILE}* versions.txt +cd .. + +if [ "${IMAGEFILE}" = "root.ext3" ] ; then + if [ "$SPLIT" -ge 1 ] ; then + sudo split -a 2 -b `expr 64 \* 1024 \* 1024` --numeric-suffixes=10 "$OUT_DIR/root.ext3" "$OUT_DIR/root.ext3-" + fi +fi +sync + +#Remove trap and report success! +trap - EXIT +printf "\033[32mSuccessfully copied data to target folder.\033[0m\n\n" + +Flash diff --git a/recipes-images/images/lx.inc b/recipes-images/images/lx.inc new file mode 100644 index 0000000..0295816 --- /dev/null +++ b/recipes-images/images/lx.inc @@ -0,0 +1,14 @@ +IMAGE_INSTALL += " \ + packagegroup-lxde-extended \ + \ + xinput-calibrator \ + \ + openbox \ + openbox-theme-clearlooks \ + openbox-theme-onyx \ + obconf \ + hicolor-icon-theme \ + gtk-theme-clearlooks \ + lxdm \ + leafpad \ +" diff --git a/recipes-images/images/qt4e-demo-image.bb b/recipes-images/images/qt4e-demo-image.bb new file mode 100644 index 0000000..eaa45a8 --- /dev/null +++ b/recipes-images/images/qt4e-demo-image.bb @@ -0,0 +1,76 @@ +#Angstrom image +SUMMARY = "Image based on qt4e-demo-image.bb" + +LICENSE = "MIT" + +PV = "V2.6" +PR = "r0" + +#start of the resulting deployable tarball name +IMAGE_NAME_colibri-pxa = "Colibri_PXA_LinuxImage-qte" +IMAGE_NAME_colibri-vf = "Colibri_VF_LinuxImage-qte" +IMAGE_NAME = "${MACHINE}_LinuxImage-qte" + +#start graphical target by default (start new qt-demo-init systemd service) +SYSTEMD_DEFAULT_TARGET = "graphical.target" + +#create the deployment directory-tree +require recipes-images/images/trdx-image-fstype.inc + +#remove interfering sysv scripts, connman systemd service +do_mkrmscript () { + echo "for i in ${IMAGE_ROOTFS}/etc/rc0.d ${IMAGE_ROOTFS}/etc/rc1.d ${IMAGE_ROOTFS}/etc/rc2.d ${IMAGE_ROOTFS}/etc/rc3.d ${IMAGE_ROOTFS}/etc/rc4.d ${IMAGE_ROOTFS}/etc/rc5.d ${IMAGE_ROOTFS}/etc/rc6.d ${IMAGE_ROOTFS}/etc/rcS.d ; do" > ${WORKDIR}/rmscript + echo " rm -f \$i/*dropbear \$i/*avahi-daemon \$i/*dbus-1 \$i/*lxdm \$i/*ntpd \$i/*syslog \$i/*ofono \$i/*alsa-state \$i/*networking \$i/*udev-late-mount \$i/*sendsigs \$i/*save-rtc.sh \$i/*umountnfs.sh \$i/*portmap \$i/*umountfs \$i/*halt \$i/*rmnologin.sh \$i/*reboot; rm -f \$i/*banner.sh \$i/*sysfs.sh \$i/*checkroot.sh \$i/*alignment.sh \$i/*mountall.sh \$i/*populate-volatile.sh \$i/*devpts.sh \$i/*hostname.sh \$i/*portmap \$i/*mountnfs.sh \$i/*bootmisc.sh" >> ${WORKDIR}/rmscript + echo "done" >> ${WORKDIR}/rmscript + chmod +x ${WORKDIR}/rmscript + readlink -e ${WORKDIR}/rmscript + cat ${WORKDIR}/rmscript +} +addtask mkrmscript before do_rootfs + +IMAGE_LINGUAS = "en-us" +#IMAGE_LINGUAS = "de-de fr-fr en-gb en-us pt-br es-es kn-in ml-in ta-in" +#ROOTFS_POSTPROCESS_COMMAND += 'install_linguas; ' + +DISTRO_UPDATE_ALTERNATIVES ??= "" +ROOTFS_PKGMANAGE_PKGS ?= '${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${ROOTFS_PKGMANAGE} ${DISTRO_UPDATE_ALTERNATIVES}", d)}' + +CONMANPKGS ?= "connman connman-systemd connman-plugin-loopback connman-plugin-ethernet connman-plugin-wifi connman-client" +CONMANPKGS_libc-uclibc = "" + +#don't install some id databases +#BAD_RECOMMENDATIONS_append_colibri-vf += " udev-hwdb cpufrequtils " + +IMAGE_INSTALL += " \ + packagegroup-core-qt4e \ + libicui18n \ + \ + initscripts \ + polkit \ + makedevs \ + mime-support \ + zeroconf \ + fbset \ + angstrom-packagegroup-boot \ + packagegroup-basic \ + udev-extra-rules \ + ${CONMANPKGS} \ + ${ROOTFS_PKGMANAGE_PKGS} \ + timestamp-service \ + packagegroup-base-extended \ + \ + bash \ + \ + alsa-states \ +" + +require recipes-images/images/trdx-extra.inc + +IMAGE_DEV_MANAGER = "udev" +IMAGE_INIT_MANAGER = "systemd" +IMAGE_INITSCRIPTS = " " +IMAGE_LOGIN_MANAGER = "busybox shadow" + +export IMAGE_BASENAME = "qt-image" + +inherit core-image diff --git a/recipes-images/images/trdx-extra.inc b/recipes-images/images/trdx-extra.inc new file mode 100644 index 0000000..dc54b0f --- /dev/null +++ b/recipes-images/images/trdx-extra.inc @@ -0,0 +1,161 @@ +#additional packages to include in our Toradex images + +# Copy Licenses to image /usr/share/common-licenses, on vybrid for flash size reasons only the manifest +COPY_LIC_MANIFEST = "1" +#Bug with several MACHINES build, license files for all arch packages stored wrongly +COPY_LIC_DIRS = "0" +COPY_LIC_DIRS_colibri-vf = "0" + +#build some ipk which are needed together with CAN, but do not yet install them +DEPENDS += "canutils libsocketcan iproute2" + +#the following builds cross gdb and gdbserver +DEPENDS += "gdb-cross-${TARGET_ARCH}" + +#create the file /etc/timestamp +IMAGE_PREPROCESS_COMMAND = "rootfs_update_timestamp" + +IMAGE_INSTALL_append_tegra = " \ + u-boot-toradex-fw-utils \ + tegrastats \ + trdx-nv-binaries \ + trdx-nv-binaries-nv-gstapps \ + trdx-nv-binaries-restricted-codecs \ + usb-rndis-systemd \ + hdmi-hotplug \ + \ + curl \ + file \ + aspell \ + kernel-modules \ +" + +IMAGE_INSTALL_append_tegra3 = " \ + fs-init \ + e2fsprogs \ + e2fsprogs-mke2fs \ + e2fsprogs-tune2fs \ + nv-conf-systemd \ +" + +IMAGE_INSTALL_append_tegra124 = " \ + aspell \ + canutils \ + curl \ + e2fsprogs \ + e2fsprogs-mke2fs \ + e2fsprogs-tune2fs \ + file \ + fs-init \ + kernel-modules \ + lvds-tegra124 \ + pciutils \ + ptpd \ + tegrastats \ + u-boot-toradex-fw-utils \ + usb-rndis-systemd \ +" + +IMAGE_INSTALL_append_apalis-t30 = " \ + pciutils \ + ptpd \ + iproute2 \ + canutils \ + lvds-ctrl \ +" + +IMAGE_INSTALL_append_colibri-t20 = " \ + mtd-utils-ubifs \ +" + +#note that the kernel-modules meta package gets installed from +#meta-fsl-arm/conf/machine/include/imx-base.inc +IMAGE_INSTALL_append_mx6 = " \ + u-boot-toradex-fsl-fw-utils \ + libusbg \ + gpio-export \ + curl \ + file \ + aspell \ + ptpd \ + iproute2 \ + canutils \ + fs-init \ + e2fsprogs \ + e2fsprogs-mke2fs \ + e2fsprogs-tune2fs \ + mimetypes \ +" + +#note that the kernel-modules meta package gets installed from +#meta-fsl-arm/conf/machine/include/imx-base.inc +IMAGE_INSTALL_append_apalis-imx6 = " \ + pciutils \ +" + +IMAGE_INSTALL_append_colibri-vf = " \ + u-boot-toradex-fsl-fw-utils \ + libusbg \ + ptpd \ + iproute2 \ + canutils \ + mtd-utils-ubifs \ + kernel-modules \ + usb-suspend-resume \ +" + +IMAGE_INSTALL_append_mx7 = " \ + u-boot-toradex-fsl-fw-utils \ + libusbg \ + curl \ + file \ + aspell \ + ptpd \ + iproute2 \ + canutils \ + mtd-utils-ubifs \ +" + +IMAGE_INSTALL += " \ + crda \ + linux-firmware-ralink \ + linux-firmware-rtl8192cu \ + \ + alsa-utils \ + alsa-utils-aplay \ + alsa-utils-amixer \ + \ + sqlite3 \ + \ + curl \ + nfs-utils-client \ + openssh-scp \ + openssh-sftp \ + \ + bzip2 \ + gdbserver \ + grep \ + joe \ + minicom \ + ldd \ + lsof \ + mtd-utils \ + dosfstools \ + util-linux-fstrim \ + \ + devmem2 \ + evtest \ + hdparm \ + iperf \ + iperf3 \ + i2c-tools \ + memtester \ + rt-tests \ + stress \ + lmbench \ + nbench-byte \ + tinymembench \ + ethtool \ + \ + trdx-oak-sensors \ +" diff --git a/recipes-images/images/trdx-image-fstype.inc b/recipes-images/images/trdx-image-fstype.inc new file mode 100644 index 0000000..ed1a132 --- /dev/null +++ b/recipes-images/images/trdx-image-fstype.inc @@ -0,0 +1,163 @@ +#create the deployment directory-tree + +BURNFLASH := "${THISDIR}/files/${MACHINE}" +IMAGE_ROOTFS = "${WORKDIR}/${IMAGE_NAME}${PV}/rootfs" + +U_BOOT_EXT = "bin" +U_BOOT_EXT_mx6 = "imx" +U_BOOT_EXT_mx7 = "imx" +U_BOOT_EXT_vf = "imx" +U_BOOT_SYMLINK = "u-boot-${MACHINE}.${U_BOOT_EXT}" +U_BOOT_SYMLINK_tegra = "u-boot-dtb-tegra-${MACHINE}.${U_BOOT_EXT}" +U_BOOT_SYMLINK_tegra124 = "u-boot-dtb-tegra-${MACHINE}.${U_BOOT_EXT}" +U_BOOT_BINARY = "u-boot.${U_BOOT_EXT}" +U_BOOT_BINARY_tegra = "u-boot-dtb-tegra.${U_BOOT_EXT}" +U_BOOT_BINARY_tegra124 = "u-boot-dtb-tegra.${U_BOOT_EXT}" + +#we need some native tools for deployment +DEPENDS_append_mx6 = " imx-loader-native" +DEPENDS_append_mx7 = " mtd-utils-native imx-loader-native" +#FIXME: 32-bit tegrarcm built on F20 does not run on 64-bit F20 even with properly installed 32-bit libs! +DEPENDS_append_tegra = " cbootimage-native tegrarcm-native" +DEPENDS_append_tegra124 = " cbootimage-native tegrarcm-native" +DEPENDS_append_tegra2 = " mtd-utils-native" +DEPENDS_append_vf = " mtd-utils-native imx-loader-native" +#we need mkimage to produce the U-Boot scripts even if not building a uImage kernel +DEPENDS_append = " virtual/bootloader u-boot-mkimage-native" + +imagedeploytools() { + # default to nothing to deploy + : +} + +imagedeploytools_append_mx6() { + IMAGE_ROOT="${IMAGE_ROOTFS}/../imx_flash/" + rm -f ${IMAGE_ROOT}/imx_flash/imx_usb ${IMAGE_ROOT}/imx_flash/*.conf + mkdir -p ${IMAGE_ROOT} + + # add imx-loader and its configuration files + cp ${STAGING_BINDIR_NATIVE}/imx_usb ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/imx_usb + cp ${STAGING_ETCDIR_NATIVE}/imx-loader.d/imx_usb.conf ${IMAGE_ROOT}/ + cp ${STAGING_ETCDIR_NATIVE}/imx-loader.d/mx6_usb_work.conf ${IMAGE_ROOT}/ +} + +imagedeploytools_append_mx7() { + IMAGE_ROOT="${IMAGE_ROOTFS}/../imx_flash/" + rm -f ${IMAGE_ROOT}/mkfs.ubifs ${IMAGE_ROOT}/imx_usb + mkdir -p ${IMAGE_ROOT} + + # add the mkfs.ubifs binary + cp ${STAGING_DIR_NATIVE}/usr/sbin/mkfs.ubifs ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/mkfs.ubifs + + # add imx-loader and its configuration files + cp ${STAGING_BINDIR_NATIVE}/imx_usb ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/imx_usb + cp ${STAGING_ETCDIR_NATIVE}/imx-loader.d/imx_usb.conf ${IMAGE_ROOT}/ + cp ${STAGING_ETCDIR_NATIVE}/imx-loader.d/mx7_usb_work.conf ${IMAGE_ROOT}/ +} + +imagedeploytools_append_tegra() { + IMAGE_ROOT="${IMAGE_ROOTFS}/../tegra-uboot-flasher/" + mkdir -p ${IMAGE_ROOT} + + # add cbootimage and tegrarcm + cp ${STAGING_BINDIR_NATIVE}/cbootimage ${IMAGE_ROOT}/ + cp ${STAGING_BINDIR_NATIVE}/tegrarcm ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/cbootimage + ${BUILD_STRIP} ${IMAGE_ROOT}/tegrarcm +} + +imagedeploytools_append_tegra2() { + # add the mkfs.ubifs binary + cp ${STAGING_DIR_NATIVE}/usr/sbin/mkfs.ubifs ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/mkfs.ubifs +} + +imagedeploytools_append_tegra124() { + IMAGE_ROOT="${IMAGE_ROOTFS}/../tegra-uboot-flasher/" + mkdir -p ${IMAGE_ROOT} + + # add cbootimage and tegrarcm + cp ${STAGING_BINDIR_NATIVE}/cbootimage ${IMAGE_ROOT}/ + cp ${STAGING_BINDIR_NATIVE}/tegrarcm ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/cbootimage + ${BUILD_STRIP} ${IMAGE_ROOT}/tegrarcm +} + +imagedeploytools_append_vf() { + IMAGE_ROOT="${IMAGE_ROOTFS}/../vf_flash/" + rm -f ${IMAGE_ROOT}/mkfs.ubifs ${IMAGE_ROOT}/imx_uart + mkdir -p ${IMAGE_ROOT} + + # add the mkfs.ubifs binary + cp ${STAGING_DIR_NATIVE}/usr/sbin/mkfs.ubifs ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/mkfs.ubifs + + # add imx-loader and its configuration files + cp ${STAGING_BINDIR_NATIVE}/imx_uart ${IMAGE_ROOT}/ + ${BUILD_STRIP} ${IMAGE_ROOT}/imx_uart* + cp ${STAGING_ETCDIR_NATIVE}/imx-loader.d/vybrid_usb_work.conf ${IMAGE_ROOT}/ +} + +imagedeploy_kernel() { + # put kernel, device-tree into the bin directories, remove the kernel/dtb from the rootfs/boot + rm -f ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGETYPE}* ${IMAGE_ROOTFS}/boot/*.dtb + cp -pP ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}* ${IMAGE_ROOTFS}/../${MACHINE}_bin/ + ls ${DEPLOY_DIR_IMAGE}/*.dtb 2> /dev/null && cp -pP ${DEPLOY_DIR_IMAGE}/*.dtb ${IMAGE_ROOTFS}/../${MACHINE}_bin/ + mv ${IMAGE_ROOTFS}/../${MACHINE}_bin/${KERNEL_IMAGETYPE}-${MACHINE}.bin ${IMAGE_ROOTFS}/../${MACHINE}_bin/${KERNEL_IMAGETYPE} +} + +imagedeploy_kernel_mx7() { + do_imagedeploy_kernel_dtb +} + +imagedeploy_kernel_tegra2() { + # put kernel into the bin directories + rm -f ${IMAGE_ROOTFS}/boot/${KERNEL_IMAGETYPE}* ${IMAGE_ROOTFS}/boot/*.dtb + cp -pP ${DEPLOY_DIR_IMAGE}/zImage* ${IMAGE_ROOTFS}/../${MACHINE}_bin/ + mv ${IMAGE_ROOTFS}/../${MACHINE}_bin/zImage-${MACHINE}.bin ${IMAGE_ROOTFS}/../${MACHINE}_bin/zImage +} + +imagedeploy_kernel_vf() { + do_imagedeploy_kernel_dtb +} + +do_imagedeploy_kernel_dtb() { + # put kernel, device-tree into the bin directories + cp -pP ${DEPLOY_DIR_IMAGE}/zImage* ${IMAGE_ROOTFS}/../${MACHINE}_bin/ + ls ${DEPLOY_DIR_IMAGE}/*.dtb 2> /dev/null && cp -pP ${DEPLOY_DIR_IMAGE}/*.dtb ${IMAGE_ROOTFS}/../${MACHINE}_bin/ + mv ${IMAGE_ROOTFS}/../${MACHINE}_bin/zImage-${MACHINE}.bin ${IMAGE_ROOTFS}/../${MACHINE}_bin/zImage +} + +fakeroot do_imagedeploy() { + cd ${WORKDIR} + cp -pLr ${BURNFLASH}/* ${IMAGE_NAME}${PV}/ + + cd ${IMAGE_NAME}${PV}/${MACHINE}_bin + ./mk-u-boot-scripts.sh + cd ${WORKDIR} + + imagedeploy_kernel + + cp -pP ${DEPLOY_DIR_IMAGE}/u-boot* ${IMAGE_ROOTFS}/../${MACHINE}_bin/ + rm -f ${IMAGE_ROOTFS}/../${MACHINE}_bin/u-boot-hsmmc-${MACHINE}.${U_BOOT_EXT} + mv ${IMAGE_ROOTFS}/../${MACHINE}_bin/${U_BOOT_SYMLINK} ${IMAGE_ROOTFS}/../${MACHINE}_bin/${U_BOOT_BINARY} + + # add the rootfs version to the welcome banner + echo "${IMAGE_NAME}${PV}_${DATE}" >> ${IMAGE_ROOTFS}/etc/issue + echo "" >> ${IMAGE_ROOTFS}/etc/issue + + # add additional tools if required + imagedeploytools + + # remove intermediate file rootfs.lock + rm -f ${IMAGE_NAME}${PV}/rootfs.lock + + #create tarball + DATE=`date +%Y%m%d` + tar -cjf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${PV}_${DATE}.tar.bz2 ${IMAGE_NAME}${PV} +} + +addtask imagedeploy after do_rootfs before do_build |