From 1a2e298809ca2edf6ce093884305adff3110e402 Mon Sep 17 00:00:00 2001 From: orangepi-xunlong <258384131@qq.com> Date: Thu, 17 Aug 2023 21:32:52 +0800 Subject: [PATCH] Add raspi-config --- external/cache/sources/raspi-config/LICENSE | 26 + .../sources/raspi-config/autologin@.service | 47 + .../sources/raspi-config/debian/.gitignore | 6 + .../sources/raspi-config/debian/changelog | 1012 +++++ .../cache/sources/raspi-config/debian/compat | 1 + .../cache/sources/raspi-config/debian/control | 15 + .../sources/raspi-config/debian/copyright | 25 + .../raspi-config/debian/raspi-config.init | 57 + .../raspi-config/debian/raspi-config.install | 3 + .../raspi-config/debian/raspi-config.postinst | 33 + .../raspi-config/debian/raspi-config.postrm | 20 + .../raspi-config/debian/raspi-config.prerm | 36 + .../cache/sources/raspi-config/debian/rules | 16 + .../sources/raspi-config/debian/source/format | 1 + .../raspi-config/etc/default/cpu_governor | 35 + .../raspi-config/etc/sudoers.d/010_proxy | 5 + .../cache/sources/raspi-config/raspi-config | 3309 +++++++++++++++++ .../usr/lib/raspi-config/cmstart.sh | 6 + .../usr/lib/raspi-config/init_resize.sh | 227 ++ .../usr/share/raspi-config/10-blanking.conf | 11 + .../debs/raspi-config_20230214_all.deb | Bin 0 -> 33164 bytes .../stage1/03-install-packages/00-packages | 1 + scripts/distributions.sh | 7 +- 23 files changed, 4898 insertions(+), 1 deletion(-) create mode 100644 external/cache/sources/raspi-config/LICENSE create mode 100644 external/cache/sources/raspi-config/autologin@.service create mode 100644 external/cache/sources/raspi-config/debian/.gitignore create mode 100644 external/cache/sources/raspi-config/debian/changelog create mode 100644 external/cache/sources/raspi-config/debian/compat create mode 100644 external/cache/sources/raspi-config/debian/control create mode 100644 external/cache/sources/raspi-config/debian/copyright create mode 100644 external/cache/sources/raspi-config/debian/raspi-config.init create mode 100644 external/cache/sources/raspi-config/debian/raspi-config.install create mode 100644 external/cache/sources/raspi-config/debian/raspi-config.postinst create mode 100644 external/cache/sources/raspi-config/debian/raspi-config.postrm create mode 100644 external/cache/sources/raspi-config/debian/raspi-config.prerm create mode 100755 external/cache/sources/raspi-config/debian/rules create mode 100644 external/cache/sources/raspi-config/debian/source/format create mode 100644 external/cache/sources/raspi-config/etc/default/cpu_governor create mode 100644 external/cache/sources/raspi-config/etc/sudoers.d/010_proxy create mode 100755 external/cache/sources/raspi-config/raspi-config create mode 100755 external/cache/sources/raspi-config/usr/lib/raspi-config/cmstart.sh create mode 100755 external/cache/sources/raspi-config/usr/lib/raspi-config/init_resize.sh create mode 100644 external/cache/sources/raspi-config/usr/share/raspi-config/10-blanking.conf create mode 100644 external/packages/raspi/orangepi/debs/raspi-config_20230214_all.deb diff --git a/external/cache/sources/raspi-config/LICENSE b/external/cache/sources/raspi-config/LICENSE new file mode 100644 index 000000000000..dd318edc44ab --- /dev/null +++ b/external/cache/sources/raspi-config/LICENSE @@ -0,0 +1,26 @@ +raspi-config is licensed under the terms of the MIT license reproduced below. + +##################################################### + +Copyright (c) 2012 Alex Bradbury + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/external/cache/sources/raspi-config/autologin@.service b/external/cache/sources/raspi-config/autologin@.service new file mode 100644 index 000000000000..17a5be17bce3 --- /dev/null +++ b/external/cache/sources/raspi-config/autologin@.service @@ -0,0 +1,47 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Getty on %I +Documentation=man:agetty(8) man:systemd-getty-generator(8) +Documentation=http://0pointer.de/blog/projects/serial-console.html +After=systemd-user-sessions.service plymouth-quit-wait.service +After=rc-local.service + +# If additional gettys are spawned during boot then we should make +# sure that this is synchronized before getty.target, even though +# getty.target didn't actually pull it in. +Before=getty.target +IgnoreOnIsolate=yes + +# On systems without virtual consoles, don't start any getty. Note +# that serial gettys are covered by serial-getty@.service, not this +# unit. +ConditionPathExists=/dev/tty0 + +[Service] +# the VT is cleared by TTYVTDisallocate +ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=%I +TTYPath=/dev/%I +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes + +# Unset locale for the console getty since the console has problems +# displaying some internationalized messages. +Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= + +[Install] +WantedBy=getty.target +DefaultInstance=tty1 diff --git a/external/cache/sources/raspi-config/debian/.gitignore b/external/cache/sources/raspi-config/debian/.gitignore new file mode 100644 index 000000000000..7d7831645f6b --- /dev/null +++ b/external/cache/sources/raspi-config/debian/.gitignore @@ -0,0 +1,6 @@ +debhelper-build-stamp +files +*.debhelper.log +*.debhelper +*.substvars +raspi-config/ diff --git a/external/cache/sources/raspi-config/debian/changelog b/external/cache/sources/raspi-config/debian/changelog new file mode 100644 index 000000000000..874c1b644f18 --- /dev/null +++ b/external/cache/sources/raspi-config/debian/changelog @@ -0,0 +1,1012 @@ +raspi-config (20230214) bullseye; urgency=medium + + * do_wifi_ssid_passphrase: set scan_ssid on hidden network in dhcpcd case + - https://github.com/RPi-Distro/raspi-config/issues/209 + + -- Serge Schneider Tue, 14 Feb 2023 14:39:41 +0000 + +raspi-config (20221214) bullseye; urgency=medium + + [ Viacheslav Vasilyev ] + * Allow to change cpu governor settings by using default file (#203) + + [ Jorge Capona ] + * Filter wlan interfaces before using wpa_cli (#162) + * Specify wlan interface when setting wifi country (#205) + + [ platinum95 ] + * Add unit to fan temperature selection text (#201) + + [ Simon Long ] + * Check os_prefix when locating cmdline.txt + + [ Serge Schneider ] + * do_expand_rootfs: remove partition number check + * Avoid spam if os_prefix is not found + * Avoid raspi-config erroring out when setting wifi country in chroot + + -- Serge Schneider Wed, 14 Dec 2022 16:57:10 +0000 + +raspi-config (20221018) bullseye; urgency=medium + + * do_hostname: add fallback for cases when hostnamectl isn't suitable + + -- Serge Schneider Tue, 18 Oct 2022 12:28:15 +0100 + +raspi-config (20220920) bullseye; urgency=medium + + * Fix keymap setup + + -- Serge Schneider Tue, 20 Sep 2022 12:45:40 +0100 + +raspi-config (20220915) bullseye; urgency=medium + + * Don't attempt to run hostnamectl if dbus is not active + + -- Serge Schneider Thu, 15 Sep 2022 12:25:36 +0100 + +raspi-config (20220914) bullseye; urgency=medium + + * Make get_boot_cli work when systemd is not running + + -- Serge Schneider Wed, 14 Sep 2022 16:45:35 +0100 + +raspi-config (20220907+1) bullseye; urgency=medium + + * Remove /2, which was created by the typo in 20220901 + + -- Serge Schneider Wed, 07 Sep 2022 17:04:52 +0100 + +raspi-config (20220907) bullseye; urgency=medium + + * do_netconf: fix typo + + -- Serge Schneider Wed, 07 Sep 2022 10:04:56 +0100 + +raspi-config (20220901) bullseye; urgency=medium + + * Rework do_netconf + * Silence options used by firstboot + + -- Serge Schneider Thu, 01 Sep 2022 12:35:47 +0100 + +raspi-config (20220809) bullseye; urgency=medium + + [ Simon Long ] + * Modify ALSA switching to work with non-BCM devices + + [ Serge Schneider ] + * Make WLAN settings work with NetworkManager + * Migrate to crda-based regulatory domain management on upgrade + * do_wifi_ssid_passphrase: add flag to allow hashed passphrase input + * Switch to dhcpcd here if Imager < v1.7.3 was used to generate firstrun.sh + + -- Serge Schneider Tue, 09 Aug 2022 12:05:54 +0100 + +raspi-config (20220705) bullseye; urgency=medium + + * Add network config switching + + -- Simon Long Tue, 05 Jul 2022 14:12:28 +0100 + +raspi-config (20220506) bullseye; urgency=medium + + * Modify Wayland switching to work with AccountSettings + + -- Simon Long Fri, 06 May 2022 14:07:57 +0100 + +raspi-config (20220425) bullseye; urgency=medium + + * Tidy hardware detection functions + + -- Simon Long Mon, 25 Apr 2022 17:38:35 +0100 + +raspi-config (20220419) bullseye; urgency=medium + + * Reinstate -R parameter for xcompmgr + + -- Simon Long Tue, 19 Apr 2022 10:36:34 +0100 + +raspi-config (20220331) bullseye; urgency=medium + + [ Serge Schneider ] + * Remove nonint whiptail msgbox in do_overlayfs + * Update get_boot_cli + * Remove legacy autologin cruft + * Run systemctl daemon-reload after boot behaviour changes + * Make autologin changes quieter + + [ Simon Long ] + * Add switching for experimental Wayland backend + * Fix incorrect detection of read-only boot partition + * Force xrandr to reload on non-mutter systems when overscan changed + + -- Serge Schneider Mon, 07 Mar 2022 09:26:38 +0000 + +raspi-config (20220303) bullseye; urgency=medium + + * Use wildcards for KMS test + + -- Simon Long Thu, 03 Mar 2022 13:44:04 +0000 + +raspi-config (20220301) bullseye; urgency=medium + + [ Serge Schneider ] + * pass -f flag to rm + * Fix init_resize.sh on Bullseye NOOBS images + + [ Simon Long ] + * Rename is_fkms function to is_kms + * Remove pixel doubling for KMS systems + * Add on-the-fly overscan setting for KMS systems + * Use in-built is_kms function for cmstart script + + -- Simon Long Tue, 01 Mar 2022 11:56:27 +0000 + +raspi-config (20220126) bullseye; urgency=medium + + * Modify overlay functions to match format of other nonint calls + + -- Simon Long Wed, 26 Jan 2022 14:55:17 +0000 + +raspi-config (20220112) bullseye; urgency=medium + + * Run apt-get with '-y' flag when in nonint mode + - https://github.com/RPi-Distro/raspi-config/issues/177 + + -- Serge Schneider Wed, 12 Jan 2022 09:04:54 +0000 + +raspi-config (20220110) bullseye; urgency=medium + + * Add -q flag to wait.conf + - https://github.com/RPi-Distro/raspi-config/issues/173 + + -- Serge Schneider Mon, 10 Jan 2022 11:54:26 +0000 + +raspi-config (20220106) bullseye; urgency=medium + + [ garyk10 ] + * Make nonint do_change_locale work with encoding field as well (#167) + + [ Aristo Chen ] + * Fix inconsistent indent (#165) + + -- Serge Schneider Thu, 06 Jan 2022 08:24:02 +0000 + +raspi-config (20211203) bullseye; urgency=medium + + * Correct labelling for x86 version as well + + -- Simon Long Thu, 02 Dec 2021 18:39:04 +0000 + +raspi-config (20211202) bullseye; urgency=medium + + * Correct labelling of entries in the interface menu + + -- Simon Long Thu, 02 Dec 2021 11:51:10 +0000 + +raspi-config (20211124) bullseye; urgency=medium + + * Legacy camera mode switch added + + -- Simon Long Wed, 24 Nov 2021 16:45:14 +0000 + +raspi-config (20211111) bullseye; urgency=medium + + * Changes to configuring of composite output under KMS + + -- Simon Long Thu, 11 Nov 2021 16:41:28 +0000 + +raspi-config (20211110) bullseye; urgency=medium + + * Add VNC resolution option + + -- Simon Long Wed, 10 Nov 2021 11:28:55 +0000 + +raspi-config (20211103) bullseye; urgency=medium + + * Use 'reboot' on initial resize instead of sysrq emergency reboot + + -- Serge Schneider Wed, 03 Nov 2021 17:50:52 +0000 + +raspi-config (20211019) bullseye; urgency=medium + + * Add switching of glamor acceleration + + -- Simon Long Tue, 19 Oct 2021 18:35:03 +0100 + +raspi-config (20210927) bullseye; urgency=medium + + * Remove resolution setting option under KMS + + -- Simon Long Mon, 27 Sep 2021 18:19:23 +0100 + +raspi-config (20210924) bullseye; urgency=medium + + * Remove fake KMS option + + -- Simon Long Fri, 24 Sep 2021 14:32:52 +0100 + +raspi-config (20210923) bullseye; urgency=medium + + * Updated the the wait.conf drop-in for the new dhcpcd5 package + + -- Serge Schneider Thu, 23 Sep 2021 18:24:05 +0100 + +raspi-config (20210922) bullseye; urgency=medium + + * Handle 73-usb-net-by-mac.link when toggling network names + - https://github.com/RPi-Distro/raspi-config/issues/166 + + -- Serge Schneider Wed, 22 Sep 2021 16:13:52 +0100 + +raspi-config (20210827) bullseye; urgency=medium + + * Add switching for new camera detection in firmware + + -- Simon Long Fri, 27 Aug 2021 16:13:49 +0100 + +raspi-config (20210816) bullseye; urgency=medium + + * Enable xcompmgr with full KMS as well as fKMS on all platforms + + -- Simon Long Mon, 16 Aug 2021 14:02:06 +0100 + +raspi-config (20210610) bullseye; urgency=medium + + * Remove redundant xcompmgr parameter + + -- Simon Long Thu, 10 Jun 2021 17:02:43 +0100 + +raspi-config (20210604) bullseye; urgency=medium + + * Disable xcompmgr when openbox not running + + -- Simon Long Fri, 04 Jun 2021 13:53:42 +0100 + +raspi-config (20210212) buster; urgency=medium + + * Update boot order menu + + -- Simon Long Fri, 12 Feb 2021 12:07:27 +0000 + +raspi-config (20210119) buster; urgency=medium + + * Move Pi 4 video output setting to advanced menu + + -- Simon Long Tue, 19 Jan 2021 14:51:58 +0000 + +raspi-config (20201108) buster; urgency=medium + + * Fix typo in fan controller + + -- Simon Long Sun, 08 Nov 2020 11:37:08 +0000 + +raspi-config (20201027) buster; urgency=medium + + * Add function to check whether board has an analog output jack + + -- Simon Long Tue, 27 Oct 2020 17:29:53 +0000 + +raspi-config (20201014) buster; urgency=medium + + * Add PulseAudio output control + * Restructure menus to match GUI application + + -- Simon Long Wed, 14 Oct 2020 14:59:35 +0100 + +raspi-config (20201006) buster; urgency=medium + + * Add fan control + + -- Simon Long Tue, 06 Oct 2020 15:17:39 +0100 + +raspi-config (20200902) buster; urgency=medium + + * Add option to control power LED on Pi Zero + + -- Simon Long Wed, 02 Sep 2020 11:46:19 +0100 + +raspi-config (20200817) buster; urgency=medium + + * Use processor ID to detect Pi 4 rather than board ID + + -- Simon Long Mon, 17 Aug 2020 09:24:09 +0100 + +raspi-config (20200727) buster; urgency=medium + + * Disable initial rfkill for all platforms when setting wireless country + + -- Simon Long Mon, 27 Jul 2020 15:47:29 +0100 + +raspi-config (20200707) buster; urgency=medium + + * Add boot ROM and boot order selection + + -- Simon Long Tue, 07 Jul 2020 09:24:56 +0100 + +raspi-config (20200601) buster; urgency=medium + + * Fix audio device check bug when used in non-English locale + + -- Simon Long Mon, 01 Jun 2020 10:28:35 +0100 + +raspi-config (20200515) buster; urgency=medium + + * Update initial resize script + - Change disk ID to avoid clashes + * Add support for USB resize + + -- Serge Schneider Fri, 15 May 2020 08:47:17 +0100 + +raspi-config (20200504) buster; urgency=medium + + * Replace references to wifi + + -- Simon Long Mon, 04 May 2020 11:47:53 +0100 + +raspi-config (20200226) buster; urgency=medium + + * Sync FKMS check with gldriver-test + * Fix is_pi check + + -- Serge Schneider Wed, 26 Feb 2020 17:51:20 +0000 + +raspi-config (20200207) buster; urgency=medium + + * Fix bug preventing VNC from being disabled + + -- Serge Schneider Fri, 07 Feb 2020 12:59:29 +0000 + +raspi-config (20200205) buster; urgency=medium + + * Add filter parameter to xrandr when setting pixel doubling + + -- Simon Long Wed, 05 Feb 2020 07:46:42 +0000 + +raspi-config (20200203) buster; urgency=medium + + * Add pixel doubling option for FKMS using xrandr + + -- Simon Long Mon, 03 Feb 2020 09:36:38 +0000 + +raspi-config (20200120) buster; urgency=medium + + * Add audio switching for discrete internal ALSA devices + + -- Simon Long Mon, 20 Jan 2020 11:38:37 +0000 + +raspi-config (20200117) buster; urgency=medium + + * Add proxy configuration + * Handle cases where SUDO_USER is unset + * Fix VNC options + * Install required packages when changing GL settings + * Add warning when enabling SSH + * OverlayFS - try loading module from rootfs + * OverlayFS - remove initramfs when disabled + + -- Serge Schneider Fri, 17 Jan 2020 11:50:54 +0000 + +raspi-config (20191210) buster; urgency=medium + + * Fix postrm script + + -- Serge Schneider Tue, 10 Dec 2019 14:22:08 +0000 + +raspi-config (20191209) buster; urgency=medium + + * Add option to enable/disable screen blanking + * Simplify source package + + -- Serge Schneider Mon, 09 Dec 2019 16:20:44 +0000 + +raspi-config (20191021) buster; urgency=medium + + * Add initramfs as dependency for overlayfs + + -- Simon Long Mon, 21 Oct 2019 14:44:54 +0100 + +raspi-config (20191008) buster; urgency=medium + + * Remove pixel doubling option for x86 + + -- Simon Long Tue, 08 Oct 2019 10:19:48 +0100 + +raspi-config (20191005) buster; urgency=medium + + * Add overlay file system functions + + -- Simon Long Fri, 05 Oct 2019 10:13:58 +0100 + +raspi-config (20190917) buster; urgency=medium + + * Enable overscan for FKMS + + -- Simon Long Tue, 17 Sep 2019 15:34:56 +0100 + +raspi-config (20190709) buster; urgency=medium + + * Rename hdmi_enable_4k to hdmi_enable_4kp60 + + -- Simon Long Tue, 09 Jul 2019 13:48:03 +0100 + +raspi-config (20190620) buster; urgency=medium + + * get_wifi_country: call save_config instead of reconfigure + - Prevents WiFi from disconnecting + + -- Serge Schneider Thu, 20 Jun 2019 20:01:06 +0100 + +raspi-config (20190619) buster; urgency=medium + + [ Simon Long ] + * Fix composite output options for Pi 4 + * Keep splash screen settings when changing GPU options + + -- Serge Schneider Wed, 19 Jun 2019 15:49:38 +0100 + +raspi-config (20190607) buster; urgency=medium + + [ Simon Long ] + * Only run xcompmgr if FKMS is enabled + + -- Serge Schneider Fri, 07 Jun 2019 16:11:11 +0100 + +raspi-config (20190520) buster; urgency=medium + + [ Simon Long ] + * Add Pi 4 video options + + -- Serge Schneider Mon, 20 May 2019 11:01:12 +0100 + +raspi-config (20190514) buster; urgency=medium + + [ Simon Long ] + * Add FKMS check + * Disable pixel doubling when FKMS is enabled + + -- Serge Schneider Tue, 14 May 2019 15:38:17 +0100 + +raspi-config (20190509) buster; urgency=medium + + * init_resize.sh: Remove sdhci.debug_quirks2=4 from /boot/cmdline.txt + + -- Serge Schneider Thu, 09 May 2019 13:38:34 +0100 + +raspi-config (20190507) buster; urgency=medium + + [ Simon Long ] + * Switch from compton to xcompmgr + * Tweak get_wifi_country to work with the desktop applet + + -- Serge Schneider Tue, 07 May 2019 16:03:15 +0100 + +raspi-config (20190502) buster; urgency=medium + + * Use wpa_cli to check WiFi country setting + + -- Serge Schneider Thu, 02 May 2019 13:22:49 +0100 + +raspi-config (20190429) buster; urgency=medium + + * Update do_wifi_country + - Enable wifi regardless of whether /run/wifi-country-unset exists + * Make sure SSH host keys are generated when SSH is enabled + -- Serge Schneider Mon, 29 Apr 2019 14:52:56 +0100 + +raspi-config (20190424) stretch; urgency=medium + + * Add Compton option to advanced options + + -- Simon Long Wed, 24 Apr 2019 13:45:54 +0100 + +raspi-config (20190423) stretch; urgency=medium + + * Change autologin $TERM; tweaks to overclock wording + + -- Simon Long Tue, 23 Apr 2019 08:19:08 +0100 + +raspi-config (20190219) stretch; urgency=medium + + * Update autologin behaviour for compatibility with buster + + -- Simon Long Tue, 19 Feb 2019 10:07:01 +0000 + +raspi-config (20181118) stretch; urgency=medium + + * Set TTY autologin correctly when using desktop autologin + + -- Simon Long Sun, 18 Nov 2018 10:59:01 +0000 + +raspi-config (20180518) stretch; urgency=medium + + * Add separate settings for serial hardware and console + + -- Simon Long Fri, 18 May 2018 07:29:57 +0100 + +raspi-config (20180406+1) stretch; urgency=medium + + * Fix Wi-Fi country setting + + -- Serge Schneider Fri, 06 Apr 2018 14:28:02 +0100 + +raspi-config (20180406) stretch; urgency=medium + + * Set Wi-Fi country while connecting to SSID + + -- Serge Schneider Fri, 06 Apr 2018 13:40:21 +0100 + +raspi-config (20180228) stretch; urgency=medium + + * Setting Wi-Fi country no longer requires a reboot + + -- Serge Schneider Wed, 28 Feb 2018 17:28:50 +0000 + +raspi-config (20171201) stretch; urgency=medium + + * Add pixel doubling option + + -- Simon Long Fri, 01 Dec 2017 08:05:53 +0000 + +raspi-config (20171127) stretch; urgency=medium + + * Allow entering SSID and passphrase (#68) + * Console keyboard layout changes effective immediately (#67) + * Formatting fixes (#70) + * Add non-interactive timezone, locale and keyboard configuration + * Modify architecture test for piserver + + -- Simon Long Mon, 27 Nov 2017 10:14:37 +0000 + +raspi-config (20170926) stretch; urgency=medium + + * Add option to enable predictable network interface names + + -- Serge Schneider Tue, 26 Sep 2017 12:32:25 +0100 + +raspi-config (20170811) stretch; urgency=medium + + * Only restart pigpio daemon if it is running + + -- Simon Long Fri, 11 Aug 2017 14:40:50 +0100 + +raspi-config (20170803) stretch; urgency=medium + + * Allow splash screen with fake KMS. + + -- Simon Long Thu, 03 Aug 2017 10:11:08 +0100 + +raspi-config (20170714) stretch; urgency=medium + + [Simon Long] + * Autologin operations now all use current user rather than defaulting to pi + * initd support removed + [Serge Schneider] + * Add pi model as backtitle + * Define memory split units + * Fix NOOBS config keyboard setup + + -- Serge Schneider Fri, 14 Jul 2017 12:34:21 +0100 + +raspi-config (20170711) stretch; urgency=medium + + * Fix wait for network option + * Bump compat level to 9 + + -- Serge Schneider Tue, 11 Jul 2017 11:47:34 +0100 + +raspi-config (20170704) stretch; urgency=medium + + * Remove unnecessary sudo from apt-get + + -- Simon Long Tue, 04 Jul 2017 10:28:55 +0100 + +raspi-config (20170627) stretch; urgency=medium + + * Change configuration for GL driver - no compton, keep fbturbo, allow on Pi 1 and Pi 0 + + -- Simon Long Tue, 27 Jun 2017 11:56:21 +0100 + +raspi-config (20170619) stretch; urgency=medium + + * Start service on all runlevels + + -- Serge Schneider Mon, 19 Jun 2017 09:14:40 +0000 + +raspi-config (20170518) jessie; urgency=medium + + * Improve x86 splash screen command line handling to remove spurious arguments and spaces + + -- Simon Long Thu, 18 May 2017 13:19:27 +0100 + +raspi-config (20170503) jessie; urgency=medium + + * Correctly handle GRUB command line options for splash screen on x86 + + -- Simon Long Wed, 03 May 2017 11:30:57 +0100 + +raspi-config (20170307) jessie; urgency=medium + + * Run init_resize.sh through shellcheck + * Improve init_resize.sh reliability + + -- Serge Schneider Tue, 07 Mar 2017 13:49:57 +0000 + +raspi-config (20170228) jessie; urgency=medium + + * Added detection of 0 W boards + + -- Simon Long Tue, 28 Feb 2017 10:06:36 +0000 + +raspi-config (20170214) jessie; urgency=medium + + * Allow compton with fake KMS driver; modified check for ARM architecture + + -- Simon Long Tue, 14 Feb 2017 14:47:58 +0000 + +raspi-config (20170127) jessie; urgency=medium + + * Prevent keyboard language from being configured over SSH + + -- Simon Long Fri, 27 Jan 2017 16:15:56 +0000 + +raspi-config (20170120) jessie; urgency=medium + + * Mods to support use on x86; fake KMS option added for GL driver + + -- Simon Long Fri, 20 Jan 2017 14:19:18 +0000 + +raspi-config (20161207) jessie; urgency=medium + + * Use compton for compositing with GL driver instead of xcompmgr + + -- Simon Long Wed, 07 Dec 2016 12:43:26 +0000 + +raspi-config (20161206) jessie; urgency=medium + + * Menus reorganised; resolution setting added + + -- Simon Long Tue, 06 Dec 2016 13:43:32 +0000 + +raspi-config (20161114) jessie; urgency=medium + + * Restore -a option for xcompmgr; disable splash screen with GL driver + + -- Simon Long Mon, 14 Nov 2016 14:25:19 +0000 + +raspi-config (20161108) jessie; urgency=medium + + * init_resize.sh: Remove clash with pix-plym-splash + + -- Serge Schneider Tue, 08 Nov 2016 17:34:00 +0000 + +raspi-config (20161102) jessie; urgency=medium + + * Sed processing of autologin options modified to improve robustness + + -- Simon Long Wed, 02 Nov 2016 15:02:45 +0000 + +raspi-config (20161013) jessie; urgency=medium + + * Rastrack option removed + * Splash screen control added + + -- Simon Long Thu, 13 Oct 2016 13:53:54 +0100 + +raspi-config (20160527) jessie; urgency=medium + + [ Simon Long ] + * Function to read hostname added + * Function added to get wifi country + * Functions to detect boot behaviour added + * Test functions added for remote GPIO and slow boot + * Added some functions to read current state for use by rc_gui + * Requirement for reboot removed from SPI and I2C settings + * A lot of NOTs taken out of serial test + * Status indications moved to end of some functions + * Overscan description amended + * Check for fs expandability added; overscan function matches others + * Added more success / fail feedback to settings + * Global check for mountpoint and existence of /boot/config.txt + * Checking of initial state added for camera and 1-wire + * Unnecessary reboots removed + * Some function names changed for consistency + * GL driver setting aligned with other functions + * Functions to control remote GPIO and boot wait for network aligned + * Tidied function to control remote GPIO access + + -- Serge Schneider Fri, 27 May 2016 11:10:11 +0100 + +raspi-config (20160506) jessie; urgency=medium + + [ Axel Beckert ] + * Downgrade hard dependency on triggerhappy to recommendation. + + init script: Check if thd is present before using it. + + [ Simon Long ] + * New method for testing whether serial is enabled. + * Current state of serial i/f reflected in raspi-config. + * Menu option to toggle device tree removed. + + -- Serge Schneider Fri, 06 May 2016 18:41:58 +0100 + +raspi-config (20160428) jessie; urgency=medium + + * [Simon Long] + - dtparam used instead of modprobe for SPI and I2C + + -- Serge Schneider Thu, 28 Apr 2016 15:42:42 +0100 + +raspi-config (20160425) jessie; urgency=medium + + * [Simon Long] + - Merge - Prevent errors when enabling "Fast" network boot multiple times + - UART switch added to serial; GPIO server public access finished + - Skeleton added for setting security state of GPIO server + - Reads in gpu_mem_ settings and clears them when writing + * [Serge Schneider] + - Remove io_is_busy + + -- Serge Schneider Mon, 25 Apr 2016 11:58:48 +0100 + +raspi-config (20160322) jessie; urgency=medium + + * [Simon Long] + - 1-wire interface control added + - Wifi country code setting now creates wpa_supplicant.conf + if it doesn't exist + * [Serge Schneider] + - Add first boot resize script + + -- Serge Schneider Tue, 22 Mar 2016 16:45:29 +0000 + +raspi-config (20160225) jessie; urgency=medium + + * Added wi-fi country setting to raspi-config + * Wifi setting in raspi-config can now be called in non-interactive mode. + * Mods to support new serial device alias in cmdline.txt. + + -- Serge Schneider Thu, 25 Feb 2016 07:48:56 +0000 + +raspi-config (20160210) jessie; urgency=medium + + * Pi board checks now take account of warranty bits. + + -- Serge Schneider Tue, 09 Feb 2016 16:16:58 +0000 + +raspi-config (20160209) jessie; urgency=medium + + * Check for mesa driver before allowing GL driver to be enabled + + -- Serge Schneider Tue, 09 Feb 2016 13:56:44 +0000 + +raspi-config (20160201) jessie; urgency=medium + + * Compute Module added to is_pione + + -- Serge Schneider Mon, 01 Feb 2016 12:28:22 +0000 + +raspi-config (20160125) jessie; urgency=medium + + * Do not allow GL driver to be enabled on 2835-based Pis - it needs at least 1GB of RAM. + * Overclocking behaviour made board-specific. + + -- Serge Schneider Mon, 25 Jan 2016 12:29:54 +0000 + +raspi-config (20160121) jessie; urgency=medium + + * GPU memory reset to default when GL driver enabled + * Launch of simple compositor added when GL driver is enabled + * Filename of V3d overlay corrected + + -- Serge Schneider Thu, 21 Jan 2016 11:12:49 +0000 + +raspi-config (20160119) jessie; urgency=medium + + * Option added to select experimental GL driver + + -- Serge Schneider Tue, 19 Jan 2016 13:56:53 +0000 + +raspi-config (20160108) jessie; urgency=medium + + * Update URL + * Remove first boot auto-login files + * Fix auto-login + * Fix typos + + -- Serge Schneider Fri, 08 Jan 2016 10:44:05 +0000 + +raspi-config (20151117) jessie; urgency=medium + + * raspi-config modified to remove config variables rather than set default + values when overclocking + + -- Serge Schneider Tue, 17 Nov 2015 11:35:14 +0000 + +raspi-config (20151019) jessie; urgency=medium + + * Add alsa-utils dependency + * Remove unnecessary sudo in init script + * Add wait for network option + + -- Serge Schneider Mon, 19 Oct 2015 13:01:26 +0100 + +raspi-config (20150923) jessie; urgency=medium + + * Auto-login to desktop and console option for rc_gui + + -- Serge Schneider Wed, 23 Sep 2015 21:25:52 +0100 + +raspi-config (20150915) jessie; urgency=medium + + * Add support for rc_gui from spl + + -- Serge Schneider Tue, 15 Sep 2015 10:23:52 +0100 + +raspi-config (20150706) jessie; urgency=low + + * Include io_is_busy in cpufreq settings + * Bump standards version to 3.9.6 + + -- Serge Schneider Mon, 06 Jul 2015 08:59:56 +0100 + +raspi-config (20150603) jessie; urgency=low + + * systemd compatibility + * Add udevadm command to notify Xorg after change of keyboard layout - jojopi + * Remove boot to scratch + + -- Serge Schneider Fri, 29 May 2015 11:31:46 +0100 + +raspi-config (20150131-4) stable; urgency=low + + * Use dh_installinit --no-start instead of --noscripts to ensure raspi-config runs + + -- Serge Schneider Thu, 14 May 2015 18:09:47 +0100 + +raspi-config (20150131-3) unstable; urgency=low + + * Add prerm failed-upgrade to allow upgrades + + -- Serge Schneider Wed, 06 May 2015 15:33:35 +0100 + +raspi-config (20150131-2) unstable; urgency=low + + * Prevent postinstall from trying to stop /etc/init.d/raspi-config + dh_installinit --noscripts + + -- Serge Schneider Wed, 06 May 2015 14:23:57 +0100 + +raspi-config (20150131-1) unstable; urgency=low + + * Add Pi2 overclock preset + * Ask whether to reboot after changing devicetree + * Remove old switch_cpu_governor init script upon install + + -- Alex Bradbury Sat, 31 Jan 2015 20:17:40 +0000 + +raspi-config (20150129-1) unstable; urgency=low + + * Add devicetree support (thanks Phil Elwell) + * Always include the ondemand governor init script + * Tweak ondemand cpu scaling governor settings + + -- Alex Bradbury Thu, 29 Jan 2015 23:40:15 +0000 + +raspi-config (20140902-1) unstable; urgency=low + + * Add option to toggle i2c and serial + + -- Alexander Bradbury Tue, 02 Sep 2014 17:26:06 +0100 + +raspi-config (20131216-1) unstable; urgency=low + + * Add option to configure audio out + * Fail boot to scratch or boot to desktop setting when pi user was removed + * When enabling camera, only set gpu mem if it's unset or < 128MiB + + -- Alexander Bradbury Mon, 16 Dec 2013 21:50:38 +0000 + +raspi-config (20130925-1) unstable; urgency=low + + * Fix issue inheriting language settings from NOOBS + * Add ability to toggle spi module blacklisting + + -- Alex Bradbury Wed, 25 Sep 2013 20:55:34 +0100 + +raspi-config (20130910-1) unstable; urgency=low + + * Bugfix for boot to scratch + * Bugfix for detecting flavour set by NOOBS + + -- Alexander Bradbury Tue, 10 Sep 2013 14:36:14 +0100 + +raspi-config (20130909-1) unstable; urgency=low + + * Support boot to scratch and applying language/keyboard settings from noobs + + -- Alexander Bradbury Mon, 09 Sep 2013 23:53:58 +0100 + +raspi-config (20130525-1) unstable; urgency=low + + * Use start_x rather than startx in config.txt for enabling camera to reduce + confusion + + -- Alex Bradbury Sat, 25 May 2013 17:15:07 +0100 + +raspi-config (20130525) unstable; urgency=low + + * Tweak height of whiptail display (thanks Rob Bishop) + * Fix issue of gpu_mem=16 not working when camera is enabled + + -- Alex Bradbury Sat, 25 May 2013 16:49:19 +0100 + +raspi-config (20130522) unstable; urgency=low + + * Re-organise menus and give better explanations for options (thanks Rob + Bishop) + * Refuse to expand_rootfs on NOOBS partition layouts. + + -- Alex Bradbury Wed, 22 May 2013 20:51:07 +0100 + +raspi-config (20130520) unstable; urgency=low + + * Make expand_rootfs work if /dev/root is not second partition + + -- Alex Bradbury Mon, 20 May 2013 19:48:02 +0100 + +raspi-config (20130515) unstable; urgency=low + + * Lower cpufreq threshold when overclocking + + -- Alex Bradbury Wed, 15 May 2013 19:47:40 +0100 + +raspi-config (20130510) unstable; urgency=low + + * Added support for registering on rastrack (thanks Ryan Walmsley) + * Added ability to set hostname (thanks Andrew Stone) + * Added --expand-rootfs option (thanks Viktor Petersson) + * Added ability to enable Raspberry Pi camera support + + -- Alex Bradbury Fri, 10 May 2013 12:19:42 +0100 + +raspi-config (20121028) unstable; urgency=low + + * Update overclocking options + * Disable command-line options for non-interactive use + * Support new gpu_mem config option + + -- Alex Bradbury Sun, 28 Oct 2012 21:11:34 +0000 + +raspi-config (20120918) unstable; urgency=low + + * Add overclocking options + * Add command-line options for non-interactive use (James Hewitt) + + -- Alexander Bradbury Tue, 18 Sep 2012 12:02:13 +0100 + +raspi-config (20120815) unstable; urgency=low + + * Various updates, recognise 240M memory split + + -- Alex Bradbury Wed, 15 Aug 2012 23:10:03 +0000 + +raspi-config (20120715) unstable; urgency=low + + * Various updates + + -- Alex Bradbury Sun, 15 Jul 2012 19:47:39 +0100 + +raspi-config (20120617) unstable; urgency=low + + * Fix keyboard configuration, misc other enhancements + * See git log for full changelog + + -- Alex Bradbury Sun, 17 Jun 2012 19:36:20 +0100 + +raspi-config (20120610) unstable; urgency=low + + * Initial release + + -- Alex Bradbury Sun, 10 Jun 2012 15:59:17 +0000 diff --git a/external/cache/sources/raspi-config/debian/compat b/external/cache/sources/raspi-config/debian/compat new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/external/cache/sources/raspi-config/debian/compat @@ -0,0 +1 @@ +10 diff --git a/external/cache/sources/raspi-config/debian/control b/external/cache/sources/raspi-config/debian/control new file mode 100644 index 000000000000..84b062e49a90 --- /dev/null +++ b/external/cache/sources/raspi-config/debian/control @@ -0,0 +1,15 @@ +Source: raspi-config +Section: utils +Priority: optional +Maintainer: Serge Schneider +Build-Depends: debhelper (>= 8.0.0) +Standards-Version: 4.3.0 +Vcs-Git: git://git@github.com:RPi-Distro/raspi-config.git +Vcs-Browser: https://github.com/RPi-Distro/raspi-config + +Package: raspi-config +Architecture: all +Depends: ${misc:Depends}, whiptail, parted, lua5.1, alsa-utils, psmisc, initramfs-tools +Recommends: triggerhappy, iw, crda +Description: Raspberry Pi configuration tool + A simple configuration tool for common Raspberry Pi administrative tasks diff --git a/external/cache/sources/raspi-config/debian/copyright b/external/cache/sources/raspi-config/debian/copyright new file mode 100644 index 000000000000..a323d7ab7afc --- /dev/null +++ b/external/cache/sources/raspi-config/debian/copyright @@ -0,0 +1,25 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://github.com/RPi-Distro/raspi-config + +Files: * +Copyright: 2012 Alex Bradbury +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/external/cache/sources/raspi-config/debian/raspi-config.init b/external/cache/sources/raspi-config/debian/raspi-config.init new file mode 100644 index 000000000000..deebb18b0e15 --- /dev/null +++ b/external/cache/sources/raspi-config/debian/raspi-config.init @@ -0,0 +1,57 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: raspi-config +# Required-Start: udev mountkernfs $remote_fs +# Required-Stop: +# Default-Start: S 2 3 4 5 +# Default-Stop: +# Short-Description: Switch to ondemand cpu governor (unless shift key is pressed) +# Description: +### END INIT INFO + +. /lib/lsb/init-functions + +if [ -f /etc/default/cpu_governor ]; then + . /etc/default/cpu_governor +fi + +CPU_DEFAULT_GOVERNOR="${CPU_DEFAULT_GOVERNOR:-ondemand}" +CPU_ONDEMAND_UP_THRESHOLD="${CPU_ONDEMAND_UP_THRESHOLD:-50}" +CPU_ONDEMAND_SAMPLING_RATE="${CPU_ONDEMAND_SAMPLING_RATE:-100000}" +CPU_ONDEMAND_DOWN_SAMPLING_FACTOR="${CPU_ONDEMAND_DOWN_SAMPLING_FACTOR:-50}" +CPU_ONDEMAND_INCLUDE_IO_CALC="${CPU_ONDEMAND_INCLUDE_IO_CALC:-0}" + +case "$1" in + start) + log_daemon_msg "Checking if shift key is held down" + if [ -x /usr/sbin/thd ] && timeout 1 thd --dump /dev/input/event* | grep -q "LEFTSHIFT\|RIGHTSHIFT"; then + printf " Yes. Not enabling $CPU_DEFAULT_GOVERNOR scaling governor" + log_end_msg 0 + else + printf " No. Switching to $CPU_DEFAULT_GOVERNOR scaling governor" + SYS_CPUFREQ_GOVERNOR=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + if [ -e $SYS_CPUFREQ_GOVERNOR ]; then + for cpu_core in /sys/devices/system/cpu/cpu?/cpufreq/scaling_governor ; do + echo "$CPU_DEFAULT_GOVERNOR" > $cpu_core + done + if [ "$CPU_DEFAULT_GOVERNOR" = "ondemand" ]; then + echo "$CPU_ONDEMAND_UP_THRESHOLD" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold + echo "$CPU_ONDEMAND_SAMPLING_RATE" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate + echo "$CPU_ONDEMAND_DOWN_SAMPLING_FACTOR" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor + echo "$CPU_ONDEMAND_INCLUDE_IO_CALC" > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy + fi + fi + log_end_msg 0 + fi + ;; + stop) + ;; + restart) + ;; + force-reload) + ;; + *) + echo "Usage: $0 start" >&2 + exit 3 + ;; +esac diff --git a/external/cache/sources/raspi-config/debian/raspi-config.install b/external/cache/sources/raspi-config/debian/raspi-config.install new file mode 100644 index 000000000000..81e14cfefc44 --- /dev/null +++ b/external/cache/sources/raspi-config/debian/raspi-config.install @@ -0,0 +1,3 @@ +raspi-config /usr/bin +usr/ +etc/ diff --git a/external/cache/sources/raspi-config/debian/raspi-config.postinst b/external/cache/sources/raspi-config/debian/raspi-config.postinst new file mode 100644 index 000000000000..c857d3c7f3ff --- /dev/null +++ b/external/cache/sources/raspi-config/debian/raspi-config.postinst @@ -0,0 +1,33 @@ +#!/bin/sh + +if [ -e /etc/init.d/switch_cpu_governor ]; then + update-rc.d switch_cpu_governor remove >/dev/null +fi + +if dpkg --compare-versions "${2}" lt-nl "20170619"; then + update-rc.d -f raspi-config remove +fi + +if dpkg --compare-versions "${2}" lt-nl "20220804"; then + echo "Moving to crda for regulatory domain management..." + if [ -f /etc/wpa_supplicant/wpa_supplicant.conf ]; then + REGDOMAIN="$(sed -n 's/^country=\(.*\)$/\1/p' /etc/wpa_supplicant/wpa_supplicant.conf)" + if [ -n "$REGDOMAIN" ]; then + echo "Setting to $REGDOMAIN..." + raspi-config nonint do_wifi_country "$REGDOMAIN" + else + echo "Regulatory domain was unset" + fi + else + echo "wpa_cupplicant.conf not found" + fi +fi + +if dpkg --compare-versions "${2}" lt-nl "20220907+1"; then + IMG_VER="$(grep -s -m1 -o '[[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}' /etc/rpi-issue)" + if [ "$IMG_VER" = "2022-09-06" ] && [ -f /2 ]; then + rm -f /2 + fi +fi + +#DEBHELPER# diff --git a/external/cache/sources/raspi-config/debian/raspi-config.postrm b/external/cache/sources/raspi-config/debian/raspi-config.postrm new file mode 100644 index 000000000000..a2ac542b4a0c --- /dev/null +++ b/external/cache/sources/raspi-config/debian/raspi-config.postrm @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +case "$1" in + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + purge) + if [ -d /etc/X11/xorg.conf.d/ ]; then + rmdir --ignore-fail-on-non-empty /etc/X11/xorg.conf.d/ + fi + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/external/cache/sources/raspi-config/debian/raspi-config.prerm b/external/cache/sources/raspi-config/debian/raspi-config.prerm new file mode 100644 index 000000000000..258eb2f5103c --- /dev/null +++ b/external/cache/sources/raspi-config/debian/raspi-config.prerm @@ -0,0 +1,36 @@ +#! /bin/sh +# prerm script for raspi-config +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade) + ;; + + failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/external/cache/sources/raspi-config/debian/rules b/external/cache/sources/raspi-config/debian/rules new file mode 100755 index 000000000000..f4a4bb68ce1c --- /dev/null +++ b/external/cache/sources/raspi-config/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +override_dh_installinit: + dh_installinit --no-start + +%: + dh $@ diff --git a/external/cache/sources/raspi-config/debian/source/format b/external/cache/sources/raspi-config/debian/source/format new file mode 100644 index 000000000000..89ae9db8f88b --- /dev/null +++ b/external/cache/sources/raspi-config/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/external/cache/sources/raspi-config/etc/default/cpu_governor b/external/cache/sources/raspi-config/etc/default/cpu_governor new file mode 100644 index 000000000000..e66974af79c2 --- /dev/null +++ b/external/cache/sources/raspi-config/etc/default/cpu_governor @@ -0,0 +1,35 @@ +# +# Set default governor on all CPU cores. +# More info https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt +# +# CPU_DEFAULT_GOVERNOR="ondemand" +# + +# +# ondemand governor: This defines what the average CPU usage between the +# samplings of 'sampling_rate' needs to be for the kernel to make a decision +# on whether it should increase the frequency. +# +# CPU_ONDEMAND_UP_THRESHOLD=50 +# + +# +# ondemand governor: How often you want the kernel to look at the CPU usage +# and to make decisions on what to do about the frequency. +# +# CPU_ONDEMAND_SAMPLING_RATE=100000 +# + +# +# ondemand governor: The rate at which the kernel makes a decision on when to +# decrease the frequency while running at top speed +# +# CPU_ONDEMAND_DOWN_SAMPLING_FACTOR=50 +# + +# +# ondemand governor: Include Input/Output (I/O) activity into CPU activity +# calculations when using ondemand CPU governor +# +# CPU_ONDEMAND_INCLUDE_IO_CALC=0 +# diff --git a/external/cache/sources/raspi-config/etc/sudoers.d/010_proxy b/external/cache/sources/raspi-config/etc/sudoers.d/010_proxy new file mode 100644 index 000000000000..3f980edd0b79 --- /dev/null +++ b/external/cache/sources/raspi-config/etc/sudoers.d/010_proxy @@ -0,0 +1,5 @@ +Defaults env_keep += "http_proxy HTTP_PROXY" +Defaults env_keep += "https_proxy HTTPS_PROXY" +Defaults env_keep += "ftp_proxy FTP_PROXY" +Defaults env_keep += "RSYNC_PROXY" +Defaults env_keep += "no_proxy NO_PROXY" diff --git a/external/cache/sources/raspi-config/raspi-config b/external/cache/sources/raspi-config/raspi-config new file mode 100755 index 000000000000..3f3d2672a526 --- /dev/null +++ b/external/cache/sources/raspi-config/raspi-config @@ -0,0 +1,3309 @@ +#!/bin/bash +# Part of raspi-config https://github.com/RPi-Distro/raspi-config +# +# See LICENSE file for copyright and license details + +INTERACTIVE=True +ASK_TO_REBOOT=0 +BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf +CONFIG=/boot/config.txt + +USER=${SUDO_USER:-$(who -m | awk '{ print $1 }')} +INIT="$(ps --no-headers -o comm 1)" + +[ -f /etc/orangepi-release ] && . /etc/orangepi-release + +is_pi () { + ARCH=$(dpkg --print-architecture) + if [ "$ARCH" = "armhf" ] || [ "$ARCH" = "arm64" ] ; then + return 0 + else + return 1 + fi +} + +if is_pi ; then + if [ -e /proc/device-tree/chosen/os_prefix ]; then + PREFIX="$(cat /proc/device-tree/chosen/os_prefix)" + fi + CMDLINE="/boot/${PREFIX}cmdline.txt" +else + CMDLINE=/proc/cmdline +fi + +# tests for Pi 1, 2 and 0 all test for specific boards... + +is_pione() { + if grep -q "^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo; then + return 0 + elif grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[0-36][0-9a-fA-F]$" /proc/cpuinfo ; then + return 0 + else + return 1 + fi +} + +is_pitwo() { + grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]04[0-9a-fA-F]$" /proc/cpuinfo + return $? +} + +is_pizero() { + grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]0[9cC][0-9a-fA-F]$" /proc/cpuinfo + return $? +} + +# ...while tests for Pi 3 and 4 just test processor type, so will also find CM3, CM4, Zero 2 etc. + +is_pithree() { + grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F]2[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo + return $? +} + +is_pifour() { + grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F]3[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo + return $? +} + +get_pi_type() { + if is_pione; then + echo 1 + elif is_pitwo; then + echo 2 + elif is_pithree; then + echo 3 + elif is_pifour; then + echo 4 + elif is_pizero; then + echo 0 + else + echo -1 + fi +} + +is_live() { + grep -q "boot=live" $CMDLINE + return $? +} + +is_ssh() { + if pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then + return 0 + else + return 1 + fi +} + +is_kms() { + if grep -s -q okay /proc/device-tree/soc/v3d@*/status \ + /proc/device-tree/soc/firmwarekms@*/status \ + /proc/device-tree/v3dbus/v3d@*/status; then + return 0 + else + return 1 + fi +} + +is_pulseaudio() { + PS=$(ps ax) + echo "$PS" | grep -q pulseaudio + return $? +} + +has_analog() { + if [ $(get_leds) -eq -1 ] ; then + return 0 + else + return 1 + fi +} + +is_installed() { + if [ "$(dpkg -l "$1" 2> /dev/null | tail -n 1 | cut -d ' ' -f 1)" != "ii" ]; then + return 1 + else + return 0 + fi +} + +deb_ver () { + ver=`cat /etc/debian_version | cut -d . -f 1` + echo $ver +} + +calc_wt_size() { + # NOTE: it's tempting to redirect stderr to /dev/null, so supress error + # output from tput. However in this case, tput detects neither stdout or + # stderr is a tty and so only gives default 80, 24 values + WT_HEIGHT=18 + WT_WIDTH=$(tput cols) + + if [ -z "$WT_WIDTH" ] || [ "$WT_WIDTH" -lt 60 ]; then + WT_WIDTH=80 + fi + if [ "$WT_WIDTH" -gt 178 ]; then + WT_WIDTH=120 + fi + WT_MENU_HEIGHT=$(($WT_HEIGHT-7)) +} + +do_about() { + whiptail --msgbox "\ +This tool provides a straightforward way of doing initial +configuration of the Raspberry Pi. Although it can be run +at any time, some of the options may have difficulties if +you have heavily customised your installation. + +$(dpkg -s raspi-config 2> /dev/null | grep Version)\ +" 20 70 1 + return 0 +} + +get_can_expand() { + ROOT_PART="$(findmnt / -o source -n)" + ROOT_DEV="/dev/$(lsblk -no pkname "$ROOT_PART")" + + PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")" + + if [ "$PART_NUM" -ne 2 ]; then + echo 1 + exit + fi + + LAST_PART_NUM=$(parted "$ROOT_DEV" -ms unit s p | tail -n 1 | cut -f 1 -d:) + if [ "$LAST_PART_NUM" -ne "$PART_NUM" ]; then + echo 1 + exit + fi + echo 0 +} + +do_expand_rootfs() { + ROOT_PART="$(findmnt / -o source -n)" + ROOT_DEV="/dev/$(lsblk -no pkname "$ROOT_PART")" + + PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")" + + LAST_PART_NUM=$(parted "$ROOT_DEV" -ms unit s p | tail -n 1 | cut -f 1 -d:) + if [ "$LAST_PART_NUM" -ne "$PART_NUM" ]; then + whiptail --msgbox "$ROOT_PART is not the last partition. Don't know how to expand" 20 60 2 + return 0 + fi + + # Get the starting offset of the root partition + PART_START=$(parted "$ROOT_DEV" -ms unit s p | grep "^${PART_NUM}" | cut -f 2 -d: | sed 's/[^0-9]//g') + [ "$PART_START" ] || return 1 + # Return value will likely be error for fdisk as it fails to reload the + # partition table because the root fs is mounted + fdisk "$ROOT_DEV" < /etc/init.d/resize2fs_once && +#!/bin/sh +### BEGIN INIT INFO +# Provides: resize2fs_once +# Required-Start: +# Required-Stop: +# Default-Start: 3 +# Default-Stop: +# Short-Description: Resize the root filesystem to fill partition +# Description: +### END INIT INFO + +. /lib/lsb/init-functions + +case "\$1" in + start) + log_daemon_msg "Starting resize2fs_once" && + resize2fs "$ROOT_PART" && + update-rc.d resize2fs_once remove && + rm /etc/init.d/resize2fs_once && + log_end_msg \$? + ;; + *) + echo "Usage: \$0 start" >&2 + exit 3 + ;; +esac +EOF + chmod +x /etc/init.d/resize2fs_once && + update-rc.d resize2fs_once defaults && + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Root partition has been resized.\nThe filesystem will be enlarged upon the next reboot" 20 60 2 + fi +} + +set_config_var() { + lua - "$1" "$2" "$3" < "$3.bak" +local key=assert(arg[1]) +local value=assert(arg[2]) +local fn=assert(arg[3]) +local file=assert(io.open(fn)) +local made_change=false +for line in file:lines() do + if line:match("^#?%s*"..key.."=.*$") then + line=key.."="..value + made_change=true + end + print(line) +end + +if not made_change then + print(key.."="..value) +end +EOF +mv "$3.bak" "$3" +} + +clear_config_var() { + lua - "$1" "$2" < "$2.bak" +local key=assert(arg[1]) +local fn=assert(arg[2]) +local file=assert(io.open(fn)) +for line in file:lines() do + if line:match("^%s*"..key.."=.*$") then + line="#"..line + end + print(line) +end +EOF +mv "$2.bak" "$2" +} + +get_config_var() { + lua - "$1" "$2" < /dev/null | grep margin | rev | cut -d ' ' -f 1 | rev) + if [ -z $RES ] ; then + echo 1 + elif [ $RES -eq 0 ] ; then + echo 1 + else + echo 0 + fi +} + +do_overscan_kms() { + if [ "$INTERACTIVE" = True ]; then + NDEVS=$(xrandr -q | grep -c connected) + if [ $NDEVS -gt 1 ] ; then + DEV=$(whiptail --menu "Select the output for which overscan compensation is to be set" 20 60 10 "1" "HDMI-1" "2" "HDMI-2" 3>&1 1>&2 2>&3) + if [ $? -eq 1 ] ; then + return + fi + else + DEV=1 + fi + if [ $(get_overscan_kms $DEV) -eq 1 ]; then + DEFAULT=--defaultno + else + DEFAULT= + fi + if whiptail --yesno "Would you like to enable overscan compensation for HDMI-$DEV?" $DEFAULT 20 60 2 ; then + PIX=16 + STATUS="enabled" + else + PIX=0 + STATUS="disabled" + fi + else + DEV=$1 + if [ $2 -eq 1 ] ; then + PIX=0 + else + PIX=16 + fi + fi + xrandr --output HDMI-$DEV --set "left margin" $PIX --set "right margin" $PIX --set "top margin" $PIX --set "bottom margin" $PIX + # hack to force reload when not using mutter + if ! ps ax | grep -v grep | grep -q " mutter" ; then + xrandr --output HDMI-$DEV --reflect x + xrandr --output HDMI-$DEV --reflect normal + fi + sed $CONFIG -i -e "s/^overscan_/#overscan_/" + set_config_var disable_overscan 1 $CONFIG + if [ -e /usr/share/ovscsetup.sh ] ; then + if grep "HDMI-$DEV" /usr/share/ovscsetup.sh 2> /dev/null | grep -q margin ; then + sed /usr/share/ovscsetup.sh -i -e "s/xrandr --output HDMI-$DEV.*margin.*/xrandr --output HDMI-$DEV --set \"left margin\" $PIX --set \"right margin\" $PIX --set \"top margin\" $PIX --set \"bottom margin\" $PIX/" + else + echo "xrandr --output HDMI-$DEV --set \"left margin\" $PIX --set \"right margin\" $PIX --set \"top margin\" $PIX --set \"bottom margin\" $PIX" >> /usr/share/ovscsetup.sh + fi + else + echo "#!/bin/sh\nxrandr --output HDMI-$DEV --set \"left margin\" $PIX --set \"right margin\" $PIX --set \"top margin\" $PIX --set \"bottom margin\" $PIX" > /usr/share/ovscsetup.sh + fi + if ! grep -q ovscsetup /usr/share/dispsetup.sh 2> /dev/null ; then + sed /usr/share/dispsetup.sh -i -e "s#exit#if [ -e /usr/share/ovscsetup.sh ] ; then\n. /usr/share/ovscsetup.sh\nfi\nexit#" + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Display overscan compensation for HDMI-$DEV is $STATUS" 20 60 1 + fi +} + +get_blanking() { + if ! [ -f "/etc/X11/xorg.conf.d/10-blanking.conf" ]; then + echo 0 + else + echo 1 + fi +} + +# shellcheck disable=SC2120 +do_blanking() { + DEFAULT=--defaultno + CURRENT=0 + if [ "$(get_blanking)" -eq 0 ]; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + if [ "$(dpkg -l xscreensaver | tail -n 1 | cut -d ' ' -f 1)" = "ii" ]; then + whiptail --msgbox "Warning: xscreensaver is installed may override raspi-config settings" 20 60 2 + fi + whiptail --yesno "Would you like to enable screen blanking?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ "$RET" -eq "$CURRENT" ]; then + ASK_TO_REBOOT=1 + fi + rm -f /etc/X11/xorg.conf.d/10-blanking.conf + sed -i '/^\o033/d' /etc/issue + if [ "$RET" -eq 0 ] ; then + STATUS=enabled + elif [ "$RET" -eq 1 ]; then + mkdir -p /etc/X11/xorg.conf.d/ + cp /usr/share/raspi-config/10-blanking.conf /etc/X11/xorg.conf.d/ + printf "\\033[9;0]" >> /etc/issue + STATUS=disabled + else + return "$RET" + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Screen blanking is $STATUS" 20 60 1 + fi +} + +get_pixdub() { + if is_pi && ! is_kms; then + FBW=$(get_config_var framebuffer_width $CONFIG) + if [ $FBW -eq 0 ]; then + echo 1 + else + echo 0 + fi + else + echo 1 + fi +} + +is_number() { + case $1 in + ''|*[!0-9]*) return 0 ;; + *) return 1 ;; + esac +} + +do_pixdub() { + DEFAULT=--defaultno + CURRENT=0 + if [ $(get_pixdub) -eq 0 ]; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like to enable pixel doubling?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if is_pi && ! is_kms; then + if [ $RET -eq 0 ] ; then + XVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f3 -d' ') + YVAL=$(xrandr 2>&1 | grep current | cut -f2 -d, | cut -f5 -d' ') + if is_number $XVAL || is_number $YVAL ; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Could not read current screen dimensions - unable to enable pixel doubling" 20 60 1 + fi + return 1 + fi + NEWX=`expr $XVAL / 2` + NEWY=`expr $YVAL / 2` + set_config_var framebuffer_width $NEWX $CONFIG + set_config_var framebuffer_height $NEWY $CONFIG + set_config_var scaling_kernel 8 $CONFIG + STATUS=enabled + elif [ $RET -eq 1 ]; then + clear_config_var framebuffer_width $CONFIG + clear_config_var framebuffer_height $CONFIG + clear_config_var scaling_kernel $CONFIG + STATUS=disabled + else + return $RET + fi + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Pixel doubling is $STATUS" 20 60 1 + fi +} + +do_change_pass() { + whiptail --msgbox "You will now be asked to enter a new password for the $USER user" 20 60 1 + passwd $USER && + whiptail --msgbox "Password changed successfully" 20 60 1 +} + +do_configure_keyboard() { + printf "Reloading keymap. This may take a short while\n" + rm -f /etc/console-setup/cached_* + if [ "$INTERACTIVE" = True ]; then + dpkg-reconfigure keyboard-configuration + else + KEYMAP="$1" + sed -i /etc/default/keyboard -e "s/^XKBLAYOUT.*/XKBLAYOUT=\"$KEYMAP\"/" + dpkg-reconfigure -f noninteractive keyboard-configuration + fi + if [ "$INIT" = "systemd" ]; then + systemctl restart keyboard-setup + fi + setsid sh -c 'exec setupcon --save -k --force <> /dev/tty1 >&0 2>&1' + udevadm trigger --subsystem-match=input --action=change + return 0 +} + +do_change_locale() { + if [ "$INTERACTIVE" = True ]; then + dpkg-reconfigure locales + else + if ! LOCALE_LINE="$(grep -E "^$1( |$)" /usr/share/i18n/SUPPORTED)"; then + return 1 + fi + export LC_ALL=C + export LANG=C + LG="/etc/locale.gen" + NEW_LANG="$(echo $LOCALE_LINE | cut -f1 -d " ")" + [ -L "$LG" ] && [ "$(readlink $LG)" = "/usr/share/i18n/SUPPORTED" ] && rm -f "$LG" + echo "$LOCALE_LINE" > /etc/locale.gen + update-locale --no-checks LANG + update-locale --no-checks "LANG=$NEW_LANG" + dpkg-reconfigure -f noninteractive locales + fi +} + +do_change_timezone() { + if [ "$INTERACTIVE" = True ]; then + dpkg-reconfigure tzdata + else + TIMEZONE="$1" + if [ ! -f "/usr/share/zoneinfo/$TIMEZONE" ]; then + return 1; + fi + rm /etc/localtime + echo "$TIMEZONE" > /etc/timezone + dpkg-reconfigure -f noninteractive tzdata 2> /dev/null + fi +} + +get_wifi_country() { + CODE=${1:-0} + if [ -e /etc/default/crda ]; then + . /etc/default/crda + elif systemctl -q is-active dhcpcd; then + REGDOMAIN="$(wpa_cli get country | tail -n 1)" + else + REGDOMAIN="$(iw reg get | sed -n "0,/country/s/^country \(.\+\):.*$/\1/p")" + fi + if [ -z "$REGDOMAIN" ] \ + || ! grep -q "^${REGDOMAIN}[[:space:]]" /usr/share/zoneinfo/iso3166.tab; then + return 1 + fi + if [ "$CODE" = 0 ]; then + echo "$REGDOMAIN" + fi + return 0 +} + +do_wifi_country() { + if [ "$INTERACTIVE" = True ]; then + value=$(sed '/^#/d' /usr/share/zoneinfo/iso3166.tab | tr '\t\n' '/') + oIFS="$IFS" + IFS="/" + #shellcheck disable=2086 + REGDOMAIN=$(whiptail --menu "Select the country in which the Pi is to be used" 20 60 10 ${value} 3>&1 1>&2 2>&3) + IFS="$oIFS" + else + REGDOMAIN=$1 + fi + if ! grep -q "^${REGDOMAIN}[[:space:]]" /usr/share/zoneinfo/iso3166.tab; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "$REGDOMAIN is not a valid ISO/IEC 3166-1 alpha2 code" 20 60 + fi + return 1 + fi + if [ -e /etc/default/crda ]; then + sed -i "s/^REGDOMAIN=.*$/REGDOMAIN=$REGDOMAIN/" /etc/default/crda + if ! ischroot; then + iw reg set "$REGDOMAIN" + fi + fi + + IFACE="$(list_wlan_interfaces | head -n 1)" + if [ "$INIT" = "systemd" ] && [ -n "$IFACE" ] && systemctl -q is-active dhcpcd; then + wpa_cli -i "$IFACE" set country "$REGDOMAIN" > /dev/null 2>&1 + wpa_cli -i "$IFACE" save_config > /dev/null 2>&1 + fi + + if [ "$INIT" = "systemd" ] && ! ischroot && systemctl -q is-active NetworkManager; then + nmcli radio wifi on + elif hash rfkill 2> /dev/null; then + rfkill unblock wifi + fi + if is_pi; then + for filename in /var/lib/systemd/rfkill/*:wlan ; do + if ! [ -e "$filename" ]; then + continue + fi + echo 0 > "$filename" + done + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Wireless LAN country set to $REGDOMAIN" 20 60 1 + fi +} + +get_hostname() { + tr -d " \t\n\r" < /etc/hostname +} + +do_hostname() { + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "\ +Please note: RFCs mandate that a hostname's labels \ +may contain only the ASCII letters 'a' through 'z' (case-insensitive), +the digits '0' through '9', and the hyphen. +Hostname labels cannot begin or end with a hyphen. +No other symbols, punctuation characters, or blank spaces are permitted.\ +" 20 70 1 + fi + CURRENT_HOSTNAME=$(get_hostname) + if [ "$INTERACTIVE" = True ]; then + NEW_HOSTNAME=$(whiptail --inputbox "Please enter a hostname" 20 60 "$CURRENT_HOSTNAME" 3>&1 1>&2 2>&3) + else + NEW_HOSTNAME="$1" + true + fi + if [ "$?" -eq 0 ]; then + if [ "$INIT" = "systemd" ] && systemctl -q is-active dbus && ! ischroot; then + hostnamectl set-hostname "$NEW_HOSTNAME" 2> /dev/null + else + echo "$NEW_HOSTNAME" > /etc/hostname + fi + sed -i "s/127\.0\.1\.1.*$CURRENT_HOSTNAME/127.0.1.1\t$NEW_HOSTNAME/g" /etc/hosts + ASK_TO_REBOOT=1 + fi +} + +do_memory_split() { # Memory Split + if [ -e /boot/start_cd.elf ]; then + # New-style memory split setting + ## get current memory split from /boot/config.txt + arm=$(vcgencmd get_mem arm | cut -d '=' -f 2 | cut -d 'M' -f 1) + gpu=$(vcgencmd get_mem gpu | cut -d '=' -f 2 | cut -d 'M' -f 1) + tot=$(($arm+$gpu)) + if [ $tot -gt 512 ]; then + CUR_GPU_MEM=$(get_config_var gpu_mem_1024 $CONFIG) + elif [ $tot -gt 256 ]; then + CUR_GPU_MEM=$(get_config_var gpu_mem_512 $CONFIG) + else + CUR_GPU_MEM=$(get_config_var gpu_mem_256 $CONFIG) + fi + if [ -z "$CUR_GPU_MEM" ] || [ $CUR_GPU_MEM = "0" ]; then + CUR_GPU_MEM=$(get_config_var gpu_mem $CONFIG) + fi + [ -z "$CUR_GPU_MEM" ] || [ $CUR_GPU_MEM = "0" ] && CUR_GPU_MEM=64 + ## ask users what gpu_mem they want + if [ "$INTERACTIVE" = True ]; then + NEW_GPU_MEM=$(whiptail --inputbox "How much memory (MB) should the GPU have? e.g. 16/32/64/128/256" \ + 20 70 -- "$CUR_GPU_MEM" 3>&1 1>&2 2>&3) + else + NEW_GPU_MEM=$1 + true + fi + if [ $? -eq 0 ]; then + if [ $(get_config_var gpu_mem_1024 $CONFIG) != "0" ] || [ $(get_config_var gpu_mem_512 $CONFIG) != "0" ] || [ $(get_config_var gpu_mem_256 $CONFIG) != "0" ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Device-specific memory settings were found. These have been cleared." 20 60 2 + fi + clear_config_var gpu_mem_1024 $CONFIG + clear_config_var gpu_mem_512 $CONFIG + clear_config_var gpu_mem_256 $CONFIG + fi + set_config_var gpu_mem "$NEW_GPU_MEM" $CONFIG + ASK_TO_REBOOT=1 + fi + else # Old firmware so do start.elf renaming + get_current_memory_split + MEMSPLIT=$(whiptail --menu "Set memory split.\n$MEMSPLIT_DESCRIPTION" 20 60 10 \ + "240" "240MiB for ARM, 16MiB for VideoCore" \ + "224" "224MiB for ARM, 32MiB for VideoCore" \ + "192" "192MiB for ARM, 64MiB for VideoCore" \ + "128" "128MiB for ARM, 128MiB for VideoCore" \ + 3>&1 1>&2 2>&3) + if [ $? -eq 0 ]; then + set_memory_split ${MEMSPLIT} + ASK_TO_REBOOT=1 + fi + fi +} + +get_current_memory_split() { + AVAILABLE_SPLITS="128 192 224 240" + MEMSPLIT_DESCRIPTION="" + for SPLIT in $AVAILABLE_SPLITS;do + if [ -e /boot/arm${SPLIT}_start.elf ] && cmp /boot/arm${SPLIT}_start.elf /boot/start.elf >/dev/null 2>&1;then + CURRENT_MEMSPLIT=$SPLIT + MEMSPLIT_DESCRIPTION="Current: ${CURRENT_MEMSPLIT}MiB for ARM, $((256 - $CURRENT_MEMSPLIT))MiB for VideoCore" + break + fi + done +} + +set_memory_split() { + cp -a /boot/arm${1}_start.elf /boot/start.elf + sync +} + +do_overclock() { + if ! is_pione && ! is_pitwo; then + whiptail --msgbox "Only Pi 1 or Pi 2 can be overclocked with this tool." 20 60 2 + return 1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "\ +Be aware that overclocking may reduce the lifetime of your +Raspberry Pi. If overclocking at a certain level causes +system instability, try a more modest overclock. Hold down +shift during boot to temporarily disable overclock. +See https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md for more information.\ +" 20 70 1 + if is_pione; then + OVERCLOCK=$(whiptail --menu "Choose overclock preset" 20 60 10 \ + "None" "700MHz ARM, 250MHz core, 400MHz SDRAM, 0 overvolt" \ + "Modest" "800MHz ARM, 250MHz core, 400MHz SDRAM, 0 overvolt" \ + "Medium" "900MHz ARM, 250MHz core, 450MHz SDRAM, 2 overvolt" \ + "High" "950MHz ARM, 250MHz core, 450MHz SDRAM, 6 overvolt" \ + "Turbo" "1000MHz ARM, 500MHz core, 600MHz SDRAM, 6 overvolt" \ + 3>&1 1>&2 2>&3) + elif is_pitwo; then + OVERCLOCK=$(whiptail --menu "Choose overclock preset" 20 60 10 \ + "None" "900MHz ARM, 250MHz core, 450MHz SDRAM, 0 overvolt" \ + "High" "1000MHz ARM, 500MHz core, 500MHz SDRAM, 2 overvolt" \ + 3>&1 1>&2 2>&3) + fi + else + OVERCLOCK=$1 + true + fi + if [ $? -eq 0 ]; then + case "$OVERCLOCK" in + None) + clear_overclock + ;; + Modest) + set_overclock Modest 800 250 400 0 + ;; + Medium) + set_overclock Medium 900 250 450 2 + ;; + High) + if is_pione; then + set_overclock High 950 250 450 6 + else + set_overclock High 1000 500 500 2 + fi + ;; + Turbo) + set_overclock Turbo 1000 500 600 6 + ;; + *) + whiptail --msgbox "Programmer error, unrecognised overclock preset" 20 60 2 + return 1 + ;; + esac + ASK_TO_REBOOT=1 + fi +} + +set_overclock() { + set_config_var arm_freq $2 $CONFIG && + set_config_var core_freq $3 $CONFIG && + set_config_var sdram_freq $4 $CONFIG && + set_config_var over_voltage $5 $CONFIG && + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Set overclock to preset '$1'" 20 60 2 + fi +} + +clear_overclock () { + clear_config_var arm_freq $CONFIG && + clear_config_var core_freq $CONFIG && + clear_config_var sdram_freq $CONFIG && + clear_config_var over_voltage $CONFIG && + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Set overclock to preset 'None'" 20 60 2 + fi +} + +get_ssh() { + if service ssh status | grep -q inactive; then + echo 1 + else + echo 0 + fi +} + +do_ssh() { + if [ -e /var/log/regen_ssh_keys.log ] && ! grep -q "^finished" /var/log/regen_ssh_keys.log; then + whiptail --msgbox "Initial ssh key generation still running. Please wait and try again." 20 60 2 + return 1 + fi + DEFAULT=--defaultno + if [ $(get_ssh) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno \ + "Would you like the SSH server to be enabled?\n\nCaution: Default and weak passwords are a security risk when SSH is enabled!" \ + $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + ssh-keygen -A && + update-rc.d ssh enable && + invoke-rc.d ssh start && + STATUS=enabled + elif [ $RET -eq 1 ]; then + update-rc.d ssh disable && + invoke-rc.d ssh stop && + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The SSH server is $STATUS" 20 60 1 + fi +} + +get_vnc() { + if systemctl status vncserver-x11-serviced.service | grep -q -w active; then + echo 0 + else + echo 1 + fi +} + +do_vnc() { + DEFAULT=--defaultno + if [ $(get_vnc) -eq 0 ]; then + DEFAULT= + fi + APT_GET_FLAGS="" + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the VNC Server to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + APT_GET_FLAGS="-y" + fi + if [ $RET -eq 0 ]; then + if is_installed realvnc-vnc-server || apt-get install "$APT_GET_FLAGS" realvnc-vnc-server; then + systemctl enable vncserver-x11-serviced.service && + systemctl start vncserver-x11-serviced.service && + STATUS=enabled + else + return 1 + fi + elif [ $RET -eq 1 ]; then + if is_installed realvnc-vnc-server; then + systemctl disable vncserver-x11-serviced.service + systemctl stop vncserver-x11-serviced.service + fi + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The VNC Server is $STATUS" 20 60 1 + fi +} + +get_spi() { + if grep -q -E "^(device_tree_param|dtparam)=([^,]*,)*spi(=(on|true|yes|1))?(,.*)?$" $CONFIG; then + echo 0 + else + echo 1 + fi +} + +do_spi() { + DEFAULT=--defaultno + if [ $(get_spi) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the SPI interface to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + SETTING=on + STATUS=enabled + elif [ $RET -eq 1 ]; then + SETTING=off + STATUS=disabled + else + return $RET + fi + + set_config_var dtparam=spi $SETTING $CONFIG && + if ! [ -e $BLACKLIST ]; then + touch $BLACKLIST + fi + sed $BLACKLIST -i -e "s/^\(blacklist[[:space:]]*spi[-_]bcm2708\)/#\1/" + dtparam spi=$SETTING + + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The SPI interface is $STATUS" 20 60 1 + fi +} + +get_i2c() { + if grep -q -E "^(device_tree_param|dtparam)=([^,]*,)*i2c(_arm)?(=(on|true|yes|1))?(,.*)?$" $CONFIG; then + echo 0 + else + echo 1 + fi +} + +do_i2c() { + DEFAULT=--defaultno + if [ $(get_i2c) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the ARM I2C interface to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + SETTING=on + STATUS=enabled + elif [ $RET -eq 1 ]; then + SETTING=off + STATUS=disabled + else + return $RET + fi + + set_config_var dtparam=i2c_arm $SETTING $CONFIG && + if ! [ -e $BLACKLIST ]; then + touch $BLACKLIST + fi + sed $BLACKLIST -i -e "s/^\(blacklist[[:space:]]*i2c[-_]bcm2708\)/#\1/" + sed /etc/modules -i -e "s/^#[[:space:]]*\(i2c[-_]dev\)/\1/" + if ! grep -q "^i2c[-_]dev" /etc/modules; then + printf "i2c-dev\n" >> /etc/modules + fi + dtparam i2c_arm=$SETTING + modprobe i2c-dev + + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The ARM I2C interface is $STATUS" 20 60 1 + fi +} + +get_serial() { + if grep -q -E "console=(serial0|ttyAMA0|ttyS0)" $CMDLINE ; then + echo 0 + else + echo 1 + fi +} + +get_serial_hw() { + if grep -q -E "^enable_uart=1" $CONFIG ; then + echo 0 + elif grep -q -E "^enable_uart=0" $CONFIG ; then + echo 1 + elif [ -e /dev/serial0 ] ; then + echo 0 + else + echo 1 + fi +} + +do_serial() { + DEFAULTS=--defaultno + DEFAULTH=--defaultno + CURRENTS=0 + CURRENTH=0 + if [ $(get_serial) -eq 0 ]; then + DEFAULTS= + CURRENTS=1 + fi + if [ $(get_serial_hw) -eq 0 ]; then + DEFAULTH= + CURRENTH=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like a login shell to be accessible over serial?" $DEFAULTS 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENTS ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + if grep -q "console=ttyAMA0" $CMDLINE ; then + if [ -e /proc/device-tree/aliases/serial0 ]; then + sed -i $CMDLINE -e "s/console=ttyAMA0/console=serial0/" + fi + elif ! grep -q "console=ttyAMA0" $CMDLINE && ! grep -q "console=serial0" $CMDLINE ; then + if [ -e /proc/device-tree/aliases/serial0 ]; then + sed -i $CMDLINE -e "s/root=/console=serial0,115200 root=/" + else + sed -i $CMDLINE -e "s/root=/console=ttyAMA0,115200 root=/" + fi + fi + set_config_var enable_uart 1 $CONFIG + SSTATUS=enabled + HSTATUS=enabled + elif [ $RET -eq 1 ] || [ $RET -eq 2 ]; then + sed -i $CMDLINE -e "s/console=ttyAMA0,[0-9]\+ //" + sed -i $CMDLINE -e "s/console=serial0,[0-9]\+ //" + SSTATUS=disabled + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the serial port hardware to be enabled?" $DEFAULTH 20 60 2 + RET=$? + else + RET=$((2-$RET)) + fi + if [ $RET -eq $CURRENTH ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + set_config_var enable_uart 1 $CONFIG + HSTATUS=enabled + elif [ $RET -eq 1 ]; then + set_config_var enable_uart 0 $CONFIG + HSTATUS=disabled + else + return $RET + fi + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The serial login shell is $SSTATUS\nThe serial interface is $HSTATUS" 20 60 1 + fi +} + +disable_raspi_config_at_boot() { + if [ -e /etc/profile.d/raspi-config.sh ]; then + rm -f /etc/profile.d/raspi-config.sh + if [ -e /etc/systemd/system/getty@tty1.service.d/raspi-config-override.conf ]; then + rm /etc/systemd/system/getty@tty1.service.d/raspi-config-override.conf + fi + telinit q + fi +} + +get_boot_cli() { + if [ "$(basename $(readlink -f /etc/systemd/system/default.target))" = graphical.target ] \ + && systemctl is-enabled lightdm > /dev/null 2>&1; then + echo 1 + else + echo 0 + fi +} + +get_autologin() { + if [ $(get_boot_cli) -eq 0 ]; then + # booting to CLI + if [ -e /etc/systemd/system/getty@tty1.service.d/autologin.conf ] ; then + echo 0 + else + echo 1 + fi + else + # booting to desktop - check the autologin for lightdm + if grep -q "^autologin-user=" /etc/lightdm/lightdm.conf ; then + echo 0 + else + echo 1 + fi + fi +} + +get_pi4video () { + if grep -q "^hdmi_enable_4kp60=1" $CONFIG ; then + echo 1 + elif grep -q "^enable_tvout=1" $CONFIG ; then + echo 2 + else + echo 0 + fi +} + +do_pi4video() { + if ! is_pifour ; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "This option can only be used on a Pi 4" 20 60 1 + fi + return 1 + fi + CURRENT=$(get_pi4video) + if [ "$INTERACTIVE" = True ]; then + VIDOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Pi 4 Video Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \ + "V1 Enable 4Kp60 HDMI" "Enable 4Kp60 resolution on HDMI0" \ + "V2 Enable composite " "Enable composite video output (disables HDMI)" \ + "V3 Default" "Disable 4Kp60 HDMI and composite video" \ + 3>&1 1>&2 2>&3) + else + VIDOPT=$1 + true + fi + if [ $? -eq 0 ]; then + case "$VIDOPT" in + V1*) + sed $CONFIG -i -e "s/^#\?hdmi_enable_4kp60=.*/hdmi_enable_4kp60=1/" + sed $CONFIG -i -e "s/^enable_tvout=/#enable_tvout=/" + if ! grep -q "hdmi_enable_4kp60" $CONFIG ; then + sed $CONFIG -i -e "\$ahdmi_enable_4kp60=1" + fi + sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d.*/dtoverlay=vc4-kms-v3d/" + STATUS="4Kp60 is enabled on HDMI0" + OPT=1 + ;; + V2*) + if whiptail --yesno "If composite video is enabled, both HDMI outputs will be disabled, and unless a composite monitor is connected, no video output will be available.\n\nAre you sure you want to enable composite and disable HDMI?" 20 60 2 --defaultno ; then + sed $CONFIG -i -e "s/^#\?enable_tvout=.*/enable_tvout=1/" + sed $CONFIG -i -e "s/^hdmi_enable_4kp60=/#hdmi_enable_4kp60=/" + if ! grep -q "enable_tvout" $CONFIG ; then + sed $CONFIG -i -e "\$aenable_tvout=1" + fi + sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d.*/dtoverlay=vc4-kms-v3d,composite/" + STATUS="Composite video is enabled. HDMI is disabled." + OPT=2 + else + STATUS="Video output settings unchanged" + OPT=$CURRENT + fi + ;; + V3*) + sed $CONFIG -i -e "s/^hdmi_enable_4kp60=/#hdmi_enable_4kp60=/" + sed $CONFIG -i -e "s/^enable_tvout=/#enable_tvout=/" + sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d.*/dtoverlay=vc4-kms-v3d/" + STATUS="Both HDMI ports set to defaults - 4Kp60 and composite disabled" + OPT=0 + ;; + *) + whiptail --msgbox "Programmer error, unrecognised video option" 20 60 2 + return 1 + ;; + esac + if [ $OPT -ne $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "$STATUS" 20 60 1 + fi + fi +} + +get_composite() { + if grep -q "^dtoverlay=vc4-kms-v3d,composite" $CONFIG ; then + echo 0 + else + echo 1 + fi +} + +do_composite() { + CURRENT=$(get_composite) + DEFAULT=--defaultno + if [ $CURRENT -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like composite video output to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d.*/dtoverlay=vc4-kms-v3d,composite/" + STATUS=enabled + elif [ $RET -eq 1 ]; then + sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d.*/dtoverlay=vc4-kms-v3d/" + STATUS=disabled + else + return $RET + fi + if [ $RET -ne $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Composite video output is $STATUS" 20 60 1 + fi +} + +get_leds () { + if grep -q "\\[actpwr\\]" /sys/class/leds/led0/trigger ; then + echo 0 + elif grep -q "\\[default-on\\]" /sys/class/leds/led0/trigger ; then + echo 1 + else + echo -1 + fi +} + +do_leds() { + CURRENT=$(get_leds) + if [ $CURRENT -eq -1 ] ; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The LED behaviour cannot be changed on this model of Raspberry Pi" 20 60 1 + fi + return 1 + fi + DEFAULT=--defaultno + if [ $CURRENT -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the power LED to flash during disk activity?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + LEDSET="actpwr" + STATUS="flash for disk activity" + elif [ $RET -eq 1 ]; then + LEDSET="default-on" + STATUS="be on constantly" + else + return $RET + fi + sed $CONFIG -i -e "s/dtparam=act_led_trigger=.*/dtparam=act_led_trigger=$LEDSET/" + if ! grep -q "dtparam=act_led_trigger" $CONFIG ; then + sed $CONFIG -i -e "\$adtparam=act_led_trigger=$LEDSET" + fi + echo $LEDSET | tee /sys/class/leds/led0/trigger > /dev/null + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The power LED will $STATUS" 20 60 1 + fi +} + +get_fan() { + if grep -q ^dtoverlay=gpio-fan $CONFIG ; then + echo 0 + else + echo 1 + fi +} + +get_fan_gpio() { + GPIO=$(grep ^dtoverlay=gpio-fan $CONFIG | cut -d, -f2 | cut -d= -f2) + if [ -z $GPIO ]; then + GPIO=14 + fi + echo $GPIO +} + +get_fan_temp() { + TEMP=$(grep ^dtoverlay=gpio-fan $CONFIG | cut -d, -f3 | cut -d= -f2) + if [ -z $TEMP ]; then + TEMP=80000 + fi + echo $(( $TEMP / 1000 )) +} + +do_fan() { + GNOW=$(get_fan_gpio) + TNOW=$(get_fan_temp) + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like to enable fan temperature control?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ] ; then + if [ "$INTERACTIVE" = True ]; then + GPIO=$(whiptail --inputbox "To which GPIO is the fan connected?" 20 60 "$GNOW" 3>&1 1>&2 2>&3) + else + if [ -z $2 ]; then + GPIO=14 + else + GPIO=$2 + fi + fi + if ! [ $? -eq 0 ] ; then + return 0 + fi + if ! echo "$GPIO" | grep -q ^[[:digit:]]*$ ; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "GPIO must be a number between 2 and 27" 20 60 1 + fi + return 1 + fi + if [ "$GPIO" -lt 2 ] || [ "$GPIO" -gt 27 ] ; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "GPIO must be a number between 2 and 27" 20 60 1 + fi + return 1 + fi + if [ "$INTERACTIVE" = True ]; then + TIN=$(whiptail --inputbox "At what temperature in degrees Celsius should the fan turn on?" 20 60 "$TNOW" 3>&1 1>&2 2>&3) + else + if [ -z $3 ]; then + TIN=80 + else + TIN=$3 + fi + fi + if ! [ $? -eq 0 ] ; then + return 0 + fi + if ! echo "$TIN" | grep -q ^[[:digit:]]*$ ; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Temperature must be a number between 60 and 120" 20 60 1 + fi + return 1 + fi + if [ "$TIN" -lt 60 ] || [ "$TIN" -gt 120 ] ; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Temperature must be a number between 60 and 120" 20 60 1 + fi + return 1 + fi + TEMP=$(( $TIN * 1000 )) + fi + if [ $RET -eq 0 ]; then + if ! grep -q "dtoverlay=gpio-fan" $CONFIG ; then + if ! tail -1 $CONFIG | grep -q "\\[all\\]" ; then + sed $CONFIG -i -e "\$a[all]" + fi + sed $CONFIG -i -e "\$adtoverlay=gpio-fan,gpiopin=$GPIO,temp=$TEMP" + else + sed $CONFIG -i -e "s/^.*dtoverlay=gpio-fan.*/dtoverlay=gpio-fan,gpiopin=$GPIO,temp=$TEMP/" + fi + ASK_TO_REBOOT=1 + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The fan on GPIO $GPIO is enabled and will turn on at $TIN degrees Celsius" 20 60 1 + fi + else + if grep -q "^dtoverlay=gpio-fan" $CONFIG ; then + ASK_TO_REBOOT=1 + fi + sed $CONFIG -i -e "/^.*dtoverlay=gpio-fan.*/d" + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The fan is disabled" 20 60 1 + fi + fi +} + +do_boot_behaviour() { + if [ "$INTERACTIVE" = True ]; then + BOOTOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Boot Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \ + "B1 Console" "Text console, requiring user to login" \ + "B2 Console Autologin" "Text console, automatically logged in as '$USER' user" \ + "B3 Desktop" "Desktop GUI, requiring user to login" \ + "B4 Desktop Autologin" "Desktop GUI, automatically logged in as '$USER' user" \ + 3>&1 1>&2 2>&3) + else + BOOTOPT=$1 + true + fi + if [ $? -eq 0 ]; then + case "$BOOTOPT" in + B1*) + systemctl --quiet set-default multi-user.target + rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf + ;; + B2*) + systemctl --quiet set-default multi-user.target + cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM +EOF + ;; + B3*) + if [ -e /etc/init.d/lightdm ]; then + systemctl --quiet set-default graphical.target + rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf + sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/" + disable_raspi_config_at_boot + else + whiptail --msgbox "Do 'sudo apt-get install lightdm' to allow configuration of boot to desktop" 20 60 2 + return 1 + fi + ;; + B4*) + if [ -e /etc/init.d/lightdm ]; then + systemctl --quiet set-default graphical.target + cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM +EOF + sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$USER/" + disable_raspi_config_at_boot + else + whiptail --msgbox "Do 'sudo apt-get install lightdm' to allow configuration of boot to desktop" 20 60 2 + return 1 + fi + ;; + *) + whiptail --msgbox "Programmer error, unrecognised boot option" 20 60 2 + return 1 + ;; + esac + if [ "$INIT" = "systemd" ]; then + systemctl daemon-reload + fi + ASK_TO_REBOOT=1 + fi +} + +do_boot_order() { + if [ "$INTERACTIVE" = True ]; then + BOOTOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Boot Device Order" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \ + "B1 SD Card Boot" "Boot from SD Card if available, otherwise boot from USB" \ + "B2 USB Boot" "Boot from USB if available, otherwise boot from SD Card" \ + "B3 Network Boot" "Boot from network if SD card boot fails" \ + 3>&1 1>&2 2>&3) + else + BOOTOPT=$1 + true + fi + if [ $? -eq 0 ]; then + CURDATE=$(date -d "`vcgencmd bootloader_version | head -n 1`" +%Y%m%d) + FILNAME="none" + if grep -q "stable" /etc/default/rpi-eeprom-update ; then + EEPATH="/lib/firmware/raspberrypi/bootloader/stable/pieeprom*.bin" + else + EEPATH="/lib/firmware/raspberrypi/bootloader/critical/pieeprom*.bin" + fi + for filename in $EEPATH ; do + FILDATE=$(date -d "`echo $filename | cut -d - -f 2- | cut -d . -f 1`" +%Y%m%d) + if [ $FILDATE -eq $CURDATE ]; then + FILNAME=$filename + fi + done + if [ "$FILNAME" = "none" ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "No EEPROM bin file found for version `date -d $CURDATE +%Y-%m-%d` - aborting" 20 60 2 + fi + return 1 + fi + EECFG=$(mktemp) + vcgencmd bootloader_config > $EECFG + sed $EECFG -i -e "/SD_BOOT_MAX_RETRIES/d" + sed $EECFG -i -e "/NET_BOOT_MAX_RETRIES/d" + case "$BOOTOPT" in + B1*) + if ! grep -q "BOOT_ORDER" $EECFG ; then + sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf41" + else + sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf41/" + fi + STATUS="SD Card" + ;; + B2*) + if ! grep -q "BOOT_ORDER" $EECFG ; then + sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf14" + else + sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf14/" + fi + STATUS="USB" + ;; + B3*) + if ! grep -q "BOOT_ORDER" $EECFG ; then + sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf21" + else + sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf21/" + fi + STATUS="Network" + ;; + *) + whiptail --msgbox "Programmer error, unrecognised boot option" 20 60 2 + return 1 + ;; + esac + EEBIN=$(mktemp) + rpi-eeprom-config --config $EECFG --out $EEBIN $FILNAME + rpi-eeprom-update -d -f $EEBIN + ASK_TO_REBOOT=1 + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "$STATUS is default boot device" 20 60 1 + fi + fi +} + + +do_boot_rom() { + if [ "$INTERACTIVE" = True ]; then + BOOTOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Boot ROM Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \ + "E1 Latest" "Use the latest version boot ROM software" \ + "E2 Default" "Use the factory default boot ROM software" \ + 3>&1 1>&2 2>&3) + else + BOOTOPT=$1 + true + fi + if [ $? -eq 0 ]; then + case "$BOOTOPT" in + E1*) + sed /etc/default/rpi-eeprom-update -i -e "s/^FIRMWARE_RELEASE_STATUS.*/FIRMWARE_RELEASE_STATUS=\"stable\"/" + EETYPE="Latest version" + ;; + E2*) + sed /etc/default/rpi-eeprom-update -i -e "s/^FIRMWARE_RELEASE_STATUS.*/FIRMWARE_RELEASE_STATUS=\"critical\"/" + EETYPE="Factory default" + ;; + *) + whiptail --msgbox "Programmer error, unrecognised boot ROM option" 20 60 2 + return 1 + ;; + esac + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "$EETYPE boot ROM selected - will be loaded at next reboot.\n\nReset boot ROM to defaults?" 20 60 2 + DEFAULTS=$? + else + DEFAULTS=$2 + fi + if [ "$DEFAULTS" -eq 0 ]; then # yes + if grep -q "stable" /etc/default/rpi-eeprom-update ; then + EEPATH="/lib/firmware/raspberrypi/bootloader/stable/" + else + EEPATH="/lib/firmware/raspberrypi/bootloader/critical/" + fi + MATCH=".*/pieeprom-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].bin" + FILNAME="$(find "${EEPATH}" -maxdepth 1 -type f -size 524288c -regex "${MATCH}" | sort -r | head -n1)" + if [ -z "$FILNAME" ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "No EEPROM bin file found - cannot reset to defaults" 20 60 2 + fi + else + rpi-eeprom-update -d -f $FILNAME + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Boot ROM reset to defaults" 20 60 2 + fi + fi + else + rpi-eeprom-update + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Boot ROM not reset to defaults" 20 60 2 + fi + fi + ASK_TO_REBOOT=1 + fi +} + +get_boot_wait() { + if test -e /etc/systemd/system/dhcpcd.service.d/wait.conf; then + echo 0 + else + echo 1 + fi +} + +do_boot_wait() { + DEFAULT=--defaultno + if [ $(get_boot_wait) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like boot to wait until a network connection is established?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + mkdir -p /etc/systemd/system/dhcpcd.service.d/ + cat > /etc/systemd/system/dhcpcd.service.d/wait.conf << EOF +[Service] +ExecStart= +ExecStart=/usr/sbin/dhcpcd -w -q +EOF + STATUS=enabled + elif [ $RET -eq 1 ]; then + rm -f /etc/systemd/system/dhcpcd.service.d/wait.conf + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Waiting for network on boot is $STATUS" 20 60 1 + fi +} + +get_boot_splash() { + if is_pi ; then + if grep -q "splash" $CMDLINE ; then + echo 0 + else + echo 1 + fi + else + if grep -q "GRUB_CMDLINE_LINUX_DEFAULT.*splash" /etc/default/grub ; then + echo 0 + else + echo 1 + fi + fi +} + +do_boot_splash() { + if [ ! -e /usr/share/plymouth/themes/pix/pix.script ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The splash screen is not installed so cannot be activated" 20 60 2 + fi + return 1 + fi + DEFAULT=--defaultno + if [ $(get_boot_splash) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like to show the splash screen at boot?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + if is_pi ; then + if ! grep -q "splash" $CMDLINE ; then + sed -i $CMDLINE -e "s/$/ quiet splash plymouth.ignore-serial-consoles/" + fi + else + sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\"\(.*\)\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\1 quiet splash plymouth.ignore-serial-consoles\"/" + sed -i /etc/default/grub -e "s/ \+/ /g" + sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\" /GRUB_CMDLINE_LINUX_DEFAULT=\"/" + update-grub + fi + STATUS=enabled + elif [ $RET -eq 1 ]; then + if is_pi ; then + if grep -q "splash" $CMDLINE ; then + sed -i $CMDLINE -e "s/ quiet//" + sed -i $CMDLINE -e "s/ splash//" + sed -i $CMDLINE -e "s/ plymouth.ignore-serial-consoles//" + fi + else + sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\"\(.*\)quiet\(.*\)\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\1\2\"/" + sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\"\(.*\)splash\(.*\)\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\1\2\"/" + sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\"\(.*\)plymouth.ignore-serial-consoles\(.*\)\"/GRUB_CMDLINE_LINUX_DEFAULT=\"\1\2\"/" + sed -i /etc/default/grub -e "s/ \+/ /g" + sed -i /etc/default/grub -e "s/GRUB_CMDLINE_LINUX_DEFAULT=\" /GRUB_CMDLINE_LINUX_DEFAULT=\"/" + update-grub + fi + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Splash screen at boot is $STATUS" 20 60 1 + fi +} + +get_rgpio() { + if test -e /etc/systemd/system/pigpiod.service.d/public.conf; then + echo 0 + else + echo 1 + fi +} + +do_rgpio() { + DEFAULT=--defaultno + if [ $(get_rgpio) -eq 0 ]; then + DEFAULT= + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the GPIO server to be accessible over the network?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq 0 ]; then + mkdir -p /etc/systemd/system/pigpiod.service.d/ + cat > /etc/systemd/system/pigpiod.service.d/public.conf << EOF +[Service] +ExecStart= +ExecStart=/usr/bin/pigpiod +EOF + STATUS=enabled + elif [ $RET -eq 1 ]; then + rm -f /etc/systemd/system/pigpiod.service.d/public.conf + STATUS=disabled + else + return $RET + fi + systemctl daemon-reload + if systemctl -q is-enabled pigpiod ; then + systemctl restart pigpiod + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Remote access to the GPIO server is $STATUS" 20 60 1 + fi +} + +get_camera() { + if [ $(deb_ver) -le 10 ]; then + CAM=$(get_config_var start_x $CONFIG) + if [ $CAM -eq 1 ]; then + echo 0 + else + echo 1 + fi + else + if grep -q camera_auto_detect $CONFIG ; then + CAM=$(get_config_var camera_auto_detect $CONFIG) + if [ $CAM -eq 1 ]; then + echo 0 + else + echo 1 + fi + else + echo 0 + fi + fi +} + +do_camera() { + if [ $(deb_ver) -le 10 ] && [ ! -e /boot/start_x.elf ]; then + whiptail --msgbox "Your firmware appears to be out of date (no start_x.elf). Please update" 20 60 2 + return 1 + fi + sed $CONFIG -i -e "s/^startx/#startx/" + sed $CONFIG -i -e "s/^fixup_file/#fixup_file/" + + DEFAULT=--defaultno + CURRENT=0 + if [ $(get_camera) -eq 0 ]; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the camera interface to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + if [ $(deb_ver) -le 10 ] ; then + set_config_var start_x 1 $CONFIG + CUR_GPU_MEM=$(get_config_var gpu_mem $CONFIG) + if [ -z "$CUR_GPU_MEM" ] || [ "$CUR_GPU_MEM" -lt 128 ]; then + set_config_var gpu_mem 128 $CONFIG + fi + else + set_config_var camera_auto_detect 1 $CONFIG + fi + STATUS=enabled + elif [ $RET -eq 1 ]; then + if [ $(deb_ver) -le 10 ] ; then + set_config_var start_x 0 $CONFIG + sed $CONFIG -i -e "s/^start_file/#start_file/" + else + set_config_var camera_auto_detect 0 $CONFIG + fi + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The camera interface is $STATUS" 20 60 1 + fi +} + +get_onewire() { + if grep -q -E "^dtoverlay=w1-gpio" $CONFIG; then + echo 0 + else + echo 1 + fi +} + +do_onewire() { + DEFAULT=--defaultno + CURRENT=0 + if [ $(get_onewire) -eq 0 ]; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the one-wire interface to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + sed $CONFIG -i -e "s/^#dtoverlay=w1-gpio/dtoverlay=w1-gpio/" + if ! grep -q -E "^dtoverlay=w1-gpio" $CONFIG; then + printf "dtoverlay=w1-gpio\n" >> $CONFIG + fi + STATUS=enabled + elif [ $RET -eq 1 ]; then + sed $CONFIG -i -e "s/^dtoverlay=w1-gpio/#dtoverlay=w1-gpio/" + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The one-wire interface is $STATUS" 20 60 1 + fi +} + +get_legacy() { + if sed -n '/\[pi4\]/,/\[/ !p' $CONFIG | grep -q '^dtoverlay=vc4-kms-v3d' ; then + echo 1 + else + echo 0 + fi +} + +do_legacy() { + DEFAULT=--defaultno + CURRENT=0 + if [ $(get_legacy) -eq 0 ]; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like to enable legacy camera support?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + sed $CONFIG -i -e '/\[pi4\]/,/\[/ s/^#\?dtoverlay=vc4-f\?kms-v3d/dtoverlay=vc4-fkms-v3d/g' + sed $CONFIG -i -e '/\[pi4\]/,/\[/ !s/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/g' + sed $CONFIG -i -e '/\[pi4\]/,/\[/ !s/^dtoverlay=vc4-fkms-v3d/#dtoverlay=vc4-fkms-v3d/g' + if ! sed -n '/\[pi4\]/,/\[/ p' $CONFIG | grep -q '^dtoverlay=vc4-fkms-v3d' ; then + if grep -q '[pi4]' $CONFIG ; then + sed $CONFIG -i -e 's/\[pi4\]/\[pi4\]\ndtoverlay=vc4-fkms-v3d/' + else + printf "[pi4]\ndtoverlay=vc4-fkms-v3d\n" >> $CONFIG + fi + fi + CUR_GPU_MEM=$(get_config_var gpu_mem $CONFIG) + if [ -z "$CUR_GPU_MEM" ] || [ "$CUR_GPU_MEM" -lt 128 ]; then + set_config_var gpu_mem 128 $CONFIG + fi + sed $CONFIG -i -e 's/^camera_auto_detect.*/start_x=1/g' + sed $CONFIG -i -e 's/^dtoverlay=camera/#dtoverlay=camera/g' + STATUS="Legacy camera support is enabled.\n\nPlease note that this functionality is deprecated and will not be supported for future development." + else + sed $CONFIG -i -e 's/^#\?dtoverlay=vc4-f\?kms-v3d/dtoverlay=vc4-kms-v3d/g' + sed $CONFIG -i -e '/\[pi4\]/,/\[/ {/dtoverlay=vc4-kms-v3d/d}' + if ! sed -n '/\[pi4\]/,/\[/ !p' $CONFIG | grep -q '^dtoverlay=vc4-kms-v3d' ; then + if grep -q '[all]' $CONFIG ; then + sed $CONFIG -i -e 's/\[all\]/\[all\]\ndtoverlay=vc4-kms-v3d/' + else + printf "[all]\ndtoverlay=vc4-kms-v3d\n" >> $CONFIG + fi + fi + sed $CONFIG -i -e 's/^start_x.*/camera_auto_detect=1/g' + sed $CONFIG -i -e 's/^#dtoverlay=camera/dtoverlay=camera/g' + STATUS="Legacy camera support is disabled." + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "$STATUS" 20 60 1 + fi +} + +do_gldriver() { + if [ ! -e /boot/overlays/vc4-kms-v3d.dtbo ]; then + whiptail --msgbox "Driver and kernel not present on your system. Please update" 20 60 2 + return 1 + fi + for package in gldriver-test libgl1-mesa-dri; do + if [ "$(dpkg -l "$package" 2> /dev/null | tail -n 1 | cut -d ' ' -f 1)" != "ii" ]; then + missing_packages="$package $missing_packages" + fi + done + if [ -n "$missing_packages" ] && ! apt-get install $missing_packages; then + whiptail --msgbox "Required packages not found, please install: ${missing_packages}" 20 60 2 + return 1 + fi + GLOPT=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "GL Driver" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \ + "G1 Legacy" "Original non-GL desktop driver" \ + "G2 GL (Full KMS)" "OpenGL desktop driver with full KMS" \ + 3>&1 1>&2 2>&3) + if [ $? -eq 0 ]; then + case "$GLOPT" in + G1*) + if sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q -E "^dtoverlay=vc4-f?kms-v3d" ; then + ASK_TO_REBOOT=1 + fi + sed $CONFIG -i -e "s/^dtoverlay=vc4-fkms-v3d/#dtoverlay=vc4-fkms-v3d/g" + sed $CONFIG -i -e "s/^dtoverlay=vc4-kms-v3d/#dtoverlay=vc4-kms-v3d/g" + STATUS="The GL driver is disabled." + ;; + G2*) + if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-kms-v3d" ; then + ASK_TO_REBOOT=1 + fi + sed $CONFIG -i -e "s/^dtoverlay=vc4-fkms-v3d/#dtoverlay=vc4-fkms-v3d/g" + sed $CONFIG -i -e "s/^#dtoverlay=vc4-kms-v3d/dtoverlay=vc4-kms-v3d/g" + if ! sed -n "/\[pi4\]/,/\[/ !p" $CONFIG | grep -q "^dtoverlay=vc4-kms-v3d" ; then + printf "[all]\ndtoverlay=vc4-kms-v3d\n" >> $CONFIG + fi + STATUS="The full KMS GL driver is enabled." + ;; + *) + whiptail --msgbox "Programmer error, unrecognised boot option" 20 60 2 + return 1 + ;; + esac + else + return 0 + fi + whiptail --msgbox "$STATUS" 20 60 1 +} + +do_xcompmgr() { + DEFAULT=--defaultno + CURRENT=0 + if [ -e /etc/xdg/autostart/xcompmgr.desktop ]; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the xcompmgr composition manager to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + if [ ! -e /usr/bin/xcompmgr ] ; then + apt-get -y install xcompmgr + fi + cat << EOF > /etc/xdg/autostart/xcompmgr.desktop +[Desktop Entry] +Type=Application +Name=xcompmgr +Comment=Start xcompmgr compositor +NoDisplay=true +Exec=/usr/lib/raspi-config/cmstart.sh +EOF + STATUS=enabled + elif [ $RET -eq 1 ]; then + rm -f /etc/xdg/autostart/xcompmgr.desktop + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The xcompmgr composition manager is $STATUS" 20 60 1 + fi +} + +do_glamor() { + DEFAULT= + CURRENT=1 + if [ -e /usr/share/X11/xorg.conf.d/20-noglamor.conf ] ; then + DEFAULT=--defaultno + CURRENT=0 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like glamor acceleration to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + systemctl disable glamor-test.service + systemctl stop glamor-test.service + rm -f /usr/share/X11/xorg.conf.d/20-noglamor.conf + STATUS=enabled + elif [ $RET -eq 1 ]; then + systemctl enable glamor-test.service && + systemctl start glamor-test.service && + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Glamor acceleration is $STATUS" 20 60 1 + fi +} + +do_wayland() { + DEFAULT=--defaultno + CURRENT=0 + if grep -q "^user-session=LXDE-pi-wayland" /etc/lightdm/lightdm.conf ; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the Wayland backend to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?user-session.*/user-session=LXDE-pi-wayland/" + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?autologin-session.*/autologin-session=LXDE-pi-wayland/" + if [ -e "/var/lib/AccountsService/users/$USER" ] ; then + sed "/var/lib/AccountsService/users/$USER" -i -e "s/XSession=.*/XSession=LXDE-pi-wayland/" + fi + STATUS=enabled + elif [ $RET -eq 1 ]; then + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?user-session.*/user-session=LXDE-pi-x/" + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?autologin-session.*/autologin-session=LXDE-pi-x/" + if [ -e "/var/lib/AccountsService/users/$USER" ] ; then + sed "/var/lib/AccountsService/users/$USER" -i -e "s/XSession=.*/XSession=LXDE-pi-x/" + fi + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Wayland is $STATUS" 20 60 1 + fi +} + +do_netconf() { + systemctl -q is-enabled NetworkManager > /dev/null 2>&1 + NMENABLED=$? + systemctl -q is-enabled dhcpcd > /dev/null 2>&1 + DHENABLED=$? + if [ "$INTERACTIVE" = True ]; then + DEFAULT=1 + if [ "$NMENABLED" = 0 ] ; then + DEFAULT=2 + fi + if is_installed dhcpcd5 ; then + OPTIONS="1 dhcpcd" + fi + if is_installed network-manager ; then + OPTIONS="$OPTIONS 2 NetworkManager" + fi + #shellcheck disable=2086 + NMOPT=$(whiptail --menu "Select the network configuration to use" 20 60 10 $OPTIONS --default-item "$DEFAULT" 3>&1 1>&2 2>&3) + RET="$?" + else + NMOPT="$1" + RET=0 + fi + if [ "$RET" -ne 0 ] ; then + return + fi + + if [ "$NMOPT" -eq 2 ] ; then # NetworkManager selected + ENABLE_SERVICE=NetworkManager + DISABLE_SERVICE=dhcpcd + NETCON="NetworkManager" + else # dhcpcd selected + ENABLE_SERVICE=dhcpcd + DISABLE_SERVICE=NetworkManager + NETCON="dhcpcd" + fi + + systemctl -q disable "$DISABLE_SERVICE" 2> /dev/null + systemctl -q enable "$ENABLE_SERVICE" + if [ "$INIT" = "systemd" ]; then + systemctl -q stop "$DISABLE_SERVICE" 2> /dev/null + systemctl -q --no-block start "$ENABLE_SERVICE" + fi + ASK_TO_REBOOT=1 + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "$NETCON is active" 20 60 1 + fi +} + +get_net_names() { + if grep -q "net.ifnames=0" '/boot/orangepiEnv.txt' || \ + ( [ "$(readlink -f /etc/systemd/network/99-default.link)" = "/dev/null" ] && \ + [ "$(readlink -f /etc/systemd/network/73-usb-net-by-mac.link)" = "/dev/null" ] ); then + echo 1 + else + echo 0 + fi +} + +do_net_names () { + DEFAULT=--defaultno + CURRENT=0 + if [ $(get_net_names) -eq 0 ]; then + DEFAULT= + CURRENT=1 + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like to enable predictable network interface names?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + ASK_TO_REBOOT=1 + fi + if [ $RET -eq 0 ]; then + sed -i /boot/orangepiEnv.txt -e "s/net.ifnames=0 *//" + rm -f /etc/systemd/network/99-default.link + rm -f /etc/systemd/network/73-usb-net-by-mac.link + STATUS=enabled + elif [ $RET -eq 1 ]; then + ln -sf /dev/null /etc/systemd/network/99-default.link + ln -sf /dev/null /etc/systemd/network/73-usb-net-by-mac.link + STATUS=disabled + else + return $RET + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Predictable network interface names are $STATUS" 20 60 1 + fi +} + +do_update() { + apt-get update && + apt-get install raspi-config && + printf "Sleeping 5 seconds before reloading raspi-config\n" && + sleep 5 && + exec raspi-config +} + +do_audio() { + if is_pulseaudio ; then + oIFS="$IFS" + if [ "$INTERACTIVE" = True ]; then + list=$(sudo -u $SUDO_USER XDG_RUNTIME_DIR=/run/user/$SUDO_UID pacmd list-sinks | grep -e index -e alsa.name | sed s/*//g | sed s/^[' '\\t]*//g | sed s/'index: '//g | sed s/'alsa.name = '//g | sed s/'bcm2835 '//g | sed s/\"//g | tr '\n' '/') + if ! [ -z "$list" ] ; then + IFS="/" + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 ${list} 3>&1 1>&2 2>&3) + else + whiptail --msgbox "No internal audio devices found" 20 60 1 + return 1 + fi + else + AUDIO_OUT=$1 + true + fi + if [ $? -eq 0 ]; then + sudo -u $SUDO_USER XDG_RUNTIME_DIR=/run/user/$SUDO_UID pactl set-default-sink $AUDIO_OUT + fi + IFS="$oIFS" + else + if aplay -l | grep -q "bcm2835 ALSA"; then + if [ "$INTERACTIVE" = True ]; then + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \ + "0" "Auto" \ + "1" "Force 3.5mm ('headphone') jack" \ + "2" "Force HDMI" \ + 3>&1 1>&2 2>&3) + else + AUDIO_OUT=$1 + fi + if [ $? -eq 0 ]; then + amixer cset numid=3 "$AUDIO_OUT" + fi + else + ASPATH=$(getent passwd $USER | cut -d : -f 6)/.asoundrc + if [ "$INTERACTIVE" = True ]; then + n=0 + array="" + while [ $n -le 9 ]] + do + CARD=$(LC_ALL=C aplay -l | grep "card $n" | cut -d [ -f 2 | cut -d ] -f 1) + if [ -z "$CARD" ] ; then + break + else + if [ -z "$array" ] ; then + array=$n"/"$CARD + else + array=$array"/"$n"/"$CARD + fi + fi + n=$(( n+1 )) + done + if [ $n -eq 0 ] ; then + whiptail --msgbox "No audio devices found" 20 60 1 + false + else + oIFS="$IFS" + IFS="/" + AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 ${array} 3>&1 1>&2 2>&3) + IFS="$oIFS" + fi + else + AUDIO_OUT=$1 + fi + if [ $? -eq 0 ]; then + cat << EOF > $ASPATH +pcm.!default { + type asym + playback.pcm { + type plug + slave.pcm "output" + } + capture.pcm { + type plug + slave.pcm "input" + } +} + +pcm.output { + type hw + card $AUDIO_OUT +} + +ctl.!default { + type hw + card $AUDIO_OUT +} +EOF + fi + fi + fi +} + +do_resolution() { + if [ "$INTERACTIVE" = True ]; then + CMODE=$(get_config_var hdmi_mode $CONFIG) + CGROUP=$(get_config_var hdmi_group $CONFIG) + if [ $CMODE -eq 0 ] ; then + CSET="Default" + elif [ $CGROUP -eq 2 ] ; then + CSET="DMT Mode "$CMODE + else + CSET="CEA Mode "$CMODE + fi + oIFS="$IFS" + IFS="/" + if tvservice -d /dev/null | grep -q Nothing ; then + value="Default/720x480/DMT Mode 4/640x480 60Hz 4:3/DMT Mode 9/800x600 60Hz 4:3/DMT Mode 16/1024x768 60Hz 4:3/DMT Mode 85/1280x720 60Hz 16:9/DMT Mode 35/1280x1024 60Hz 5:4/DMT Mode 51/1600x1200 60Hz 4:3/DMT Mode 82/1920x1080 60Hz 16:9/" + else + value="Default/Monitor preferred resolution/" + value=$value$(tvservice -m CEA | grep progressive | cut -b 12- | sed 's/mode \([0-9]\+\): \([0-9]\+\)x\([0-9]\+\) @ \([0-9]\+\)Hz \([0-9]\+\):\([0-9]\+\), clock:[0-9]\+MHz progressive/CEA Mode \1\/\2x\3 \4Hz \5:\6/' | tr '\n' '/') + value=$value$(tvservice -m DMT | grep progressive | cut -b 12- | sed 's/mode \([0-9]\+\): \([0-9]\+\)x\([0-9]\+\) @ \([0-9]\+\)Hz \([0-9]\+\):\([0-9]\+\), clock:[0-9]\+MHz progressive/DMT Mode \1\/\2x\3 \4Hz \5:\6/' | tr '\n' '/') + fi + RES=$(whiptail --default-item $CSET --menu "Choose screen resolution" 20 60 10 ${value} 3>&1 1>&2 2>&3) + STATUS=$? + IFS="$oIFS" + if [ $STATUS -eq 0 ] ; then + GRS=$(echo "$RES" | cut -d ' ' -f 1) + MODE=$(echo "$RES" | cut -d ' ' -f 3) + if [ $GRS = "Default" ] ; then + MODE=0 + elif [ $GRS = "DMT" ] ; then + GROUP=2 + else + GROUP=1 + fi + fi + else + GROUP=$1 + MODE=$2 + STATUS=0 + fi + if [ $STATUS -eq 0 ]; then + if [ $MODE -eq 0 ]; then + clear_config_var hdmi_force_hotplug $CONFIG + clear_config_var hdmi_group $CONFIG + clear_config_var hdmi_mode $CONFIG + else + set_config_var hdmi_force_hotplug 1 $CONFIG + set_config_var hdmi_group $GROUP $CONFIG + set_config_var hdmi_mode $MODE $CONFIG + fi + if [ "$INTERACTIVE" = True ]; then + if [ $MODE -eq 0 ] ; then + whiptail --msgbox "The resolution is set to default" 20 60 1 + else + whiptail --msgbox "The resolution is set to $GRS mode $MODE" 20 60 1 + fi + fi + if [ $MODE -eq 0 ] ; then + TSET="Default" + elif [ $GROUP -eq 2 ] ; then + TSET="DMT Mode "$MODE + else + TSET="CEA Mode "$MODE + fi + if [ "$TSET" != "$CSET" ] ; then + ASK_TO_REBOOT=1 + fi + fi +} + +get_vnc_resolution() { + if [ -e /etc/xdg/autostart/vnc_xrandr.desktop ] ; then + echo $(grep fb /etc/xdg/autostart/vnc_xrandr.desktop | cut -f 15 -d ' ') + else + echo "" + fi +} + +do_vnc_resolution() { + if [ "$INTERACTIVE" = True ]; then + CUR=$(get_vnc_resolution) + if [ "$CUR" = "" ] ; then + CUR=640x480 + fi + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --default-item $CUR --menu "Set VNC Resolution" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "640x480" "" "720x480" "" "800x600" "" "1024x768" "" "1280x720" "" "1280x1024" "" "1600x1200" "" "1920x1080" "" 3>&1 1>&2 2>&3) + RET=$? + else + FUN=$1 + RET=0 + fi + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + cat > /etc/xdg/autostart/vnc_xrandr.desktop << EOF +[Desktop Entry] +Type=Application +Name=vnc_xrandr +Comment=Set resolution for VNC +NoDisplay=true +Exec=sh -c "if ! (xrandr | grep -q -w connected) ; then /usr/bin/xrandr --fb $FUN ; fi" +EOF + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The resolution is set to $FUN" 20 60 1 + ASK_TO_REBOOT=1 + fi + fi +} + +list_wlan_interfaces() { + for dir in /sys/class/net/*/wireless; do + if [ -d "$dir" ]; then + IFACE="$(basename "$(dirname "$dir")")" + if wpa_cli -i "$IFACE" status > /dev/null 2>&1; then + echo "$IFACE" + fi + fi + done +} + +do_wifi_ssid_passphrase() { + RET=0 + if [ "$INTERACTIVE" = True ] && [ -z "$(get_wifi_country)" ]; then + do_wifi_country + fi + + if systemctl -q is-active dhcpcd; then + IFACE="$(list_wlan_interfaces | head -n 1)" + + if [ -z "$IFACE" ]; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "No wireless interface found" 20 60 + fi + return 1 + fi + + if ! wpa_cli -i "$IFACE" status > /dev/null 2>&1; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Could not communicate with wpa_supplicant" 20 60 + fi + return 1 + fi + elif ! systemctl -q is-active NetworkManager; then + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "No supported network connection manager found" 20 60 + fi + return 1 + fi + + SSID="$1" + while [ -z "$SSID" ] && [ "$INTERACTIVE" = True ]; do + if ! SSID=$(whiptail --inputbox "Please enter SSID" 20 60 3>&1 1>&2 2>&3); then + return 0 + elif [ -z "$SSID" ]; then + whiptail --msgbox "SSID cannot be empty. Please try again." 20 60 + fi + done + + PASSPHRASE="$2" + while [ "$INTERACTIVE" = True ]; do + if ! PASSPHRASE=$(whiptail --passwordbox "Please enter passphrase. Leave it empty if none." 20 60 3>&1 1>&2 2>&3); then + return 0 + else + break + fi + done + + # Escape special characters for embedding in regex below + ssid="$(echo "$SSID" \ + | sed 's;\\;\\\\;g' \ + | sed -e 's;\.;\\\.;g' \ + -e 's;\*;\\\*;g' \ + -e 's;\+;\\\+;g' \ + -e 's;\?;\\\?;g' \ + -e 's;\^;\\\^;g' \ + -e 's;\$;\\\$;g' \ + -e 's;\/;\\\/;g' \ + -e 's;\[;\\\[;g' \ + -e 's;\];\\\];g' \ + -e 's;{;\\{;g' \ + -e 's;};\\};g' \ + -e 's;(;\\(;g' \ + -e 's;);\\);g' \ + -e 's;";\\\\\";g')" + + HIDDEN=${3:-0} + PLAIN=${4:-1} + + if systemctl -q is-active dhcpcd; then + wpa_cli -i "$IFACE" list_networks \ + | tail -n +2 | cut -f -2 | grep -P "\t$ssid$" | cut -f1 \ + | while read -r ID; do + wpa_cli -i "$IFACE" remove_network "$ID" > /dev/null 2>&1 + done + + ID="$(wpa_cli -i "$IFACE" add_network)" + wpa_cli -i "$IFACE" set_network "$ID" ssid "\"$SSID\"" 2>&1 | grep -q "OK" + RET=$((RET + $?)) + + if [ -z "$PASSPHRASE" ]; then + wpa_cli -i "$IFACE" set_network "$ID" key_mgmt NONE 2>&1 | grep -q "OK" + RET=$((RET + $?)) + else + if [ "$PLAIN" = 1 ]; then + PASSPHRASE="\"$PASSPHRASE\"" + fi + wpa_cli -i "$IFACE" set_network "$ID" psk "$PASSPHRASE" 2>&1 | grep -q "OK" + RET=$((RET + $?)) + fi + if [ "$HIDDEN" -ne 0 ]; then + wpa_cli -i "$IFACE" set_network "$ID" scan_ssid 1 2>&1 | grep -q "OK" + RET=$((RET + $?)) + fi + if [ $RET -eq 0 ]; then + wpa_cli -i "$IFACE" enable_network "$ID" > /dev/null 2>&1 + else + wpa_cli -i "$IFACE" remove_network "$ID" > /dev/null 2>&1 + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Failed to set SSID or passphrase" 20 60 + fi + fi + wpa_cli -i "$IFACE" save_config > /dev/null 2>&1 + echo "$IFACE_LIST" | while read -r IFACE; do + wpa_cli -i "$IFACE" reconfigure > /dev/null 2>&1 + done + else + if [ "$HIDDEN" -ne 0 ]; then + nmcli device wifi connect "$SSID" password "$PASSPHRASE" hidden true | grep -q "activated" + else + nmcli device wifi connect "$SSID" password "$PASSPHRASE" | grep -q "activated" + fi + RET=$((RET + $?)) + fi + + return "$RET" +} + +do_finish() { + disable_raspi_config_at_boot + if [ $ASK_TO_REBOOT -eq 1 ]; then + whiptail --yesno "Would you like to reboot now?" 20 60 2 + if [ $? -eq 0 ]; then # yes + sync + reboot + fi + fi + exit 0 +} + +# $1 = filename, $2 = key name +get_json_string_val() { + sed -n -e "s/^[[:space:]]*\"$2\"[[:space:]]*:[[:space:]]*\"\(.*\)\"[[:space:]]*,$/\1/p" $1 +} + +# TODO: This is probably broken +do_apply_os_config() { + [ -e /boot/os_config.json ] || return 0 + NOOBSFLAVOUR=$(get_json_string_val /boot/os_config.json flavour) + NOOBSLANGUAGE=$(get_json_string_val /boot/os_config.json language) + NOOBSKEYBOARD=$(get_json_string_val /boot/os_config.json keyboard) + + if [ -n "$NOOBSFLAVOUR" ]; then + printf "Setting flavour to %s based on os_config.json from NOOBS. May take a while\n" "$NOOBSFLAVOUR" + + printf "Unrecognised flavour. Ignoring\n" + fi + + # TODO: currently ignores en_gb settings as we assume we are running in a + # first boot context, where UK English settings are default + case "$NOOBSLANGUAGE" in + "en") + if [ "$NOOBSKEYBOARD" = "gb" ]; then + DEBLANGUAGE="" # UK english is the default, so ignore + else + DEBLANGUAGE="en_US.UTF-8" + fi + ;; + "de") + DEBLANGUAGE="de_DE.UTF-8" + ;; + "fi") + DEBLANGUAGE="fi_FI.UTF-8" + ;; + "fr") + DEBLANGUAGE="fr_FR.UTF-8" + ;; + "hu") + DEBLANGUAGE="hu_HU.UTF-8" + ;; + "ja") + DEBLANGUAGE="ja_JP.UTF-8" + ;; + "nl") + DEBLANGUAGE="nl_NL.UTF-8" + ;; + "pt") + DEBLANGUAGE="pt_PT.UTF-8" + ;; + "ru") + DEBLANGUAGE="ru_RU.UTF-8" + ;; + "zh_CN") + DEBLANGUAGE="zh_CN.UTF-8" + ;; + *) + printf "Language '%s' not handled currently. Run sudo raspi-config to set up" "$NOOBSLANGUAGE" + ;; + esac + + if [ -n "$DEBLANGUAGE" ]; then + printf "Setting language to %s based on os_config.json from NOOBS. May take a while\n" "$DEBLANGUAGE" + do_change_locale "$DEBLANGUAGE" + fi + + if [ -n "$NOOBSKEYBOARD" -a "$NOOBSKEYBOARD" != "gb" ]; then + printf "Setting keyboard layout to %s based on os_config.json from NOOBS. May take a while\n" "$NOOBSKEYBOARD" + do_configure_keyboard "$NOOBSKEYBOARD" + fi + return 0 +} + +get_overlay_now() { + grep -q "boot=overlay" /proc/cmdline + echo $? +} + +get_overlay_conf() { + grep -q "boot=overlay" $CMDLINE + echo $? +} + +get_bootro_now() { + findmnt /boot | grep -q " ro," + echo $? +} + +get_bootro_conf() { + grep /boot /etc/fstab | grep -q "defaults.*,ro[ ,]" + echo $? +} + +is_uname_current() { + test -d "/lib/modules/$(uname -r)" +} + +enable_overlayfs() { + KERN=$(uname -r) + INITRD=initrd.img-"$KERN" + + # mount the boot partition as writable if it isn't already + if [ $(get_bootro_now) -eq 0 ] ; then + if ! mount -o remount,rw /boot 2>/dev/null ; then + echo "Unable to mount boot partition as writable - cannot enable" + return 1 + fi + BOOTRO=yes + else + BOOTRO=no + fi + + cat > /etc/initramfs-tools/scripts/overlay << 'EOF' +# Local filesystem mounting -*- shell-script -*- + +# +# This script overrides local_mount_root() in /scripts/local +# and mounts root as a read-only filesystem with a temporary (rw) +# overlay filesystem. +# + +. /scripts/local + +local_mount_root() +{ + local_top + local_device_setup "${ROOT}" "root file system" + ROOT="${DEV}" + + # Get the root filesystem type if not set + if [ -z "${ROOTFSTYPE}" ]; then + FSTYPE=$(get_fstype "${ROOT}") + else + FSTYPE=${ROOTFSTYPE} + fi + + local_premount + + # CHANGES TO THE ORIGINAL FUNCTION BEGIN HERE + # N.B. this code still lacks error checking + + modprobe ${FSTYPE} + checkfs ${ROOT} root "${FSTYPE}" + + # Create directories for root and the overlay + mkdir /lower /upper + + # Mount read-only root to /lower + if [ "${FSTYPE}" != "unknown" ]; then + mount -r -t ${FSTYPE} ${ROOTFLAGS} ${ROOT} /lower + else + mount -r ${ROOTFLAGS} ${ROOT} /lower + fi + + modprobe overlay || insmod "/lower/lib/modules/$(uname -r)/kernel/fs/overlayfs/overlay.ko" + + # Mount a tmpfs for the overlay in /upper + mount -t tmpfs tmpfs /upper + mkdir /upper/data /upper/work + + # Mount the final overlay-root in $rootmnt + mount -t overlay \ + -olowerdir=/lower,upperdir=/upper/data,workdir=/upper/work \ + overlay ${rootmnt} +} +EOF + + # add the overlay to the list of modules + if ! grep overlay /etc/initramfs-tools/modules > /dev/null; then + echo overlay >> /etc/initramfs-tools/modules + fi + + # build the new initramfs + update-initramfs -c -k "$KERN" + + # rename it so we know it has overlay added + mv /boot/initrd.img-"$KERN" /boot/"$INITRD" + + # there is now a modified initramfs ready for use... + + # modify config.txt + #sed -i /boot/config.txt -e "/initramfs.*/d" + #echo initramfs "$INITRD" >> /boot/config.txt + + # modify command line + if ! grep -q "boot=overlay" "/boot/orangepiEnv.txt" ; then + sed -i '/extraargs=/ s/$/ boot=overlay/' '/boot/orangepiEnv.txt' + #sed -i $CMDLINE -e "s/^/boot=overlay /" + fi + + if [ "$BOOTRO" = "yes" ] ; then + if ! mount -o remount,ro /boot 2>/dev/null ; then + echo "Unable to remount boot partition as read-only" + fi + fi +} + +disable_overlayfs() { + KERN=$(uname -r) + # mount the boot partition as writable if it isn't already + if [ $(get_bootro_now) -eq 0 ] ; then + if ! mount -o remount,rw /boot 2>/dev/null ; then + echo "Unable to mount boot partition as writable - cannot disable" + return 1 + fi + BOOTRO=yes + else + BOOTRO=no + fi + + # modify config.txt + sed -i /boot/config.txt -e "/initramfs.*/d" + update-initramfs -d -k "${KERN}-overlay" + + # modify command line + sed -i $CMDLINE -e "s/\(.*\)boot=overlay \(.*\)/\1\2/" + + if [ "$BOOTRO" = "yes" ] ; then + if ! mount -o remount,ro /boot 2>/dev/null ; then + echo "Unable to remount boot partition as read-only" + fi + fi +} + +enable_bootro() { + if [ $(get_overlay_now) -eq 0 ] ; then + echo "Overlay in use; cannot update fstab" + return 1 + fi + sed -i /etc/fstab -e "s/\(.*\/boot.*\)defaults\(.*\)/\1defaults,ro\2/" +} + +disable_bootro() { + if [ $(get_overlay_now) -eq 0 ] ; then + echo "Overlay in use; cannot update fstab" + return 1 + fi + sed -i /etc/fstab -e "s/\(.*\/boot.*\)defaults,ro\(.*\)/\1defaults\2/" +} + +do_overlayfs() { + DEFAULT=--defaultno + CURRENT=0 + STATUS="disabled" + + if [ "$INTERACTIVE" = True ] && ! is_uname_current; then + whiptail --msgbox "Could not find modules for the running kernel ($(uname -r))." 20 60 1 + return 1 + fi + + if [ $(get_overlay_conf) -eq 0 ] ; then + DEFAULT= + CURRENT=1 + STATUS="enabled" + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the overlay file system to be enabled?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + if [ $RET -eq 0 ]; then + if enable_overlayfs; then + STATUS="enabled" + ASK_TO_REBOOT=1 + else + STATUS="unchanged" + fi + elif [ $RET -eq 1 ]; then + if disable_overlayfs; then + STATUS="disabled" + ASK_TO_REBOOT=1 + else + STATUS="unchanged" + fi + else + return $RET + fi + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The overlay file system is $STATUS." 20 60 1 + fi + if [ $(get_overlay_now) -eq 0 ] ; then + if [ $(get_bootro_conf) -eq 0 ] ; then + BPRO="read-only" + else + BPRO="writable" + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The boot partition is currently $BPRO. This cannot be changed while an overlay file system is enabled." 20 60 1 + fi + else + DEFAULT=--defaultno + CURRENT=0 + STATUS="writable" + if [ $(get_bootro_conf) -eq 0 ]; then + DEFAULT= + CURRENT=1 + STATUS="read-only" + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --yesno "Would you like the boot partition to be write-protected?" $DEFAULT 20 60 2 + RET=$? + else + RET=$1 + fi + if [ $RET -eq $CURRENT ]; then + if [ $RET -eq 0 ]; then + if enable_bootro; then + STATUS="read-only" + ASK_TO_REBOOT=1 + else + STATUS="unchanged" + fi + elif [ $RET -eq 1 ]; then + if disable_bootro; then + STATUS="writable" + ASK_TO_REBOOT=1 + else + STATUS="unchanged" + fi + else + return $RET + fi + fi + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "The boot partition is $STATUS." 20 60 1 + fi + fi +} + +get_proxy() { + SCHEME="$1" + VAR_NAME="${SCHEME}_proxy" + if [ -f /etc/profile.d/proxy.sh ]; then + # shellcheck disable=SC1091 + . /etc/profile.d/proxy.sh + fi + eval "echo \$$VAR_NAME" +} + +do_proxy() { + SCHEMES="$1" + ADDRESS="$2" + if [ "$SCHEMES" = "all" ]; then + CURRENT="$(get_proxy http)" + SCHEMES="http https ftp rsync" + else + CURRENT="$(get_proxy "$SCHEMES")" + fi + if [ "$INTERACTIVE" = True ]; then + if [ "$SCHEMES" = "no" ]; then + STRING="Please enter a comma separated list of addresses that should be excluded from using proxy servers.\\nEg: localhost,127.0.0.1,localaddress,.localdomain.com" + else + STRING="Please enter proxy address.\\nEg: http://user:pass@proxy:8080" + fi + if ! ADDRESS="$(whiptail --inputbox "$STRING" 20 60 "$CURRENT" 3>&1 1>&2 2>&3)"; then + return 0 + fi + fi + for SCHEME in $SCHEMES; do + unset "${SCHEME}_proxy" + CURRENT="$(get_proxy "$SCHEME")" + if [ "$CURRENT" != "$ADDRESS" ]; then + ASK_TO_REBOOT=1 + fi + if [ -f /etc/profile.d/proxy.sh ]; then + sed -i "/^export ${SCHEME}_/Id" /etc/profile.d/proxy.sh + fi + if [ "${SCHEME#*http}" != "$SCHEME" ]; then + if [ -f /etc/apt/apt.conf.d/01proxy ]; then + sed -i "/::${SCHEME}::Proxy/d" /etc/apt/apt.conf.d/01proxy + fi + fi + if [ -z "$ADDRESS" ]; then + STATUS=cleared + continue + fi + STATUS=updated + SCHEME_UPPER="$(echo "$SCHEME" | tr '[:lower:]' '[:upper:]')" + echo "export ${SCHEME_UPPER}_PROXY=\"$ADDRESS\"" >> /etc/profile.d/proxy.sh + if [ "$SCHEME" != "rsync" ]; then + echo "export ${SCHEME}_proxy=\"$ADDRESS\"" >> /etc/profile.d/proxy.sh + fi + if [ "${SCHEME#*http}" != "$SCHEME" ]; then + echo "Acquire::$SCHEME::Proxy \"$ADDRESS\";" >> /etc/apt/apt.conf.d/01proxy + fi + done + if [ "$INTERACTIVE" = True ]; then + whiptail --msgbox "Proxy settings $STATUS" 20 60 1 + fi +} + +nonint() { + "$@" +} + +# +# Command line options for non-interactive use +# +for i in $* +do + case $i in + --memory-split) + OPT_MEMORY_SPLIT=GET + printf "Not currently supported\n" + exit 1 + ;; + --memory-split=*) + OPT_MEMORY_SPLIT=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` + printf "Not currently supported\n" + exit 1 + ;; + --expand-rootfs) + INTERACTIVE=False + do_expand_rootfs + printf "Please reboot\n" + exit 0 + ;; + --apply-os-config) + INTERACTIVE=False + do_apply_os_config + exit $? + ;; + nonint) + INTERACTIVE=False + "$@" + exit $? + ;; + *) + # unknown option + ;; + esac +done + +#if [ "GET" = "${OPT_MEMORY_SPLIT:-}" ]; then +# set -u # Fail on unset variables +# get_current_memory_split +# echo $CURRENT_MEMSPLIT +# exit 0 +#fi + +# Everything else needs to be run as root +if [ $(id -u) -ne 0 ]; then + printf "Script must be run as root. Try 'sudo raspi-config'\n" + exit 1 +fi + +if [ -n "${OPT_MEMORY_SPLIT:-}" ]; then + set -e # Fail when a command errors + set_memory_split "${OPT_MEMORY_SPLIT}" + exit 0 +fi + +do_system_menu() { + if is_pi ; then + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "System Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "S1 Wireless LAN" "Enter SSID and passphrase" \ + "S2 Audio" "Select audio out through HDMI or 3.5mm jack" \ + "S3 Password" "Change password for the '$USER' user" \ + "S4 Hostname" "Set name for this computer on a network" \ + "S5 Boot / Auto Login" "Select boot into desktop or to command line" \ + 3>&1 1>&2 2>&3) + elif is_live ; then + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "System Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "S1 Wireless LAN" "Enter SSID and passphrase" \ + "S3 Password" "Change password for the '$USER' user" \ + "S4 Hostname" "Set name for this computer on a network" \ + "S5 Boot / Auto Login" "Select boot into desktop or to command line" \ + 3>&1 1>&2 2>&3) + else + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "System Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "S1 Wireless LAN" "Enter SSID and passphrase" \ + "S3 Password" "Change password for the '$USER' user" \ + "S4 Hostname" "Set name for this computer on a network" \ + "S5 Boot / Auto Login" "Select boot into desktop or to command line" \ + 3>&1 1>&2 2>&3) + fi + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + S1\ *) do_wifi_ssid_passphrase ;; + S2\ *) do_audio ;; + S3\ *) do_change_pass ;; + S4\ *) do_hostname ;; + S5\ *) do_boot_behaviour ;; + S6\ *) do_boot_wait ;; + S7\ *) do_boot_splash ;; + S8\ *) do_leds ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_display_menu() { + if is_pi ; then + if is_kms; then + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Display Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "D5 VNC Resolution" "Set resolution for headless use" \ + 3>&1 1>&2 2>&3) + else + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Display Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "D5 VNC Resolution" "Set resolution for headless use" \ + 3>&1 1>&2 2>&3) + fi + fi + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + D1\ *) do_resolution ;; + D2\ *) if is_pi && ! is_kms; then + do_overscan + else + do_overscan_kms + fi + ;; + D3\ *) do_pixdub ;; + D4\ *) do_blanking ;; + D5\ *) do_vnc_resolution ;; + D6\ *) if is_pifour ; then + do_pi4video + else + do_composite + fi + ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_hardware() { + + OVERLAYDIR="/boot/dtb/overlay"; + [[ "$LINUXFAMILY" == "sunxi64" ]] && OVERLAYDIR="/boot/dtb/allwinner/overlay"; + [[ "$LINUXFAMILY" == "rockchip64" ]] && OVERLAYDIR="/boot/dtb/rockchip/overlay"; + [[ "$LINUXFAMILY" == "rockchip-rk3588" ]] && OVERLAYDIR="/boot/dtb/rockchip/overlay"; + [[ "$LINUXFAMILY" == "sun50iw9" && "$BRANCH" == "current" ]] && OVERLAYDIR="/boot/dtb/sunxi/overlay"; + [[ "$LINUXFAMILY" == "sun50iw9" && "$BRANCH" == "next" ]] && OVERLAYDIR="/boot/dtb/allwinner/overlay"; + [[ "$LINUXFAMILY" == "rockchip-rk356x" ]] && OVERLAYDIR="/boot/dtb/rockchip/overlay"; + + # check if user agree to enter this area + CHANGES="false" + while true; do + overlay_prefix=$(cat /boot/orangepiEnv.txt | grep overlay_prefix | sed 's/overlay_prefix=//g') + TARGET_BRANCH=$BRANCH + MOTD=() + LINES=() + LIST_CONST=-3 + j=0 + DIALOG_CANCEL=1 + DIALOG_ESC=255 + while read line + do + STATUS=$([[ -n $(cat /boot/orangepiEnv.txt | grep overlays | grep -w ${line}) ]] && echo "on") + DESC="" + MOTD+=( "$line" "$DESC" "$STATUS") + LINES[ $j ]=$line + (( j++ )) + done < <(ls -1 ${OVERLAYDIR}/${overlay_prefix}*.dtbo | sed 's/^.*\('${overlay_prefix}'.*\)/\1/g' | sed 's/'${overlay_prefix}'-//g' | sed 's/.dtbo//g' ) + + exec 3>&1 + selection=$(dialog --backtitle "orangepi" --colors --title "Toggle hardware configuration" --clear --cancel-label \ + "Back" --ok-label "Save" --checklist "\nUse \Z1\Z0 to toggle functions and save them. Exit when you are done.\n " \ + 0 0 0 "${MOTD[@]}" 2>&1 1>&3) + exit_status=$? + exec 3>&- + + case $exit_status in + $DIALOG_ESC) + break + ;; + 0) + CHANGES="true" + newoverlays="$(echo "$selection" | sed "s|[^ ]* *|&|g")" + sed -i "s/^overlays=.*/overlays=$newoverlays/" /boot/orangepiEnv.txt + if ! grep -q "overlays" /boot/orangepiEnv.txt; then echo "overlays=$newoverlays" >> /boot/orangepiEnv.txt; fi + if [[ -z $newoverlays ]]; then sed -i "/^overlays/d" /boot/orangepiEnv.txt; fi + sync + ;; + 1) + if [[ "$CHANGES" == "true" ]]; then + dialog --title " Applying changes " --backtitle "$BACKTITLE" --yes-label "Reboot" \ + --no-label "Cancel" --yesno "\nReboot to enable new features?" 7 34 + if [[ $? = 0 ]]; then reboot; else break; fi + else + break + fi + ;; + esac + done +} + +do_interface_menu() { + if is_pi ; then + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "I1 Hardware" "Toggle hardware configuration: UART, I2C, etc." \ + "I2 SSH" "Enable/disable remote command line access using SSH" \ + "I3 VNC" "Enable/disable graphical remote access using RealVNC" \ + 3>&1 1>&2 2>&3) + else + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "I2 SSH" "Enable/disable remote command line access using SSH" \ + 3>&1 1>&2 2>&3) + fi + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + I1\ *) do_hardware ;; + I2\ *) do_ssh ;; + I3\ *) do_vnc ;; + I4\ *) do_spi ;; + I5\ *) do_i2c ;; + I6\ *) do_serial ;; + I7\ *) do_onewire ;; + I8\ *) do_rgpio ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_performance_menu() { + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Performance Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "P3 Overlay File System" "Enable/disable read-only file system" \ + 3>&1 1>&2 2>&3) + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + P1\ *) do_overclock ;; + P2\ *) do_memory_split ;; + P3\ *) do_overlayfs ;; + P4\ *) do_fan ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_internationalisation_menu() { + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Localisation Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "L1 Locale" "Configure language and regional settings" \ + "L2 Timezone" "Configure time zone" \ + "L3 Keyboard" "Set keyboard layout to match your keyboard" \ + "L4 WLAN Country" "Set legal wireless channels for your country" \ + 3>&1 1>&2 2>&3) + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + L1\ *) do_change_locale ;; + L2\ *) do_change_timezone ;; + L3\ *) do_configure_keyboard ;; + L4\ *) do_wifi_country ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_advanced_menu() { + if is_pifour ; then + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "A1 Expand Filesystem" "Ensures that all of the SD card is available" \ + "A5 Network Proxy Settings" "Configure network proxy settings" \ + "AA Network Config" "Set network configuration tool" \ + 3>&1 1>&2 2>&3) + elif is_pi ; then + if is_kms; then + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "A1 Expand Filesystem" "Ensures that all of the SD card is available" \ + "A5 Network Proxy Settings" "Configure network proxy settings" \ + "AA Network Config" "Set network configuration tool" \ + 3>&1 1>&2 2>&3) + else + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "A1 Expand Filesystem" "Ensures that all of the SD card is available" \ + "A5 Network Proxy Settings" "Configure network proxy settings" \ + "AA Network Config" "Set network configuration tool" \ + 3>&1 1>&2 2>&3) + fi + else + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "A4 Network Interface Names" "Enable/disable predictable network i/f names" \ + "A5 Network Proxy Settings" "Configure network proxy settings" \ + "AA Network Config" "Set network configuration tool" \ + 3>&1 1>&2 2>&3) + fi + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + A1\ *) do_expand_rootfs ;; + A2\ *) do_gldriver ;; + A3\ *) do_xcompmgr ;; + A4\ *) do_net_names ;; + A5\ *) do_proxy_menu ;; + A6\ *) do_boot_order ;; + A7\ *) do_boot_rom ;; + A8\ *) do_glamor ;; + A9\ *) do_wayland ;; + AA\ *) do_netconf ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +do_proxy_menu() { + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Network Proxy Settings" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \ + "P1 All" "Set the same proxy for all schemes" \ + "P2 HTTP" "Set the HTTP proxy" \ + "P3 HTTPS" "Set the HTTPS/SSL proxy" \ + "P4 FTP" "Set the FTP proxy" \ + "P5 RSYNC" "Set the RSYNC proxy" \ + "P6 Exceptions" "Set addresses for which a proxy server should not be used" \ + 3>&1 1>&2 2>&3) + RET=$? + if [ $RET -eq 1 ]; then + return 0 + elif [ $RET -eq 0 ]; then + case "$FUN" in + P1\ *) do_proxy all ;; + P2\ *) do_proxy http ;; + P3\ *) do_proxy https ;; + P4\ *) do_proxy ftp ;; + P5\ *) do_proxy rsync ;; + P6\ *) do_proxy no;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + fi +} + +# +# Interactive use loop +# +if [ "$INTERACTIVE" = True ]; then + [ -e $CONFIG ] || touch $CONFIG + calc_wt_size + while [ "$USER" = "root" ] || [ -z "$USER" ]; do + if ! USER=$(whiptail --inputbox "raspi-config could not determine the default user.\\n\\nWhat user should these settings apply to?" 20 60 pi 3>&1 1>&2 2>&3); then + return 0 + fi + done + while true; do + if is_pi ; then + MODEL=$(tr -d '\0' < /proc/device-tree/model) + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --backtitle "${MODEL}" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \ + "1 System Options" "Configure system settings" \ + "2 Display Options" "Configure display settings" \ + "3 Interface Options" "Configure connections to peripherals" \ + "4 Performance Options" "Configure performance settings" \ + "5 Localisation Options" "Configure language and regional settings" \ + "6 Advanced Options" "Configure advanced settings" \ + "9 About raspi-config" "Information about this configuration tool" \ + 3>&1 1>&2 2>&3) + else + FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \ + "1 System Options" "Configure system settings" \ + "2 Display Options" "Configure display settings" \ + "3 Interface Options" "Configure connections to peripherals" \ + "5 Localisation Options" "Configure language and regional settings" \ + "6 Advanced Options" "Configure advanced settings" \ + "9 About raspi-config" "Information about this configuration tool" \ + 3>&1 1>&2 2>&3) + fi + RET=$? + if [ $RET -eq 1 ]; then + do_finish + elif [ $RET -eq 0 ]; then + case "$FUN" in + 1\ *) do_system_menu ;; + 2\ *) do_display_menu ;; + 3\ *) do_interface_menu ;; + 4\ *) do_performance_menu ;; + 5\ *) do_internationalisation_menu ;; + 6\ *) do_advanced_menu ;; + 8\ *) do_update ;; + 9\ *) do_about ;; + *) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;; + esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1 + else + exit 1 + fi + done +fi diff --git a/external/cache/sources/raspi-config/usr/lib/raspi-config/cmstart.sh b/external/cache/sources/raspi-config/usr/lib/raspi-config/cmstart.sh new file mode 100755 index 000000000000..2904250946a9 --- /dev/null +++ b/external/cache/sources/raspi-config/usr/lib/raspi-config/cmstart.sh @@ -0,0 +1,6 @@ +#!/bin/sh +if raspi-config nonint is_kms ; then + if ps ax | grep -v grep | grep -q openbox ; then + exec xcompmgr -aR + fi +fi diff --git a/external/cache/sources/raspi-config/usr/lib/raspi-config/init_resize.sh b/external/cache/sources/raspi-config/usr/lib/raspi-config/init_resize.sh new file mode 100755 index 000000000000..a9ae9bba83fc --- /dev/null +++ b/external/cache/sources/raspi-config/usr/lib/raspi-config/init_resize.sh @@ -0,0 +1,227 @@ +#!/bin/sh + +reboot_pi () { + umount /boot + mount / -o remount,ro + sync + if [ "$NOOBS" = "1" ]; then + if [ "$NEW_KERNEL" = "1" ]; then + reboot -f "$BOOT_PART_NUM" + sleep 5 + else + echo "$BOOT_PART_NUM" > "/sys/module/${BCM_MODULE}/parameters/reboot_part" + fi + fi + reboot -f + sleep 5 + exit 0 +} + +check_commands () { + if ! command -v whiptail > /dev/null; then + echo "whiptail not found" + sleep 5 + return 1 + fi + for COMMAND in grep cut sed parted fdisk findmnt; do + if ! command -v $COMMAND > /dev/null; then + FAIL_REASON="$COMMAND not found" + return 1 + fi + done + return 0 +} + +check_noobs () { + if [ "$BOOT_PART_NUM" = "1" ]; then + NOOBS=0 + else + NOOBS=1 + fi +} + +get_variables () { + ROOT_PART_DEV=$(findmnt / -o source -n) + ROOT_PART_NAME=$(echo "$ROOT_PART_DEV" | cut -d "/" -f 3) + ROOT_DEV_NAME=$(echo /sys/block/*/"${ROOT_PART_NAME}" | cut -d "/" -f 4) + ROOT_DEV="/dev/${ROOT_DEV_NAME}" + ROOT_PART_NUM=$(cat "/sys/block/${ROOT_DEV_NAME}/${ROOT_PART_NAME}/partition") + + BOOT_PART_DEV=$(findmnt /boot -o source -n) + BOOT_PART_NAME=$(echo "$BOOT_PART_DEV" | cut -d "/" -f 3) + BOOT_DEV_NAME=$(echo /sys/block/*/"${BOOT_PART_NAME}" | cut -d "/" -f 4) + BOOT_PART_NUM=$(cat "/sys/block/${BOOT_DEV_NAME}/${BOOT_PART_NAME}/partition") + + OLD_DISKID=$(fdisk -l "$ROOT_DEV" | sed -n 's/Disk identifier: 0x\([^ ]*\)/\1/p') + + check_noobs + + ROOT_DEV_SIZE=$(cat "/sys/block/${ROOT_DEV_NAME}/size") + TARGET_END=$((ROOT_DEV_SIZE - 1)) + + PARTITION_TABLE=$(parted -m "$ROOT_DEV" unit s print | tr -d 's') + + LAST_PART_NUM=$(echo "$PARTITION_TABLE" | tail -n 1 | cut -d ":" -f 1) + + ROOT_PART_LINE=$(echo "$PARTITION_TABLE" | grep -e "^${ROOT_PART_NUM}:") + ROOT_PART_START=$(echo "$ROOT_PART_LINE" | cut -d ":" -f 2) + ROOT_PART_END=$(echo "$ROOT_PART_LINE" | cut -d ":" -f 3) + + if [ "$NOOBS" = "1" ]; then + EXT_PART_LINE=$(echo "$PARTITION_TABLE" | grep ":::;" | head -n 1) + EXT_PART_NUM=$(echo "$EXT_PART_LINE" | cut -d ":" -f 1) + EXT_PART_START=$(echo "$EXT_PART_LINE" | cut -d ":" -f 2) + EXT_PART_END=$(echo "$EXT_PART_LINE" | cut -d ":" -f 3) + fi +} + +fix_partuuid() { + mount -o remount,rw "$ROOT_PART_DEV" + mount -o remount,rw "$BOOT_PART_DEV" + DISKID="$(tr -dc 'a-f0-9' < /dev/hwrng | dd bs=1 count=8 2>/dev/null)" + fdisk "$ROOT_DEV" > /dev/null < /dev/null 2>&1 + + check_kernel + + if [ "$NOOBS" = "1" ] && [ "$NEW_KERNEL" != "1" ]; then + BCM_MODULE=$(grep -e "^Hardware" /proc/cpuinfo | cut -d ":" -f 2 | tr -d " " | tr '[:upper:]' '[:lower:]') + if ! modprobe "$BCM_MODULE"; then + FAIL_REASON="Couldn't load BCM module $BCM_MODULE" + return 1 + fi + fi + + if [ "$ROOT_PART_END" -eq "$TARGET_END" ]; then + reboot_pi + fi + + if [ "$NOOBS" = "1" ]; then + if ! printf "resizepart %s\nyes\n%ss\n" "$EXT_PART_NUM" "$TARGET_END" | parted "$ROOT_DEV" ---pretend-input-tty; then + FAIL_REASON="Extended partition resize failed" + return 1 + fi + fi + + if ! parted -m "$ROOT_DEV" u s resizepart "$ROOT_PART_NUM" "$TARGET_END"; then + FAIL_REASON="Root partition resize failed" + return 1 + fi + + fix_partuuid + + return 0 +} + +mount -t proc proc /proc +mount -t sysfs sys /sys +mount -t tmpfs tmp /run +mkdir -p /run/systemd + +mount /boot +mount / -o remount,ro + +sed -i 's| init=/usr/lib/raspi-config/init_resize\.sh||' /boot/cmdline.txt +sed -i 's| sdhci\.debug_quirks2=4||' /boot/cmdline.txt + +if ! grep -q splash /boot/cmdline.txt; then + sed -i "s/ quiet//g" /boot/cmdline.txt +fi +mount /boot -o remount,ro +sync + +if ! check_commands; then + reboot_pi +fi + +if main; then + whiptail --infobox "Resized root filesystem. Rebooting in 5 seconds..." 20 60 + sleep 5 +else + whiptail --msgbox "Could not expand filesystem, please try raspi-config or rc_gui.\n${FAIL_REASON}" 20 60 + sleep 5 +fi + +reboot_pi diff --git a/external/cache/sources/raspi-config/usr/share/raspi-config/10-blanking.conf b/external/cache/sources/raspi-config/usr/share/raspi-config/10-blanking.conf new file mode 100644 index 000000000000..2c794af6e583 --- /dev/null +++ b/external/cache/sources/raspi-config/usr/share/raspi-config/10-blanking.conf @@ -0,0 +1,11 @@ +Section "Extensions" + Option "DPMS" "Disable" +EndSection + +Section "ServerLayout" + Identifier "ServerLayout0" + Option "StandbyTime" "0" + Option "SuspendTime" "0" + Option "OffTime" "0" + Option "BlankTime" "0" +EndSection diff --git a/external/packages/raspi/orangepi/debs/raspi-config_20230214_all.deb b/external/packages/raspi/orangepi/debs/raspi-config_20230214_all.deb new file mode 100644 index 0000000000000000000000000000000000000000..3e794e122185d2b1b26eb291ac1c51aa463f21d0 GIT binary patch liter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