Bare-bones O/S for Raspberry Pi hardware maintenance
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Bare-bones O/S for Raspberry Pi hardware maintenance
Hi all,
I have been using a Pi successfully in an embedded application for the last 4 years and the time is about right to replace the cell in the hardware clock module I've been using with it. The clock has reverted to 1st Jan 2000 so I need to reset it following the battery replacement. Can anyone suggest a suitable image I can download and burn to a 1 or 2Gb SD card which will boot-up and give me access to the hwclock function I need for this purpose? I only need a terminal to work with, not a fancy GUI, so the smaller the image the better, so long as it boots and recognises hwclock.
TIA.
I tend to take a raspbian image, and use it to create a debian armel image (armv4 since armhf is v7+, and I have a B model / armv6) with debootstrap. Although I use the raspbian /boot/ and kernel. It'll take two cards and a reader. But with debootstrap you can have a min system with < 300MB of usage.
You can also use the debootstrap method to install a minimal raspbian, or ubuntu, or pretty much any .deb based distro with the "script" for it.
Although the last time I did it for raspbian I needed to do some $(ln -s) trickery to make it work. But I like debootstrap installs as you only have what you use, and the latest version of it once the process is done, so no need to do an immediate update equal to or greater than the girth of the install image. Plus if your intent is to run testing or sid, you can go straight to it. Without the full system, then upgrade bandwidth waste. Plus write wear on the media.
Although to set the time you could just use date to manually set time. Or ntpdate to sync it with a server one off / adhoc style.
$ date +%s
(to get the current epoch date)
$ sudo date -d @1495203001 +%s
To set the date to that epoch date, the numbers are what epoch was on my system when I did the first one. Plus other ways to set date based on UTC format or other options.
$ sudo ntpdate pool.ntp.org
You might have to do that more than once if latency or packet loss is high. Or the ntp server is under load. Plus it requires an internet connection.
Although to set the time you could just use date to manually set time. Or ntpdate to sync it with a server one off / adhoc style.
$ date +%s
(to get the current epoch date)
$ sudo date -d @1495203001 +%s
To set the date to that epoch date, the numbers are what epoch was on my system when I did the first one. Plus other ways to set date based on UTC format or other options.
$ sudo ntpdate pool.ntp.org
You might have to do that more than once if latency or packet loss is high. Or the ntp server is under load. Plus it requires an internet connection.
Er, yeeesssss. Thanks for all the suggestions, but it all seems like a *lot* of work just to set a clock! I'm going to roll with the Arch idea on this one.
So the Pi is running a standalone embedded application but no operating system?
Although you can install one of many distributions I suggest Raspian Jessie lite which is 1.3GB. You will still need to run several commands to actually set the clock.
1. Load the RTC module and possibly run other commands dependent on the actual hardware.
2. Set the system date/time using one of the methods above.
3. Sync the RTC clock to the system clock using the hwclock command.
Er, yeeesssss. Thanks for all the suggestions, but it all seems like a *lot* of work just to set a clock! I'm going to roll with the Arch idea on this one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.