Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 402e775

Browse files
procountXECDesign
authored andcommitted
Added auto HDMI switching
Tidy up profile
1 parent 6df566a commit 402e775

File tree

11 files changed

+168
-0
lines changed

11 files changed

+168
-0
lines changed

buildroot/.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ BR2_PACKAGE_P7ZIP=y
343343
BR2_PACKAGE_PARTCLONE=y
344344
BR2_PACKAGE_RECOVERY=y
345345
BR2_PACKAGE_RPI_WIFI_FIRMWARE=y
346+
BR2_PACKAGE_CON2FBMAP=y
346347

347348
#
348349
# Audio and video applications

buildroot/package/Config.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ menu "Target packages"
66
source "package/partclone/Config.in"
77
source "package/recovery/Config.in"
88
source "package/rpi-wifi-firmware/Config.in"
9+
source "package/con2fbmap/Config.in"
910

1011
menu "Audio and video applications"
1112
source "package/alsa-utils/Config.in"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
config BR2_PACKAGE_CON2FBMAP
2+
bool "con2fbmap"
3+
### build dependencies
4+
### runtime dependencies
5+
help
6+
Change tty console to a different framebuffer device /dev/fbX
7+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#############################################################
2+
#
3+
# con2fbmap system
4+
#
5+
#############################################################
6+
7+
8+
CON2FBMAP_VERSION = 1.0
9+
CON2FBMAP_SITE = $(TOPDIR)/../con2fbmap
10+
CON2FBMAP_SITE_METHOD = local
11+
CON2FBMAP_LICENSE = BSD-3c
12+
CON2FBMAP_LICENSE_FILES = LICENSE.txt
13+
CON2FBMAP_INSTALL_STAGING = NO
14+
15+
define CON2FBMAP_BUILD_CMDS
16+
cd $(@D)
17+
$(MAKE) -C $(@D) all
18+
$(TARGET_STRIP) $(@D)/con2fbmap
19+
endef
20+
21+
define CON2FBMAP_INSTALL_TARGET_CMDS
22+
$(INSTALL) -m 0755 $(@D)/con2fbmap $(TARGET_DIR)/usr/bin/con2fbmap
23+
endef
24+
25+
$(eval $(generic-package))

buildroot/package/recovery/init

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@ echo 2 >/sys/module/vt/parameters/cur_default
3333
# Enable syslog
3434
/etc/init.d/S01logging start > /dev/null
3535

36+
present=`tvservice -l | sed -n -e 's|^Display Number \(.*\),.*$|\1| p'`
37+
for dev in $present; do
38+
fitted=`tvservice -n -v $dev 2>/dev/null`
39+
if [[ "$fitted" != "" ]]; then
40+
case $dev in
41+
0) #7in Touchscreen
42+
export QWS_DISPLAY="LinuxFb:/dev/fb0"
43+
break;
44+
;;
45+
2) #normal HDMI0
46+
export QWS_DISPLAY="LinuxFb:/dev/fb0"
47+
break;
48+
;;
49+
7) #Secondary HDMI1
50+
export QWS_DISPLAY="LinuxFb:/dev/fb1"
51+
/usr/bin/con2fbmap 2 1
52+
/usr/bin/con2fbmap 3 1
53+
break;
54+
;;
55+
esac
56+
fi
57+
done
58+
59+
3660
if grep -q vncinstall /proc/cmdline; then
3761
# VNC server mode. Mainly useful for making screenshots
3862
export QWS_DISPLAY="VNC:size=800x600:depth=32:0"

buildroot/package/recovery/profile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export PS1="\u@\h:\w# "
2+

buildroot/package/recovery/recovery.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ define RECOVERY_INSTALL_TARGET_CMDS
3333
$(INSTALL) -m 0755 package/recovery/unicode-fonts/NanumBarunGothicBold.ttf $(TARGET_DIR)/usr/lib/fonts/NanumBarunGothicBold.ttf
3434
$(INSTALL) -m 0755 package/recovery/data/data $(TARGET_DIR)/usr/data
3535
$(INSTALL) -m 0644 $(@D)/cmdline.txt $(BINARIES_DIR)/cmdline.txt
36+
$(INSTALL) -m 0755 package/recovery/profile $(TARGET_DIR)/root/.profile
37+
3638
mkdir -p $(TARGET_DIR)/keymaps/
3739
$(INSTALL) -m 0755 package/recovery/keymaps/* $(TARGET_DIR)/keymaps/
3840
$(INSTALL) -m 0644 package/recovery/wpa_supplicant.conf $(TARGET_DIR)/etc/wpa_supplicant.conf

buildroot/package/rpi-firmware/config.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ fixup_file=fixup_rc.dat
55
[pi4]
66
start_file=recover4.elf
77
fixup_file=fixup4rc.dat
8+
max_framebuffers=2

con2fbmap/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CC=$(PWD)/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc
2+
3+
all: con2fbmap
4+
$(MAKE) $(AM_MAKEFLAGS) con2fbmap
5+
6+
con2fbmap: con2fbmap.c
7+
$(CC) -static con2fbmap.c -o con2fbmap
8+
9+
10+

con2fbmap/con2fbmap.1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.TH con2fbmap 1 2006-01-18 2.1 "Linux frame buffer utils"
2+
.SH NAME
3+
con2fbmap \- shows and sets mapping between consoles and framebuffer devices.
4+
.SH SYNOPSIS
5+
.B con2fbmap
6+
.RI console
7+
.RI [ framebuffer ]
8+
.SH DESCRIPTION
9+
.B This documentation is not finished
10+
.PP
11+
.B con2fbmap
12+
is a system utility to show or change the mapping of the consoles to the
13+
frame buffer device. The frame buffer device provides a simple and unique
14+
interface to access different kinds of graphic displays.
15+
.PP
16+
Frame buffer devices are accessed via special device nodes located in the
17+
/dev directory. The naming scheme for these nodes is always
18+
.IR \fBfb < n >,
19+
where
20+
.I n
21+
is the number of the used frame buffer device.
22+
.PP
23+
.SH OPTIONS
24+
The first option must be there, and identify the console on which to work.
25+
If the second option is not set, con2fbmap shows the current mapping of
26+
identified console. If the second argument is given (as a number) con2fbmap
27+
maps the identified console to said framebuffer device.
28+
.TP
29+
Sven LUTHER <[email protected]>

0 commit comments

Comments
 (0)