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 14:22] – maferreira | operating_systems:raspbian:raspbian [2019/05/07 06:56] – maferreira | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Raspbian ====== | ====== Raspbian ====== | ||
- | ===== Clone only a directory ===== | + | |
- | git clone <git path> | + | * [[Clean installation]] |
- | cd <git directory> | + | |
- | git config core.sparsecheckout true | + | |
- | echo "< | + | * [[easyGateway configuration]] |
- | git checkout -- | + | * [[easyDoor configuration]] |
- | + | ||
- | ===== Reduce time that is used to raise network interfaces ===== | + | |
- | As root, create the "**networking.service.d**" | + | |
- | | + | |
- | | + | |
- | | + | |
- | Then add this to your "**reduce.timeout.conf**" | + | |
- | | + | |
- | | + | |
- | + | ||
- | < | + | |
===== Disable swap ===== | ===== Disable swap ===== | ||
Line 133: | Line 122: | ||
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 / | ||
- | After creating the partition that will be mounted at / | ||
- | mkfs.ext4 / | ||
- | |||
- | Now, it's time to test what you have done. | ||
- | mount -a | ||
- | df -h | ||
- | | ||
- | Filesystem | ||
- | / | ||
- | devtmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | tmpfs | ||
- | / | ||
- | tmpfs 93M | ||
- | / | ||
- | | ||
- | |||
- | 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 | ||
- | / | ||
- | | ||
- | reboot | ||
- | |||
- | vi /etc/fstab | ||
- | / | ||
- | |||
- | 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 | ||
- | |||
- | * [[Clean installation]] |