The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "Draft Funtoo Install on RPI/Configure"
(Created page with "== Configure Your System == There are two ways to approach configuration. Here we alter files and symlinks in {{c|$SYSROOT/etc}} directly from the operating system we are wor...") |
|||
Line 87: | Line 87: | ||
###i## cp ${KERNEL_WORK}/firmware/boot/kernel7.img ${SYSROOT}/boot/ | ###i## cp ${KERNEL_WORK}/firmware/boot/kernel7.img ${SYSROOT}/boot/ | ||
}} | }} | ||
Next: [[Draft_Funtoo_Install_on_RPI/Kernel|Install Binary Kernel, Modules and dtbs]] |
Revision as of 20:25, February 9, 2019
Configure Your System
There are two ways to approach configuration. Here we alter files and symlinks in $SYSROOT/etc
directly from the operating system we are working under to do the install. This is most flexible. Further configuration using Funtoo tools can be done on the pi itself once it is booted.
Alternatively, we could also chroot into $SYSROOT using QEMU with binary translation of arm to the architecture of the machine you are working to do the install. Then one can install packages, edit files and use rc-update
directly to set up services using Funtoo provided services directly.
``
Set Up Mount Points
Alter $SYSROOT/etc/fstab
as follows. We remove the swap, and alter the storage device name and partition file types. We also remove the /dev/cdrom
device.
No swap is configured. If you need to control out of memory conditions (e.g. when compiling chromium) you need to configure a swap parition or use No results. A partition must also be created and formatted on the device (probably on the sd card, but usb block memory devices can be used if necessary).
$SYSROOT/etc/fstab
/dev/mmcblk0p1 /boot vfat noauto,noatime 1 2
/dev/mmcblk0p2 / ext4 noatime 0 1
We can use the following No results code.
root # sed -i "s/\/dev\/sda1.*/\/dev\/mmcblk0p1 \/boot vfat defaults 0 2/" ${SYSROOT}/etc/fstab root # sed -i "s/\/dev\/sda2.*//" ${SYSROOT}/etc/fstab root # sed -i "s/\/dev\/sda3.*/\/dev\/mmcblk0p2 \/ ext4 defaults 0 1/" ${SYSROOT}/etc/fstab root # sed -i "s/\#\/dev\/cdrom.*//" ${SYSROOT}/etc/fstab
Set Up Root Password
Here we interactively add a root password to log in with to $SYSROOT/etc/shadow
.
root # sed -i "s|root\:\*|root\:`(openssl passwd -1)`|" $SYSROOT/etc/shadow
Set Up Networking
We add dhcpcd as a default runlevel service.
root # ln -sf /etc/init.d/dhcpcd ${SYSROOT}/etc/runlevels/default
Set Up SSH Access
If you want to ssh to the board as root, you need to allow it explicitly and we add sshd as a default runlevel service.
root # echo "PermitRootLogin yes" >> ${SYSROOT}/etc/ssh/sshd_config root # ln -sf /etc/init.d/sshd ${SYSROOT}/etc/runlevels/default~
Set Up the Software Clock
Let's set up the software clock. This is Raspberry Pi specific, and due to its lack of a stock RTC chipset. This has ramifications for maintaining the correct time via a pacakge like No results. }}
Link to Accelerated Video Libraries
You must add /opt/vc/lib
to $LD_LIBRARY_PATH
in the shell, or use the env-update
functionality of Funtoo if you want to link against these firmware libraries. This is critical if you want to do any accelerated graphics or gpu level work.
Here we add an entry to the appropriate configuration file which env-update
will pick up whenever we source /etc/profile
.
root # echo "LDPATH=\"/opt/vc/lib\"" > ${SYSROOT}/etc/env.d/99vc
If you want to try building native vc4 acceleration with media-libs/mesa you must unmask the appropriate USE flags at the profile level and VIDEO_CARDS="vc4" in make.conf.
root # cat > /etc/portage/profile/portage.use.mask << EOF root ##i##media-libs/mesa -video_cards_vc4~ root ##i##x11-libs/libdrm -video_cards_vc4 root ##i##EOF
If /var/log/Xorg.0.log
is flooded with messages of the following type:
(EE) modeset(0): Failed to get GBM bo for flip to new front. (EE) modeset(0): present flip failed
the workaround is to disable the PageFlip
parameter for the modesetting
driver.
To do this, as a root user create a file 20-displaylink.conf under /usr/share/X11/xorg.conf.d/ with the following content:~
$SYSROOT/usr/share/X11/xorg.conf.d/20-displaylink.conf
Section "Device"
Identifier "DisplayLink"
Driver "modesetting"
Option "PageFlip" "false"
EndSection~~
Configure the Boot Parameters
root # cat > ${SYSROOT}/boot/cmdline.txt << EOF root ##i## dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait root ##i## EOF
Install Binary Kernel, Modules and dtbs
root # mkdir -p ${SYSROOT}/boot/overlays root # cp ${KERNEL_WORK}/firmware/boot/dts/*.dtb ${SYSROOT}/boot/ root # cp ${KERNEL_WORK}/firmware/boot/dts/overlays/*.dtb* ${SYSROOT}/boot/overlays/ root # cp ${KERNEL_WORK}/firmware/boot/dts/overlays/README ${SYSROOT}/boot/overlays/ root # cp ${KERNEL_WORK}/firmware/boot/kernel7.img ${SYSROOT}/boot/