Skip to contentSkip to conversation

freerdp: Add support for tz package

PATCH New Scott Fan 2 participants 8 messages Jul 28, 2015 – Sep 20, 2015 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore

Scott Fan

author
#0 lore raw

PATCH v2 1/4 freerdp: Add support for tz package

Fixes error message while freerdp connected the remote desktop:
Unable to detect time zone

---
 .../freerdp/0004-add-support-for-tz-package.patch  | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/freerdp/0004-add-support-for-tz-package.patch
package/freerdp/0004-add-support-for-tz-package.patch new file +30 -0
new file mode 100644
index 0000000..93e4afd
@@ -0,0 +1,30 @@
+From 605d0a85183d2f9d5b0da5629cbadf01173bbb2f Mon Sep 17 00:00:00 2001
+From: Scott Fan <[email protected]>
+Date: Mon, 13 Jul 2015 15:01:17 +0800
+Subject: [PATCH] Add support for tz package
+
+Fixes error message while freerdp connected the remote desktop:
+Unable to detect time zone
+
+Signed-off-by: Scott Fan <[email protected]>
+---
+ libfreerdp/locale/timezone.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libfreerdp/locale/timezone.c b/libfreerdp/locale/timezone.c
+index 3070f1f..4a06786 100644
+--- a/libfreerdp/locale/timezone.c
++++ b/libfreerdp/locale/timezone.c
+@@ -1539,7 +1539,8 @@ char* freerdp_get_unix_timezone_identifier()
+ 	 * America/Montreal for example.
+ 	 */
+ 	
+-	if ((len = readlink("/etc/localtime", buf, sizeof(buf) - 1)) != -1)
++	if ((len = readlink("/etc/localtime", buf, sizeof(buf) - 1)) != -1 ||
++	    (len = readlink("/etc/TZ", buf, sizeof(buf) - 1)) != -1)
+ 	{
+ 		int num = 0;
+ 		int pos = len;
+-- 
+2.4.5
+
Signature · 1 line
2.4.6
author
#1 lore raw

PATCH v2 2/4 xdriver_xf86-video-fbturbo: new package

Add the fbturbo video driver, which is based on xf86-video-fbdev (with none of the original features stripped), primarily optimized for the devices powered by the Allwinner SoC (A10, A13, A20).

https://github.com/ssvb/xf86-video-fbturbo/

---
 package/x11r7/Config.in                            |  1 +
 package/x11r7/xdriver_xf86-video-fbturbo/Config.in | 57 ++++++++++++++++++++++
 .../xdriver_xf86-video-fbturbo.mk                  | 19 ++++++++
 3 files changed, 77 insertions(+)
 create mode 100644 package/x11r7/xdriver_xf86-video-fbturbo/Config.in
 create mode 100644 package/x11r7/xdriver_xf86-video-fbturbo/xdriver_xf86-video-fbturbo.mk
package/x11r7/Config.in +1 -0
index 859e895..4e996fc 100644
@@ -162,6 +162,7 @@ if BR2_PACKAGE_XORG7
 		source package/x11r7/xdriver_xf86-video-cirrus/Config.in
 		source package/x11r7/xdriver_xf86-video-dummy/Config.in
 		source package/x11r7/xdriver_xf86-video-fbdev/Config.in
+		source package/x11r7/xdriver_xf86-video-fbturbo/Config.in
 		source package/x11r7/xdriver_xf86-video-geode/Config.in
 		source package/x11r7/xdriver_xf86-video-glide/Config.in
 		source package/x11r7/xdriver_xf86-video-glint/Config.in
package/x11r7/xdriver_xf86-video-fbturbo/Config.in new file +57 -0

57 lines not on this page · raw message

package/x11r7/xdriver_xf86-video-fbturbo/xdriver_xf86-video-fbturbo.mk new file +19 -0
new file mode 100644
index 0000000..95a8e86
@@ -0,0 +1,19 @@
+################################################################################
+#
+# xdriver_xf86-video-fbturbo
+#
+################################################################################
+
+XDRIVER_XF86_VIDEO_FBTURBO_VERSION = 0.4.0
+XDRIVER_XF86_VIDEO_FBTURBO_SITE = $(call github,ssvb,xf86-video-fbturbo,$(XDRIVER_XF86_VIDEO_FBTURBO_VERSION))
+XDRIVER_XF86_VIDEO_FBTURBO_LICENSE = MIT
+XDRIVER_XF86_VIDEO_FBTURBO_LICENSE_FILES = COPYING
+XDRIVER_XF86_VIDEO_FBTURBO_DEPENDENCIES = xserver_xorg-server xproto_fontsproto xproto_randrproto xproto_renderproto xproto_videoproto xproto_xproto xproto_xf86driproto libdri2
+
+define XDRIVER_XF86_VIDEO_FBTURBO_INSTALL_CONF_FILE
+        $(INSTALL) -m 0644 -D $(@D)/xorg.conf $(TARGET_DIR)/etc/X11/xorg.conf
+endef
+
+XDRIVER_XF86_VIDEO_FBTURBO_POST_INSTALL_TARGET_HOOKS += XDRIVER_XF86_VIDEO_FBTURBO_INSTALL_CONF_FILE
+
+$(eval $(autotools-package))
Signature · 1 line
2.4.6
author
#2 lore raw

PATCH v2 3/4 cubieboard: update build support for cubieboard 1/2/3.

In reply to Scott Fan

This patch update the cb1/cb2's defconfig to mainline u-boot version, and bump their linux-sunxi kernel to latest stage/sunxi-3.4 branch.

Additionally, add defconfig for cubieboard3 (a.k.a. cubietruck).

Finally, support set up the SD card only to boot from network.

---
 board/cubietech/cubieboard/boot.cmd                |   7 +-
 board/cubietech/cubieboard/boot.env                |  20 +
 .../cubietech/cubieboard/linux-cubieboard2.config  | 749 ---------------------
 board/cubietech/cubieboard/mkcubiecard.sh          | 125 ++--
 board/cubietech/cubieboard/post-build.sh           |  14 -
 board/cubietech/cubieboard/post-image.sh           |  26 +
 board/cubietech/cubieboard/readme.txt              |  31 +-
 board/cubietech/cubieboard/sun4i-cubieboard.config |   4 +
 .../cubietech/cubieboard/sun7i-cubieboard2.config  |   4 +
 board/cubietech/cubieboard/sun7i-cubietruck.config |   4 +
 configs/cubieboard2_defconfig                      |  39 +-
 configs/cubieboard_defconfig                       |  38 +-
 configs/cubietruck_defconfig                       |  21 +
 13 files changed, 205 insertions(+), 877 deletions(-)
 create mode 100644 board/cubietech/cubieboard/boot.env
 delete mode 100644 board/cubietech/cubieboard/linux-cubieboard2.config
 delete mode 100755 board/cubietech/cubieboard/post-build.sh
 create mode 100755 board/cubietech/cubieboard/post-image.sh
 create mode 100644 board/cubietech/cubieboard/sun4i-cubieboard.config
 create mode 100644 board/cubietech/cubieboard/sun7i-cubieboard2.config
 create mode 100644 board/cubietech/cubieboard/sun7i-cubietruck.config
 create mode 100644 configs/cubietruck_defconfig
board/cubietech/cubieboard/boot.cmd +4 -3
index 849ed00..519b0e7 100644
@@ -1,4 +1,5 @@
+setenv bootm_boot_mode sec
 setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
-fatload mmc 0 0x43000000 script.bin
-fatload mmc 0 0x48000000 uImage
-bootm 0x48000000
+load mmc 0:1 0x43000000 script.bin || load mmc 0:1 0x43000000 boot/script.bin
+load mmc 0:1 0x42000000 uImage || load mmc 0:1 0x42000000 boot/uImage
+bootm 0x42000000
board/cubietech/cubieboard/boot.env new file +20 -0
new file mode 100644
index 0000000..8d8fbd4
@@ -0,0 +1,20 @@
+autoload=no
+nfsroot=/tftpboot/rootfs
+
+stderr=serial,vga
+stdin=serial,usbkbd
+stdout=serial,vga
+
+scriptfile=script.bin
+scriptaddr=0x43000000
+
+kernelfile=uImage
+kernel_addr_r=0x42000000
+
+bootm_boot_mode=sec
+console=ttyS0,115200
+
+netargs=setenv bootargs console=${console} root=/dev/nfs nfsroot=${serverip}:${nfsroot} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off:${dnsip} ${extra}
+netboot=if test -s ${ipaddr}; then if test -s ${serverip}; then run netargs; tftp ${scriptaddr} ${serverip}:${scriptfile}; tftp ${kernel_addr_r} ${serverip}:${kernelfile}; bootm ${kernel_addr_r}; else echo WARN: Cannot find the environment variable serverip, please setenv, then saveenv and boot; fi; else run bootcmd; fi;
+
+bootcmd=dhcp; run netboot;
board/cubietech/cubieboard/linux-cubieboard2.config deleted +0 -749

749 lines not on this page · raw message

board/cubietech/cubieboard/mkcubiecard.sh +78 -47

177 lines not on this page · raw message

board/cubietech/cubieboard/post-build.sh deleted +0 -14
deleted file mode 100755
index 1b0258c..0000000
@@ -1,14 +0,0 @@
-#!/bin/sh
-# post-build.sh for CubieBoard
-# 2013, Carlo Caione <[email protected]>
-
-BOARD_DIR="$(dirname $0)"
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
-BOOT_CMD=$BOARD_DIR/boot.cmd
-BOOT_CMD_H=$BINARIES_DIR/boot.scr
-
-# U-Boot script
-if [ -e $MKIMAGE -a -e $BOOT_CMD ];
-then
-	$MKIMAGE -C none -A arm -T script -d $BOOT_CMD $BOOT_CMD_H
-fi
board/cubietech/cubieboard/post-image.sh new file +26 -0
new file mode 100755
index 0000000..4d792a4
@@ -0,0 +1,26 @@
+#!/bin/sh
+# post-image.sh for CubieBoard
+# 2015, Scott Fan <[email protected]>
+# 2013, Carlo Caione <[email protected]>
+
+BOARD_DIR="$(dirname $0)"
+MKIMAGE=$HOST_DIR/usr/bin/mkimage
+BOOT_CMD=$BOARD_DIR/boot.cmd
+BOOT_CMD_H=$BINARIES_DIR/boot.scr
+
+MKENVIMAGE=$HOST_DIR/usr/bin/mkenvimage
+BOOT_ENV_SIZE=0x20000
+BOOT_ENV_SRC=$BOARD_DIR/boot.env
+BOOT_ENV_BIN=$BINARIES_DIR/u-boot-env.bin
+
+# U-Boot script
+if [ -e $MKIMAGE -a -e $BOOT_CMD ];
+then
+	$MKIMAGE -C none -A arm -T script -d $BOOT_CMD $BOOT_CMD_H
+fi
+
+# U-Boot environment
+if [ -e $MKENVIMAGE -a -e $BOOT_ENV_SRC ];
+then
+	$MKENVIMAGE -s $BOOT_ENV_SIZE -o $BOOT_ENV_BIN $BOOT_ENV_SRC
+fi
board/cubietech/cubieboard/readme.txt +24 -7
index 81cc5e4..af3e997 100644
@@ -1,4 +1,4 @@
-cubieboard and cubieboard2
+cubieboard, cubieboard2 and cubietruck
 
 -----
 Intro
@@ -13,11 +13,16 @@ For more information, please see http://linux-sunxi.org/FirstSteps
 How to build it
 ---------------
 
-You need to use the cubieboard_defconfig or cubieboard2_defconfig, to do so:
+You need to use the cubie*_defconfig, to do so:
+cubieboard1 (a.k.a. cubieboard):
  * make cubieboard_defconfig
-or
+
+cubieboard2:
  * make cubieboard2_defconfig
 
+cubieboard3 (a.k.a. cubietruck):
+ * make cubietruck_defconfig
+
 And to compile:
  * make
 
@@ -31,10 +36,10 @@ After building, you should obtain this tree:
     +-- rootfs.tar
     +-- boot.scr
     +-- script.bin
-    +-- sunxi-spl.bin
     +-- u-boot.bin
-    +-- u-boot-sunxi-with-spl.bin (optional)
-    `-- uImage
+    +-- u-boot-env.bin
+    +-- u-boot-sunxi-with-spl.bin
+    +-- uImage
 
 --------------------------
 How setting up the SD card
@@ -54,9 +59,21 @@ Use dmesg to find out where the SD card is attached in the /dev tree
 where:
  - <images_dir> is the directory containing the generated files (usually
    output/images)
- - <device> is the device file of the SD card (usually /dev/sdX)
+ - <device> is the device file of the SD card (usually /dev/mmcblk0 or /dev/sdX)
+
 
+Alternately, you may set up the SD card only to boot from the network:
+
+# sudo ./mkcubiecard.sh <images_dir> <device> [netboot]
+
+where:
+ - <images_dir> and <device> as above
+ - [netboot] specify whether to boot from network (should yes, if you want)
 
+ATTENTION: This operation will keep the partition table of your SD card, will not
+           write any data to the existing partitions. However, if the first
+           partition ahead of the 1MB offset, it will be damaged.
 
 --
+Scott Fan <[email protected]>
 Carlo Caione <[email protected]>
board/cubietech/cubieboard/sun4i-cubieboard.config new file +4 -0
new file mode 100644
index 0000000..43eee73
@@ -0,0 +1,4 @@
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_ROOT_NFS=y
+CONFIG_SUNXI_EMAC=y
board/cubietech/cubieboard/sun7i-cubieboard2.config new file +4 -0
new file mode 100644
index 0000000..43eee73
@@ -0,0 +1,4 @@
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_ROOT_NFS=y
+CONFIG_SUNXI_EMAC=y
board/cubietech/cubieboard/sun7i-cubietruck.config new file +4 -0
new file mode 100644
index 0000000..ff7813f
@@ -0,0 +1,4 @@
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_ROOT_NFS=y
+CONFIG_SUNXI_GMAC=y
configs/cubieboard2_defconfig +10 -29
index f85760d..41d5266 100644
@@ -1,40 +1,21 @@
-# Architecture
 BR2_arm=y
 BR2_cortex_a7=y
-
-# System configuration
+BR2_KERNEL_HEADERS_3_4=y
 BR2_TARGET_GENERIC_HOSTNAME="Cubieboard2"
 BR2_TARGET_GENERIC_ISSUE="Welcome to use Cubieboard!"
-BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/cubietech/cubieboard/post-build.sh"
-
-# Additional tools
-BR2_PACKAGE_HOST_SUNXI_TOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-BR2_PACKAGE_SUNXI_TOOLS=y
-BR2_PACKAGE_SUNXI_BOARDS=y
-BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a20/cubieboard2.fex"
-
-# Kernel headers
-BR2_KERNEL_HEADERS_3_4=y
-
-# Kernel
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/cubietech/cubieboard/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/linux-sunxi/linux-sunxi.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="5dda5145c877335e17bd9ca48954841acc0f785a"
-BR2_LINUX_KERNEL_VERSION="sunxi-3.4"
-BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
-BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/cubietech/cubieboard/linux-cubieboard2.config"
-
-# Bootloaders
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d47d367036be38c5180632ec8a3ad169a4593a88"
+BR2_LINUX_KERNEL_DEFCONFIG="sun7i"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/cubietech/cubieboard/sun7i-cubieboard2.config"
+BR2_PACKAGE_SUNXI_TOOLS=y
+BR2_PACKAGE_SUNXI_BOARDS=y
+BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a20/cubieboard2.fex"
 BR2_TARGET_UBOOT=y
-BR2_TARGET_UBOOT_BOARDNAME="cubieboard2"
-BR2_TARGET_UBOOT_CUSTOM_GIT=y
-BR2_TARGET_UBOOT_VERSION="sunxi"
-BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/linux-sunxi/u-boot-sunxi.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="b4bca5e0651b460a4511582f07a935cb48f74948"
-BR2_TARGET_UBOOT_FORMAT_BIN=y
+BR2_TARGET_UBOOT_BOARDNAME="Cubieboard2"
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
configs/cubieboard_defconfig +10 -28
index 1da019f..85dc794 100644
@@ -1,39 +1,21 @@
-# Architecture
 BR2_arm=y
 BR2_cortex_a8=y
-
-# System configuration
+BR2_KERNEL_HEADERS_3_4=y
 BR2_TARGET_GENERIC_HOSTNAME="Cubieboard"
 BR2_TARGET_GENERIC_ISSUE="Welcome to use Cubieboard!"
-BR2_TARGET_GENERIC_GETTY=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/cubietech/cubieboard/post-build.sh"
-
-# Additional tools
-BR2_PACKAGE_HOST_SUNXI_TOOLS=y
-BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-BR2_PACKAGE_SUNXI_TOOLS=y
-BR2_PACKAGE_SUNXI_BOARDS=y
-BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a10/cubieboard.fex"
-
-# Kernel headers
-BR2_KERNEL_HEADERS_3_4=y
-
-# Kernel
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/cubietech/cubieboard/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/linux-sunxi/linux-sunxi.git"
-BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="274a66a7bfcbaabb88d63e4eba161965383cc416"
-BR2_LINUX_KERNEL_VERSION="sunxi-3.4"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d47d367036be38c5180632ec8a3ad169a4593a88"
 BR2_LINUX_KERNEL_DEFCONFIG="sun4i"
-
-# Bootloaders
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/cubietech/cubieboard/sun4i-cubieboard.config"
+BR2_PACKAGE_SUNXI_TOOLS=y
+BR2_PACKAGE_SUNXI_BOARDS=y
+BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a10/cubieboard.fex"
 BR2_TARGET_UBOOT=y
-BR2_TARGET_UBOOT_BOARDNAME="cubieboard"
-BR2_TARGET_UBOOT_CUSTOM_GIT=y
-BR2_TARGET_UBOOT_VERSION="sunxi"
-BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/linux-sunxi/u-boot-sunxi.git"
-BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="1a8ac55429f7f8cc9f100c1cf2dc0195cf81e76f"
-BR2_TARGET_UBOOT_FORMAT_BIN=y
+BR2_TARGET_UBOOT_BOARDNAME="Cubieboard"
 BR2_TARGET_UBOOT_SPL=y
-BR2_TARGET_UBOOT_SPL_NAME="spl/sunxi-spl.bin"
+BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
configs/cubietruck_defconfig new file +21 -0
new file mode 100644
index 0000000..01a5fc2
@@ -0,0 +1,21 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_KERNEL_HEADERS_3_4=y
+BR2_TARGET_GENERIC_HOSTNAME="Cubietruck"
+BR2_TARGET_GENERIC_ISSUE="Welcome to use Cubieboard!"
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/cubietech/cubieboard/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/linux-sunxi/linux-sunxi.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d47d367036be38c5180632ec8a3ad169a4593a88"
+BR2_LINUX_KERNEL_DEFCONFIG="sun7i"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/cubietech/cubieboard/sun7i-cubietruck.config"
+BR2_PACKAGE_SUNXI_TOOLS=y
+BR2_PACKAGE_SUNXI_BOARDS=y
+BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a20/cubietruck.fex"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="Cubietruck"
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin"
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
Signature · 1 line
2.4.6
#3 lore raw

PATCH v2 3/4 cubieboard: update build support for cubieboard 1/2/3.

Scott,

Quoted 8 lines · Scott Fan

This patch update the cb1/cb2's defconfig to mainline u-boot version, and bump their linux-sunxi kernel to latest stage/sunxi-3.4 branch.

Additionally, add defconfig for cubieboard3 (a.k.a. cubietruck).

Finally, support set up the SD card only to boot from network.

When you post new versions of a patch series, please make sure to include a changelog of what was modified. Otherwise it's difficult for people reviewing your patches to figure out what you've changed.

See
http://buildroot.org/downloads/manual/manual.html#submitting-patches
for some discussion about this.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 3/4 cubieboard: update build support for cubieboard 1/2/3.

In reply to Scott Fan

Dear Scott Fan,

Quoted 6 lines · Scott Fan

This patch update the cb1/cb2's defconfig to mainline u-boot version, and bump their linux-sunxi kernel to latest stage/sunxi-3.4 branch.

Additionally, add defconfig for cubieboard3 (a.k.a. cubietruck).

Finally, support set up the SD card only to boot from network.

Thanks for this patch. There are things that I like (like using the in-kernel defconfig + a fragment), but there are also things I don't really like. Most notably, the addition of the "boot from network" feature. Our defconfig typically build a system that will boot from SD or NAND, and we don't aim at supporting dozens of possibilities in those defconfigs. They are meant to be a starting point, and the user should know how to customize the U-Boot boot command and kernel configuration to use network boot instead.

So, could you rework this by not adding the network boot option?

Also, maybe, instead of doing this crazy SD card setup script, could you use the genimage tool, like is done for the Wandboard. See configs/wandboard_config, board/wandboard/post-image.sh and board/wandboard/genimage.cfg ?

This is optional of course, but I'd prefer to move in this direction rather than a complete rewrite of board/cubietech/cubieboard/mkcubiecard.sh for no real reason.

board/cubietech/cubieboard/boot.cmd line 1

Quoted 6 lines
board/cubietech/cubieboard/boot.cmd +1 -0
index 849ed00..519b0e7 100644
@@ -1,4 +1,5 @@
+setenv bootm_boot_mode sec

What is this doing?

board/cubietech/cubieboard/boot.cmd line 4

Quoted 6 lines
board/cubietech/cubieboard/boot.cmd +2 -3
 setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
-fatload mmc 0 0x43000000 script.bin
-fatload mmc 0 0x48000000 uImage
-bootm 0x48000000
+load mmc 0:1 0x43000000 script.bin || load mmc 0:1 0x43000000 boot/script.bin
+load mmc 0:1 0x42000000 uImage || load mmc 0:1 0x42000000 boot/uImage

Why do we have the two possible locations for the script.bin and uImage ?

board/cubietech/cubieboard/mkcubiecard.sh line 6

Quoted 12 lines
board/cubietech/cubieboard/mkcubiecard.sh +6 -1
index f1d5a9f..a5bd8ec 100755
@@ -1,4 +1,9 @@
-#! /bin/sh
+#!/bin/sh
+### BEGIN INTRO
+# mkcubiecard.sh v0.2:
+# 2015, Scott Fan <[email protected]>
+# rewrite this script more clear;
+# add the 'netboot' argument, to make a network-bootable card.

There are too many things done in one patch. You should do several patches doing changes to this script, one patch updating the existing cubieboard* defconfig, and one adding the cubietruck defconfig.

And better than rewriting the script: remove it and use genimage instead.

Quoted 26 lines
board/cubietech/cubieboard/sun4i-cubieboard.config new file +4 -0
new file mode 100644
index 0000000..43eee73
@@ -0,0 +1,4 @@
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_ROOT_NFS=y
+CONFIG_SUNXI_EMAC=y
board/cubietech/cubieboard/sun7i-cubieboard2.config new file +4 -0
new file mode 100644
index 0000000..43eee73
@@ -0,0 +1,4 @@
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_ROOT_NFS=y
+CONFIG_SUNXI_EMAC=y
board/cubietech/cubieboard/sun7i-cubietruck.config new file +0 -0
new file mode 100644
index 0000000..ff7813f

board/cubietech/cubieboard/sun7i-cubietruck.config line 4

Quoted 4 lines
board/cubietech/cubieboard/sun7i-cubietruck.config new file +4 -0
@@ -0,0 +1,4 @@
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_ROOT_NFS=y
+CONFIG_SUNXI_GMAC=y

As I said above, really good idea to use config fragments! However, it would be nicer if the files indicated that it's a kernel configuration fragment, so maybe:

linux-sun7i-cubietruck.config

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#5 lore raw

PATCH v2 4/4 cubieboard: [PATCH] ipconfig: add nameserver IPs to kernel-parameter ip=

In reply to Scott Fan
---
 .../5e953778a2aab04929a5e7b69f53dc26e39b079e.patch | 133 +++++++++++++++++++++
 configs/cubieboard2_defconfig                      |   1 +
 configs/cubieboard_defconfig                       |   1 +
 configs/cubietruck_defconfig                       |   1 +
 4 files changed, 136 insertions(+)
 create mode 100644 board/cubietech/cubieboard/5e953778a2aab04929a5e7b69f53dc26e39b079e.patch
board/cubietech/cubieboard/5e953778a2aab04929a5e7b69f53dc26e39b079e.patch new file +133 -0
new file mode 100644
index 0000000..e473040
@@ -0,0 +1,133 @@
+From 5e953778a2aab04929a5e7b69f53dc26e39b079e Mon Sep 17 00:00:00 2001
+From: Christoph Fritz <[email protected]>
+Date: Fri, 21 Sep 2012 08:31:19 +0000
+Subject: [PATCH] ipconfig: add nameserver IPs to kernel-parameter ip=
+
+On small systems (e.g. embedded ones) IP addresses are often configured
+by bootloaders and get assigned to kernel via parameter "ip=".  If set to
+"ip=dhcp", even nameserver entries from DHCP daemons are handled. These
+entries exported in /proc/net/pnp are commonly linked by /etc/resolv.conf.
+
+To configure nameservers for networks without DHCP, this patch adds option
+<dns0-ip> and <dns1-ip> to kernel-parameter 'ip='.
+
+Signed-off-by: Christoph Fritz <[email protected]>
+Tested-by: Jan Weitzel <[email protected]>
+Signed-off-by: David S. Miller <[email protected]>
+---
+ Documentation/filesystems/nfs/nfsroot.txt | 10 +++++++-
+ net/ipv4/ipconfig.c                       | 39 ++++++++++++++++++++++++++++---
+ 2 files changed, 45 insertions(+), 4 deletions(-)
+
+diff --git a/Documentation/filesystems/nfs/nfsroot.txt b/Documentation/filesystems/nfs/nfsroot.txt
+index ffdd9d8..2d66ed6 100644
+--- a/Documentation/filesystems/nfs/nfsroot.txt
++++ b/Documentation/filesystems/nfs/nfsroot.txt
+@@ -78,7 +78,8 @@ nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
+ 			flags		= hard, nointr, noposix, cto, ac
+ 
+ 
+-ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
++ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:
++   <dns0-ip>:<dns1-ip>
+ 
+   This parameter tells the kernel how to configure IP addresses of devices
+   and also how to set up the IP routing table. It was originally called
+@@ -158,6 +159,13 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
+ 
+                 Default: any
+ 
++  <dns0-ip>	IP address of first nameserver.
++		Value gets exported by /proc/net/pnp which is often linked
++		on embedded systems by /etc/resolv.conf.
++
++  <dns1-ip>	IP address of secound nameserver.
++		Same as above.
++
+ 
+ nfsrootdebug
+ 
+diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
+index 67e8a6b..1c0e7e0 100644
+--- a/net/ipv4/ipconfig.c
++++ b/net/ipv4/ipconfig.c
+@@ -743,14 +743,22 @@ static void __init ic_bootp_init_ext(u8 *e)
+ 
+ 
+ /*
+- *  Initialize the DHCP/BOOTP mechanism.
++ *  Predefine Nameservers
+  */
+-static inline void __init ic_bootp_init(void)
++static inline void __init ic_nameservers_predef(void)
+ {
+ 	int i;
+ 
+ 	for (i = 0; i < CONF_NAMESERVERS_MAX; i++)
+ 		ic_nameservers[i] = NONE;
++}
++
++/*
++ *  Initialize the DHCP/BOOTP mechanism.
++ */
++static inline void __init ic_bootp_init(void)
++{
++	ic_nameservers_predef();
+ 
+ 	dev_add_pack(&bootp_packet_type);
+ }
+@@ -1379,6 +1387,7 @@ static int __init ip_auto_config(void)
+ 	int retries = CONF_OPEN_RETRIES;
+ #endif
+ 	int err;
++	unsigned int i;
+ 
+ #ifdef CONFIG_PROC_FS
+ 	proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops);
+@@ -1499,7 +1508,15 @@ static int __init ip_auto_config(void)
+ 		&ic_servaddr, &root_server_addr, root_server_path);
+ 	if (ic_dev_mtu)
+ 		pr_cont(", mtu=%d", ic_dev_mtu);
+-	pr_cont("\n");
++	for (i = 0; i < CONF_NAMESERVERS_MAX; i++)
++		if (ic_nameservers[i] != NONE) {
++			pr_info("     nameserver%u=%pI4",
++				i, &ic_nameservers[i]);
++			break;
++		}
++	for (i++; i < CONF_NAMESERVERS_MAX; i++)
++		if (ic_nameservers[i] != NONE)
++			pr_cont(", nameserver%u=%pI4\n", i, &ic_nameservers[i]);
+ #endif /* !SILENT */
+ 
+ 	return 0;
+@@ -1570,6 +1587,8 @@ static int __init ip_auto_config_setup(char *addrs)
+ 		return 1;
+ 	}
+ 
++	ic_nameservers_predef();
++
+ 	/* Parse string for static IP assignment.  */
+ 	ip = addrs;
+ 	while (ip && *ip) {
+@@ -1613,6 +1632,20 @@ static int __init ip_auto_config_setup(char *addrs)
+ 					ic_enable = 0;
+ 				}
+ 				break;
++			case 7:
++				if (CONF_NAMESERVERS_MAX >= 1) {
++					ic_nameservers[0] = in_aton(ip);
++					if (ic_nameservers[0] == ANY)
++						ic_nameservers[0] = NONE;
++				}
++				break;
++			case 8:
++				if (CONF_NAMESERVERS_MAX >= 2) {
++					ic_nameservers[1] = in_aton(ip);
++					if (ic_nameservers[1] == ANY)
++						ic_nameservers[1] = NONE;
++				}
++				break;
+ 			}
+ 		}
+ 		ip = cp;
configs/cubieboard2_defconfig +1 -0
index 41d5266..a2b2aef 100644
@@ -9,6 +9,7 @@ BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/linux-sunxi/linux-sunxi.git"
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d47d367036be38c5180632ec8a3ad169a4593a88"
+BR2_LINUX_KERNEL_PATCH="board/cubietech/cubieboard/5e953778a2aab04929a5e7b69f53dc26e39b079e.patch"
 BR2_LINUX_KERNEL_DEFCONFIG="sun7i"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/cubietech/cubieboard/sun7i-cubieboard2.config"
 BR2_PACKAGE_SUNXI_TOOLS=y
configs/cubieboard_defconfig +1 -0
index 85dc794..566f633 100644
@@ -9,6 +9,7 @@ BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/linux-sunxi/linux-sunxi.git"
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d47d367036be38c5180632ec8a3ad169a4593a88"
+BR2_LINUX_KERNEL_PATCH="board/cubietech/cubieboard/5e953778a2aab04929a5e7b69f53dc26e39b079e.patch"
 BR2_LINUX_KERNEL_DEFCONFIG="sun4i"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/cubietech/cubieboard/sun4i-cubieboard.config"
 BR2_PACKAGE_SUNXI_TOOLS=y
configs/cubietruck_defconfig +1 -0
index 01a5fc2..419b64f 100644
@@ -9,6 +9,7 @@ BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_GIT=y
 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/linux-sunxi/linux-sunxi.git"
 BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d47d367036be38c5180632ec8a3ad169a4593a88"
+BR2_LINUX_KERNEL_PATCH="board/cubietech/cubieboard/5e953778a2aab04929a5e7b69f53dc26e39b079e.patch"
 BR2_LINUX_KERNEL_DEFCONFIG="sun7i"
 BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/cubietech/cubieboard/sun7i-cubietruck.config"
 BR2_PACKAGE_SUNXI_TOOLS=y
Signature · 1 line
2.4.6
#6 lore raw

PATCH v2 4/4 cubieboard: [PATCH] ipconfig: add nameserver IPs to kernel-parameter ip=

Dear Scott Fan,

Quoted 8 lines · Scott Fan
---
 .../5e953778a2aab04929a5e7b69f53dc26e39b079e.patch | 133 +++++++++++++++++++++
 configs/cubieboard2_defconfig                      |   1 +
 configs/cubieboard_defconfig                       |   1 +
 configs/cubietruck_defconfig                       |   1 +
 4 files changed, 136 insertions(+)
 create mode 100644 board/cubietech/cubieboard/5e953778a2aab04929a5e7b69f53dc26e39b079e.patch

Thanks for this patch. It is indeed the backport of an upstream kernel patch. But if we go down the road of backporting patches adding new features to the kernel for each platform, it's going to be a never ending story. You are interested by nameserver configuration in ip=, but the next Buildroot user will want this other backported patch. This is not manageable I believe.

So, I would suggest that you keep this backported patch in your project-specific customization. You can use BR2_GLOBAL_PATCH_DIR to point to a place outside of the Buildroot sources, and store your custom patches here.

Consequently, I will mark your patch as "Rejected" in our patch tracking system.

Thanks again!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#7 lore raw

PATCH v2 4/4 cubieboard: [PATCH] ipconfig: add nameserver IPs to kernel-parameter ip=

Dear Thomas,

I know your means, you are correct, i think.

Thanks for your explanation.

Scott Fan

Quoted 29 lines · Thomas Petazzoni

Dear Scott Fan,

Quoted 3 lines · Scott Fan
---
 .../5e953778a2aab04929a5e7b69f53dc26e39b079e.patch | 133

+++++++++++++++++++++

Quoted 5 lines
 configs/cubieboard2_defconfig                      |   1 +
 configs/cubieboard_defconfig                       |   1 +
 configs/cubietruck_defconfig                       |   1 +
 4 files changed, 136 insertions(+)
 create mode 100644

board/cubietech/cubieboard/5e953778a2aab04929a5e7b69f53dc26e39b079e.patch

Thanks for this patch. It is indeed the backport of an upstream kernel patch. But if we go down the road of backporting patches adding new features to the kernel for each platform, it's going to be a never ending story. You are interested by nameserver configuration in ip=, but the next Buildroot user will want this other backported patch. This is not manageable I believe.

So, I would suggest that you keep this backported patch in your project-specific customization. You can use BR2_GLOBAL_PATCH_DIR to point to a place outside of the Buildroot sources, and store your custom patches here.

Consequently, I will mark your patch as "Rejected" in our patch tracking system.

Quoted 8 lines

Thanks again!

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150831/df30a53e/attachment.html>