§2023-09-12
Some configurations need to be done on the rpi side after booting.
¶1. change password of root
# password
Enter new password: b2nnnnnnn
Re-type new password:
¶2. start ssh and allow root to ssh-in
# /etc/init.d/ssdh start
or,
# rc-service sshd start/status/restart
- PermitRootLogin
# nano /etc/ssh/sshd_config, and add a line `PermitRootLogin yes`
#PermitRootLogin prohibit-password
PermitRootLogin yes
PasswordAuthentication yes
<-- does not work even rc-service sshd restart
¶2. cretae alexlai
user
# useradd -m -u 1026 alexlai
# password alexlai
# usermod -G wheel alexlai
# id alexlai
uid=1026(alexlai) gid=1026(alexlai) groups=1026(alexlai),10(wheel)
I have problem to
su
into root
¶3. emerge-webrsync
¶ 4. emerge net-misc/ntp
- /etc/ntp.conf
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server time.stdtime.gov.tw
server ntp.nict.gov.tw
server ntp.twaren.net
- start
rc-service ntpd start
rc-update add ntpd default
sudo rc-update show default
$ date
Tue Sep 12 18:07:42 CST 2023
¶ 5. install sudo
# emerge --search sudo
# emerge -av app-admin/sudo
# visudo
以下: alexlai can do sudo but not su into root --> PermitRootLogin yes
sudo emerge --ask --update --deep --newuse @world
(emerge -auDN @world)
¶5. trim the sd card
fstrim -av
fstrim -av is used in Linux to trim unused blocks on solid-state drives. -a: This option tells fstrim to trim all mounted file systems. It means it will try to trim all the supported file systems it finds. This is useful to ensure that all eligible file systems are trimmed. -v: This option stands for "verbose," and it makes the command provide more detailed output, showing which file systems are being trimmed and the progress of the operation.
So, when you run fstrim -av, you are instructing the system to trim all mounted file systems that support trimming and provide verbose output, so you can see the progress of the trim operation. This command is typically used periodically to help maintain SSD performance, especially on systems where TRIM is not automatically scheduled by the operating system.
¶6 password and locale
- set root password
passwd
- edit /etc/locale.gen with nan and set locales
- ucomment en_US.UTF-8
- locale-gen
- list locales
# eselect locale list
Available targets for the LANG variable:
[1] C
[2] C.utf8
[3] POSIX
[4] en_US.utf8
[5] C.UTF8 *
[ ] (free form)
- set (hereen_US.utf8)
eselect locale set 4
# eselect locale set 4
Setting LANG to en_US.utf8 ...
Run ". /etc/profile" to update the variable in your shell.
# . /etc/profile, or
# source /etc/profile
# env-update
>>> Regenerating /etc/ld.so.cache...
¶6.network
以下: it looks like all set, I dont have to do anything
# cd /etc/init.d/
ln -sv net.lo net.eth0
edit /etc/conf.d/net and set a static IP address (no dhcp installed yet)
config_eth0="192.168.0.11/24"
routes_eth0="default via 192.168.0.1"
restart the interface
ifconfig eth0 down
ifconfig eth0 up
start the service
rc-service net.eth0 start
rc-update add net.eth0 boot
now you shpuld able to ping
ping -c 3 8.8.8.8
set a nameserver with nano /etc/resolv.conf
nameserver 8.8.8.8
try to ping www.google.de
ping -c 3 www.google.de
time settings
remove hw clock (rpi hasn't got a hw clock)
rc-update add swclock boot
rc-update del hwclock boot
set current date in format MMDDhhmmYYYY
date 022818202022
install ntp and let it start on boot
emerge --ask ntp
rc-update add ntp-client default
rc-update --update
update
update your system with
emerge --sync
emerge -auDN @world
add user
add user (here mck) and set a password
useradd -m -G users,wheel,video,audio,usb -s /bin/bash mck
passwd mck
References: https://wiki.gentoo.org/wiki/Raspberry_Pi/Quick_Install_Guide https://wiki.gentoo.org/wiki/Raspberry_Pi_3_64_bit_Install https://wiki.gentoo.org/wiki/Raspberry_Pi4_64_Bit_Install https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Finalizing