buildrootでビルド時のネタ

# サマリ

特にbuildrootに特化した内容ではなく
buildroot内のpackageが使用しているビルドシステムのエラー回避方法など

# 内容

## pragma
一番基本

warningでエラー停止するので除外する

libglib2はなぜかこんなエラーが発生する


<details><summary>stdio.hをincludeするだけでビルドが止まる</summary>

```
buildroot-linux-gnu/sysroot/usr/include/stdio.h:970,
                 from ../glib/gprintf.h:24,
                 from ../glib/gstdio.h:24,
                 from ../glib/gspawn.c:61:
/home/tyano/workspace/buildroot/rockchip/rk3399/buildroot/output/host/aarch64-buildroot-linux-gnu/sy
sroot/usr/include/bits/stdio2.h: In function ‘sprintf’:
/home/tyano/workspace/buildroot/rockchip/rk3399/buildroot/output/host/aarch64-buildroot-linux-gnu/sy
sroot/usr/include/bits/stdio2.h:32:35: error: format not a string literal, argument types not checke
d [-Werror=format-nonliteral]
   32 |                                   __va_arg_pack ());
      |                                   ^~~~~~~~~~~~~
/home/tyano/workspace/buildroot/rockchip/rk3399/buildroot/output/host/aarch64-buildroot-linux-gnu/sy
sroot/usr/include/bits/stdio2.h: In function ‘snprintf’:
/home/tyano/workspace/buildroot/rockchip/rk3399/buildroot/output/host/aarch64-buildroot-linux-gnu/sy
sroot/usr/include/bits/stdio2.h:70:36: error: format not a string literal, argument types not checke
d [-Werror=format-nonliteral]
   70 |                                    __va_arg_pack ());
      |                                    ^~~~~~~~~~~~~

```

</details>

仕方がないのでこんな感じでpatchをあてる

<details><summary>details</summary>

```diff
diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c
index b708b16..8833df9 100644
--- a/glib/gbacktrace.c
+++ b/glib/gbacktrace.c
@@ -34,7 +34,10 @@
 
 #include <signal.h>
 #include <stdarg.h>
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 #include <stdio.h>
+#pragma GCC diagnostic pop
 #include <stdlib.h>
 
 #ifdef HAVE_SYS_TIME_H
diff --git a/glib/gbookmarkfile.c b/glib/gbookmarkfile.c

```

</details>

## patchのあてかた
patchはpackageディレクトリ内の該当のプログラムディレクトリから
mkファイルに書かれているソースコードをダウンロードしてきて
git管理するのが良い

### libglib2の場合
`package/libglib2/libglib2.mk`が以下のようになっている
```cmake
LIBGLIB2_VERSION_MAJOR = 2.76
LIBGLIB2_VERSION = $(LIBGLIB2_VERSION_MAJOR).1
LIBGLIB2_SOURCE = glib-$(LIBGLIB2_VERSION).tar.xz
LIBGLIB2_SITE = https://download.gnome.org/sources/glib/$(LIBGLIB2_VERSION_MAJOR)
```

普通に読み解くと
`https://download.gnome.org/sources/glib/2.76/glib-2.76.1.tar.xz`が
該当のファイルなので以下のようにする
```shell
wget https://download.gnome.org/sources/glib/2.76/glib-2.76.1.tar.xz
tar xf glib-2.76.1.tar.xz
cd glib-2.76.1
git init
git add .
git commit -m "init"
```

元々存在しているpatchがあるのでそれを当てる
```shell
for a in `ls /path/to/buildroot/package/libglib2/ | grep patch `
do
patch -p1 < /path/to/buildroot/package/libglib2/$a
done
```

git 更新する(origファイルとか出来ても不要なので削除する)
patchが新規ファイルを作成するようになっている場合は削除せず
`git add -N xxx`などしておく
```shell
git status
# git add -N xxx 必要に応じて
git clean -dfx
git add -u
git commit -m "patched"
```

後は編集してpatchファイルを作成する
（番号は連番である必要は無いが、順番が関係ある場合もあるので注意）

```shell
# vim [ソースコード]など
...
git diff > /path/to/buildroot/package/libglib2/0007-cross_compile.patch
```

### サブモジュールのpatch
サブモジュールは`git diff`で差分を取るとcommit-idの差分しか見えない
サブモジュール内で差分を取って、ディレクトリ構成だけ合わせる必要がある
親の差分がある場合だとパッチファイルを分けた方が良い

例) bpftoolの場合

```shell
SM=libbpf ##これはSM=libbpf git ... など1行にすると$SMで値が取れないので注意
git diff --ignore-submodules > /path/to/0001-cross_compile.patch
git -C $SM diff | perl -pe "s/ (a|b)\// \1\/$SM\//g" > /path/to/0002-cross_compile_submodule.patch
```



## configure.ac

### 処理を追加する方法

#### m4ファイルを作成する
aclocal.m4は自動生成なので新規で作成する

AC_DEFUNで関数名を定義し、[]内に処理を記載する
例) custom.m4
```
AC_DEFUN([DUMP_VARS], [
    AC_MSG_NOTICE([Running custom macro...])
    declare -p
])
```

#### configure.acで呼び出す
```sh
m4_include([custom.m4])
DUMP_VARS
```

### Makefile.amに変数を渡す
#### configure.ac内の変数を渡す
AC_SUBSTの第１引数に変数名、第２引数に設定する内容を記載する。
```
AC_SUBST([TARGET_OR_HOST], "$target_or_host")
```
#### configureに来た変数を渡す

`STAGING_DIR=/path/to/dir ./configure`などで変数が渡されてきた場合
そのままMakefileに渡す方法

```
AC_ARG_VAR(STAGING_DIR, [Staging directory for cross-compilation])
AC_SUBST([STAGING_DIR])
```

ちなみに`STAGING_DIR`はルートのMakefileでexportされているので
```
AC_SUBST([TARGET_ROOT_DIR],"$STAGING_DIR")
```
みたいな感じで変数名を変換したほうが良いと思う。


#### Makefile.amで条件処理を行う変数を渡す

x11の場合

上と組み合わせて使うと良いと思う
```
AM_CONDITIONAL(STAGING_DIR_SET, [test -n "${STAGING_DIR}"])
```

Makefile.am側では以下のように処理する
```
if STAGING_DIR_SET
CROSS_SYSROOT = --sysroot=$(STAGING_DIR)
else
CROSS_SYSROOT =
endif
```

`AM_CONDITIONAL`は存在しない場合もある
ソースコード内のm4ファイルをAC_DEFUNでgrepしたら
使用可能な関数がわかります

## libtool

### ltmain.sh

ビルドにlibtoolが使用されていてltmain.shがソースコード内に存在する場合
ltmain.shがlibtoolに変換される

ltmain.shは単なるシェルスクリプトだがコード量が膨大
また、libtoolに渡された引数は独自の処理が行われて、
実際に`gcc`に渡されるものには変換がかけられる

#### コンパイル時の処理
`func_mode_compile`で行う

#### リンク時の処理

`func_mode_link`で行う

##### 引数解析
6800行くらいの以下あたりから
```
for arg
do
```

##### コマンド実行
10000行くらいの以下あたりで$cmdにgccのコマンドラインが入っている

`$opt_dry_run || eval "$cmd" || {`


`cmd="$cmd [追加したいオプション]"`
などとやると無理やり通すことができる
とくに-Wl系はMakefileで指定してもlibtoolで弾かれるので

#### 自動patch
なお、ltmain.shはbuildroot側でpatchがされる場合がある
自前patchが先に行われるため、conflictした場合
buildrootのpatchを含めた自前patchを作成する必要がある

patchを作成するのはbuildで止まった場合だと思われるため、
大元のコードを取得し、git管理したあと
buildrootの自動patchが当たった(buildで止まった状態の)ものを上書きする
ここでcommitせずに修正したい箇所を修正すると
自動patchと自前の修正が合わさったdiffが出来る

buildroot側では同じ内容で再patchしないように
自動patchをoffにする
やり方は `[パッケージ名]_LIBTOOL_PATCH = NO`

例) libxml2の場合

package/libxml2/libxml2.mk
```diff
diff --git a/package/libxml2/libxml2.mk b/package/libxml2/libxml2.mk
index 8a5d703d..13dcb5ac 100644
--- a/package/libxml2/libxml2.mk
+++ b/package/libxml2/libxml2.mk
@@ -14,6 +14,7 @@ LIBXML2_LICENSE = MIT
 LIBXML2_LICENSE_FILES = Copyright
 LIBXML2_CPE_ID_VENDOR = xmlsoft
 LIBXML2_CONFIG_SCRIPTS = xml2-config
+LIBXML2_LIBTOOL_PATCH = NO
 
 # relocation truncated to fit: R_68K_GOT16O
 ifeq ($(BR2_m68k_cf),y)

```

## configure.in
configure.acが無くてconfigure.inしかない場合
[sdl](http://www.libsdl.org/release/SDL-1.2.15.tar.gz)のパターン

AM_CONDITIONALはm4内に存在しない
コンパイル時はconfigure.inでsysrootを指定するだけ
リンク時はltmain.shに手を入れる必要がある


```diff
diff --git a/build-scripts/ltmain.sh b/build-scripts/ltmain.sh
index 5e04f08..aa6b28d 100644
--- a/build-scripts/ltmain.sh
+++ b/build-scripts/ltmain.sh
@@ -4716,7 +4716,9 @@ func_mode_link ()
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
-
+    --sysroot=*)
+    sysroot=$arg
+    ;;
       -Wl,*)
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
@@ -7338,6 +7340,7 @@ EOF
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
+        cmd="$cmd $sysroot"
 	  $opt_dry_run || eval "$cmd" || {
 	    lt_exit=$?
 
diff --git a/configure.in b/configure.in
index f740e0c..dcb39af 100644
--- a/configure.in
+++ b/configure.in
@@ -82,6 +82,14 @@ case "$host" in
         BASE_LDFLAGS=""
         ;;
 esac
+
+if [[ "x${target}" != "x" ]] ; then
+    CFLAGS="$CFLAGS $(echo $CFLAGS_FOR_BUILD | sed -e 's/\/host\//\/target\/usr\//g') --sysroot=$STAGING_DIR"
+    CXXFLAGS="$CXXFLAGS $(echo $CXXFLAGS_FOR_BUILD | sed -e 's/\/host\//\/target\/usr\//g') --sysroot=$STAGING_DIR"
+    LDFLAGS="$LDFLAGS $(echo $LDFLAGS_FOR_BUILD | sed -e 's/\/host\//\/target\/usr\//g') --sysroot=$STAGING_DIR"
+    AC_SUBST([TARGET_OR_HOST], "$target")
+fi
+
 BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
 EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
 BUILD_LDFLAGS="$LDFLAGS"
```

`configure`に変換される際に`[]`が取り除かれる
したがって、`[`では無く`[[`にする必要があるので注意

## meson.build
cross-compilation.confにsysrootが書き込まれるが
肝心のmeson.build内で利用されていない
propertyをmeson.buildの変数に変換する必要がある

また、sys_root指定をしても
ライブラリチェック時のビルドには適用されないので
自分で適用する必要がある

例）pangoの場合
上の差分はpango自体のビルドに適用されるオプション
下の差分はライブラリチェック時のビルドに適用されるオプション

```diff
diff --git a/meson.build b/meson.build
index bf78d32..b3eddd2 100644
--- a/meson.build
+++ b/meson.build
@@ -54,6 +54,8 @@ common_cflags = []
 common_cppflags = []
 common_ldflags = []
 
+sys_root = meson.get_external_property('sys_root', '')
+
 # Add more compiler warnings to the default set
 if cc.get_id() == 'msvc'
   # Compiler options taken from msvc_recommended_pragmas.h
@@ -445,8 +447,14 @@ int main() {
   cairo_ft_font_face_create_for_pattern (p);
   return 0;
 }'''
+            if sys_root.strip() != ''
+              cross_sysroot = '--sysroot=' + sys_root
+            else
+              cross_sysroot =
+            endif
             if not cc.links(cairo_fc_test,
                             dependencies: dep,
+                            args: cross_sysroot,
                             name : 'Cairo is built with FreeType and FontConfig support')
               error('@0@ does not have the required FontConfig support'.format(b[0]))
             endif
```

### エラー変換されるwarningの取り除き方

例） `-Werror=redundant-decls`を取り除きたい場合
一旦別の配列変数を用意してそこに入れ込んだあと、入れ替える
filterとかは探した限りでは見当たらなかった

```diff
diff --git a/pango/meson.build b/pango/meson.build
index 82242ab..cafa33e 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -114,6 +114,14 @@ pango_cflags = [
 
 pango_inc = include_directories('.')
 
+temp_cflags = []
+foreach flag : common_cflags
+  if flag != '-Werror=redundant-decls'
+    temp_cflags += flag
+  endif
+endforeach
+common_cflags = temp_cflags
+
 libpango = library(
   pango_api_name,
   sources: pango_sources + pango_enums,

```



## ビルド

基本的には`V=1`をつけるのが吉

エラーが発生したら、エラー発生パッケージを一回きれいにしないと
なんとなくで通ってしまう可能性がある。
`make パッケージ名-dirclean`でビルドディレクトリごと削除される。
(ダウンロードしたものは別に保存されているので再ダウンロードはされない)

例) libinputでエラーが発生し、configure.acのパッチをおいて再ビルドする場合
```
make xdriver_xf86-input-libinput-dirclean && make V=1 2>&1 | tee build.log
```

### AUTORECONF
configure.acファイルがあるのにautoreconfが有効で無い場合
なるべく有効にした方が良いと思う。

例) twmでautoreconfを有効にする
```diff
diff --git a/package/x11r7/xapp_twm/xapp_twm.mk b/package/x11r7/xapp_twm/xapp_twm.mk
index b2228304..2bd563f9 100644
--- a/package/x11r7/xapp_twm/xapp_twm.mk
+++ b/package/x11r7/xapp_twm/xapp_twm.mk
@@ -11,5 +11,7 @@ XAPP_TWM_LICENSE = MIT
 XAPP_TWM_LICENSE_FILES = COPYING
 XAPP_TWM_DEPENDENCIES = \
        host-bison xlib_libX11 xlib_libXext xlib_libXt xlib_libXmu
+XAPP_TWM_AUTORECONF = YES
+XAPP_TWM_AUTORECONF_OPTS = --force
 
```

この場合修正はconfigureではなくconfigure.acで

## perl
`libopenssl`しか今のところ見つかってない

```diff
diff --git a/Configure b/Configure
index 77af4d7..53953df 100755
--- a/Configure
+++ b/Configure
@@ -1466,6 +1466,10 @@ foreach (keys %user) {
     delete $config{$_} unless defined $config{$_};
 }
 
+$useradd{CFLAGS}->[0] .= env('CFLAGS_FOR_BUILD');
+$useradd{CXXFLAGS}->[0] .= env('CXXFLAGS_FOR_BUILD');
+$useradd{LDFLAGS}->[0] .= env('LDFLAGS_FOR_BUILD');
+
 # Finish up %config by appending things the user gave us on the command line
 # apart from "make variables"
 foreach (keys %useradd) {

```

## gcc-15対応

gcc-15はまだリリースされてないので使う人いないと思うけど
以下の問題があるのでそのうち対応する必要が出てくると思う

https://qiita.com/ta_yano/questions/df75c9c24f3bcdce2bdd

対応方法としてはCFLAGSに`-std=c99`(c17まではOK)をつけるだけ

gmpの例
```diff
diff --git a/package/gmp/gmp.mk b/package/gmp/gmp.mk
index 7e8da9025c..e37e41366d 100644
--- a/package/gmp/gmp.mk
+++ b/package/gmp/gmp.mk
@@ -33,5 +33,7 @@ else
 GMP_CONF_OPTS += --disable-cxx
 endif
 
+HOST_GMP_CONF_OPTS += "CFLAGS=-std=c99"
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))

```
なぜかhostでない方はすでに`-std=c99`がついていたという

# 確認
以下でビルドを通してみた(~~動作確認は未~~)

https://github.com/tyano463/rock4cp/commit/fb5f5b337339cf1e681c5882cfaba82f741c8a72

<details><summary>使った.configファイル</summary>

```
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_9=y
BR2_HOST_GCC_AT_LEAST_5=y
BR2_HOST_GCC_AT_LEAST_6=y
BR2_HOST_GCC_AT_LEAST_7=y
BR2_HOST_GCC_AT_LEAST_8=y
BR2_HOST_GCC_AT_LEAST_9=y
BR2_HOST_GCC_AT_LEAST_10=y
BR2_HOST_GCC_AT_LEAST_11=y
BR2_ARCH_IS_64=y
BR2_USE_MMU=y
BR2_aarch64=y
BR2_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ACKAGE_GLIBC_ARCH_SUPPORTS=y
BR2_PACKAGE_GLIBC_SUPPORTS=y
BR2_PACKAGE_GLIBC=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI=y
BR2_BINUTILS_VERSION_2_42_X=y
BR2_BINUTILS_VERSION="2.42"
BR2_BINUTILS_EXTRA_CONFIG_OPTIONS=""
BR2_GCC_VERSION_13_X=y
BR2_GCC_VERSION="13.3.0"
BR2_EXTRA_GCC_CONFIG_OPTIONS=""
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_GCC_FINAL=y
BR2_PACKAGE_HOST_GDB_ARCH_SUPPORTS=y
BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS=y
BR2_TOOLCHAIN_SUPPORTS_VARIADIC_MI_THUNK=y
BR2_USE_WCHAR=y
BR2_ENABLE_LOCALE=y
BR2_INSTALL_LIBSTDCPP=y
BR2_TOOLCHAIN_HAS_THREADS=y
BR2_TOOLCHAIN_HAS_THREADS_DEBUG=y
BR2_TOOLCHAIN_HAS_THREADS_NPTL=y
BR2_TOOLCHAIN_HAS_SSP=y
BR2_TOOLCHAIN_HAS_SSP_STRONG=y
BR2_TOOLCHAIN_HAS_UCONTEXT=y
BR2_TOOLCHAIN_SUPPORTS_PIE=y
BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY=y
BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST=""
BR2_TOOLCHAIN_EXTRA_LIBS=""
BR2_TOOLCHAIN_HAS_FULL_GETTEXT=y
BR2_TARGET_OPTIMIZATION=""
BR2_TARGET_LDFLAGS=""
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_3=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_5=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_6=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_7=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_8=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_11=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_12=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_13=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_0=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_1=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_2=y
BR2_TOOLCHAIN_HEADERS_AT_LE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BR2_SFTP="sftp"
BR2_HG="hg"
BR2_ZCAT="gzip -d -c"
BR2_BZCAT="bzcat"
BR2_XZCAT="xzcat"
BR2_LZCAT="lzip -d -c"
BR2_ZSTDCAT="zstdcat"
BR2_TAR_OPTIONS=""
BR2_DEFCONFIG="/home/tyano/workspace/buildroot/rockchip/rk3399/buildroot/configs/rock4cp_defconfig"
BR2_DL_DIR="$(TOPDIR)/dl"
BR2_HOST_DIR="$(BASE_DIR)/host"
BR2_PRIMARY_SITE=""
BR2_BACKUP_SITE="https://sources.buildroot.net"
BR2_KERNEL_MIRROR="https://cdn.kernel.org/pub"
BR2_GNU_MIRROR="https://ftpmirror.gnu.org"
BR2_LUAROCKS_MIRROR="http://rocks.moonscript.org"
BR2_CPAN_MIRROR="https://cpan.metacpan.org"
BR2_JLEVEL=0
BR2_STRIP_strip=y
BR2_STRIP_EXCLUDE_FILES=""
BR2_STRIP_EXCLUDE_DIRS=""
BR2_OPTIMIZE_2=y
BR2_SHARED_LIBS=y
BR2_PACKAGE_OVERRIDE_FILE="$(CONFIG_DIR)/local.mk"
BR2_GLOBAL_PATCH_DIR="board/radxa/rock4cp/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_PIC_PIE_ARCH_SUPPORTS=y
BR2_PIC_PIE=y
BR2_SSP_STRONG=y
BR2_SSP_OPTION="-fstack-protector-strong"
BR2_RELRO_FULL=y
BR2_FORTIFY_SOURCE_ARCH_SUPPORTS=y
BR2_FORTIFY_SOURCE_1=y
BR2_ROOTFS_SKELETON_DEFAULT=y
BR2_TARGET_GENERIC_HOSTNAME="rock4cp"
BR2_TARGET_GENERIC_ISSUE="Welcome to the rock4c+ board"
BR2_TARGET_GENERIC_PASSWD_SHA256=y
BR2_TARGET_GENERIC_PASSWD_METHOD="sha-256"
BR2_INIT_BUSYBOX=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt"
BR2_ROOTFS_MERGED_USR=y
BR2_TARGET_ENABLE_ROOT_LOGIN=y
BR2_TARGET_GENERIC_ROOT_PASSWD=""
BR2_SYSTEM_BIN_SH_BUSYBOX=y
BR2_TARGET_GENERIC_GETTY=y
BR2_TARGET_GENERIC_GETTY_PORT="console"
BR2_TARGET_GENERIC_GETTY_BAUDRATE_KEEP=y
BR2_TARGET_GENERIC_GETTY_BAUDRATE="0"
BR2_TARGET_GENERIC_GETTY_TERM="vt100"
BR2_TARGET_GENERIC_GETTY_OPTIONS=""
BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW=y
BR2_SYSTEM_DHCP="eth0"
BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin"
BR2_ENABLE_LOCALE_PURGE=y
BR2_ENABLE_LOCALE_WHITELIST="C en_US"
BR2_GENERATE_LOCALE=""
BR2_ROOTFS_USERS_TABLES=""
BR2_ROOTFS_OVERLAY="board/radxa/rock4cp/overlay/"
BR2_ROOTFS_PRE_BUILD_SCRIPT=""
BR2_ROOTFS_POST_BUILD_SCRIPT="board/radxa/rock4cp/post-build.sh"
BR2_ROOTFS_POST_FAKEROOT_SCRIPT=""
BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/radxa/rock4cp/genimage.cfg"
BR2_ROOTFS_POST_BUILD_SCRIPT_ARGS=""
BR2_ROOTFS_POST_IMAGE_SCRIPT_ARGS=""
BR2_LINUX_KERNEL=y
BR2_LINUX_NEEDS_MODULES=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.7.4"
BR2_LINUX_KERNEL_VERSION="6.7.4"
BR2_LINUX_KERNEL_PATCH=""
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/radxa/rock4cp/linux.fragment"
BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH=""
BR2_LINUX_KERNEL_IMAGE=y
BR2_LINUX_KERNEL_GZIP=y
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3399-rock-4c-plus"
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH=""
BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_PACKAGE_BUSYBOX=y
BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"
BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES=""
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_SKELETON=y
BR2_PACKAGE_HAS_SKELETON=y
BR2_PACKAGE_PROVIDES_SKELETON="skeleton-init-sysv"
BR2_PACKAGE_SKELETON_INIT_COMMON=y
BR2_PACKAGE_SKELETON_INIT_SYSV=y
BR2_PACKAGE_FFMPEG_ARCH_SUPPORTS=y
BR2_PACKAGE_KODI_ARCH_SUPPORTS=y
BR2_PACKAGE_MPV_SUPPORTS_VAAPI=y
BR2_PACKAGE_PULSEAUDIO_HAS_ATOMIC=y
BR2_PACKAGE_GZIP=y
BR2_PACKAGE_XZ=y
BR2_PACKAGE_ZIP=y
BR2_PACKAGE_BPFTOOL_ARCH_SUPPORTS=y
BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS=y
BR2_PACKAGE_DELVE_ARCH_SUPPORTS=y
BR2_PACKAGE_FWTS_ARCH_SUPPORTS=y
BR2_PACKAGE_GDB_ARCH_SUPPORTS=y
BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS=y
BR2_PACKAGE_KEXEC_ARCH_SUPPORTS=y
BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS=y
BR2_PACKAGE_LTP_TESTSUITE_ARCH_SUPPORTS=y
BR2_PACKAGE_LTRACE_ARCH_SUPPORTS=y
BR2_PACKAGE_OPROFILE_ARCH_SUPPORTS=y
BR2_PACKAGE_PERFTEST_ARCH_SUPPORTS=y
BR2_PACKAGE_PLY_ARCH_SUPPORTS=y
BR2_PACKAGE_PTM2HUMAN_ARCH_SUPPORTS=y
BR2_PACKAGE_TCF_AGENT_ARCH="a64"
BR2_PACKAGE_TCF_AGENT_ARCH_SUPPORTS=y
BR2_PACKAGE_TRINITY_ARCH_SUPPORTS=y
BR2_PACKAGE_UFTRACE_ARCH_SUPPORTS=y
BR2_PACKAGE_VALGRIND_ARCH_SUPPORTS=y
BR2_PACKAGE_CMAKE_ARCH_SUPPORTS=y
BR2_PACKAGE_PROVIDES_HOST_GETTEXT="host-gettext-tiny"
BR2_PACKAGE_NETSURF_ARCH_SUPPORTS=y
BR2_PACKAGE_DIRECTFB=y
BR2_PACKAGE_DIRECTFB_DEBUG_SUPPORT=y
BR2_PACKAGE_DIRECTFB_LINUXINPUT=y
BR2_PACKAGE_DIRECTFB_KEYBOARD=y
BR2_PACKAGE_DIRECTFB_PS2MOUSE=y
BR2_PACKAGE_DIRECTFB_SERIALMOUSE=y
BR2_PACKAGE_DIRECTFB_TSLIB=y
BR2_PACKAGE_DIRECTFB_GIF=y
BR2_PACKAGE_DIRECTFB_JPEG=y
BR2_PACKAGE_DIRECTFB_PNG=y
BR2_PACKAGE_DIRECTFB_SVG=y
BR2_PACKAGE_LINUX_FUSION=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_QT5_JSCORE_AVAILABLE=y
BR2_PACKAGE_QT6_ARCH_SUPPORTS=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_XSERVER_XORG_SERVER=y
BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR=y
BR2_PACKAGE_LIBXCB=y
BR2_PACKAGE_XCB_UTIL=y
BR2_PACKAGE_XCB_UTIL_CURSOR=y
BR2_PACKAGE_XCB_UTIL_IMAGE=y
BR2_PACKAGE_XCB_UTIL_KEYSYMS=y
BR2_PACKAGE_XCB_U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_XDRIVER_XF86_VIDEO_FBDEV=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_VESA=y
BR2_PACKAGE_XFONT_FONT_UTIL=y
BR2_PACKAGE_XFONT_ENCODINGS=y
BR2_PACKAGE_XFONT_FONT_ALIAS=y
BR2_PACKAGE_XFONT_FONT_CURSOR_MISC=y
BR2_PACKAGE_XFONT_FONT_MISC_MISC=y
BR2_PACKAGE_XCB_PROTO=y
BR2_PACKAGE_XORGPROTO=y
BR2_PACKAGE_MCOOKIE=y
BR2_PACKAGE_XDATA_XBITMAPS=y
BR2_PACKAGE_XTERM=y
BR2_PACKAGE_XKEYBOARD_CONFIG=y
BR2_PACKAGE_LINUX_FIRMWARE=y
BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y
BR2_PACKAGE_ACPID=y
BR2_PACKAGE_DBUS=y
BR2_PACKAGE_EUDEV=y
BR2_PACKAGE_PROVIDES_UDEV="eudev"
BR2_PACKAGE_EUDEV_MODULE_LOADING=y
BR2_PACKAGE_EUDEV_ENABLE_HWDB=y
BR2_PACKAGE_EVTEST=y
BR2_PACKAGE_FLASHROM_ARCH_SUPPORTS=y
BR2_PACKAGE_MDEVD=y
BR2_PACKAGE_ROCKCHIP_RKBIN=y
BR2_PACKAGE_ROCKCHIP_RKBIN_TPL_FILENAME="bin/rk33/rk3399_ddr_933MHz_v1.30.bin"
BR2_PACKAGE_ROCKCHIP_RKBIN_BL31_FILENAME="bin/rk33/rk3399_bl31_v1.36.elf"
BR2_PACKAGE_ROCKCHIP_RKBIN_TEE_FILENAME=""
BR2_PACKAGE_SEDUTIL_ARCH_SUPPORTS=y
BR2_PACKAGE_HAS_UDEV=y
BR2_PACKAGE_HOST_ERLANG_ARCH_SUPPORTS=y
BR2_PACKAGE_ERLANG_ARCH_SUPPORTS=y
BR2_PACKAGE_PROVIDES_HOST_LUAINTERPRETER="host-lua"
BR2_PACKAGE_LUAJIT_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_MONO_ARCH_SUPPORTS=y
BR2_PACKAGE_MONO_ARCH_SUPPORTS=y
BR2_PACKAGE_NODEJS_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_OPENJDK_BIN_ARCH_SUPPORTS=y
BR2_PACKAGE_OPENJDK_ARCH_SUPPORTS=y
BR2_PACKAGE_PHP_ARCH_SUPPORTS=y
BR2_PACKAGE_SWIPL_ARCH_SUPPORTS=y
BR2_PACKAGE_FDK_AAC_ARCH_SUPPORTS=y
BR2_PACKAGE_GTKIOSTREAM_ARCH_SUPPORTS=y
BR2_PACKAGE_OPENAL_ARCH_SUPPORTS=y
BR2_PACKAGE_WEBRTC_AUDIO_PROCESSING_ARCH_SUPPORTS=y
BR2_PACKAGE_LIBZIP=y
BR2_PACKAGE_ZLIB_NG_ARCH_SUPPORTS=y
BR2_PACKAGE_ZLIB=y
BR2_PACKAGE_LIBZLIB=y
BR2_PACKAGE_HAS_ZLIB=y
BR2_PACKAGE_PROVIDES_ZLIB="libzlib"
BR2_PACKAGE_PROVIDES_HOST_ZLIB="host-libzlib"
BR2_PACKAGE_BOTAN_ARCH_SUPPORTS=y
BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS=y
BR2_PACKAGE_LIBGPG_ERROR_SYSCFG="aarch64-unknown-linux-gnu"
BR2_PACKAGE_LIBSHA1=y
BR2_PACKAGE_LIBSPDM_CPU_FAMILY="aarch64"
BR2_PACKAGE_LIBSPDM_ARCH_SUPPORTS=y
BR2_PACKAGE_LIBRESSL_ARCH_SUPPORTS=y
BR2_PACKAGE_PROVIDES_HOST_OPENSSL="host-libopenssl"
BR2_PACKAGE_WOLFSSL_ASM_SUPPORTS=y
BR2_PACKAGE_MONGODB_ARCH_SUPPORTS=y
BR2_PACKAGE_ROCKSDB_ARCH_SUPPORTS=y
BR2_PACKAGE_BAYER2RGB_NEON_ARCH_SUPPORTS=y
BR2_PACKAGE_CAIRO=y
BR2_PACKAGE_CAIRO_PNG=y
BR2_PACKAGE_FLUTTER_ENGINE_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=y
BR2_PACKAGE_KMOD=y
BR2_PACKAGE_LIBVIRT_ARCH_SUPPORTS=y
BR2_PACKAGE_MAKEDUMPFILE_ARCH_SUPPORTS=y
BR2_PACKAGE_OPENVMTOOLS_ARCH_SUPPORTS=y
BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS=y
BR2_PACKAGE_SYSTEMD_BOOTCHART_ARCH_SUPPORTS=y
BR2_PACKAGE_UTIL_LINUX=y
BR2_PACKAGE_UTIL_LINUX_LIBS=y
BR2_PACKAGE_UTIL_LINUX_LIBBLKID=y
BR2_PACKAGE_UTIL_LINUX_LIBUUID=y
BR2_PACKAGE_XVISOR_ARCH_SUPPORTS=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_GEN=4
BR2_TARGET_ROOTFS_EXT2_REV=1
BR2_TARGET_ROOTFS_EXT2_LABEL="rootfs"
BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
BR2_TARGET_ROOTFS_EXT2_INODES=0
BR2_TARGET_ROOTFS_EXT2_INODE_SIZE=256
BR2_TARGET_ROOTFS_EXT2_RESBLKS=5
BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O ^64bit"
BR2_TARGET_ROOTFS_EXT2_NONE=y
BR2_TARGET_ROOTFS_TAR=y
BR2_TARGET_ROOTFS_TAR_NONE=y
BR2_TARGET_ROOTFS_TAR_OPTIONS=""
BR2_TARGET_EDK2_ARCH_SUPPORTS=y
BR2_TARGET_GRUB2_ARCH_SUPPORTS=y
BR2_PACKAGE_SHIM_ARCH_SUPPORTS=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.01"
BR2_TARGET_UBOOT_VERSION="2024.01"
BR2_TARGET_UBOOT_PATCH=""
BR2_TARGET_UBOOT_USE_DEFCONFIG=y
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="rock-4c-plus-rk3399"
BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES=""
BR2_TARGET_UBOOT_DEFAULT_ENV_FILE=""
BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
BR2_TARGET_UBOOT_NEEDS_ROCKCHIP_RKBIN=y
BR2_TARGET_UBOOT_FORMAT_BIN=y
BR2_TARGET_UBOOT_CUSTOM_DTS_PATH=""
BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS=""
BR2_PACKAGE_HOST_ARM_GNU_TOOLCHAIN_SUPPORTS=y
BR2_HOST_CMAKE_AT_LEAST="3.18"
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_DTC=y
BR2_PACKAGE_HOST_E2FSPROGS=y
BR2_PACKAGE_HOST_EUDEV=y
BR2_PACKAGE_HOST_FLUTTER_SDK_BIN_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS=y
BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_GO_HOST_CGO_LINKING_SUPPORTS=y
BR2_PACKAGE_PROVIDES_HOST_GO="host-go-bin"
BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH="amd64"
BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE1_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_GOOGLE_BREAKPAD_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_KMOD=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_NODEJS_BIN_ARCH_SUPPORTS=y
BR2_PACKAGE_PROVIDES_HOST_NODEJS="host-nodejs-bin"
BR2_PACKAGE_HOST_PATCHELF=y
BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS=y
BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_RUSTC_ARCH="aarch64"
BR2_PACKAGE_PROVIDES_HOST_RUSTC="host-rust-bin"
BR2_PACKAGE_HOST_UTIL_LINUX=y
BR2_PACKAGE_IPMITOOL_PEN_REG_URI=""
BR2_PACKAGE_WATCHDOGD_GENERIC_POLL=0
BR2_PACKAGE_WATCHDOGD_LOADAVG_POLL=0
BR2_PACKAGE_WATCHDOGD_FILENR_POLL=0
BR2_PACKAGE_WATCHDOGD_MEMINFO_POLL=0
BR2_PACKAGE_QEMU_CUSTOM_TARGETS=""
BR2_TARGET_ROOTFS_OCI_ENTRYPOINT_ARGS=""
BR2_TARGET_GRUB2_BUILTIN_MODULES=""
BR2_TARGET_GRUB2_BUILTIN_CONFIG=""
BR2_PACKAGE_REFPOLICY_POLICY_VERSION=""
BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS=""
BR2_XTENSA_OVERLAY_DIR=""
BR2_XTENSA_CUSTOM_NAME=""
BR2_TARGET_ROOTFS_EXT2_BLOCKS=0
BR2_TARGET_ROOTFS_EXT2_EXTRA_INODES=0
BR2_TARGET_ROOTFS_EXT2_EXTRA_BLOCKS=0
BR2_TARGET_UBOOT_CUSTOM_PATCH_DIR=""
```

</details>

# 24/12/18追記

qemuのvirtで動作確認出来ました。
使用した起動コマンドは以下です。

```
sudo qemu-system-aarch64 -M virt -cpu cortex-a710 -m 2048 -kernel output/images/Image -device virtio-gpu -display gtk,show-cursor=on -append "root=/dev/vda console=ttyS0" -drive if=pflash,format=raw,file=efi.img,readonly=on -drive if=pflash,format=raw,file=varstore.img -drive file=./output/images/rootfs.ext2,if=virtio,format=raw -netdev tap,ifname=tap0,script=no,downscript=no,id=my_net_id -device driver=virtio-net,netdev=my_net_id -device qemu-xhci -serial stdio -device usb-mouse -device usb-kbd -device usb-tablet -vnc :0
```

varstore.imgとefi.imgは以下です。
ubuntuだとQEMU_EFI.fdのインストール場所は変わると思いますが
edk2のインストール先にあると思います。
```
truncate -s 64m varstore.img
truncate -s 64m efi.img
dd if=/usr/share/edk2/aarch64/QEMU_EFI.fd of=efi.img conv=notrunc
```

`-device usb-tablet`を追加しないとマウスがプルプルしました。

![aarch64-linux-gui.gif](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3786381/33d8a6c5-415a-e506-2d65-0df792240c20.gif)

カーネルのコンフィギュレーションで
`CONFIG_DRM_VIRTIO_GPU`を有効にして
xorg.confを以下のようにする必要がありました。(ボード名はmenuconfigしたものに変更する)
```shell
$ cat board/radxa/rock4cp/overlay/etc/X11/xorg.conf 
Section "InputClass"
    Identifier "Mouse"
    MatchIsPointer "yes"
    Driver "libinput"
EndSection

Section "InputClass"
    Identifier "Keyboard"
    MatchIsKeyboard "yes"
    Driver "libinput"
EndSection

Section "Device"
    Identifier "Device0"
    Driver "modesetting"
EndSection

Section "Monitor"
    Identifier "Monitor0"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1024x768"
    EndSubSection
EndSection
```