Changes

Jump to: navigation, search

Funtoo Linux Installation on RPI

908 bytes added, 2 months ago
Configure the Boot Parameters
This is an update of [[Crossdev_Automation]], reflecting the changes needed to accomodate the new kits structure of Funtoo, and to clean up the scripting used for automation. The document will remain available for reference purposes.
 
{{warning|There are no available stage 3 builds for Raspberry Pi. Stay tuned though.}}
== Installation Overview ==
# [[#Install Binary Kernel, Modules and dtbs]]
# [[#Cross-compile Kernel, Modules and dtbs from Source]]
# [[#Use QEMUTo chroot]]
# [[#Partition and Format an SDCard]]
# [[#Deploy Installation to SDCard]]
# [[#Enjoy!]]
== Get the Bash Script (Or Not) ===== If You Want to Try the Script ===Development code to automate completely the process of installing is available on [https://github.com/d4g33z/sysroot.git github]. The structure of the file {{c|sysroot.sh}} should roughly correspond to the information contained here in this document. The script contains enough functionality to:* get the latest stage3 tarball and verify its integrity* install necessary open and closed source firmware* configure the system: ** modify fstab to make a simple partition structure (no swap)** set a root password interactively** add appropriate services to default run level** set up the software clock** link to accelerated video libraries** set boot parameters* install a kernel ** rpi binary kernel, dtbs, and modules** OR cross compile a kernel, modules and dtbs from source* install QEMU and use binary translation to allow the use of chroot for further tweaking* partition and format an sdcard* copy the bootable configured stage3 to the sdcard
Development code The script is available designed to used on [https://github.com/d4g33z/sysroot.git github]. The structure of a machine that mounts the file {{c|sysroot.sh}} should roughly correspond to sdcard that will be used on the information contained herepi.
Too use the basic install functionality of the script, edit the {{c|config}} file (pay attention to the {{c|SDCARD_DEV}} variable) and then
{{console|body=
###i## source sysroot.sh && sysroot_install
}}
Read the questions carefully and answer yes or no.
 
=== If You Want to Do it Yourself ===
Read the document here and follow the steps, referring {{c|sysroot.sh}} to reassure yourself of the correctness of the installer script.
== Create Your Installation Settings ==
SYSROOT_WORK=/mnt/shared/sysroots
STAGE3_URL=httphttps://ftpbuild.osuoslfuntoo.org/pub/funtoo/funtoo1.3-release-currentstd/arm-32bit/raspi3/2019-01-25/stage3-latestraspi3-1.3-release-std-2019-01-25.tar.xz
CHOST=armv7a-hardfloat-linux-gnueabi
CFLAGS="-O2 -pipe -march=armv7-a -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard"
INSTALL_VARS=(KERNEL_WORK RPI_KERN_BRANCH SYSROOT_WORK STAGE3_URL CHOST CFLAGS SDCARD_DEV)
}}
 
 
== Install the Stage 3 Tarball ==
Download the current Funtoo stage 3 build appropriate for your Raspberry Pi device. Check the [[Subarches#arm32Raspberry_Pi_(Version_3)]] page, to see the version available for versions 1,2 and 3 of the Pi. Here we download the version for version 3 by setting the STAGE_URL variable in our configuration file.
We need to save the archive to {{c|$STAGE3_ARCHIVE}} and unpack it to {{c|$SYSROOT}}. Back up or remove any previous work in that local.
###i## git clone --depth 1 https://github.com/RPi-Distro/firmware-nonfree ${KERNEL_WORK}/firmware-nonfree
###i## git --git-dir=${KERNEL_WORK}/firmware-nonfree/.git --work-tree=${KERNEL_WORK}/firmware-nonfree pull origin
###i## mkdir -p ${SYSROOT}/lib/firmware/brcm###i## cp -r ${KERNEL_WORK}/firmware-nonfree/brcm/brcmfmac43430-sdio.{bin,txt} ${SYSROOT}/lib/firmware/brcm
}}
==== Set Up Root Password ====
Here we interactively add a root password to log in with to {{c|$SYSROOT/etc/shadow}}.
{{warning|Occasionally this fails due to an unescaped sed control character in the password hash. Just try it until it works, or run the password generation separately from the shadow file editing, or actually fix it.}}
{{console|body=
###i## sed -i "s/{{!}}root\:\*/{{!}}root\:`(openssl passwd -1)`/{{!}}" $SYSROOT/etc/shadow
}}
 
==== Set Up Networking ====
We add dhcpcd as a default runlevel service.
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 {{Package|net-misc/openntpd}}.
{{console|body=
###i## ln rc-sf /etc/init.d/update add swclock ${SYSROOT}/etc/runlevels/boot###i## rm ${SYSROOT}/etc/runlevels/rc-update del hwclock boot/hwclock
###i## mkdir -p ${SYSROOT}/lib/rc/cache
###i## touch ${SYSROOT}/lib/rc/cache/shutdowntime
}}
 
==== Disable Serial Console Access ====
Let's prevent serial consoles from spawning. If you have a need for this, you'll be able to set it up yourself.
{{console|body=
###i## cat > ${SYSROOT}/boot/cmdline.txt << EOF
\##i## dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait\##i## EOF
}}
}}
== Use QEMU To chroot ==
{{Package|app-emulation/qemu}} relies upon KVM and the associated kernel module, called either {{c|kvm_intel}} or {{c|kvm_amd}}, depending on the architecture the kernel is running on. Please see [[KVM]] to find out how to get these kernel modules loaded and virtualization working.
=== Install a QEMU Chroot ===
Bureaucrats, Administrators, wiki-admins, wiki-staff
6,213
edits

Navigation menu