User Tools

Site Tools


modop:minipi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
modop:minipi [2020/11/25 16:12] rootmodop:minipi [2020/11/25 17:38] (current) root
Line 11: Line 11:
 apt-get install -y busybox-syslogd && apt-get purge -y rsyslog apt-get install -y busybox-syslogd && apt-get purge -y rsyslog
  
-# Disable wifi and bluetooth+# Disable audio, wifi and bluetooth
 echo "dtoverlay=pi3-disable-wifi" >> /boot/config.txt echo "dtoverlay=pi3-disable-wifi" >> /boot/config.txt
 echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt
 +sed -i 's/dtparam=audio=on/#dtparam=audio=on/' /boot/config.txt
  
 # Purge unnecessary packages # Purge unnecessary packages
-apt-get purge -y avahi-daemon bind9-host bluez bluez-firmware dphys-swapfile geoip-database libavahi-common-data libavahi-common3 libavahi-core7 libbind9-161 libdaemon0 libdns1104 libfstrm0 libgeoip1 libisc1100 libisccc161 libisccfg163 liblmdb0 liblwres161 libnss-mdns libprotobuf-c1 pi-bluetooth triggerhappy+apt-get purge -y avahi-daemon bind9-host bluez bluez-firmware dphys-swapfile geoip-database libavahi-common-data libavahi-common3 libavahi-core7 libbind9-161 libdaemon0 libdns1104 libfstrm0 libgeoip1 libisc1100 libisccc161 libisccfg163 liblmdb0 liblwres161 libnss-mdns libprotobuf-c1 pi-bluetooth triggerhappy wpasupplicant
  
 # Delete the swap file # Delete the swap file
 rm -f /var/swap rm -f /var/swap
 +
 +# Switch to fastboot
 +sed -i 's/rootwait/rootwait fastboot noswap/' /boot/cmdline.txt
 +sed -i 's/console=serial0,115200 //' /boot/cmdline.txt
  
 # Disable HDMI on startup # Disable HDMI on startup
 echo "/usr/bin/tvservice -o" >> /etc/rc.local echo "/usr/bin/tvservice -o" >> /etc/rc.local
 +
 +# Disable unneccesary services
 +systemctl disable keyboard-setup.service
 +systemctl disable rpi-eeprom-update.service
 +</code>
 +
 +===== Read only =====
 +
 +<code bash>
 +# Move some system files
 +cp /etc/resolv.conf /tmp/dhcpcd.resolv.conf
 +rm -rf /var/lib/dhcp /var/lib/dhcpcd5 /var/run /var/spool /var/lock /etc/resolv.conf
 +ln -s /tmp /var/lib/dhcp
 +ln -s /tmp /var/lib/dhcpcd5
 +ln -s /tmp /var/run
 +ln -s /tmp /var/spool
 +ln -s /tmp /var/lock
 +ln -s /tmp/dhcpcd.resolv.conf /etc/resolv.conf
 +
 +# Update dhcpcd5.service
 +sed -i 's/PIDFile=\/run\/dhcp/PIDFile=\/var\/run\/dhcp/' /etc/systemd/system/dhcpcd5.service 
 +
 +# Update the random-seed unit file
 +mv /var/lib/systemd/random-seed /tmp/random-seed 
 +ln -s /tmp/random-seed /var/lib/systemd/random-seed
 +sed -i '/^\[Service\]$/a ExecStartPre=/bin/echo "" >/tmp/random-seed' /lib/systemd/system/systemd-random-seed.service
 +
 +# Update fstab
 +grep '\/tmp' /etc/fstab &> /dev/null || echo "tmpfs           /tmp            tmpfs   nosuid,nodev               0" >> /etc/fstab
 +grep '\/var' /etc/fstab &> /dev/null || echo "tmpfs           /var/log        tmpfs   nosuid,nodev               0" >> /etc/fstab
 +grep '\/var\/tmp' /etc/fstab &> /dev/null || echo "tmpfs           /var/tmp        tmpfs   nosuid,nodev               0" >> /etc/fstab
 +
 +# Reload systemd units
 +systemctl daemon-reload
 </code> </code>
modop/minipi.1606317122.txt.gz · Last modified: 2020/11/25 16:12 by root

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki