Skip to content

Commit

Permalink
fix: load i2c-dev modules
Browse files Browse the repository at this point in the history
This PR adds to mainsail-crew#196 with the required bits to enable i2c by default.

Signed-off-by: ashthespy <ashthespy@users.noreply.github.com>
  • Loading branch information
ashthespy committed Apr 6, 2023
1 parent 9f09363 commit 4c431f9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/modules/piconfig/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,22 @@ cp "${PICONFIG_CMDLINE_TXT_FILE}" "${PICONFIG_CMDLINE_BAK_FILE}"
echo_green "Disable Serial Linux console ..."
sed -i 's/console=serial0,115200 //' "${PICONFIG_CMDLINE_TXT_FILE}"

# Step 9: Disable bluetooth and related services
# Step 9: Enable i2c modules
# Also needs corresponding bits in config.txt (see #196)
echo_green "Enabling i2c-dev"
sed /etc/modprobe.d/raspi-blacklist.conf -i -e "s/^\(blacklist[[:space:]]*i2c[-_]bcm2708\)/#\1/"
sed /etc/modules -i -e "s/^#[[:space:]]*\(i2c[-_]dev\)/\1/"
if ! grep -q "^i2c[-_]dev" /etc/modules; then
printf "i2c-dev\n" >> /etc/modules
fi

# Step 10: Disable bluetooth and related services
echo_green "Disabling Bluetooth related services..."
systemctl_if_exists disable hciuart.service
systemctl_if_exists disable bluetooth.service
systemctl_if_exists disable bluealsa.service

# Step 10: Increase swapfile size
# Step 11: Increase swapfile size
if [[ -f "${PICONFIG_SWAP_CONF_FILE}" ]]; then
echo_green "Increasing swap file size to ${PICONFIG_SWAP_SIZE} Mb. Limit to ${PICONFIG_SWAP_MAX} Mb"
sed -i 's/^CONF_SWAPSIZE.*/'CONF_SWAPSIZE="${PICONFIG_SWAP_SIZE}"'/' "${PICONFIG_SWAP_CONF_FILE}"
Expand Down

0 comments on commit 4c431f9

Please sign in to comment.