piframe/docs/finalize_setup.md

2.3 KiB

Setup Finalization

The following will walk through finalizing setup of the base environment.


# Wait for cloud initi to spew to LCD (this will take a minute, it's prepping the initial config and deploying it, including the default user account)

# Login as ubuntu / ubuntu and follow the prompts

sudo -sHu root /bin/bash

# Disable cloud-init as it's unnecessary for the purposes of this project
touch /etc/cloud/cloud-init.disabled
nano -w /boot/firmware/cmdline.txt
    remove console=tty1
    # If using the wisecoco 6" 2k 1440x2560 *portrait* LCD, include the below line
    fbcon=rotate:1

# Setup screen resolution (UNCOMMENT THE RIGHT LINES!!!)
cat >> /boot/firmware/usercfg.txt <<EOF

# Setup GPU general settings
gpu_mem=256
disable_splash=1
disable_overscan=1

# Screen Settings
#     Further reading
#     https://www.raspberrypi.org/documentation/configuration/config-txt/video.md
#     https://www.raspberrypi.org/forums/viewtopic.php?t=5851
#     https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=24679

# wisecoco 6" 2k 1440x2560 *portrait* LCD
#     https://wisecoco.en.alibaba.com/
#dtoverlay=vc4-kms-v3d-pi4
#hdmi_group=2
#hdmi_mode=87
#hdmi_cvt=1440 2560 50 3 0 0 1

# wisecoco 10.1" 2k 1600x2560 *portrait* LCD
#     https://wisecoco.en.alibaba.com/
#dtoverlay=vc4-kms-v3d-pi4
#hdmi_group=2
#hdmi_mode=87
#hdmi_cvt=1600 2560 50 3 0 0 1

EOF

# Reboot to pickup changes
systemctl reboot

# Login

sudo -sHu root /bin/bash

# Cleanup timezone
dpkg-reconfigure tzdata

# Disable power/hibernate/sleep keys
mkdir /etc/systemd/logind.conf.d
cat > /etc/systemd/logind.conf.d/ignored_keys.conf <<EOF
[Login]
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
EOF

# Full system update
apt update && apt upgrade
systemctl reboot

# Login

sudo -sHu root /bin/bash

# Useful packages
apt install build-essential cmake nano tmux vim htop iotop nload git net-tools

# Raspberry Pi tools
apt install linux-tools-raspi
mkdir /opt/raspberry-pi
cd /opt/raspberry-pi
git clone https://github.com/raspberrypi/userland.git
cd userland
./buildme --aarch64
cat > /etc/profile.d/rpi-tools.sh <<EOF
#!/bin/bash
export PATH="$PATH:/opt/vc/bin"
EOF
cat > /etc/ld.so.conf.d/00-vmcs.conf <<EOF
/opt/vc/lib
EOF
ldconfig

# Finalize basic network config
hostnamectl set-hostname piframe

# Reboot system for all changes to take effect
systemctl reboot