community.riocities.com
  • Home
  • Categories
  • Tags
  • Archives

Alpine Linux on a Raspberry Pi 3 B+ with a RTC module

Contents

  • Prerequisites
  • Pre-Setup
  • Setup

Prerequisites¶

  • Alpine Linux v3.11 (or later) installed on a Raspberry Pi 3 B+
  • DS3231 Real Time Clock Module for Raspberry Pi

Pre-Setup¶

Install the RTC module on GPIO pins 1, 3, 5, 7 & 9 on the Raspberry Pi 3 B+

DS3231 mounting

Create (or edit) usercfg.txt on the SD card partition and add

dtoverlay=i2c-rtc,ds3231

Boot into Alpine Linux and login

If you are running Alpine version v3.13 this is all you need to do, if running an older version continue below.

Setup¶

Install mkinitfs package

# apk add mkinitfs

add rpirtc to /etc/mkinitfs/mkinitfs.conf

Example after:

features="ata base cdrom ext4 keymap kms mmc raid scsi usb virtio rpirtc"

Rebuild initramfs in order to add the kernel modules needed for the ds3231 device.

# . /etc/lbu/lbu.conf
# ln -s /media/$LBU_MEDIA/boot /boot
# mount /media/$LBU_MEDIA -o remount,rw

# . /etc/mkinitfs/mkinitfs.conf
# mkinitfs -F "$features base squashfs"

# mount /media/$LBU_MEDIA -o remount,ro

Enable the hwclock service

# rc-update del swclock boot
# rc-update add hwclock boot
# hwclock -w
# lbu commit

Now you can reboot and the rtc hwclock should be used.


  • « Alpine Linux XEN dom0 from a USB stick - upgrading
  • Alpine Linux RPi - upgrading »

Published

Aug 4, 2020

Last Updated

2021-01-29 00:00:00+01:00

Author

henrik

Category

HOWTOs

Tags

  • Alpine 15

Social

  • atom feed
  • rss feed
  • ipv6 ready
  • Powered by Pelican. Theme: Elegant by Talha Mansoor