Installation and Setup
Relevant source files
The following files were used as context for generating this wiki page:
- README.md
- safe64.sh
- /proc/device-tree/model (Referenced for hardware validation)
- /boot/config.txt (Primary configuration target)
- /boot/config.txt.bak (Backup file created during setup)
The safe64switch project provides a specialized shell script, safe64.sh, designed to transition a Raspberry Pi OS from a 32-bit environment to a 64-bit kernel environment safely. The setup process involves environment validation, automated configuration backups, and modification of system boot parameters to enable 64-bit support and optimized performance settings.
Sources: README.md:3-6, safe64.sh:2-4
Prerequisites and Environment Validation
Before any modifications are applied, the script performs a hardware check to ensure it is executing on a Raspberry Pi device. This is achieved by inspecting the device tree model information.
if ! grep -q "Raspberry Pi" /proc/device-tree/model 2>/dev/null; then
echo "Error: Not running on a Raspberry Pi. Exiting."
exit 1
fi
Sources: safe64.sh:12-16
Hardware Compatibility Table
| Check Type | Target Path | Required String | Action on Failure |
|---|---|---|---|
| Hardware Model | /proc/device-tree/model | "Raspberry Pi" | Terminate execution with exit code 1 |
Sources: safe64.sh:12-16
Installation Workflow
The installation logic follows a linear execution path, enforced by the set -e flag which ensures the script terminates immediately if any command returns a non-zero exit status.
The following flowchart illustrates the logical flow of the setup process:
This diagram shows the sequential steps taken by the safe64.sh script to modify the system state.
Sources: safe64.sh:6-34
System Configuration and Backups
The setup process prioritizes system stability by creating a backup of the existing boot configuration before making changes.
- Backup: The script copies
/boot/config.txtto/boot/config.txt.bak. - Kernel Configuration: It checks for the existence of the
arm_64bit=1directive. If missing, it appends it to the configuration file. - Performance Optimization: The script ensures specific memory allocations for the GPU are present.
Configuration Parameters
| Parameter | Value | Purpose |
|---|---|---|
arm_64bit | 1 | Instructs the firmware to load the 64-bit kernel. |
gpu_mem | 16 | Sets GPU memory to a minimum value (16MB) to maximize available system RAM. |
Sources: safe64.sh:19-31
Execution Instructions
To install and run the switch utility, the user must provide execution permissions and run the script with administrative privileges.
chmod +x safe64.sh
sudo ./safe64.sh
Sources: README.md:14-15
Setup Logic Sequence
The following sequence diagram details the interaction between the script and the system filesystem during the setup process:
This diagram represents the file operations and conditional logic performed during the configuration switch.
Sources: safe64.sh:12-34
Summary
The Installation and Setup process for safe64switch is a streamlined automation that handles hardware verification, safety backups, and the critical configuration changes required for 64-bit operation on Raspberry Pi. Once the script completes, a system reboot is mandatory to initialize the 64-bit kernel and apply the performance optimizations.
Sources: README.md:8-11, safe64.sh:33-35