Sample Header Ad - 728x90

Optimize adding extra packages to the USB-media for alpine linux offline install?

2 votes
1 answer
874 views
We would like to make an automated installer for Alpine Linux for running our own application on an embedded x86 pc. Our application setup requires packages not present on the downloadable media and we need it to run self-contained and offline. I have implemented the functionality we need, but that requires "main" and "community" repositories present on the USB-stick. I have solved this so far by burning the ISO-image to the USB-stick using Rufus in ISO mode (making it writable) and then essentially rsync'ing a mirror to the USB-stick (to /media/usb/alpine) and manually adding this directory to /etc/apk/repositories as needed. This works well. Unfortunaly this is an almost 20 GB download meaning that the manual step to copy to the USB-stick takes a very long time on the USB-sticks I have available right now (2 hours at the moment). A SSD USB-disk takes about 20 minutes. I have therefore been looking at setup-apkcache and found that we only need less than 100 MB of packages, but that it appears from my experiments that setup-disk installing to the local harddisk in "sys"-mode (which runs lbu package - under the covers) does not use the packages in the cache, but expects all packages to be found from one of the repositories listed in /etc/apk/repositories. Is using a apk cache the way to go? Or am I barking up the wrong tree?
Asked by Thorbjørn Ravn Andersen (1064 rep)
Sep 13, 2021, 09:05 AM
Last activity: Feb 27, 2022, 01:37 PM