@@ -41,6 +41,9 @@ final_action=reboot
41
41
hwrng_support=1
42
42
enable_watchdog=0
43
43
gpu_mem=
44
+ sound_enable=0
45
+ camera_enable=0
46
+ camera_disable_led=0
44
47
45
48
# these shouldn't really be changed unless auto-detection fails
46
49
bootdev=/dev/mmcblk0
@@ -519,8 +522,10 @@ echo " rootfs_mkfs_options = $rootfs_mkfs_options"
519
522
echo " rootfs_install_mount_options = $rootfs_install_mount_options"
520
523
echo " rootfs_mount_options = $rootfs_mount_options"
521
524
echo " final_action = $final_action"
522
- echo " hardware_versions = $hardware_versions"
523
525
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"
524
529
echo
525
530
526
531
echo -n "Waiting 5 seconds"
@@ -1014,6 +1019,27 @@ echo -n "Creating default cmdline.txt... "
1014
1019
echo "$cmdline root=$rootpartition rootfstype=$rootfstype rootwait loglevel=3" > /rootfs/boot/cmdline.txt
1015
1020
echo "OK"
1016
1021
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
+
1017
1043
# run post install script if exists
1018
1044
if [ -e /bootfs/post-install.txt ]; then
1019
1045
echo "================================================="
0 commit comments