Provide repository on USB stick

This chapter describes how to provide a repository on a USB stick. TwinCAT/BSD is used as the host system for the work steps.

Requirements:

Proceed as follows:

1. Download the TwinCAT/BSD repository from the Beckhoff server. If you use Linux or TwinCAT/BSD, use the command wget --recursive --timestamping --level=inf --no-cache --no-parent --no-cookies --no-host-directories --relative --directory-prefix /tmp/mirror https://tcbsd.beckhoff.com/TCBSD/14/stable/packages/
2. Insert the USB stick into your TwinCAT/BSD device. Note that the device may boot directly from the USB stick according to your BIOS setting. Then plug in the USB stick only after booting.
3. Connect the USB stick to your system (see: Integrating a USB stick). Automount was deactivated ex works for security reasons.
4. Copy the repository from the directory /tmp/mirror to the FAT partition of a USB stick using the command cp -r /tmp/mirror /mnt/usb. The path /mnt/usb is the mount point of the USB stick in this example.
5. Next, the repository path that points to this Beckhoff Package Server by default must be changed: https://tcbsd.beckhoff.com/TCBSD/14/stable/packages/
6. In this example, the repository path must point to the USB stick in order to use the local repository on the USB stick. Enter the following command: doas sh /usr/local/share/examples/bhf/pkgrepo-set.sh file:///mnt/mirror/TCBSD/14/stable/packages
Use the pkg tool as usual. The command doas pkg upgrade can now be used to update and install packages from the USB stick. Instead of the Beckhoff Package Server, the local repository on the USB stick is used. Note that after a reboot the USB stick must be integrated manually again.