Skip to content

Commit 85aeebe

Browse files
committed
Added installer variables for audio and camera module, Re-added gpu_mem installer variable
1 parent f1b5e2a commit 85aeebe

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ The format of the _installer-config.txt_ file and the current defaults:
165165
# undesirable.
166166
enable_watchdog=0 # loads up the hardware watchdog module and configures systemd to use it. Set to
167167
# "1" to enable this functionality.
168+
gpu_mem= # Specifies the amount of RAM in MB that should be reserved for the GPU.
169+
# Minimum is "16". If not defined, the bootloader sets it to 64MB.
170+
sound_enable=0 # Set to "1" to enable the onboard audio.
171+
camera_enable=0 # Set to "1" to enable the camera module. This sets all needed parameters in config.txt.
172+
camera_disable_led=0 # Disables the camera led. The option `camera_enable=1` has to be set to take effect.
168173

169174
The timeserver parameter is only used during installation for _rdate_ which is used as fallback when setting the time with `ntpdate` fails.
170175

scripts/etc/init.d/rcS

+27-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ final_action=reboot
4141
hwrng_support=1
4242
enable_watchdog=0
4343
gpu_mem=
44+
sound_enable=0
45+
camera_enable=0
46+
camera_disable_led=0
4447

4548
# these shouldn't really be changed unless auto-detection fails
4649
bootdev=/dev/mmcblk0
@@ -519,8 +522,10 @@ echo " rootfs_mkfs_options = $rootfs_mkfs_options"
519522
echo " rootfs_install_mount_options = $rootfs_install_mount_options"
520523
echo " rootfs_mount_options = $rootfs_mount_options"
521524
echo " final_action = $final_action"
522-
echo " hardware_versions = $hardware_versions"
523525
echo " gpu_mem = $gpu_mem"
526+
echo " sound_enable = $sound_enable"
527+
echo " camera_enable = $camera_enable"
528+
echo " camera_disable_led = $camera_disable_led"
524529
echo
525530

526531
echo -n "Waiting 5 seconds"
@@ -1014,6 +1019,27 @@ echo -n "Creating default cmdline.txt... "
10141019
echo "$cmdline root=$rootpartition rootfstype=$rootfstype rootwait loglevel=3" > /rootfs/boot/cmdline.txt
10151020
echo "OK"
10161021

1022+
# enable sound if specified in the configuration file
1023+
if [ "${sound_enable}" = "1" ] ; then
1024+
sed -i "s/^#\(dtparam=audio=on\)/\1/" config.txt
1025+
fi
1026+
1027+
# enable camera if specified in the configuration file
1028+
if [ "${camera_enable}" = "1" ] ; then
1029+
if [ "${gpu_mem}" -lt "128" ] ; then
1030+
gpu_mem=128
1031+
fi
1032+
echo "start_x=1" >> /rootfs/boot/config.txt
1033+
if [ "${camera_disable_led}" = "1" ] ; then
1034+
echo "disable_camera_led=1" >> /rootfs/boot/config.txt
1035+
fi
1036+
fi
1037+
1038+
# set gpu_mem if specified in the configuration file
1039+
if [ -n "${gpu_mem}" ] ; then
1040+
echo "gpu_mem=${gpu_mem}" >> /rootfs/boot/config.txt
1041+
fi
1042+
10171043
# run post install script if exists
10181044
if [ -e /bootfs/post-install.txt ]; then
10191045
echo "================================================="

0 commit comments

Comments
 (0)