operating_systems:raspbian:raspbian
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
operating_systems:raspbian:raspbian [2019/04/30 08:29] – maferreira | operating_systems:raspbian:raspbian [2019/05/03 15:06] – maferreira | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Raspbian ====== | ====== Raspbian ====== | ||
+ | |||
+ | * [[Clean installation]] | ||
+ | * [[Minimal configuration]] | ||
+ | * [[Tricks]] | ||
+ | * [[easyGateway configuration]] | ||
+ | |||
===== Clone only a directory ===== | ===== Clone only a directory ===== | ||
git clone <git path> | git clone <git path> | ||
Line 7: | Line 13: | ||
git checkout -- | git checkout -- | ||
| | ||
- | ===== Reduce time that is used to raise network interfaces ===== | ||
- | As root, create the " | ||
- | mkdir / | ||
- | vi reduce-timeout.conf | ||
- | | ||
- | Then add this to your " | ||
- | [Service] | ||
- | TimeoutStartSec=XX | ||
- | | ||
- | < | ||
- | |||
===== Disable swap ===== | ===== Disable swap ===== | ||
As root, turn off the process that automatically creates a swap file | As root, turn off the process that automatically creates a swap file | ||
Line 133: | Line 128: | ||
After some time of lecture, I found out that there wasn't a config file with a lease-file option. | After some time of lecture, I found out that there wasn't a config file with a lease-file option. | ||
- | |||
- | |||
- | |||
- | ===== Create a clean raspbian image ===== | ||
- | sudo dd if=/ | ||
- | | ||
- | <note important> | ||
- | |||
- | Before modifying **cmdline.txt** and **config.txt**, | ||
- | cp -p cmdline.txt cmdline.txt.original | ||
- | cp -p config.txt config.txt.original | ||
- | Once you have finished, change the output console device and remove the script that autoexpands / partition size at first startup. | ||
- | vi cmdline.txt | ||
- | console=serial0, | ||
- | delete init=/ | ||
- | |||
- | Don't forget to enable this option, otherwise you won't be able to communicate to your raspberry pi throught raspberry debug port (TTL-232R-RPi). | ||
- | vi config.txt | ||
- | add this : enable_uart=1 | ||
- | |||
- | / | ||
- | devtmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | / | ||
- | tmpfs 93M | ||
- | | ||
- | Now, resize the / partition and create a new one. As root, type : | ||
- | fdisk / | ||
- | Your partition table should look like this : | ||
- | Device | ||
- | / | ||
- | / | ||
- | Delete the / partition, and create a new one (primary) which starts at THE SAME POSITION as the one you have just deleted, in my case 98304.\\ | ||
- | In the **fstab**, replace **PARTUUID** by / | ||
- | resize2fs / | ||
- | |||
- | sudo apt update | ||
- | sudo apt upgrade | ||
- | |||
- | touch /boot/ssh | ||
- | sudo systemctl enable ssh | ||
- | sudo systemctl start ssh | ||
- | Reference : https:// | ||
- | |||
- | vi fstab | ||
- | tmpfs / | ||
- | tmpfs / | ||
- | | ||
- | reboot | ||
- | Check if there are any errors | ||
- | |||
- | vi / | ||
- | | ||
- | [Unit] | ||
- | Description=Generate Rsyslog structure | ||
- | Before=syslog.service | ||
- | | ||
- | [Service] | ||
- | ExecStart=/ | ||
- | Type=oneshot | ||
- | | ||
- | [Install] | ||
- | WantedBy=default.target | ||
- | |||
- | vi / | ||
- | #!/bin/bash | ||
- | | ||
- | if [ -r / | ||
- | WorkDirectory=$(grep " | ||
- | else | ||
- | echo " | ||
- | exit 1 | ||
- | fi | ||
- | | ||
- | if [ ! -d " | ||
- | mkdir $WorkDirectory | ||
- | fi | ||
- | | ||
- | exit 0 | ||
- | |||
- | sudo chmod 664 generateRsyslogStructure.service | ||
- | chmod a+x generateRsyslogStructure.sh | ||
- | | ||
- | sudo systemctl enable enerateRsyslogStructure.service | ||
- | vi /etc/fstab | ||
- | tmpfs / | ||
- | | ||
- | reboot | ||
- | |||
- | vi /etc/fstab | ||
- | tmpfs / | ||
- | | ||
- | reboot | ||
- | Systemd-hostnamed doest not start | ||
- | vi /etc/fstab | ||
- | tmpfs / | ||
- | | ||
- | reboot | ||
- | |||
- | vi /etc/fstab | ||
- | PARTUUID=c1dc39e5-02 | ||
- | | ||
- | reboot | ||
- | |||
- | vi /etc/fstab | ||
- | PARTUUID=c1dc39e5-01 | ||
- | |||
- | sudo systemctl stop dphys-swapfile.service | ||
- | sudo systemctl disable dphys-swapfile.service | ||
- | reboot | ||
- | Systemd manual: https:// | ||
- | |||
- | Create a partition with the unused partition size.\\ | ||
- | --Rw mode--\\ | ||
- | Create / | ||
- | Mount /media/data (/ | ||
- | reboot\\ | ||
- | --Ro mode--\\ | ||
- | reboot\\ | ||
- | vi / | ||
- | | ||
- | #! /bin/bash | ||
- | | ||
- | history -c | ||
- | set +o history | ||
- | | ||
- | export HISTFILESIZE=0 | ||
- | export HISTSIZE=0 | ||
- | unset HISTFILE | ||
- | | ||
- | chmod a+x / | ||
- | | ||
- | reboot | ||
- | ===== Rename username ===== | ||
- | As root account is disabled by default on raspberrian, | ||
- | sudo mount -o remount,rw / | ||
- | sudo su passwd root | ||
- | And then enter the new password you want. | ||
- | |||
- | usermod -l acdsn pi | ||
- | usermod -m -d /home/acdsn acdsn | ||
- | Set a password to the user | ||
- | passwd acdsn | ||
- | |||
- | ===== Rename group ===== | ||
- | groupmod --new-name acdsn pi | ||
- | |||
- | ===== Rename hostname ===== | ||
- | vi / | ||
- | Replace the existing hostname by the new one. | ||
- | ===== Generate ssh keys ===== | ||
- | ssh-keygen -t rsa -b 2048 |