* [Buildroot] [PATCH v2 1/4] board/minnowboard: Rework to generate SD card image
2016-04-15 15:56 [Buildroot] [PATCH v2 0/4] Minnowboard: The grand unification Ezequiel Garcia
@ 2016-04-15 15:56 ` Ezequiel Garcia
2016-04-15 15:56 ` [Buildroot] [PATCH v2 2/4] board/minnowboard: Unify Minnowboard and Minnowboard MAX boards Ezequiel Garcia
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Ezequiel Garcia @ 2016-04-15 15:56 UTC (permalink / raw)
To: buildroot
Let's rework the board and config files to use genimage
to generate the SD card image directly.
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
--
Changes from v1:
* host-mtools is needed too, as noted by Peter.
---
board/minnowboard/genimage.cfg | 34 ++++++++++++++++++++++++++++++++++
board/minnowboard/post-image.sh | 13 +++++++++++++
board/minnowboard/readme.txt | 39 ++++++++++++---------------------------
configs/minnowboard_defconfig | 9 +++++++++
4 files changed, 68 insertions(+), 27 deletions(-)
create mode 100644 board/minnowboard/genimage.cfg
create mode 100755 board/minnowboard/post-image.sh
diff --git a/board/minnowboard/genimage.cfg b/board/minnowboard/genimage.cfg
new file mode 100644
index 000000000000..6cf787430752
--- /dev/null
+++ b/board/minnowboard/genimage.cfg
@@ -0,0 +1,34 @@
+# Create an image of the efi partition
+image efi-part.vfat {
+ vfat {
+ file startup.nsh {
+ image = "efi-part/startup.nsh"
+ }
+ file EFI {
+ image = "efi-part/EFI"
+ }
+ file bzImage {
+ image = "bzImage"
+ }
+ }
+ size=10M
+}
+
+# Create the sdcard image, pulling in
+# * the image created by buildroot
+# * the efi-partition created above
+image sdcard.img {
+ hdimage {
+ }
+
+ partition boot {
+ partition-type = 0xEF
+ image = "efi-part.vfat"
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext4"
+ size = 512M
+ }
+}
diff --git a/board/minnowboard/post-image.sh b/board/minnowboard/post-image.sh
new file mode 100755
index 000000000000..428baa5e5599
--- /dev/null
+++ b/board/minnowboard/post-image.sh
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+
+GENIMAGE_CFG="board/minnowboard/genimage.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage \
+ --rootpath "${TARGET_DIR}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
diff --git a/board/minnowboard/readme.txt b/board/minnowboard/readme.txt
index 62ffa92e0b83..3a24fdc162b8 100644
--- a/board/minnowboard/readme.txt
+++ b/board/minnowboard/readme.txt
@@ -1,40 +1,25 @@
-Prepare the SD card for the Minnow Board
+How to get started with the MinnowBoard
========================================
- 1. Partition the SD card with a GPT partition table
+1. Build
- sudo cgdisk /dev/mmcblk0
+ Apply the defconfig:
- Create two partitions:
+ $ make minnowboard_defconfig
- a) First partition of a few dozens of megabytes, which will be
- used to store the bootloader and the kernel image. Type must
- be EF00 (EFI partition).
+ Add any additional packages required and build:
- b) Second partition of any size, which will be used to store the
- root filesystem. Type must be 8300 (Linux filesystem)
+ $ make
- 2. Prepare the boot partition
+2. Write the SD card
- We will format it, mount it, copy the EFI data generated by
- Buildroot, and the kernel image.
+ The build process will create a SD card image in output/images.
+ Write the image to an mSD card, insert into the MinnowBoard
+ and power the board on.
- sudo mkfs.vfat -F 32 -n boot /dev/mmcblk0p1
- sudo mount /dev/mmcblk0p1 /mnt
- sudo cp -a output/images/efi-part/* /mnt/
- sudo cp output/images/bzImage /mnt/
- sudo umount /mnt
+ $ dd if=output/images/sdcard.img of=/dev/mmcblk0; sync
- 3. Prepare the root partition
-
- We will format it, mount it, and extract the root filesystem.
-
- sudo mkfs.ext3 -L root /dev/mmcblk0p2
- sudo mount /dev/mmcblk0p2 /mnt
- sudo tar -C /mnt -xf output/images/rootfs.tar
- sudo umount /mnt
-
- 4. Enjoy
+3. Enjoy
Additional information about this board can be found at
http://www.minnowboard.org/.
diff --git a/configs/minnowboard_defconfig b/configs/minnowboard_defconfig
index 3091957f35dc..25c63ccbeead 100644
--- a/configs/minnowboard_defconfig
+++ b/configs/minnowboard_defconfig
@@ -5,9 +5,13 @@ BR2_x86_atom=y
# Misc
BR2_TARGET_GENERIC_GETTY_PORT="ttyPCH0"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/minnowboard/post-image.sh"
# Linux headers same as kernel, a 3.8 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_8=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
# Linux kernel
BR2_LINUX_KERNEL=y
@@ -20,3 +24,8 @@ BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/minnowboard/linux-3.8.config"
# Bootloader
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_I386_EFI=y
+
+# Filesystem image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v2 2/4] board/minnowboard: Unify Minnowboard and Minnowboard MAX boards
2016-04-15 15:56 [Buildroot] [PATCH v2 0/4] Minnowboard: The grand unification Ezequiel Garcia
2016-04-15 15:56 ` [Buildroot] [PATCH v2 1/4] board/minnowboard: Rework to generate SD card image Ezequiel Garcia
@ 2016-04-15 15:56 ` Ezequiel Garcia
2016-04-15 15:56 ` [Buildroot] [PATCH v2 3/4] board/minnowboard-max: Add more peripherals and features to the kernel Ezequiel Garcia
2016-04-15 15:56 ` [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig Ezequiel Garcia
3 siblings, 0 replies; 9+ messages in thread
From: Ezequiel Garcia @ 2016-04-15 15:56 UTC (permalink / raw)
To: buildroot
Given Minnowboard and Minnowboard MAX boards are very similar,
it's desirable to unify the support for them.
This commit does the following:
1) Remove Minnowboard MAX's genimage.cfg, post-build.sh
and post-image.sh. These are identical to Minnowboard's.
2) Move Minnowboard MAX's linux config, and rename it.
It would be lovely to have a single kernel config file.
The kernel size penalty involved in adding support for
all the peripherals on both boards is small enough to
justify this.
However, the original Minnowboard has some GPIO buttons
that need to be registered by the kernel. This is not
upstreamed, and hence we need to use the yocto v3.8 kernel
to have this support.
3) Rename each grub config to grub-{board}.cfg.
4) Modify (the now unique) post-build script to use
a different grub config, according to the board.
5) Update both defconfigs, as per the above changes.
6) Finally, update the readme.txt.
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
--
Changes from v1:
* New patch, not present in v1.
---
board/minnowboard-max/genimage.cfg | 34 ----------------------
board/minnowboard-max/post-build.sh | 2 --
board/minnowboard-max/post-image.sh | 13 ---------
board/minnowboard-max/readme.txt | 25 ----------------
.../grub-minnowboard-max.cfg} | 0
.../minnowboard/{grub.cfg => grub-minnowboard.cfg} | 0
.../linux.config => minnowboard/linux-4.4.config} | 0
board/minnowboard/post-build.sh | 5 +++-
board/minnowboard/readme.txt | 4 +++
configs/minnowboard_defconfig | 1 +
configs/minnowboard_max_defconfig | 7 +++--
11 files changed, 13 insertions(+), 78 deletions(-)
delete mode 100644 board/minnowboard-max/genimage.cfg
delete mode 100755 board/minnowboard-max/post-build.sh
delete mode 100755 board/minnowboard-max/post-image.sh
delete mode 100644 board/minnowboard-max/readme.txt
rename board/{minnowboard-max/grub.cfg => minnowboard/grub-minnowboard-max.cfg} (100%)
rename board/minnowboard/{grub.cfg => grub-minnowboard.cfg} (100%)
rename board/{minnowboard-max/linux.config => minnowboard/linux-4.4.config} (100%)
diff --git a/board/minnowboard-max/genimage.cfg b/board/minnowboard-max/genimage.cfg
deleted file mode 100644
index 6cf787430752..000000000000
--- a/board/minnowboard-max/genimage.cfg
+++ /dev/null
@@ -1,34 +0,0 @@
-# Create an image of the efi partition
-image efi-part.vfat {
- vfat {
- file startup.nsh {
- image = "efi-part/startup.nsh"
- }
- file EFI {
- image = "efi-part/EFI"
- }
- file bzImage {
- image = "bzImage"
- }
- }
- size=10M
-}
-
-# Create the sdcard image, pulling in
-# * the image created by buildroot
-# * the efi-partition created above
-image sdcard.img {
- hdimage {
- }
-
- partition boot {
- partition-type = 0xEF
- image = "efi-part.vfat"
- }
-
- partition rootfs {
- partition-type = 0x83
- image = "rootfs.ext4"
- size = 512M
- }
-}
diff --git a/board/minnowboard-max/post-build.sh b/board/minnowboard-max/post-build.sh
deleted file mode 100755
index 9f86d390f2ef..000000000000
--- a/board/minnowboard-max/post-build.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-cp board/minnowboard-max/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
diff --git a/board/minnowboard-max/post-image.sh b/board/minnowboard-max/post-image.sh
deleted file mode 100755
index e90dd6b8cf10..000000000000
--- a/board/minnowboard-max/post-image.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh -e
-
-GENIMAGE_CFG="board/minnowboard-max/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage \
- --rootpath "${TARGET_DIR}" \
- --tmppath "${GENIMAGE_TMP}" \
- --inputpath "${BINARIES_DIR}" \
- --outputpath "${BINARIES_DIR}" \
- --config "${GENIMAGE_CFG}"
diff --git a/board/minnowboard-max/readme.txt b/board/minnowboard-max/readme.txt
deleted file mode 100644
index dfad2aba2123..000000000000
--- a/board/minnowboard-max/readme.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-How to get started with the Minnow Board MAX
-============================================
-
-1. Build
-
- Apply the defconfig:
-
- $ make minnowboard_max_defconfig
-
- Add any additional packages required and build:
-
- $ make
-
-2. Write the SD card
-
- The build process will create a SD card image in output/images.
- Write the image to an mSD card, insert into the Minnowboard MAX
- and power the board on.
-
- $ dd if=output/images/sdcard.img of=/dev/mmcblk0; sync
-
-3. Enjoy
-
-Additional information about this board can be found at
-http://www.minnowboard.org/ or http://wiki.minnowboard.org/MinnowBoard_MAX
diff --git a/board/minnowboard-max/grub.cfg b/board/minnowboard/grub-minnowboard-max.cfg
similarity index 100%
rename from board/minnowboard-max/grub.cfg
rename to board/minnowboard/grub-minnowboard-max.cfg
diff --git a/board/minnowboard/grub.cfg b/board/minnowboard/grub-minnowboard.cfg
similarity index 100%
rename from board/minnowboard/grub.cfg
rename to board/minnowboard/grub-minnowboard.cfg
diff --git a/board/minnowboard-max/linux.config b/board/minnowboard/linux-4.4.config
similarity index 100%
rename from board/minnowboard-max/linux.config
rename to board/minnowboard/linux-4.4.config
diff --git a/board/minnowboard/post-build.sh b/board/minnowboard/post-build.sh
index e3f4a92ec943..f3a11e99f0f5 100755
--- a/board/minnowboard/post-build.sh
+++ b/board/minnowboard/post-build.sh
@@ -1,2 +1,5 @@
#!/bin/sh
-cp board/minnowboard/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
+# args from BR2_ROOTFS_POST_SCRIPT_ARGS
+# $2 board name
+
+cp -v board/minnowboard/grub-${2}.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
diff --git a/board/minnowboard/readme.txt b/board/minnowboard/readme.txt
index 3a24fdc162b8..9d59a2f4546a 100644
--- a/board/minnowboard/readme.txt
+++ b/board/minnowboard/readme.txt
@@ -7,6 +7,10 @@ How to get started with the MinnowBoard
$ make minnowboard_defconfig
+ Or, for the Minnowboard MAX board:
+
+ $ make minnowboard_max_defconfig
+
Add any additional packages required and build:
$ make
diff --git a/configs/minnowboard_defconfig b/configs/minnowboard_defconfig
index 25c63ccbeead..f4afc86bf814 100644
--- a/configs/minnowboard_defconfig
+++ b/configs/minnowboard_defconfig
@@ -6,6 +6,7 @@ BR2_x86_atom=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyPCH0"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/minnowboard/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="minnowboard"
# Linux headers same as kernel, a 3.8 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_8=y
diff --git a/configs/minnowboard_max_defconfig b/configs/minnowboard_max_defconfig
index 05df9878ccf0..df1759d19f80 100644
--- a/configs/minnowboard_max_defconfig
+++ b/configs/minnowboard_max_defconfig
@@ -4,8 +4,9 @@ BR2_x86_atom=y
# Misc
BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard-max/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/minnowboard-max/post-image.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/minnowboard/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="minnowboard-max"
# Linux headers same as kernel, a 4.4 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
@@ -22,7 +23,7 @@ BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
-BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/minnowboard-max/linux.config"
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/minnowboard/linux-4.4.config"
# Bootloader
BR2_TARGET_GRUB2=y
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v2 3/4] board/minnowboard-max: Add more peripherals and features to the kernel
2016-04-15 15:56 [Buildroot] [PATCH v2 0/4] Minnowboard: The grand unification Ezequiel Garcia
2016-04-15 15:56 ` [Buildroot] [PATCH v2 1/4] board/minnowboard: Rework to generate SD card image Ezequiel Garcia
2016-04-15 15:56 ` [Buildroot] [PATCH v2 2/4] board/minnowboard: Unify Minnowboard and Minnowboard MAX boards Ezequiel Garcia
@ 2016-04-15 15:56 ` Ezequiel Garcia
2016-04-15 15:56 ` [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig Ezequiel Garcia
3 siblings, 0 replies; 9+ messages in thread
From: Ezequiel Garcia @ 2016-04-15 15:56 UTC (permalink / raw)
To: buildroot
This commit enables support for:
* HDMI audio
* Support for user-provided EDID firmware
(useful to workaround broken monitors)
* Evdev interface
* System V IPC (required by ALSA)
The options make the system more useful.
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
--
Changes from v1:
* Since we dropped systemd usage, got rid of related
options.
---
board/minnowboard/linux-4.4.config | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/board/minnowboard/linux-4.4.config b/board/minnowboard/linux-4.4.config
index abb7fdce9861..349842325293 100644
--- a/board/minnowboard/linux-4.4.config
+++ b/board/minnowboard/linux-4.4.config
@@ -1,3 +1,4 @@
+CONFIG_SYSVIPC=y
CONFIG_NO_HZ=y
CONFIG_SMP=y
CONFIG_X86_INTEL_LPSS=y
@@ -19,6 +20,7 @@ CONFIG_SATA_AHCI=y
CONFIG_ATA_PIIX=y
CONFIG_NETDEVICES=y
CONFIG_R8169=y
+CONFIG_INPUT_EVDEV=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DW=y
@@ -33,7 +35,15 @@ CONFIG_GPIOLIB=y
CONFIG_GPIO_SYSFS=y
CONFIG_AGP=y
CONFIG_DRM=y
+CONFIG_DRM_LOAD_EDID_FIRMWARE=y
CONFIG_DRM_I915=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+# CONFIG_SND_DRIVERS is not set
+CONFIG_SND_HDA_INTEL=y
+CONFIG_SND_HDA_CODEC_HDMI=y
+# CONFIG_SND_SPI is not set
+# CONFIG_SND_USB is not set
CONFIG_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_NOP_USB_XCEIV=y
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig
2016-04-15 15:56 [Buildroot] [PATCH v2 0/4] Minnowboard: The grand unification Ezequiel Garcia
` (2 preceding siblings ...)
2016-04-15 15:56 ` [Buildroot] [PATCH v2 3/4] board/minnowboard-max: Add more peripherals and features to the kernel Ezequiel Garcia
@ 2016-04-15 15:56 ` Ezequiel Garcia
2016-04-15 20:01 ` Thomas Petazzoni
3 siblings, 1 reply; 9+ messages in thread
From: Ezequiel Garcia @ 2016-04-15 15:56 UTC (permalink / raw)
To: buildroot
This commit adds a new defconfig to build a X-based
graphical system for the Minnowboard MAX board.
* The 'openbox' windows manager is chosen because it's simple
and lightweigth.
* Basic X apps are enabled (such as xrandr, xterm), so we
can at least get a console and change video mode.
* ALSA default configuration is provided, so HDMI audio
works out-of-the-box.
* OpenGL is supported.
Tested on Minnoboard Turot (which is Minnowboard Max compatible).
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
--
Changes from v1:
* Use an overlay instead of post-build.sh to customize the rootfs.
* Remove systemd usage, so we provide a minimum "audio and graphics"
setup.
---
.../fs-overlay-graphical/etc/asound.conf | 4 +
.../minnowboard/fs-overlay-graphical/root/.xinitrc | 1 +
.../fs-overlay-graphical/usr/bin/startx | 248 +++++++++++++++++++++
configs/minnowboard_max-graphical_defconfig | 79 +++++++
4 files changed, 332 insertions(+)
create mode 100644 board/minnowboard/fs-overlay-graphical/etc/asound.conf
create mode 100644 board/minnowboard/fs-overlay-graphical/root/.xinitrc
create mode 100755 board/minnowboard/fs-overlay-graphical/usr/bin/startx
create mode 100644 configs/minnowboard_max-graphical_defconfig
diff --git a/board/minnowboard/fs-overlay-graphical/etc/asound.conf b/board/minnowboard/fs-overlay-graphical/etc/asound.conf
new file mode 100644
index 000000000000..b75b2383647b
--- /dev/null
+++ b/board/minnowboard/fs-overlay-graphical/etc/asound.conf
@@ -0,0 +1,4 @@
+# Customize ALSA:
+# the HDMI PCM is at card=0, device=3 (i.e. hw:0,3)
+defaults.pcm.card 0
+defaults.pcm.device 3
diff --git a/board/minnowboard/fs-overlay-graphical/root/.xinitrc b/board/minnowboard/fs-overlay-graphical/root/.xinitrc
new file mode 100644
index 000000000000..4274b24df1bc
--- /dev/null
+++ b/board/minnowboard/fs-overlay-graphical/root/.xinitrc
@@ -0,0 +1 @@
+exec /usr/bin/openbox-session
diff --git a/board/minnowboard/fs-overlay-graphical/usr/bin/startx b/board/minnowboard/fs-overlay-graphical/usr/bin/startx
new file mode 100755
index 000000000000..a600348e317f
--- /dev/null
+++ b/board/minnowboard/fs-overlay-graphical/usr/bin/startx
@@ -0,0 +1,248 @@
+#!/bin/sh
+
+# Fixup startx so it doesn't start X on the controlling
+# virtual console. Apparently, this is a bug and we are
+# affected for our lack of a Display Manager.
+# See https://bugs.freedesktop.org/show_bug.cgi?id=87762
+#
+# I haven't found a way to do this without hacking startx
+# itself. The only change we are doing here is setting
+# serverargs to "vt1", see below.
+
+#
+# This is just a sample implementation of a slightly less primitive
+# interface than xinit. It looks for user .xinitrc and .xserverrc
+# files, then system xinitrc and xserverrc files, else lets xinit choose
+# its default. The system xinitrc should probably do things like check
+# for .Xresources files and merge them in, start up a window manager,
+# and pop a clock and several xterms.
+#
+# Site administrators are STRONGLY urged to write nicer versions.
+#
+
+unset DBUS_SESSION_BUS_ADDRESS
+unset SESSION_MANAGER
+userclientrc=$HOME/.xinitrc
+sysclientrc=/etc/X11/xinit/xinitrc
+
+userserverrc=$HOME/.xserverrc
+sysserverrc=/etc/X11/xinit/xserverrc
+defaultclient=xterm
+defaultserver=/usr/bin/X
+defaultclientargs=""
+defaultserverargs=""
+defaultdisplay=":0"
+clientargs=""
+serverargs="vt1"
+vtarg=""
+enable_xauth=1
+
+
+# Automatically determine an unused $DISPLAY
+d=0
+while true ; do
+ [ -e /tmp/.X$d-lock ] || break
+ d=$(($d + 1))
+done
+defaultdisplay=":$d"
+unset d
+
+whoseargs="client"
+while [ x"$1" != x ]; do
+ case "$1" in
+ # '' required to prevent cpp from treating "/*" as a C comment.
+ /''*|\./''*)
+ if [ "$whoseargs" = "client" ]; then
+ if [ x"$client" = x ] && [ x"$clientargs" = x ]; then
+ client="$1"
+ else
+ clientargs="$clientargs $1"
+ fi
+ else
+ if [ x"$server" = x ] && [ x"$serverargs" = x ]; then
+ server="$1"
+ else
+ serverargs="$serverargs $1"
+ fi
+ fi
+ ;;
+ --)
+ whoseargs="server"
+ ;;
+ *)
+ if [ "$whoseargs" = "client" ]; then
+ clientargs="$clientargs $1"
+ else
+ # display must be the FIRST server argument
+ if [ x"$serverargs" = x ] && \
+ expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then
+ display="$1"
+ else
+ serverargs="$serverargs $1"
+ fi
+ fi
+ ;;
+ esac
+ shift
+done
+
+# process client arguments
+if [ x"$client" = x ]; then
+ client=$defaultclient
+
+ # For compatibility reasons, only use startxrc if there were no client command line arguments
+ if [ x"$clientargs" = x ]; then
+ if [ -f "$userclientrc" ]; then
+ client=$userclientrc
+ elif [ -f "$sysclientrc" ]; then
+ client=$sysclientrc
+ fi
+ fi
+fi
+
+# if no client arguments, use defaults
+if [ x"$clientargs" = x ]; then
+ clientargs=$defaultclientargs
+fi
+
+# process server arguments
+if [ x"$server" = x ]; then
+ server=$defaultserver
+
+
+ # When starting the defaultserver start X on the current tty to avoid
+ # the startx session being seen as inactive:
+ # "https://bugzilla.redhat.com/show_bug.cgi?id=806491"
+ tty=$(tty)
+ if expr match "$tty" '^/dev/tty[0-9]\+$' > /dev/null; then
+ tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
+ vtarg="vt$tty_num"
+ fi
+
+
+ # For compatibility reasons, only use xserverrc if there were no server command line arguments
+ if [ x"$serverargs" = x -a x"$display" = x ]; then
+ if [ -f "$userserverrc" ]; then
+ server=$userserverrc
+ elif [ -f "$sysserverrc" ]; then
+ server=$sysserverrc
+ fi
+ fi
+fi
+
+# if no server arguments, use defaults
+if [ x"$serverargs" = x ]; then
+ serverargs=$defaultserverargs
+fi
+
+# if no vt is specified add vtarg (which may be empty)
+have_vtarg="no"
+for i in $serverargs; do
+ if expr match "$i" '^vt[0-9]\+$' > /dev/null; then
+ have_vtarg="yes"
+ fi
+done
+if [ "$have_vtarg" = "no" ]; then
+ serverargs="$serverargs $vtarg"
+fi
+
+# if no display, use default
+if [ x"$display" = x ]; then
+ display=$defaultdisplay
+fi
+
+if [ x"$enable_xauth" = x1 ] ; then
+ if [ x"$XAUTHORITY" = x ]; then
+ XAUTHORITY=$HOME/.Xauthority
+ export XAUTHORITY
+ fi
+
+ removelist=
+
+ # set up default Xauth info for this machine
+ case `uname` in
+ Linux*)
+ if [ -z "`hostname --version 2>&1 | grep GNU`" ]; then
+ hostname=`hostname -f`
+ else
+ hostname=`hostname`
+ fi
+ ;;
+ *)
+ hostname=`hostname`
+ ;;
+ esac
+
+ authdisplay=${display:-:0}
+
+ mcookie=`/usr/bin/mcookie`
+
+
+
+
+
+
+
+ if test x"$mcookie" = x; then
+ echo "Couldn't create cookie"
+ exit 1
+ fi
+ dummy=0
+
+ # create a file with auth information for the server. ':0' is a dummy.
+ xserverauthfile=$HOME/.serverauth.$$
+ trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM
+ xauth -q -f "$xserverauthfile" << EOF
+add :$dummy . $mcookie
+EOF
+
+
+
+
+ serverargs=${serverargs}" -auth "${xserverauthfile}
+
+
+ # now add the same credentials to the client authority file
+ # if '$displayname' already exists do not overwrite it as another
+ # server man need it. Add them to the '$xserverauthfile' instead.
+ for displayname in $authdisplay $hostname$authdisplay; do
+ authcookie=`xauth list "$displayname" \
+ | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null;
+ if [ "z${authcookie}" = "z" ] ; then
+ xauth -q << EOF
+add $displayname . $mcookie
+EOF
+ removelist="$displayname $removelist"
+ else
+ dummy=$(($dummy+1));
+ xauth -q -f "$xserverauthfile" << EOF
+add :$dummy . $authcookie
+EOF
+ fi
+ done
+fi
+
+
+
+
+xinit "$client" $clientargs -- "$server" $display $serverargs
+
+retval=$?
+
+if [ x"$enable_xauth" = x1 ] ; then
+ if [ x"$removelist" != x ]; then
+ xauth remove $removelist
+ fi
+ if [ x"$xserverauthfile" != x ]; then
+ rm -f "$xserverauthfile"
+ fi
+fi
+
+
+
+
+
+if command -v deallocvt > /dev/null 2>&1; then
+ deallocvt
+fi
+exit $retval
diff --git a/configs/minnowboard_max-graphical_defconfig b/configs/minnowboard_max-graphical_defconfig
new file mode 100644
index 000000000000..5397720d7c91
--- /dev/null
+++ b/configs/minnowboard_max-graphical_defconfig
@@ -0,0 +1,79 @@
+# Architecture
+BR2_x86_64=y
+BR2_x86_atom=y
+
+# Toolchain
+BR2_OPTIMIZE_2=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_4=y
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_GLIBC_VERSION_2_23=y
+BR2_BINUTILS_VERSION_2_26_X=y
+BR2_GCC_VERSION_5_X=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+
+# System configuration
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="tty0"
+BR2_ROOTFS_OVERLAY="board/minnowboard/fs-overlay-graphical"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/minnowboard/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/minnowboard/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="minnowboard-max"
+
+# Host packages
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
+# Linux
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/minnowboard/linux-4.4.config"
+
+# Bootloader
+BR2_TARGET_GRUB2=y
+BR2_TARGET_GRUB2_X86_64_EFI=y
+
+# ALSA
+BR2_PACKAGE_ALSA_UTILS=y
+BR2_PACKAGE_ALSA_UTILS_APLAY=y
+
+# OpenGL
+BR2_PACKAGE_GLMARK2=y
+BR2_PACKAGE_MESA3D_DEMOS=y
+BR2_PACKAGE_MESA3D=y
+BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
+BR2_PACKAGE_MESA3D_DRI_DRIVER_I965=y
+
+# Framebuffer (just for testing purposes)
+BR2_PACKAGE_FB_TEST_APP=y
+
+# X
+BR2_PACKAGE_XORG7=y
+BR2_PACKAGE_XSERVER_XORG_SERVER=y
+BR2_PACKAGE_XSERVER_XORG_SERVER_AIGLX=y
+BR2_PACKAGE_XAPP_XINIT=y
+BR2_PACKAGE_XAPP_XRANDR=y
+BR2_PACKAGE_XDRIVER_XF86_INPUT_EVDEV=y
+BR2_PACKAGE_XDRIVER_XF86_INPUT_KEYBOARD=y
+BR2_PACKAGE_XDRIVER_XF86_INPUT_MOUSE=y
+BR2_PACKAGE_XDRIVER_XF86_VIDEO_INTEL=y
+BR2_PACKAGE_XTERM=y
+BR2_PACKAGE_OPENBOX=y
+
+# Firmware
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y
+
+# Libraries
+BR2_PACKAGE_IMLIB2=y
+BR2_PACKAGE_IMLIB2_JPEG=y
+BR2_PACKAGE_IMLIB2_PNG=y
+BR2_PACKAGE_STARTUP_NOTIFICATION=y
+
+# Filesystem image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig
2016-04-15 15:56 ` [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig Ezequiel Garcia
@ 2016-04-15 20:01 ` Thomas Petazzoni
2016-04-15 20:11 ` Ezequiel Garcia
0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2016-04-15 20:01 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 15 Apr 2016 12:56:07 -0300, Ezequiel Garcia wrote:
> .../fs-overlay-graphical/usr/bin/startx | 248 +++++++++++++++++++++
This script looks really long and complicated. Where does it come from?
Is it really specific to the Minnowboard?
Another open question is whether we should add some details in
readme.txt about this configuration, like which demos are provided,
example commands to run to test the whole thing, etc.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig
2016-04-15 20:01 ` Thomas Petazzoni
@ 2016-04-15 20:11 ` Ezequiel Garcia
2016-04-15 20:14 ` Thomas Petazzoni
0 siblings, 1 reply; 9+ messages in thread
From: Ezequiel Garcia @ 2016-04-15 20:11 UTC (permalink / raw)
To: buildroot
On 15 April 2016 at 17:01, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Fri, 15 Apr 2016 12:56:07 -0300, Ezequiel Garcia wrote:
>
>> .../fs-overlay-graphical/usr/bin/startx | 248 +++++++++++++++++++++
>
> This script looks really long and complicated. Where does it come from?
> Is it really specific to the Minnowboard?
>
Nope, it's the standard startx script, provided by the xinit package.
I'm pretty sure all distros bundle the same cumbersome startx script.
It is perfectly possible to write a much, much simpler script.
In fact, the juicy part is this:
xinit "$client" $clientargs -- "$server" $display $serverargs
I.e., It is possible to run xinit, with a couple params and it would work.
The only change needed is running X on a different VT, which
startx forces to be the controlling terminal.
The problem (or a related one?) is well described here:
https://bugs.freedesktop.org/show_bug.cgi?id=87762
BTW: now that I think of it, I'm not sure this script is needed,
since it was somewhat related to systemd being used.
I will check again, and in any case, provide a simpler startx.
> Another open question is whether we should add some details in
> readme.txt about this configuration, like which demos are provided,
> example commands to run to test the whole thing, etc.
Sure, that makes sense.
I'll cook a v3.
--
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig
2016-04-15 20:11 ` Ezequiel Garcia
@ 2016-04-15 20:14 ` Thomas Petazzoni
2016-04-15 20:16 ` Ezequiel Garcia
0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2016-04-15 20:14 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 15 Apr 2016 17:11:56 -0300, Ezequiel Garcia wrote:
> Nope, it's the standard startx script, provided by the xinit package.
The big question now is why do you have this script in an overlay
rather than using the one provided by the xinit package?
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH v2 4/4] board/minnowboard-max: Add a X-based graphical defconfig
2016-04-15 20:14 ` Thomas Petazzoni
@ 2016-04-15 20:16 ` Ezequiel Garcia
0 siblings, 0 replies; 9+ messages in thread
From: Ezequiel Garcia @ 2016-04-15 20:16 UTC (permalink / raw)
To: buildroot
On 15 April 2016 at 17:14, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Fri, 15 Apr 2016 17:11:56 -0300, Ezequiel Garcia wrote:
>
>> Nope, it's the standard startx script, provided by the xinit package.
>
> The big question now is why do you have this script in an overlay
> rather than using the one provided by the xinit package?
>
Quoting the script itself:
+# Fixup startx so it doesn't start X on the controlling
+# virtual console. Apparently, this is a bug and we are
+# affected for our lack of a Display Manager.
+# See https://bugs.freedesktop.org/show_bug.cgi?id=87762
+#
+# I haven't found a way to do this without hacking startx
+# itself. The only change we are doing here is setting
+# serverargs to "vt1", see below.
Unless serverargs is set, calling "startx" without params
will always use the controlling terminal, and X then
fails to switch VT or something. Don't really recall
the error, but it prevented X from starting.
--
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar
^ permalink raw reply [flat|nested] 9+ messages in thread