├── debian ├── compat ├── source │ └── format ├── raspberrypi-sys-mods.install ├── raspberrypi-sys-mods.install.armhf ├── raspberrypi-sys-mods.install.arm64 ├── .gitignore ├── raspberrypi-sys-mods.maintscript ├── raspberrypi-sys-mods.sshswitch.service ├── raspberrypi-sys-mods.apply_noobs_os_config.service ├── raspberrypi-sys-mods.rpi-display-backlight.service ├── raspberrypi-sys-mods.regenerate_ssh_host_keys.service ├── control ├── raspberrypi-sys-mods.preinst ├── raspberrypi-sys-mods.postrm ├── copyright ├── rules ├── NEWS ├── raspberrypi-sys-mods.postinst └── changelog ├── etc.arm64 └── modules-load.d │ └── aes-neon.conf ├── etc.arm ├── modprobe.d │ ├── blacklist-8192cu.conf │ └── blacklist-rtl8xxxu.conf ├── sysctl.d │ └── 98-rpi.conf └── udev │ └── rules.d │ └── 99-com.rules ├── etc ├── sudoers.d │ ├── 010_pi-nopasswd │ └── 010_at-export └── profile.d │ └── at-dbus-fix.sh ├── lib └── udev │ └── rules.d │ ├── 70-microbit.rules │ ├── 80-noobs.rules │ └── 15-i2c-modprobe.rules ├── var └── lib │ └── polkit-1 │ └── localauthority │ └── 10-vendor.d │ └── 55-storage.pkla └── usr └── lib └── raspberrypi-sys-mods └── i2cprobe /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /etc.arm64/modules-load.d/aes-neon.conf: -------------------------------------------------------------------------------- 1 | aes-neon-bs 2 | -------------------------------------------------------------------------------- /etc.arm/modprobe.d/blacklist-8192cu.conf: -------------------------------------------------------------------------------- 1 | blacklist 8192cu 2 | -------------------------------------------------------------------------------- /etc/sudoers.d/010_pi-nopasswd: -------------------------------------------------------------------------------- 1 | pi ALL=(ALL) NOPASSWD: ALL 2 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.install: -------------------------------------------------------------------------------- 1 | etc 2 | lib 3 | usr 4 | var 5 | -------------------------------------------------------------------------------- /etc.arm/modprobe.d/blacklist-rtl8xxxu.conf: -------------------------------------------------------------------------------- 1 | blacklist rtl8xxxu 2 | -------------------------------------------------------------------------------- /etc/sudoers.d/010_at-export: -------------------------------------------------------------------------------- 1 | Defaults env_keep += "NO_AT_BRIDGE" 2 | -------------------------------------------------------------------------------- /etc.arm/sysctl.d/98-rpi.conf: -------------------------------------------------------------------------------- 1 | kernel.printk = 3 4 1 3 2 | vm.min_free_kbytes = 16384 3 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.install.armhf: -------------------------------------------------------------------------------- 1 | etc 2 | etc.arm/* etc 3 | lib 4 | usr 5 | var 6 | -------------------------------------------------------------------------------- /lib/udev/rules.d/70-microbit.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="usb", ATTR{idVendor}=="0d28", TAG+="uaccess" 2 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.install.arm64: -------------------------------------------------------------------------------- 1 | etc 2 | etc.arm/* etc 3 | etc.arm64/* etc 4 | lib 5 | usr 6 | var 7 | -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | debhelper-build-stamp 2 | files 3 | *.log 4 | *.debhelper 5 | *.substvars 6 | raspberrypi-sys-mods/ 7 | -------------------------------------------------------------------------------- /etc/profile.d/at-dbus-fix.sh: -------------------------------------------------------------------------------- 1 | if ! [ -e /usr/share/dbus-1/services/org.a11y.Bus.service ] ; then 2 | export NO_AT_BRIDGE=1 3 | fi 4 | -------------------------------------------------------------------------------- /lib/udev/rules.d/80-noobs.rules: -------------------------------------------------------------------------------- 1 | # NOOBS Settings partition 2 | ENV{ID_FS_TYPE}=="ext4", ENV{ID_FS_LABEL}=="SETTINGS", ENV{UDISKS_IGNORE}="1" 3 | -------------------------------------------------------------------------------- /lib/udev/rules.d/15-i2c-modprobe.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="i2c|spi", ENV{MODALIAS}=="?*", ENV{OF_NAME}=="?*", ENV{OF_COMPATIBLE_0}=="?*", RUN+="/usr/lib/raspberrypi-sys-mods/i2cprobe" 2 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.maintscript: -------------------------------------------------------------------------------- 1 | rm_conffile /etc/profile.d/sshpasswd.sh 20161220 2 | rm_conffile /etc/profile.d/wifi-country.sh 20190429 3 | rm_conffile /etc/modprobe.d/blacklist-rtl8192cu.conf 20190730 4 | rm_conffile /etc/apt/preferences.d/3rd_parties.pref 20210310 5 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.sshswitch.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Turn on SSH if /boot/ssh is present 3 | ConditionPathExistsGlob=/boot/ssh{,.txt} 4 | After=regenerate_ssh_host_keys.service 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStart=/bin/sh -c "systemctl enable --now ssh && rm -f /boot/ssh ; rm -f /boot/ssh.txt" 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | 13 | -------------------------------------------------------------------------------- /var/lib/polkit-1/localauthority/10-vendor.d/55-storage.pkla: -------------------------------------------------------------------------------- 1 | [Storage Permissions] 2 | Identity=unix-group:plugdev 3 | Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown 4 | ResultAny=yes 5 | ResultActive=yes 6 | ResultInactive=no 7 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.apply_noobs_os_config.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Apply NOOBS config 3 | ConditionPathExists=/boot/os_config.json 4 | Before=display-manager.service getty.target autologin@tty1.service 5 | 6 | [Service] 7 | Type=oneshot 8 | TimeoutSec=300 9 | ExecStart=/usr/bin/raspi-config --apply-os-config 10 | ExecStartPost=/bin/systemctl disable apply_noobs_os_config 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.rpi-display-backlight.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Turns off Raspberry Pi display backlight on shutdown/reboot 3 | ConditionPathIsDirectory=/proc/device-tree/rpi_backlight 4 | DefaultDependencies=no 5 | Before=umount.target 6 | 7 | [Service] 8 | Type=oneshot 9 | ExecStart=/bin/sh -c '/bin/echo 1 > /sys/class/backlight/rpi_backlight/bl_power' 10 | 11 | [Install] 12 | WantedBy=reboot.target halt.target poweroff.target 13 | 14 | -------------------------------------------------------------------------------- /usr/lib/raspberrypi-sys-mods/i2cprobe: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ALIASES=/lib/modules/`uname -r`/modules.alias 3 | n=0 4 | while true; do 5 | comp=OF_COMPATIBLE_${n} 6 | comp=`echo ${!comp} | sed 's/.*,//'` 7 | if [ "${comp}" == "" ]; then 8 | break 9 | fi 10 | if grep -q "alias ${SUBSYSTEM}:${comp} " $ALIASES; then 11 | modprobe "${SUBSYSTEM}:${comp}" && exit 0 12 | fi 13 | let n="$n + 1" 14 | done 15 | modprobe "${MODALIAS}" || modprobe "of:N${OF_NAME}TC${OF_COMPATIBLE_0}" 16 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.regenerate_ssh_host_keys.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Regenerate SSH host keys 3 | Before=ssh.service 4 | ConditionFileIsExecutable=/usr/bin/ssh-keygen 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStartPre=-/bin/dd if=/dev/hwrng of=/dev/urandom count=1 bs=4096 9 | ExecStartPre=-/bin/sh -c "/bin/rm -f -v /etc/ssh/ssh_host_*_key*" 10 | ExecStart=/usr/bin/ssh-keygen -A -v 11 | ExecStartPost=/bin/systemctl disable regenerate_ssh_host_keys 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: raspberrypi-sys-mods 2 | Section: admin 3 | Priority: optional 4 | Maintainer: Serge Schneider 5 | Build-Depends: debhelper (>= 10) 6 | Standards-Version: 4.3.0 7 | Homepage: https://github.com/RPi-Distro/raspberrypi-sys-mods 8 | Vcs-Git: git://git@github.com:RPi-Distro/raspberrypi-sys-mods.git 9 | Vcs-Browser: https://github.com/RPi-Distro/raspberrypi-sys-mods 10 | 11 | Package: raspberrypi-sys-mods 12 | Architecture: any 13 | Depends: ${shlibs:Depends}, ${misc:Depends}, libcap2-bin, systemd (>= 230), 14 | gettext-base, procps 15 | Breaks: raspberrypi-ui-mods (<<1.20210706) 16 | Replaces: raspberrypi-ui-mods (<<1.20210706) 17 | Recommends: rfkill, rpi-eeprom 18 | Description: System tweaks for the Raspberry Pi 19 | Various modifications to improve the performance or user experience. 20 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | case "${1}" in 4 | install|upgrade) 5 | if dpkg --compare-versions "${2}" lt-nl "20160915" && [ -f /etc/sysctl.d/98-rpi.conf ]; then 6 | if [ "$(md5sum /etc/sysctl.d/98-rpi.conf | cut -f1 -d" ")" = "69873a82479534ccfb0f2f05f6693439" ]; then 7 | echo "Removing old /etc/sysctl.d/98-rpi.conf..." 8 | rm -f /etc/sysctl.d/98-rpi.conf 9 | echo "Adjusting vm.swappiness and vm.min_free_kbytes..." 10 | echo 60 > /proc/sys/vm/swappiness 11 | echo 16384 > /proc/sys/vm/min_free_kbytes 12 | else 13 | echo "Detected modified /etc/sysctl.d/98-rpi.conf. Leaving unchanged." 14 | fi 15 | fi 16 | ;; 17 | 18 | abort-upgrade) 19 | 20 | ;; 21 | 22 | *) 23 | echo "preinst called with unknown argument \`${1}'" >&2 24 | exit 1 25 | ;; 26 | esac 27 | 28 | #DEBHELPER# 29 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # summary of how this script can be called: 5 | # * `remove' 6 | # * `purge' 7 | # * `upgrade' 8 | # * `failed-upgrade' 9 | # * `abort-install' 10 | # * `abort-install' 11 | # * `abort-upgrade' 12 | # * `disappear' 13 | # 14 | # for details, see https://www.debian.org/doc/debian-policy/ or 15 | # the debian-policy package 16 | 17 | 18 | case "$1" in 19 | purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 20 | ;; 21 | remove) 22 | eval "$(apt-config shell APT_SOURCE_PARTS Dir::Etc::sourceparts/d)" 23 | CODE_SOURCE_PART="${APT_SOURCE_PARTS}vscode.list" 24 | eval "$(apt-config shell APT_TRUSTED_PARTS Dir::Etc::trustedparts/d)" 25 | CODE_TRUSTED_PART="${APT_TRUSTED_PARTS}microsoft.gpg" 26 | if ! [ -s "$CODE_TRUSTED_PART" ] && [ -f "$CODE_TRUSTED_PART" ]; then 27 | rm "$CODE_TRUSTED_PART" ||: 28 | fi 29 | if ! grep -vsq '^\s*$\|^\s*#' "$CODE_SOURCE_PART" && [ -f "$CODE_SOURCE_PART" ]; then 30 | rm "$CODE_SOURCE_PART" ||: 31 | fi 32 | 33 | ;; 34 | *) 35 | echo "postrm called with unknown argument \`$1'" >&2 36 | exit 1 37 | ;; 38 | esac 39 | 40 | # dh_installdeb will replace this with shell code automatically 41 | # generated by other debhelper scripts. 42 | 43 | #DEBHELPER# 44 | 45 | exit 0 46 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: raspberrypi-sys-mods 3 | Source: https://github.com/RPi-Distro/raspberrypi-sys-mods 4 | 5 | Files: * 6 | Copyright: 2015 Raspberry Pi Foundation 7 | License: BSD-3-Clause 8 | 9 | License: BSD-3-Clause 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions 12 | are met: 13 | 1. Redistributions of source code must retain the above copyright 14 | notice, this list of conditions and the following disclaimer. 15 | 2. Redistributions in binary form must reproduce the above copyright 16 | notice, this list of conditions and the following disclaimer in the 17 | documentation and/or other materials provided with the distribution. 18 | 3. Neither the name of the University nor the names of its contributors 19 | may be used to endorse or promote products derived from this software 20 | without specific prior written permission. 21 | . 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR 26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #DH_VERBOSE = 1 5 | 6 | # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* 7 | DPKG_EXPORT_BUILDFLAGS = 1 8 | include /usr/share/dpkg/default.mk 9 | 10 | # see FEATURE AREAS in dpkg-buildflags(1) 11 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 12 | 13 | # see ENVIRONMENT in dpkg-buildflags(1) 14 | # package maintainers to append CFLAGS 15 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 16 | # package maintainers to append LDFLAGS 17 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 18 | 19 | 20 | # main packaging script based on dh7 syntax 21 | %: 22 | dh $@ --with systemd 23 | 24 | # debmake generated override targets 25 | # This is example for Cmake (See http://bugs.debian.org/641051 ) 26 | #override_dh_auto_configure: 27 | # dh_auto_configure -- \ 28 | # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) 29 | 30 | 31 | override_dh_installinit: 32 | dh_installinit --name=rpi-display-backlight --no-stop-on-upgrade --no-start 33 | dh_installinit --name=sshswitch 34 | dh_installinit --name=apply_noobs_os_config --no-stop-on-upgrade --no-start 35 | dh_installinit --name=regenerate_ssh_host_keys --no-stop-on-upgrade --no-start 36 | dh_installinit --name=wifi-country --no-stop-on-upgrade --no-start 37 | 38 | override_dh_systemd_enable: 39 | dh_systemd_enable --name=rpi-display-backlight 40 | dh_systemd_enable --name=sshswitch 41 | dh_systemd_enable --name=apply_noobs_os_config --no-enable 42 | dh_systemd_enable --name=regenerate_ssh_host_keys --no-enable 43 | dh_systemd_enable --name=wifi-country 44 | 45 | override_dh_systemd_start: 46 | dh_systemd_start --name=sshswitch --no-start 47 | dh_systemd_start --name=apply_noobs_os_config --no-start 48 | dh_systemd_start --name=regenerate_ssh_host_keys --no-start 49 | dh_systemd_start --name=wifi-country --no-start 50 | -------------------------------------------------------------------------------- /debian/NEWS: -------------------------------------------------------------------------------- 1 | raspberrypi-sys-mods (20161018+3) jessie; urgency=medium 2 | 3 | * The 20161018 release has introduced a /etc/sudoers.d/010_pi-nopasswd file. 4 | - The file is installed even if the "pi ALL=(ALL) NOPASSWD: ALL" entry has been 5 | previously removed from /etc/sudoers by the user. 6 | - If you do not want the entry to exist, please comment out or remove 010_pi-nopasswd. 7 | - If upgrading to 20161018+3 from a version earlier than 20161018, the line in 8 | 010_pi-nopasswd is automatically commented out if the entry doesn't exist in sudoers. 9 | - See https://github.com/RPi-Distro/raspberrypi-sys-mods/issues/6 10 | 11 | -- Serge Schneider Wed, 19 Oct 2016 10:52:07 +0100 12 | 13 | raspberrypi-sys-mods (20160321) jessie; urgency=medium 14 | 15 | * This update replaces ttyAMA0 and ttyS0 with serial0 and serial1 in /boot/cmdline.txt 16 | * On the Raspberry Pi 3, ttyAMA0 is used to communicate with Bluetooth chip. 17 | In order to support using the same SD card across all models of the Raspberry Pi, some changes have been made: 18 | - Device tree aliases have been added for the 'free'/console and bluetooth serial devices (serial0 and serial1, respecitvely) 19 | - The firmare reads cmdline.txt and replaces instances of serial0 and serial1 accordingly 20 | - When running on a Pi 3, the firmware replaces ttyAMA0 with ttyS0 in cmdline.txt. This may be removed in the future. 21 | - A udev rules has been added to 99-com.rules which creates /dev/serial0 and /dev/serial1 symlinks 22 | If you have any custom changes relating to serial, it is worth rebooting and checking that /proc/cmdline contains what you expect 23 | * Raspberry Pi 3 serial console does not use correct baudrate 24 | See https://github.com/raspberrypi/firmware/issues/553 and https://github.com/RPi-Distro/repo/issues/22 25 | - Current workarounds are adding force_turbo=1, gpu_freq=300, or core_freq=250 to /boot/config.txt 26 | 27 | -- Serge Schneider Mon, 21 Mar 2016 13:35:45 +0000 28 | -------------------------------------------------------------------------------- /etc.arm/udev/rules.d/99-com.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="input", GROUP="input", MODE="0660" 2 | SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660" 3 | SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" 4 | SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660" 5 | SUBSYSTEM=="rpivid-*", GROUP="video", MODE="0660" 6 | 7 | KERNEL=="vcsm-cma", GROUP="video", MODE="0660" 8 | SUBSYSTEM=="dma_heap", GROUP="video", MODE="0660" 9 | 10 | SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" 11 | SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ 12 | chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ 13 | chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\ 14 | chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\ 15 | '" 16 | 17 | SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\ 18 | chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\ 19 | chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\ 20 | '" 21 | 22 | KERNEL=="ttyAMA0", PROGRAM="/bin/sh -c '\ 23 | ALIASES=/proc/device-tree/aliases; \ 24 | if cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \ 25 | echo 0;\ 26 | elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \ 27 | echo 1; \ 28 | else \ 29 | exit 1; \ 30 | fi\ 31 | '", SYMLINK+="serial%c" 32 | 33 | KERNEL=="ttyAMA1", PROGRAM="/bin/sh -c '\ 34 | ALIASES=/proc/device-tree/aliases; \ 35 | if [ -e /dev/ttyAMA0 ]; then \ 36 | exit 1; \ 37 | elif cmp -s $$ALIASES/uart0 $$ALIASES/serial0; then \ 38 | echo 0;\ 39 | elif cmp -s $$ALIASES/uart0 $$ALIASES/serial1; then \ 40 | echo 1; \ 41 | else \ 42 | exit 1; \ 43 | fi\ 44 | '", SYMLINK+="serial%c" 45 | 46 | KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\ 47 | ALIASES=/proc/device-tree/aliases; \ 48 | if cmp -s $$ALIASES/uart1 $$ALIASES/serial0; then \ 49 | echo 0; \ 50 | elif cmp -s $$ALIASES/uart1 $$ALIASES/serial1; then \ 51 | echo 1; \ 52 | else \ 53 | exit 1; \ 54 | fi \ 55 | '", SYMLINK+="serial%c" 56 | 57 | ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon1", RUN+="/bin/sh -c '\ 58 | if echo RPi-Sense FB | cmp -s /sys/class/graphics/fb0/name; then \ 59 | echo 0 > /sys$devpath/bind; \ 60 | fi; \ 61 | '" 62 | -------------------------------------------------------------------------------- /debian/raspberrypi-sys-mods.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | check_audio () { 4 | # audio dtparam mentioned in config.txt (enabled, disabled or commented out) 5 | AM_PAT="^[[:space:]]*#?[[:space:]]*(device_tree_param|dtparam)[[:space:]]*=[[:space:]]*([^,]*,)*audio[[:space:]]*=.*$" 6 | # snd_bcm2835 module enabled pattern 7 | SND_PAT="^[[:space:]]*snd(_|-)bcm2835[[:space:]]*$" 8 | 9 | if grep -q -E "$AM_PAT" /boot/config.txt; then 10 | return 0; 11 | fi 12 | 13 | if grep -q -E "^[[:space:]]*\[.*\]" /boot/config.txt; then 14 | return 0; 15 | fi 16 | 17 | if grep -q -E "$SND_PAT" /etc/modules; then 18 | echo "Enabling audio in config.txt and removing from /etc/modules..." 19 | printf '\n# Enable audio (added by raspberrypi-sys-mods)\n' >> /boot/config.txt 20 | echo "dtparam=audio=on" >> /boot/config.txt 21 | MODBAK=/etc/modules.ui-mods.bak 22 | grep -v -E "$SND_PAT" /etc/modules > ${MODBAK} 23 | mv ${MODBAK} /etc/modules 24 | else 25 | echo "Disabling audio in config.txt..." 26 | printf '\n# Disable audio (added by raspberrypi-sys-mods)\n' >> /boot/config.txt 27 | echo "dtparam=audio=no" >> /boot/config.txt 28 | fi 29 | } 30 | 31 | block_ms_repo () { 32 | eval "$(apt-config shell APT_SOURCE_PARTS Dir::Etc::sourceparts/d)" 33 | CODE_SOURCE_PART="${APT_SOURCE_PARTS}vscode.list" 34 | eval "$(apt-config shell APT_TRUSTED_PARTS Dir::Etc::trustedparts/d)" 35 | CODE_TRUSTED_PART="${APT_TRUSTED_PARTS}microsoft.gpg" 36 | echo "### Disabled by raspberrypi-sys-mods ###" > "$CODE_TRUSTED_PART" > "$CODE_SOURCE_PART" ||: 37 | } 38 | 39 | case "${1}" in 40 | configure) 41 | if dpkg --compare-versions "${2}" lt "20160112"; then 42 | check_audio 43 | fi 44 | if dpkg --compare-versions "${2}" lt "20160321+1"; then 45 | echo "Fixing file capabilities..." 46 | setcap cap_net_raw+ep /bin/ping6 || true 47 | setcap cap_net_raw+ep /bin/ping || true 48 | setcap cap_dac_override,cap_sys_ptrace+ep /usr/bin/systemd-detect-virt || true 49 | fi 50 | if dpkg --compare-versions "${2}" lt "20160321"; then 51 | echo "Adjusting cmdline.txt..." 52 | sed -e "s|=ttyAMA0|=serial0|;s|=ttyS0|=serial1|;" -i /boot/cmdline.txt || echo "Failed" 53 | fi 54 | if dpkg --compare-versions "${2}" lt "20160916"; then 55 | echo "Removing old sysctl tweaks, if present..." 56 | sed -n '1h;1!H;${;g;s/\n\# rpi tweaks\nvm\.swappiness=1\nvm\.min_free_kbytes = 8192//g;p;}' -i /etc/sysctl.conf 57 | fi 58 | if dpkg --compare-versions "${2}" lt-nl "20161018" && \ 59 | ! grep -Eq '^pi ALL=\(ALL\) NOPASSWD: ALL$' /etc/sudoers; then 60 | echo "Old entry not found. Disabling new NOPASSWD line..." 61 | sed -e '/^pi/ s/^#*/#/' -i /etc/sudoers.d/010_pi-nopasswd || echo "Failed" 62 | fi 63 | if dpkg --compare-versions "${2}" lt "20161018+3"; then 64 | echo "Removing old NOPASSWD line, if present..." 65 | sed '/pi ALL=(ALL) NOPASSWD: ALL/d' -i /etc/sudoers || echo "Failed" 66 | fi 67 | if dpkg --compare-versions "${2}" lt "20170313"; then 68 | echo "Updating documentation URL in /boot/config.txt..." 69 | sed -i 's|http://www.raspberrypi.org/documentation/configuration/config-txt.md|http://rpf.io/configtxtreadme|' /boot/config.txt || echo "Failed" 70 | fi 71 | if dpkg --compare-versions "${2}" lt "20170717"; then 72 | deb-systemd-invoke disable apply_noobs_os_config.service 73 | deb-systemd-invoke disable regenerate_ssh_host_keys.service 74 | fi 75 | if dpkg --compare-versions "${2}" lt "20180328+1"; then 76 | echo "Updating apt sources from {mirrordirector,archive}.raspbian.org to raspbian.raspberrypi.org..." 77 | find /etc/apt/sources.list* -type f -exec sed -i -E 's/(mirrordirector|archive)\.raspbian\.org/raspbian.raspberrypi.org/g' {} \; 78 | fi 79 | if dpkg --compare-versions "${2}" lt "20210310"; then 80 | echo "Blocking vscode repo..." 81 | block_ms_repo 82 | fi 83 | ;; 84 | 85 | abort-upgrade|abort-remove|abort-deconfigure) 86 | 87 | ;; 88 | 89 | *) 90 | echo "postinst called with unknown argument \`${1}'" >&2 91 | exit 1 92 | ;; 93 | esac 94 | 95 | #DEBHELPER# 96 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | raspberrypi-sys-mods (20210706) buster; urgency=medium 2 | 3 | * Allow plugdev group to mount disks 4 | 5 | -- Serge Schneider Tue, 06 Jul 2021 14:52:03 +0100 6 | 7 | raspberrypi-sys-mods (20210705) buster; urgency=medium 8 | 9 | * Add procps dependency 10 | 11 | -- Serge Schneider Mon, 05 Jul 2021 17:57:53 +0100 12 | 13 | raspberrypi-sys-mods (20210310) buster; urgency=medium 14 | 15 | * Remove Microsoft repo, since it is no longer required 16 | * Remove restrictions added in previous update 17 | * Load aes-neon-bs module to speed up SSL on arm64 18 | 19 | -- Serge Schneider Wed, 10 Mar 2021 13:32:28 +0000 20 | 21 | raspberrypi-sys-mods (20210208) buster; urgency=medium 22 | 23 | * Stop-gap measure to address one of the main concerns about 3rd party repos 24 | - Prevent VS Code repo from potentially overriding system packages 25 | - Only allow installation of known packages (code-*) 26 | 27 | -- Serge Schneider Mon, 08 Feb 2021 12:37:18 +0000 28 | 29 | raspberrypi-sys-mods (20210125) buster; urgency=medium 30 | 31 | * Add Microsoft's VS Code repo on upgrade 32 | 33 | -- Serge Schneider Mon, 25 Jan 2021 16:03:24 +0000 34 | 35 | raspberrypi-sys-mods (20201026) buster; urgency=medium 36 | 37 | [ chungf ] 38 | * Use $$ instead of $ in udev rules 39 | [ Serge Schneider ] 40 | * Unbind fbcon from fb0 when it's a Sense HAT 41 | 42 | -- Serge Schneider Mon, 26 Oct 2020 16:50:48 +0000 43 | 44 | raspberrypi-sys-mods (20200812) buster; urgency=medium 45 | 46 | * Add dma_heap to video group 47 | 48 | -- Serge Schneider Wed, 12 Aug 2020 21:58:24 +0100 49 | 50 | raspberrypi-sys-mods (20200729) buster; urgency=medium 51 | 52 | [ Phil Elwell ] 53 | * Prevent the /dev/serial* aliases from getting confused when additional 54 | UARTs are enabled on Pi 4 55 | 56 | -- Serge Schneider Wed, 29 Jul 2020 08:44:40 +0100 57 | 58 | raspberrypi-sys-mods (20200514) buster; urgency=medium 59 | 60 | * Update udev rules 61 | - Remove unused argon rule 62 | - Add vcsm-cma to video group 63 | - Add pwm to gpio group 64 | * i2cprobe: More flexible I2C/SPI alias mapping 65 | 66 | -- Serge Schneider Thu, 14 May 2020 06:16:38 +0100 67 | 68 | raspberrypi-sys-mods (20191105) buster; urgency=medium 69 | 70 | [ macmpi ] 71 | * Create blacklist-8192cu.conf 72 | * Delete blacklist-rtl8192cu.conf 73 | 74 | [ Serge Schneider ] 75 | * Add rpi-eeprom as a recommended package 76 | 77 | -- Serge Schneider Tue, 05 Nov 2019 14:15:52 +0000 78 | 79 | raspberrypi-sys-mods (20190730) buster; urgency=medium 80 | 81 | * Add micro:bit udev rule 82 | * Allow video group access to rpivid-* subsystems 83 | 84 | -- Serge Schneider Tue, 30 Jul 2019 14:28:36 +0100 85 | 86 | raspberrypi-sys-mods (20190722) buster; urgency=medium 87 | 88 | * Use systemctl to enable/start ssh service 89 | * Allow video group access to argon-* subsystems 90 | * i2cprobe: Fix loading of I2C modules without DT aliases 91 | 92 | -- Serge Schneider Mon, 22 Jul 2019 10:08:53 +0100 93 | 94 | raspberrypi-sys-mods (20190429) buster; urgency=medium 95 | 96 | * Remove WiFi handling 97 | - Images generated going forward will ship with WiFi disabled by default. 98 | - Instead of running a script to check whether WiFi should be blocked, 99 | unblocking is handled by the GUI, raspi-config or the user. 100 | * Detect if openssh-client is installed before regenerating SSH host keys 101 | * Add 80-noobs.rules which prevents the NOOBS SETTINGS partition from 102 | auto-mounting or showing up on the desktop 103 | * Match arm64 and armhf .install files 104 | * Replace --no-restart-on-upgrade with --no-stop-on-upgrade 105 | 106 | -- Serge Schneider Mon, 29 Apr 2019 10:54:23 +0100 107 | 108 | raspberrypi-sys-mods (20181127) stretch; urgency=medium 109 | 110 | * Suppress dpkg error message for a11y script 111 | 112 | -- Simon Long Mon, 26 Nov 2018 14:39:38 +0000 113 | 114 | raspberrypi-sys-mods (20181126) stretch; urgency=medium 115 | 116 | * Use -q in grep in a11y warning script 117 | 118 | -- Simon Long Mon, 26 Nov 2018 11:20:01 +0000 119 | 120 | raspberrypi-sys-mods (20181121) stretch; urgency=medium 121 | 122 | * Add /etc/profile.d script to suppress a11y warnings 123 | 124 | -- Simon Long Wed, 21 Nov 2018 09:35:19 +0000 125 | 126 | raspberrypi-sys-mods (20180328+1) stretch; urgency=medium 127 | 128 | * sources.list: change archive.raspbian.org to raspbian.raspberrypi.org 129 | 130 | -- Serge Schneider Wed, 28 Mar 2018 10:44:05 +0100 131 | 132 | raspberrypi-sys-mods (20180328) stretch; urgency=medium 133 | 134 | * sources.list: change mirrordirector.raspbian.org to raspbian.raspberrypi.org 135 | 136 | -- Serge Schneider Wed, 28 Mar 2018 10:19:36 +0100 137 | 138 | raspberrypi-sys-mods (20180323) stretch; urgency=medium 139 | 140 | * Add gettext-base dependency 141 | 142 | -- Serge Schneider Fri, 23 Mar 2018 16:30:38 +0000 143 | 144 | raspberrypi-sys-mods (20180315) stretch; urgency=medium 145 | 146 | * Run wifi-country.service after raspberrypi-net-mods.service 147 | 148 | -- Serge Schneider Thu, 15 Mar 2018 15:02:29 +0000 149 | 150 | raspberrypi-sys-mods (20180312) stretch; urgency=medium 151 | 152 | * Add Wi-Fi country check 153 | 154 | -- Serge Schneider Mon, 12 Mar 2018 07:44:06 +0000 155 | 156 | raspberrypi-sys-mods (20180103) stretch; urgency=medium 157 | 158 | * Remove rfkill persistence (handled by systemd) 159 | 160 | -- Serge Schneider Wed, 03 Jan 2018 11:40:58 +0000 161 | 162 | raspberrypi-sys-mods (20171127) stretch; urgency=medium 163 | 164 | * Allow the default user to access the new gpio character device 165 | * Extend of-compatible-based probing to spi 166 | 167 | -- Serge Schneider Mon, 27 Nov 2017 13:54:20 +0000 168 | 169 | raspberrypi-sys-mods (20170717) stretch; urgency=medium 170 | 171 | * Prevent debhelper from enabling ssh host key regen and NOOBS config scripts 172 | * Fix NOOBS config service Before parameter 173 | * Remove 61-partuuid.rules as an alternative is provided by systemd 174 | 175 | -- Serge Schneider Mon, 17 Jul 2017 12:00:16 +0100 176 | 177 | raspberrypi-sys-mods (20170714) stretch; urgency=medium 178 | 179 | * Add ssh host key regen and NOOBS config services 180 | 181 | -- Serge Schneider Tue, 11 Jul 2017 16:18:47 +0100 182 | 183 | raspberrypi-sys-mods (20170519) jessie; urgency=medium 184 | 185 | * Remove whois dependency 186 | 187 | -- Serge Schneider Fri, 19 May 2017 14:23:47 +0100 188 | 189 | raspberrypi-sys-mods (20170502) jessie; urgency=medium 190 | 191 | * Remove wifi blacklists from i386 builds 192 | 193 | -- Serge Schneider Tue, 02 May 2017 09:31:02 +0100 194 | 195 | raspberrypi-sys-mods (20170313) jessie; urgency=medium 196 | 197 | * Update config.txt documentation URL 198 | 199 | -- Serge Schneider Mon, 13 Mar 2017 17:59:58 +0000 200 | 201 | raspberrypi-sys-mods (20170306) jessie; urgency=medium 202 | 203 | * Add PARTUUID symlinks for DOS partitions 204 | 205 | -- Serge Schneider Mon, 06 Mar 2017 10:05:01 +0000 206 | 207 | raspberrypi-sys-mods (20170302) jessie; urgency=medium 208 | 209 | * Blacklist rtl8192cu and rtl8xxxu 210 | 211 | -- Serge Schneider Thu, 02 Mar 2017 17:15:36 +0000 212 | 213 | raspberrypi-sys-mods (20170127) jessie; urgency=medium 214 | 215 | * check_audio: don't modify config.txt files with filters 216 | * Remove sshpasswd.sh 217 | 218 | -- Serge Schneider Fri, 27 Jan 2017 14:06:29 +0000 219 | 220 | raspberrypi-sys-mods (20161220) jessie; urgency=medium 221 | 222 | * Don't restart rpi-display-backlight on upgrade 223 | * Fix typo in debian/rules 224 | 225 | -- Serge Schneider Tue, 20 Dec 2016 15:22:29 +0000 226 | 227 | raspberrypi-sys-mods (20161208+1) jessie; urgency=medium 228 | 229 | * Add ssh.txt as valid activation file for ssh 230 | 231 | -- Simon Long Thu, 08 Dec 2016 13:32:30 +0000 232 | 233 | raspberrypi-sys-mods (20161208) jessie; urgency=medium 234 | 235 | * Explicit check for existence of pi user in ssh password check 236 | 237 | -- Simon Long Thu, 08 Dec 2016 10:36:54 +0000 238 | 239 | raspberrypi-sys-mods (20161205) jessie; urgency=medium 240 | 241 | * Improve robustness of password checks; do not generate hash unless SSH enabled 242 | 243 | -- Simon Long Mon, 05 Dec 2016 13:31:29 +0000 244 | 245 | raspberrypi-sys-mods (20161124) jessie; urgency=medium 246 | 247 | * Add a login warning if SSH is enabled and the password is unchanged 248 | * Enable SSH if /boot/ssh is present 249 | 250 | -- Serge Schneider Thu, 24 Nov 2016 14:05:14 +0000 251 | 252 | raspberrypi-sys-mods (20161018+3) jessie; urgency=medium 253 | 254 | * See NEWS and https://github.com/RPi-Distro/raspberrypi-sys-mods/issues/6 255 | 256 | -- Serge Schneider Wed, 19 Oct 2016 12:05:09 +0100 257 | 258 | raspberrypi-sys-mods (20161018+2) jessie; urgency=medium 259 | 260 | * Fix postinst rebasing error 261 | 262 | -- Serge Schneider Tue, 18 Oct 2016 19:01:23 +0100 263 | 264 | raspberrypi-sys-mods (20161018+1) jessie; urgency=medium 265 | 266 | * Add /etc/sudoers.d/010_pi-nopasswd 267 | * Change architecture to all 268 | 269 | -- Serge Schneider Tue, 18 Oct 2016 16:29:14 +0100 270 | 271 | raspberrypi-sys-mods (20161010) jessie; urgency=medium 272 | 273 | * Mods to rfkill to ensure Bluetooth status is retained after reboot 274 | 275 | -- Simon Long Mon, 10 Oct 2016 12:04:24 +0100 276 | 277 | raspberrypi-sys-mods (20160916) jessie; urgency=medium 278 | 279 | * Fix bug in 98-rpi.conf 280 | * Remove pre-jessie sysctl tweaks 281 | * Improve I2C subsystem module loading 282 | - (https://www.raspberrypi.org/forums/viewtopic.php?p=1037943#p1037943) 283 | * Change package architecture from any to all 284 | 285 | -- Serge Schneider Fri, 16 Sep 2016 23:40:45 +1000 286 | 287 | raspberrypi-sys-mods (20160915) jessie; urgency=medium 288 | 289 | * Add /etc/sysctl.d/98-rpi.conf 290 | 291 | -- Serge Schneider Thu, 15 Sep 2016 04:42:08 +0000 292 | 293 | raspberrypi-sys-mods (20160426) jessie; urgency=medium 294 | 295 | * Add service to turn off official screen backlight 296 | 297 | -- Serge Schneider Tue, 26 Apr 2016 12:21:38 +0100 298 | 299 | raspberrypi-sys-mods (20160321+1) jessie; urgency=medium 300 | 301 | * Actually fix capabilities instead of just verifying them 302 | 303 | -- Serge Schneider Mon, 21 Mar 2016 20:35:16 +0000 304 | 305 | raspberrypi-sys-mods (20160321) jessie; urgency=medium 306 | 307 | * Udev rule 308 | - Use $devpath 309 | - Add serial0 and serial1 symlinks 310 | * Replace ttyAMA0 with serial0 and ttyS0 with serial1 in cmdline.txt 311 | * Add NEWS file explaining above changes 312 | 313 | -- Serge Schneider Mon, 21 Mar 2016 13:35:45 +0000 314 | 315 | raspberrypi-sys-mods (20160113) jessie; urgency=medium 316 | 317 | * Fix capabilities for all files. Fail gracefully if unable. 318 | 319 | -- Serge Schneider Tue, 09 Feb 2016 11:49:44 +0000 320 | 321 | raspberrypi-sys-mods (20160112) jessie; urgency=medium 322 | 323 | * Added the custom udev rules 324 | * Ensure audio is enabled when upgrading from an earlier version 325 | * Fix ping capabilities (no longer require root access) 326 | 327 | -- Serge Schneider Tue, 12 Jan 2016 13:52:34 +0000 328 | 329 | raspberrypi-sys-mods (20131021) jessie; urgency=low 330 | 331 | * Initial release 332 | 333 | -- Serge Schneider Wed, 21 Oct 2015 13:54:43 +0100 334 | --------------------------------------------------------------------------------