update README.md

This commit is contained in:
2024-01-24 11:26:27 +01:00
parent 95e38093d7
commit ee56015580

103
README.md
View File

@ -2,9 +2,9 @@
The APU is a Linux box to be used as a control box at LIN sample environment
servercfg/ contains the configuration files for all boxes
`servercfg/` contains the configuration files for all boxes
to_system/ contains the files to be installed in the system
`to_system/` contains the files to be installed in the system
## config files
@ -86,72 +86,67 @@ available on control boxes (MLZ type) only. must therefore not be present on bar
## Installation of a Fresh Control Box or bare APU
### Tools / Resources needed
#### progress bar
On mac use ``brew install pv`` to install. If you do not want it, you may leve it out,
it is a matter of convenience. In this case omit ``| pv `` in the commands
## install image by means of the USB stick BOOT_TINY
The stick has TinyLinux on it and some additional scripts
If you do not have one, you may create it logging to an other box as root
If you do not have one, you may create it from another box
### a) create a USB stick with TinyLinux (omit if you have the stick already)
to verify that /dev/sdb is your stick, use the following command before and after plugging the stick
log in as root/FrappyLinse to an apu box
```
apu> cd aputools
apu> bash mkusb.sh
... you are asked to give the device name from a list (typically sdb) ...
```
You are asked to give the device name from a list (typically sdb)
before it writes to the stick.
### b) mount with TinyLinux from USB stick
### b) boot with TinyLinux from USB stick
Connect a Mac with an USB to serial adapter (and null-modem!).
```
mac> screen /dev/tty.usbserial-130 115200
```
Do not yet connect LAN, plug USB stick and start the box, wait for prompt 'tc@box:'
Do not yet conenct to LAN, if the box is not yet registered to PacketFence.
Plug USB stick and start the box, wait for prompt 'tc@box:' and cd into BOOT_TINY
```
apu> cd /media/BOOT_TINY (or /media/CENTOS_APU)
apu> sh reg
cd /media/BOOT_TINY
```
enter new hostname (HWaddr will be on the output)
register to PacketFence (if not yet done) and set role to sinq-samenv
connect LAN to rightmost socket on a bare APU or the leftmost socket an a control box
### c) Determine address/name for registering in PacketFence
```
sh reg
```
enter new hostname (HWaddr will be on the output)
register to PacketFence and set role to sinq-samenv
connect LAN to rightmost socket on a bare APU or the leftmost socket on a control box
### d) Copy Image to APU SSD
```
sh write_to_ssd
```
apu> sh tiny
...
some random art images are shown ...
...
inet addr:129.168.1.43 Bcast:192.168.1.255 Mask:255.255.255.0
inet addr:127.0.0.1 Mask:255.0.0.0
```
images from l_samenv@samenv:boxes/images:
apumaster_2022-11-09.lz4
apumaster_2024-01-18.lz4
which image?
```
Use the displayed ip address for the following step.
* Enter the image you want to write (typically the last one).
* It will take around 10 mins to write the image.
* remove the stick, power off/on (or do `sudo reboot now`)
### c) Copy Image to APU SSD
Note that the images are not part of the git repo.
```
mac> cd ~/switchdrive/apu/images
mac> dd if=apumaster.lz4 bs=512k | pv | ssh root@192.168.1.43 "lz4 -d | dd of=/dev/sda bs=512k"
```
(you are asked for root password, which is root, ``| pv `` may be omitted)
remove the stick, power off/on
### e) Install Services
login with root/FrappyLinse
```
@ -168,29 +163,11 @@ enter host name:
DONE!
### d) Cloning an Image from an Existing Box
### f) Cloning an Image from an Existing Box
Use (b) above to boot from TinyLinux (replace the IP address by the one from the box!)
First make sure that a copy of the last apumaster.lz4 is saved with its date.
Use (b) above to boot from the BOOT_TINY USB stick
```
mac> ssh root@192.168.1.43 "dd if=/dev/sda bs=512k | lz4" | pv | dd of=apumaster.lz4 bs=512k
$ sh clone
```
### e) Appendix
Source of scripts on TinyLinux:
```
apu> cat tini.sh
tce-load -wi nano
tce-load -wi lz4
tce-load -wi openssh
sudo /usr/local/etc/init.d/openssh start
sudo chpasswd << EOF
tc:tc
root:root
EOF
ifconfig | grep 'inet addr'
```
You are asked