drm2netbsd revision 1.3
11.1Sriastrad#!/bin/sh
21.1Sriastrad
31.3Sriastrad#	$NetBSD: drm2netbsd,v 1.3 2021/12/19 00:25:13 riastradh Exp $
41.1Sriastrad#
51.1Sriastrad# $ /path/to/drm2netbsd > /path/to/files.drm.new
61.1Sriastrad#
71.1Sriastrad# Run from the directory that came from drivers/gpu/drm.
81.1Sriastrad
91.1Sriastradset -Ceu
101.1Sriastrad
111.1Sriastrad# Location of the DRMKMS sources relative to $NETBSDSRCDIR.
121.1Sriastraddrmkms_top=external/bsd/drm2/dist/drm
131.1Sriastrad
141.1Sriastrad# config(5) flag for the DRMKMS driver.
151.1Sriastraddrmkms_flag=drmkms
161.1Sriastrad
171.1Sriastradenv CONFIG_PCI=y \
181.1Sriastradenv CONFIG_AGP=y \
191.2Sriastradenv CONFIG_DRM_FBDEV_EMULATION=y \
201.3Sriastradenv CONFIG_DRM_VM=y \
211.1Sriastradmake -f Makefile -V '$(drm-y)' -V '$(drm_kms_helper-y)' \
221.1Sriastrad| tr ' ' '\n' \
231.1Sriastrad| grep -v '^$' \
241.1Sriastrad| sed -e 's,\.o$,.c,' \
251.1Sriastrad| sort -u \
261.1Sriastrad| while read f; do
271.1Sriastrad	printf 'file\t%s\t%s\n' "$drmkms_top/$f" "$drmkms_flag"
281.1Sriastraddone
29