Modificare OS Armbian pentru imaginile RoLink bazate pe Orange Pi PC

Pasul 1

Se execută următoarele comenzi :

rm -f /etc/logrotate.conf && mv /etc/logrotate.d /tmp && ln -s /tmp /etc/logrotate.d
mv /etc/resolv.conf /run/resolvconf/resolv.conf && ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
mv /var/lib/NetworkManager /tmp && ln -s /tmp /var/lib/NetworkManager
mv /etc/armbianmonitor /tmp && ln -s /tmp /etc/armbianmonitor
systemctl disable apt-daily-upgrade.service && systemctl disable apt-daily-upgrade.timer
systemctl disable apt-daily.service && systemctl disable apt-daily.timer
tee -a /etc/bash.bashrc << EOF
fs_mode=\$(mount | sed -n -e "s/^.* on \/ .*(\(r[w|o]\).*/\1/p")
alias ro='mount -o remount,ro / ; fs_mode=\$(mount | sed -n -e "s/^.* on \/ .*(\(r[w|o]\).*/\1/p")'
alias rw='mount -o remount,rw / ; fs_mode=\$(mount | sed -n -e "s/^.* on \/ .*(\(r[w|o]\).*/\1/p")'
export PS1='\[\033[01;32m\]\u@\h\${fs_mode:+(\$fs_mode)}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
EOF
tee -a /etc/fstab << EOF
tmpfs /var/log tmpfs nodev,nosuid 0 0
tmpfs /var/tmp tmpfs nodev,nosuid 0 0
EOF
clear

Pasul 2

Se execută comanda : nano /etc/fstab

se modifică prima linie din :
UUID=1b49372a-ea5b-42f6-9e60-036606066891 / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1

în :
UUID=1b49372a-ea5b-42f6-9e60-036606066891 / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro,ro 0 1

Pasul 3

Se execută comanda : nano /usr/lib/armbian/armbian-hardware-optimization
apoi se adaugă la linia 282 : return

add_usb_storage_quirks() {
return # <---------

După modificările de mai sus, se reporneşte sistemul, iar la următorul log-in, prompt-ul ar trebui să indice starea (ro).
Schimbarea modurilor ro/rw se face cu comenzile ro, respectiv rw.

Razvan / YO6NAM
23.03.2020

Leave a Comment

Your email address will not be published. Required fields are marked *