]>
Commit | Line | Data |
---|---|---|
628b5aed TG |
1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings FATAL => 'all'; | |
5 | ||
6 | # This was taken from the linux-image-5.16.0-3-arm64-unsigned | |
7 | # Than it was copied as .config in the asahi tree | |
8 | # Than make olddefconfig was executed twice | |
c6eade91 | 9 | my @lines = `cat config`; |
628b5aed TG |
10 | chomp @lines; |
11 | ||
12 | my %asahi_options = ( | |
13 | 'CONFIG_APPLE_ADMAC' => 'y', | |
14 | 'CONFIG_APPLE_AIC' => 'y', | |
15 | 'CONFIG_APPLE_DART' => 'y', | |
16 | 'CONFIG_APPLE_MAILBOX' => 'y', | |
17 | 'CONFIG_APPLE_PLATFORMS' => 'y', | |
18 | 'CONFIG_APPLE_PMGR_PWRSTATE' => 'y', | |
19 | 'CONFIG_APPLE_RTKIT' => 'y', | |
20 | 'CONFIG_APPLE_SART' => 'y', | |
21 | 'CONFIG_APPLE_SMC' => 'y', | |
22 | 'CONFIG_APPLE_SMC_RTKIT' => 'y', | |
23 | 'CONFIG_APPLE_WATCHDOG' => 'y', | |
24 | 'CONFIG_ARCH_APPLE' => 'y', | |
25 | 'CONFIG_ARM_APPLE_SOC_CPUFREQ' => 'y', | |
26 | 'CONFIG_BRCMFMAC' => 'm', | |
27 | 'CONFIG_BRCMFMAC_PCIE' => 'y', | |
28 | 'CONFIG_CFG80211_WEXT' => 'y', | |
29 | 'CONFIG_CHARGER_MACSMC' => 'y', | |
30 | 'CONFIG_COMMON_CLK_APPLE_NCO' => 'y', | |
31 | 'CONFIG_DRM' => 'y', | |
4abf6f9d | 32 | 'CONFIG_DRM_SIMPLEDRM' => 'y', |
628b5aed TG |
33 | 'CONFIG_FW_LOADER_USER_HELPER' => 'n', |
34 | 'CONFIG_FW_LOADER_USER_HELPER_FALLBACK' => 'n', | |
35 | 'CONFIG_GPIO_MACSMC' => 'y', | |
36 | 'CONFIG_HID_APPLE' => 'y', | |
37 | 'CONFIG_HID_MAGICMOUSE' => 'y', | |
38 | 'CONFIG_I2C_APPLE' => 'y', | |
39 | 'CONFIG_MFD_APPLE_SPMI_PMU' => 'y', | |
40 | 'CONFIG_MMC_SDHCI_PCI' => 'y', | |
41 | 'CONFIG_NLMON' => 'm', | |
42 | 'CONFIG_NVMEM_SPMI_MFD' => 'y', | |
43 | 'CONFIG_NVME_APPLE' => 'y', | |
44 | 'CONFIG_PCIE_APPLE' => 'y', | |
45 | 'CONFIG_PINCTRL_APPLE_GPIO' => 'y', | |
46 | 'CONFIG_POWER_RESET_MACSMC' => 'y', | |
47 | 'CONFIG_RTC_DRV_MACSMC' => 'y', | |
48 | 'CONFIG_SND_SIMPLE_CARD' => 'y', | |
49 | 'CONFIG_SND_SOC_APPLE_MCA' => 'y', | |
50 | 'CONFIG_SND_SOC_APPLE_SILICON' => 'y', | |
51 | 'CONFIG_SND_SOC_CS42L42' => 'y', | |
52 | 'CONFIG_SND_SOC_TAS2770' => 'm', | |
53 | 'CONFIG_SPI_APPLE' => 'y', | |
54 | 'CONFIG_SPI_HID_APPLE_CORE' => 'y', | |
55 | 'CONFIG_SPI_HID_APPLE_OF' => 'y', | |
56 | 'CONFIG_SPMI_APPLE' => 'y', | |
57 | 'CONFIG_USB_DWC3' => 'y', | |
58 | 'CONFIG_USB_DWC3_PCI' => 'y', | |
c6eade91 | 59 | 'CONFIG_FB_EFI' => 'y', |
fdbce99a TG |
60 | 'CONFIG_BACKLIGHT_CLASS_DEVICE' => 'y', |
61 | 'CONFIG_BACKLIGHT_GPIO' => 'm', | |
03e35824 | 62 | 'CONFIG_TYPEC_TPS6598X' => 'y', |
9d961f8a | 63 | 'CONFIG_BT_HCIBCM4377' => 'm', |
b1bdeb59 TG |
64 | 'CONFIG_HID_DOCKCHANNEL' => 'm', |
65 | 'CONFIG_APPLE_DOCKCHANNEL' => 'm', | |
628b5aed TG |
66 | ); |
67 | ||
68 | my %debian_options; | |
69 | ||
70 | for (@lines) { | |
71 | if (/(^CONFIG_[^=]+)=(.*)/) { | |
72 | $debian_options{$1} = $2; | |
73 | } | |
74 | } | |
75 | ||
76 | for my $o (keys %asahi_options) { | |
03e35824 | 77 | if ((not exists $debian_options{$o}) && $asahi_options{$o} ne 'n') { |
628b5aed TG |
78 | print "$o missing, adding\n"; |
79 | $debian_options{$o} = $asahi_options{$o}; | |
03e35824 TG |
80 | } elsif ((exists $debian_options{$o}) && ($asahi_options{$o} eq 'n')) { |
81 | print "$o present, removing\n"; | |
82 | delete $debian_options{$o}; | |
83 | } elsif ((exists $asahi_options{$o} && exists $debian_options{$o}) && ($debian_options{$o} ne $asahi_options{$o})) { | |
84 | print "$o different\n"; | |
628b5aed TG |
85 | } |
86 | } | |
87 | ||
03e35824 | 88 | open(CONFIG, '>', 'config.new') || die; |
628b5aed TG |
89 | for (keys %debian_options) { |
90 | print CONFIG $_ . '=' . $debian_options{$_} . "\n"; | |
91 | } | |
92 | close CONFIG; |