#21 Raspberry Pi & Create a Hello World RPM Quick Docs
Closed 6 years ago by bex. Opened 6 years ago by coremodule.
fedora-docs/ coremodule/quick-docs docs_branch  into  master

change
Geoff • 6 years ago  
change
Geoff • 6 years ago  
file modified
+5 -5
@@ -44,10 +44,14 @@ 

      File: understanding-and-administering-systemd

    - Name: Creating RPM packages

      File: creating-rpm-packages

-   - Name: Repositories  

+   - Name: Repositories

      File: repositories

    - Name: Configuring X Window System using the xorg.conf file

      File: configuring-x-window-system-using-the-xorg-conf-file

+   - Name: Raspberry Pi

+     File: raspberry-pi

+   - Name: How to Create a GNU Hello World RPM Package

+     File: create-hello-world-rpm

    - Name: (CHECK) GRUB 2

      File: grub2

    - Name: (CHECK) Spotify
@@ -62,8 +66,6 @@ 

      File: bumblebee

    - Name: (FIX ME!) Creating GPG Keys

      File: create-gpg-keys

-   - Name: (FIX ME!) How to create a GNU Hello RPM package

-     File: create-hello-world-rpm

    - Name: (FIX ME!) How to debug Dracut problems

      File: debug-dracut-problems

    - Name: (FIX ME!) How to debug Systemd problems
@@ -98,8 +100,6 @@ 

      File: postgresql

    - Name: (FIX ME!) How to use qemu

      File: qemu

-   - Name: (FIX ME!) Raspberry Pi

-     File: raspberry-pi

    - Name: (FIX ME!) How to reset a root password

      File: reset-root-password

    - Name: (FIX ME!) Using UEFI with QEMU

@@ -0,0 +1,6 @@ 

+ :WRPM: link:https://docs.fedoraproject.org/quick-docs/en-US/creating-rpm-packages.html

+ :WPACKAGE: link:https://fedoraproject.org/wiki/Join_the_package_collection_maintainers[How to join the Fedora Package Collection Maintainers]

I'm not sure if it's good practice to include the title for the URL in the attribute? I'm not sure but I haven't seen it done before, so I'd turn to @bex @rkratky @zoglesby if they would have strong opinions on this.

bex commented 6 years ago

I am not sure why there is an attribute here if we only use the URL once ...

+ :RPMSCHAT: https://fedoraproject.org/wiki/Building_RPM_packages_(20090405)

+ :MOCKTEST: https://fedoraproject.org/wiki/Using_Mock_to_test_package_builds

+ :KOJIBUILD: https://fedoraproject.org/wiki/Using_the_Koji_build_system

+ :YUM: https://fedoraproject.org/wiki/Yum

file modified
+127 -218
@@ -1,226 +1,159 @@ 

- = How to create a GNU Hello RPM package

+ include::en-US/attributes.adoc[]

  

- '''

+ = How to Create a GNU Hello World RPM Package

  

- [IMPORTANT]

- ======

+ This is a short hands-on tutorial on writing RPM files, showing how to quickly step up to create simple source and binary software packages.

+ It assumes some familiarity with using pre-made RPM packages, and with the FOSS building process.

  

- This page was automatically converted from https://fedoraproject.org/wiki/How_to_create_a_GNU_Hello_RPM_package

+ For comprehensive information on how to create RPM files, including more detailed tips, refer to {WRPM}[How to create an RPM package].

+ If you plan to create an RPM package for the Fedora repository, follow the process for {WPACKAGE}, including following the various Fedora guidance.

  

- It is probably

- 

- * Badly formatted

- * Missing graphics and tables that do not convert well from mediawiki

- * Out-of-date

- * In need of other love

- 

- Pull requests accepted at https://pagure.io/fedora-docs/quick-docs

- 

- Once you've fixed this page, remove this notice, and update

- `_topic_map.yml`.

- 

- Once the document is live, go to the original wiki page and replace its text

- with the following macro:

- 

- ....

- {{#fedoradocs: https://docs.fedoraproject.org/whatever-the-of-this-new-page}}

- ....

- 

- ======

- 

- '''

+ This tutorial demonstrates packaging of the GNU "Hello World" project.

+ While the C program printing "Hello World" to standard output is trivial, the GNU version contains most of the usual peripheral components associated with a typical FOSS project, including the configuration/build/install environment, documentation, internationalization, etc.

+ The GNU version, however, traditionally consists of a `tar` file containing the source code and configure/make scripts, but it does not include the packaging information.

+ Therefore, it's a reasonable vehicle to practice building RPMs on.

  

+ == Development Environment

  

- This is a short hands-on tutorial on writing RPM files, showing how to

- quickly step up to create simple source and binary software packages. It

- assumes some familiarity with using pre-made RPM packages, and with the

- FOSS building process.

+ To build RPMs we need a set of development tools.

  

- For comprehensive information on how to create RPM files, including more

- detailed tips, refer to link:How_to_create_an_RPM_package[How to create

- an RPM package]. If you plan to create an RPM package for the Fedora

- repository, follow the process for

- link:Join_the_package_collection_maintainers[How to join the Fedora

- Package Collection Maintainers], including following the various Fedora

- guidance.

+ IMPORTANT: Make sure you run the following command as the `root` user!

  

- This tutorial demonstrates packaging of the GNU "Hello World" project.

- While the C program printing 'Hello World" to standard output is

- trivial, the GNU version contains most of the usual peripheral

- components associated with a typical FOSS project, including the

- configuration/build/install environment, documentation,

- internationalization, etc. The GNU version, however, traditionally

- consists of a `tar` file containing the source code and configure/make

- scripts, but it does not include the packaging information. Therefore,

- it's a reasonable vehicle to practice building RPMs on.

- 

- [[development-environment]]

- Development environment

- ~~~~~~~~~~~~~~~~~~~~~~~

- 

- To build RPMs we need a set of development tools. This is a

- one-time-only setup, installed by running those commands from a system

- administration (`root`) account:

+ This is a one-time-only setup, installed by running these commands from a system administration (`root`) account:

  

- ....

+ ----

  # dnf install fedora-packager @development-tools

- ....

+ ----

  

- To be able to test the build procedure in a clean chroot you need to

- configure your non-privileged account to be a member of the 'mock'

- group:

+ IMPORTANT: Make sure you run the following command as the `root` user!

  

- ....

+ To be able to test the build procedure in a clean chroot you need to configure your non-privileged account to be a member of the 'mock' group:

+ 

+ ----

  # usermod -a -G mock <your username>

- ....

+ ----

  

- Those are the only commands requiring `root` privileges. All the

- remaining work should be done from your regular, non-privileged account,

- or even from a separate account created just for development work.

- Modern RPM-based systems, including Fedora, are set up to build and test

- RPM packages purely from within a non-privileged account. The command

+ Those are the only commands requiring `root` privileges.

+ All the remaining work should be done from your regular, non-privileged account, or even from a separate account created just for development work.

+ Modern RPM-based systems, including Fedora, are set up to build and test RPM packages purely from within a non-privileged account.

+ The follwing command sets up an RPM build area in your `~/rpmbuild` directory.

+ This directory will contain several subdirectories, for the project source code, RPM configuration files and for the resulting source and binary packages.

  

- ....

+ ----

  $ rpmdev-setuptree

- ....

- 

- sets up an RPM build area in your `~/rpmbuild` directory. This directory

- will contain several subdirectories, for the project source code, RPM

- configuration files and for the resulting source and binary packages.

+ ----

  

- [[building-a-hello-world-rpm]]

- Building a "Hello World" RPM

- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ == Building a "Hello World" RPM

  

- We need the source code of the project we are packaging, often referred

- to as the 'upstream' source. We will download it from the project's

- website into the `~/rpmbuild/SOURCE` directory. We are getting the

- compressed tarball archive, which happens to be the preferred

- distribution form for most FOSS projects.

+ We need the source code of the project we are packaging, often referred to as the 'upstream' source.

+ We will download it from the project's website into the `~/rpmbuild/SOURCE` directory.

+ We are getting the compressed tarball archive, which happens to be the preferred distribution form for most FOSS projects.

  

- ....

+ ----

  $ cd ~/rpmbuild/SOURCES

  $ wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz

- ....

+ ----

  

- The RPM package is configured by `.spec` files. We will create a

- template file `hello.spec` in the appropriate directory:

+ The RPM package is configured by `.spec` files.

+ We will create a template file `hello.spec` in the appropriate directory:

  

- ....

+ ----

  $ cd ~/rpmbuild/SPECS

  $ rpmdev-newspec hello

- ....

+ ----

  

- Recent versions of `Emacs` and `vi` have .spec file editing modes which

- will also bring up a similar template upon creating a new file. So you

- can just use the following command for example to use the template

- automatically.

+ Recent versions of `Emacs` and `vi` have .spec file editing modes which will also bring up a similar template upon creating a new file.

+ So you can just use the following command for example to use the template automatically.

  

- ....

+ ----

  $ emacs hello.spec

- ....

+ ----

  

- [[inside-a-.spec-file]]

- Inside a `.spec` file

- ^^^^^^^^^^^^^^^^^^^^^

+ == Inside a Spec File

  

- The fields in our `.spec` file need slight editing. Please follow the

- link:How_to_create_an_RPM_package#Spec_file_pieces_explained[Fedora

- rules] for these fields. In our case, the file might start as follows:

+ The fields in our `.spec` file need slight editing.

+ Please follow the {WRPM}[Fedora rules] for these fields.

+ In our case, the file might start as follows:

  

- ....

+ [source, RPMSpec]

+ ----

  Name:     hello

  Version:  2.10

  Release:  1

  Summary:  The "Hello World" program from GNU

  License:  GPLv3+

- URL:      https://www.gnu.org/software/hello/   

+ URL:      https://www.gnu.org/software/hello/

  Source0:  https://ftp.gnu.org/gnu/hello/hello-%{version}.tar.gz

  

  %description

- The "Hello World" program, done with all bells and whistles of a proper FOSS 

+ The "Hello World" program, done with all bells and whistles of a proper FOSS

  project, including configuration, build, internationalization, help files, etc.

  

  %changelog

  * Thu Jul 07 2011 The Coon of Ty <Ty@coon.org> - 2.10-1

  - Initial version of the package

- ....

+ ----

  

- The `Version` should mirror upstream while `Release` numbers our work

- within Fedora.

+ The `Version` should mirror upstream while `Release` numbers our work within Fedora.

  

- The first letter of the `Summary` should be uppercase to avoid `rpmlint`

- complaints.

+ The first letter of the `Summary` should be uppercase to avoid `rpmlint` complaints.

  

- It is your responsibility to check the `License` status of the software,

- by inspecting the source files and/or their `LICENSE` files, and/or by

- talking to the authors.

+ It is your responsibility to check the `License` status of the software, by inspecting the source files and/or their `LICENSE` files, and/or by talking to the authors.

  

- The `Group` tag was historically used to classify the package in

- accordance with the list in `/usr/share/doc/rpm-``/GROUPS`. It is being

- phased out so you will not see it added by default. However, it doesn't

- hurt to add it anyway.

+ The `Group` tag was historically used to classify the package in accordance with the list in `/usr/share/doc/rpm-``/GROUPS`.

+ It is being phased out so you will not see it added by default.

+ However, it doesn't hurt to add it anyway.

  

- The `%changelog` should document the work on preparing the RPM,

- especially if there are security and bug patches included on top of the

- base upstream source. Changelog data can be displayed by

- `rpm --changelog -q `, which is very useful for instance to find out if

- specific bug and security patches were included in the installed

- software, thanks to the diligent Fedora packagers who include this info

- with the relevant http://cve.mitre.org/[CVE] numbers.

+ The `%changelog` should document the work on preparing the RPM, especially if there are security and bug patches included on top of the base upstream source.

+ Changelog data can be displayed by `rpm --changelog -q `, which is very useful for instance to find out if specific bug and security patches were included in the installed software, thanks to the diligent Fedora packagers who include this info with the relevant http://cve.mitre.org/[CVE] numbers.

  

- The `%changelog` entry should include the version string to avoid

- `rpmlint` complaints.

+ The `%changelog` entry should include the version string to avoid `rpmlint` complaints.

  

- Multi-line sections like `%changelog` or `%description` start on a line

- under the directive, and end with a blank line.

+ Multi-line sections like `%changelog` or `%description` start on a line under the directive, and end with a blank line.

  

- Lines which aren't needed (e.g. `BuildRequires` and `Requires`) can be

- commented out with a hash ('#') for now.

+ Lines which aren't needed (e.g. `BuildRequires` and `Requires`) can be commented out with a hash ('#') for now.

  

- Many lines in the template don't need to be changed at all in many

- cases, at least for the initial attempt.

+ Many lines in the template don't need to be changed at all in many cases, at least for the initial attempt.

  

- [[building-the-package]]

- Building the package

- ^^^^^^^^^^^^^^^^^^^^

+ == Building the Package

  

- We are ready for the first run to build source, binary and debugging

- packages:

+ We are ready for the first run to build source, binary and debugging packages:

  

- ....

+ ----

  $ rpmbuild -ba hello.spec

- ....

+ ----

  

- It will complain and list the unpackaged files, i.e. the files that

- would be installed in the system that weren't declared as belonging to

- the package. We need to declare them in the `%files` section. Do not

- hardcode names like `/usr/bin/`, but use macros, like `%{_bindir}/hello`

- instead. The manual pages should be declared in the `%doc` subsection:

- `%doc %{_mandir}/man1/hello.1.*`.

+ It will complain and list the unpackaged files, i.e. the files that would be installed in the system that weren't declared as belonging to the package.

+ We need to declare them in the `%files` section.

+ Do not hardcode names like `/usr/bin/`, but use macros, like `%{_bindir}/hello` instead.

+ The manual pages should be declared in the `%doc` subsection:

+ 

+ ....

+ %doc %{_mandir}/man1/hello.1.*

+ ....

  

- This is an iterative process: after editing the `.spec` file, rerun

- `rpmbuild`.

+ This is an iterative process; after editing the `.spec` file, rerun `rpmbuild`.

  

- Since our program uses translations and internationalization, we are

- seeing a lot of undeclared i18 files. The

- Packaging:Guidelines#Handling_Locale_Files[recommended method] to

- declare them is:

+ Since our program uses translations and internationalization, we are seeing a lot of undeclared i18 files.

+ The link:https://fedoraproject.org/wiki/Packaging:Guidelines#Handling_Locale_Files[recommended method] to declare them is:

  

  * find the filenames in the `%install` step: `%find_lang %{name}`

  * add the required build dependencies: `BuildRequires: gettext`

  * use the found filenames `%files -f %{name}.lang`

  

- If the program uses GNU `info` files, you need to make sure the

- installation and uninstallation of the package does not interfere with

- other software on the system, by using this boilerplate:

+ If the program uses GNU `info` files, you need to make sure the installation and uninstallation of the package does not interfere with other software on the system, by using this boilerplate:

  

  * delete the `dir` file in `%install`:

- `rm -f %{buildroot}/%{_infodir}/dir`

+ 

+ ----

+ $ rm -f %{buildroot}/%{_infodir}/dir

+ ----

+ 

  * `Requires(post): info` and `Requires(preun): info`

  * add those steps:

  

- ....

+ [source,RPMSpec]

+ ----

  %post

  /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

  
@@ -228,20 +161,18 @@ 

  if [ $1 = 0 ] ; then

  /sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :

  fi

- ....

+ ----

  

- This snippet is copied directly from

- Packaging:ScriptletSnippets#Texinfo. That page contains solutions to

- many common packaging tasks. If possible, try to copy a solution from

- there instead of devising your own.

+ This snippet is copied directly from link:https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Texinfo[here].

+ That page contains solutions to many common packaging tasks.

+ If possible, try to copy a solution from there instead of devising your own.

  

- [[a-complete-hello.spec-file]]

- A complete `hello.spec` file

- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

+ == A Complete `hello.spec` File

  

  Here's the initial version of `hello.spec`:

  

- ....

+ [source,RPMSpec]

+ ----

  Name:           hello

  Version:        2.10

  Release:        1%{?dist}
@@ -252,12 +183,12 @@ 

  Source0:        http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz

  

  BuildRequires: gettext

-       

+ 

  Requires(post): info

  Requires(preun): info

  

- %description 

- The "Hello World" program, done with all bells and whistles of a proper FOSS 

+ %description

+ The "Hello World" program, done with all bells and whistles of a proper FOSS

  project, including configuration, build, internationalization, help files, etc.

  

  %prep
@@ -291,66 +222,44 @@ 

  %changelog

  * Tue Sep 06 2011 The Coon of Ty <Ty@coon.org> 2.10-1

  - Initial version of the package

- ....

+ ----

  

- With this `.spec` file, you should be able to successfully complete the

- build process, and create the source and binary RPM packages.

+ With this `.spec` file, you should be able to successfully complete the build process, and create the source and binary RPM packages.

  

- Next you should check them for conformance with RPM design rules, by

- running `rpmlint` on the `.spec` file and all RPMs:

+ Next you should check them for conformance with RPM design rules, by running `rpmlint` on the `.spec` file and all RPMs:

  

- ....

+ ----

  $ rpmlint hello.spec ../SRPMS/hello* ../RPMS/*/hello*

- ....

+ ----

  

- If there are no warnings or errors, we've succeeded. Otherwise, use

- `rpmlint -i` or `rpmlint -I <error_code>` to see a more verbose

- description of the `rpmlint` diagnostics.

+ If there are no warnings or errors, we've succeeded.

+ Otherwise, use `rpmlint -i` or `rpmlint -I <error_code>` to see a more verbose description of the `rpmlint` diagnostics.

  

- [[the-mock-builds]]

- The `mock` builds

- ^^^^^^^^^^^^^^^^^

+ == The `mock` Builds

  

- To check that the package build will succeed in the Fedora restricted

- build environment, check it with `mock`. The default `mock`

- configuration builds the package against Rawhide - the Fedora

- development branch.

+ To check that the package build will succeed in the Fedora restricted build environment, check it with `mock`.

+ The default `mock` configuration builds the package against Rawhide - the Fedora development branch.

  

- ....

+ ----

  $ mock --verbose ../SRPMS/hello-2.10-1.fc25.src.rpm

- ....

+ ----

+ 

+ == References

+ 

+ * {WRPM}[How to create an RPM package]

+ 

+ * {RPMSCHAT}[Building RPM packages (20090405)]

+ 

+ * {MOCKTEST}[Using Mock to test package builds]

+ 

+ * {KOJIBUILD}[Using the Koji build system]

+ 

+ == History

  

- [[references]]

- References

- ~~~~~~~~~~

- 

- * link:How_to_create_an_RPM_package[How to create an RPM package]

- * link:Building_RPM_packages_(20090405)[Building RPM packages

- (20090405)]

- * link:Using_Mock_to_test_package_builds[Using Mock to test package

- builds]

- * link:Using_the_Koji_build_system[Using the Koji build system]

- 

- [[history]]

- History

- ~~~~~~~

- 

- Przemek Klosowski wrote this tutorial when he worked through

- link:Building_RPM_packages_%2820090405%29[Christoph Wickert's IRC

- session on building RPMs] using Rahul Sundaram suggestion of GNU "Hello

- World" as a test case. After he wrote up his experience, he found out

- about the excellent and extensive link:How_to_create_an_RPM_package[How

- to create an RPM package] page on this wiki, as well as the

- http://www.absolutepanic.org/blog/2009/07/building-a-gnu-hello-world-rpm[Christian

- Lyder Jacobsen's website]. However, Christian isn't planning to update

- his site, and it seemed that a 5-minute 'fast food' alternative to the

- more extensive article might suit some people. More in-depth information

- on using and building RPM packages is available from link:Yum[other

- sources].

- 

- Category:Package_Maintainers[Category:Package Maintainers]

- Category:How_to[Category:How to]

- '''

- 

- See a typo, something missing or out of date, or anything else which can be

- improved? Edit this document at https://pagure.io/fedora-docs/quick-docs.

+ Przemek Klosowski wrote this tutorial when he worked through {RPMSCHAT}[Christoph Wickert's IRC session on building RPMs] using Rahul Sundaram suggestion of GNU "Hello World" as a test case.

+ After he wrote up his experience, he found out about the excellent and extensive {WRPM}[How to create an RPM package] page on the Fedora wiki.

+ More in-depth information on using and building RPM packages is available from {YUM}[other sources].

+  +

+  +

+ See a typo, something missing or out of date, or anything else which can be improved?

+ Edit this document link:https://pagure.io/fedora-docs/quick-docs[here.]

file modified
+316 -22
@@ -1,40 +1,334 @@ 

  = Raspberry Pi

  

- '''

+ TIP: The Raspberry Pi is now supported in Fedora 25 and later.

+ Fedora on the Raspberry Pi is still very new so please report issues to the ARM mailing list or IRC channel.

  

- [IMPORTANT]

- ======

+ == Introduction

  

- This page was automatically converted from https://fedoraproject.org/wiki/Architectures/ARM/Raspberry_Pi

+ The link:https://www.raspberrypi.org[Raspberry Pi] is a credit card-sized ARM based single board computer (SBC).

+ Fedora supports the the Raspberry Pi Model B versions 2 and 3 since Fedora 25 without any requirement of third party kernels or scripts to adjust offical images.

+ This documentation describes how to get started, and includes a Frequently Asked Questions (FAQ) section at the end of the document about what is supported and what isn't.

  

- It is probably

+ == Supported Hardware

  

- * Badly formatted

- * Missing graphics and tables that do not convert well from mediawiki

- * Out-of-date

- * In need of other love

+ We currently only support the Raspberry Pi Model B versions 2 and 3.

  

+ == Prerequisites

  

- Pull requests accepted at https://pagure.io/fedora-docs/quick-docs

+ * A Raspberry Pi 2 or 3

+ * Good quality SD Card (link:http://elinux.org/RPi_SD_cards[eLinux] hosts a compatibility list)

+ * HDMI Monitor or TV, a USB keyboard and mouse

+ * A decent power supply. You'll want at least 2A for the RPi2 and 2.5A for the RPi3, link:https://www.raspberrypi.org/help/faqs/#power[details here].

+ * Computer running Windows/MacOS/Linux

+ * SD card reader

  

- Once you've fixed this page, remove this notice, and update

- `_topic_map.yml`.

+ == Downloading the Fedora ARM image

  

- Once the document is live, go to the original wiki page and replace its text

- with the following macro:

+ Official support for the Raspberry Pi 2/3 is available in Fedora!

+ Please read the FAQ for the current status of various features.

+ 

+ The lastest Fedora ARM images can be downloaded link:https://arm.fedoraproject.org/[here.]

+ 

+ == Preparing the SD card

+ 

+ You can quite easily prepare the image on the SD card on Fedora or any Linux distribution, MacOS or Windows.

+ The default settings will provide the user interface on a HDMI monitor with keyboard and mouse support. 

+ If you wish to have output over a serial console please see the FAQs at the end of this document for more information.

+ 

+ == Fedora or Other Linux Distributions

+ 

+ === Use the fedora-arm-installer

+ 

+ To install arm-image-installer:

+ 

+ ----

+ $ dnf install -y fedora-arm-installer

+ ----

+ 

+ To write the image out use the following:

+ 

+ ----

+ $ sudo arm-image-installer

+ ----

+ 

+ Usage: `$ arm-image-installer <options>`

  

  ....

- {{#fedoradocs: https://docs.fedoraproject.org/whatever-the-of-this-new-page}}

+    --image=IMAGE    - xz compressed image file name

+    --target=TARGET  - target board

+    --media=DEVICE   - media device file (/dev/[sdX|mmcblkX])

+    --selinux=ON/OFF - Turn SELinux off/on as needed

+    --norootpass     - Remove the root password

+    -y		    - Assumes yes, will not wait for confirmation

+    --version	    - Display version and exit

+    --resizefs	    - Resize root filesystem to fill media device

+    --addconsole     - Add system console to extlinux.conf

+    --addkey=        - /path/to/ssh-public-key

  ....

  

- ======

+ Example: 

+ 

+ ----

+ $ arm-image-installer --image=Fedora-Rawhide.xz --target=Bananapi --media=/dev/mmcblk0

+ ----

+ 

+ For list of supported boards please check SUPPORTED-BOARDS file.

+ 

+ For the Raspberry Pi 2 use `--target=rpi2` and for the Raspberry Pi 3 use `--target=rpi3`.

+ 

+ === Manually Configure SD Card

+ 

+ ----

+ $ xzcat Fedora-IMAGE-NAME.raw.xz | sudo dd status=progress bs=4M of=/dev/XXX #Location of your media (will be sdX or mmcblkX depending on hardware)

+ ----

+ 

+ == Microsoft Windows / MacOS

+ 

+ The Raspberry Pi foundation provides some nice instructions for image copying using a Mac link:https://www.raspberrypi.org/documentation/installation/installing-images/mac.md[here].  

+ Simply replace any image file references with the name and path of the image downloaded in the step above.

+ 

+ == Resizing the Root Partition

+ 

+ The root partition is shrunk to the smallest size possible to ensure a small download.

+ You currently need to resize it manually.

+ Ideally we would like this to happen automatically (great community project idea!).

+ 

+ === Resize Before First Boot

+ 

+ The easiest way to do this before boot on a Linux system is with gparted:

+ 

+ ----

+ $ gparted /dev/XXX

+ ----

+ 

+ === Resize After initial-setup

+ 

+ The other mechanism for doing it is once you've booted the Raspberry Pi and completed the initial setup to create accounts.

+ 

+ * enlarge the 4th partition (this example uses mmcblk0)

+ 

+ ----

+ $ growpart /dev/mmcblk0p4

+ ----

+ 

+ * grow the fileystem to fill the available space

+ 

+ ----

+ $ resize2fs /dev/mmcblk0p4

+ ----

+ 

+ * resize root partition for the server image (which uses xfs)

+ 

+ ----

+ $ xfs_growfs -d /

+ ----

+ 

+ == Booting Fedora on the Raspberry Pi for the First Time

+ 

+ * Insert the SD card into the Raspberry Pi.

+ * Make sure you have a keyboard, mouse, network cable and monitor connected.

+ * Power on the Raspberry Pi.

+ * You will see Fedora booting and eventually the "Initial setup wizard" will appear.

+ * Follow the wizard to set language, timezone and create users.

+ * You should be presented with a login prompt or a getting started guide (depending on which Desktop/SPIN you're using).

+ 

+ == Applying Updates and Installing Software

+ 

+ There are no special ways or procedures necessary to install or update the software so you just use standard Fedora installation and update mechanisms such as dnf, gnome-software or any of the other GUI update systems as supported in the various desktop environments.

+ 

+ == Getting Help and Reporting Issues

+ 

+ So where can you get help if it’s not working? The usual Fedora support forums are:

+ 

+ * link:https://ask.fedoraproject.org/[Ask Fedora]

+ * link:https://lists.fedoraproject.org/admin/lists/arm%40lists.fedoraproject.org/[Fedora ARM mailing list]

+ * irc://irc.freenode.net/#fedora-arm[IRC via the #fedora-arm channel on Freenode]

+ 

+ == Frequently Asked Questions

+ 

+ === Why do I get a rainbow display when I try and power on my Raspberry Pi?

+ 

+ There's a number of different reasons you might get rainbow output on the display when you're trying to boot as Raspberry Pi. 

+ The three common ones we see are:

+ 

+ * The power supply isn't strong enough. See the "Prerequisites" section above.

+ 

+ * There's no OS installed. Check the SD card is properly in place and you've followed the instructions to write out the card.

+ 

+ * Wrong edition of the Raspberry Pi. If you try and use Fedora on a Raspberry Pi 1 or Zero you'll get this as we don't support ARMv6 SoCs.

+ 

+ === What desktop environments are supported?

+ 

+ Both 3D/2D work out of the box and all desktops as shipped in Fedora should work just fine. 

+ There is an open source fully accelerated driver for the Video Core IV GPU.

+ 

+ === Will there be more enhancements to the hardware support?

+ 

+ Yes. 

+ New enhancements will be delivered when, and as soon as, they are ready via the standard Fedora updates mechanism. 

+ New, significant features will be blogged about as they arrive either via link:https://fedoramagazine.org/[Fedora Magazine] or the link:http://fedoraplanet.org/[Fedora Planet].

+ 

+ === What about support for the Raspberry Pi Models A/A+, B/B+ (generation 1), Zero/ZeroW and Compute Module?

+ 

+ THESE ARE NOT SUPPORTED!!! 

+ 

+ Fedora doesn't, and NEVER will, support ARMv6 processors. 

+ There's been a number of attempts to support these over the years. 

+ The current best effort is Pignus based on Fedora 23. 

+ More information can be found at link:https://pignus.computer[the Pignus site]. 

+ 

+ NOTE: Fedora DOES support the Compute Module 3 based on the same SoC as the Raspberry Pi 3, but *as the previous generation Compute Modules are based on ARMv6 archetecture, they are [#.underline]#not supported#*.

+ 

+ === Will Fedora 24 be supported?

+ 

+ No. 

+ The small team is focused on the Fedora 25 release and rawhide to best focus resources. 

+ While possible to do there is reasonably significant amount of work to back port all the fixes that have gone into Fedora 25/rawhide back to stable releases. 

+ Fedora 25 is released and is already very stable on the Raspberry Pi.

+ 

+ === What USB devices are supported on the Raspberry Pi

+ 

+ You should be able to use most USB-2 compatible devices that are supported in Fedora on other devices. 

+ There are some limitations to the USB bus of the Raspberry Pi hardware as link:https://www.raspberrypi.org/documentation/hardware/raspberrypi/usb/README.md[documented here].

+ 

+ === Is the onboard WiFi and Bluetooth supported on the Raspberry Pi 3?

+ 

+ ==== Wifi

+ 

+ Wifi on the Raspberry Pi 3 is supported in Fedora.

+ There's a file we can't currently redistribute which you'll need to retrieve. 

+ This can be done either post first boot using onboard ethernet or when setting up the SD card. 

+ The command needed when running from a Raspberry Pi 3 is as follows:

+ 

+ ----

+ $ sudo curl https://fedora.roving-it.com/brcmfmac43430-sdio.txt -o /lib/firmware/brcm/brcmfmac43430-sdio.txt

+ ----

+ 

+ Once retrieved you just need to reboot and WiFi should be available.

+ 

+ ==== Bluetooth

+ 

+ It's currently untested but as it's attached to a serial port and is accessible it might work. 

+ It's only been briefly tested but in practice it tends to crash the entire device so is not currently recommended. 

+ Those interested can investigate further and potentially provide more information.

+ 

+ For the brave you can test it with this command:

+ 

+ ----

+ $ hciattach /dev/ttyAMA0 bcm43xx 3000000 noflow -

+ ----

+ 

+ === Does sound work?

+ 

+ HDMI audio output is included Fedora however the analog port is not yet supported. 

+ Audio output via a USB audio interface should also work fine.

+ 

+ === Does the add-on camera work?

+ 

+ Not currently. 

+ There is still ongoing work to support this upstream and add the appropriated media acceleration support.

+ 

+ === Does accelerated media decode work?

+ 

+ No. 

+ There's no upstream kernel support and it relies on code from a number of kernel subsystems to be supported.

+ 

+ === Does HDMI-CEC work?

+ 

+ Yes. 

+ It current is supported using link:http://libcec.pulse-eight.com/[libcec] packaged in Fedora.

+ 

+ === Is the Raspberry Pi Touch Display supported?

+ 

+ Work on the official Raspberry Pi Touch Display is ongoing upstream and initial support has landed in the 4.10 kernel, being link:https://github.com/anholt/linux/issues/8[tracked upstream]. 

+ Fedora will review any missing pieces for support soon. 

+ The touchscreen driver isn't yet released upstream. 

+ Support for other displays is not currently planned.

+ 

+ === Is the composite TV out supported?

+ 

+ The composite TV out is not currently supported in a stable Fedora release but the core support has landed upstream in the 4.10 kernel. 

+ There's some missing enabling patches currently which we will add to the Fedora kernel soon.

+ 

+ === Are the expansion HATs supported?

+ 

+ The quick answer here is they are not currently supported.

+ 

+ The long answer is a lot more complex. 

+ Most of the hardware interfaces that are exposed by the 40 pin HAT connector are supported with drivers shipped with Fedora. 

+ Drivers for the hardware contained on a lot of the common HATs are also enabled and supported in Fedora. 

+ The core means of supporting the HAT add-on boards require the use of device tree overlays. 

+ The kernel and the u-boot 2016.09 boot-loader supports the loading over overlays manually. 

+ Currently there is no upstream consensus on the means of autoloading these overlays by means of an "overlay manager" (also known as Cape Manager and by numerous other names) by reading the EEPROM ID and loading the appropriate overlay automatically. 

+ There's also no consensus on the extensions to the dtc (Device Tree Compiler) to build the binary blob overlays, and no consensus of the exact format of the overlay file. 

+ There is now a group of people working to resolve this issue which enable Fedora to better support HATs (Raspberry Pi), Capes (BeagleBone), DIPs (C.H.I.P) and Mezzanine (96boards) before long.

+ 

+ The first focus HAT to support will be the official Raspberry Pi Sense HAT. 

+ This will be documented using the manual process to build and load the overlay to provide access to the onboard devices as a means of demonstrating how this process works for those wishing to use this manual method in the interim. 

+ The link to this documentation will be added here once that is complete.

+ 

+ === Are Device Tree Overlays supported?

+ 

+ There's basic support for overlays in u-boot and the Linux kernel but an overlay manager isn't yet upstream. 

+ 

+ === Is GPIO supported?

+ 

+ GPIO isn't supported well as they need to be mapped with Device Tree overlays. 

+ This will be improved in the Fedora 27/28 cycles.

+ 

+ === Is SPI supported?

+ 

+ Yes, basic SPI is supported.

+ 

+ === Is I2C supported?

+ 

+ Yes, basic I2C is supported.

+ 

+ === Is there Raspberry Pi 3 aarch64 support?

+ 

+ Yes! You can download the aarch64 disk images for the Raspberry Pi 3 link:https://archive.fedoraproject.org/pub/fedora-secondary/releases/[here.]

+ 

+ === How do I use a serial console?

+ 

+ The serial console is disabled by default on the Raspberry Pi 2 and 3 because it requires the device to run at significantly slower speeds. 

+ To wire up the USB to TTL adapter follow link:https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/connect-the-lead[this guide from Adafruit]. 

+ You'll need a 3.3 volt USB to TTL Serial Cable like link:https://www.adafruit.com/product/954[this one from Adafruit].

+ To enable the serial console follow the specific steps for the Raspberry Pi 2 or 3 as they both differ slightly:

+ 

+ ==== Raspberry Pi 2:

+ * Insert the micro SD card into a PC

+ * On the VFAT partition edit the config.txt file and uncomment the enable_uart line:

+ 

+ ----

+ $ enable_uart=1

+ ----

+ 

+ * On the boot partition edit the extlinux/extlinux.conf file adding `console=tty0 console=ttyAMA0,115200` to the end of the append line so it looks similar to:

+ 

+ ----

+ $ append ro root=UUID="LARGE UUID STRING OF TEXT" console=tty0 console=ttyAMA0,115200

+ ----

+ 

+ * Safely unmount the micro SD card

+ * Insert micro SD into Raspberry Pi, connect serial console, power on

+ 

+ ==== Raspberry Pi 3:

+ * Insert the micro SD card into a PC

+ * On the VFAT partition edit the config.txt file and uncomment the enable_uart line:

+ 

+ ----

+ $ enable_uart=1

+ ----

+  

+ * On the boot partition edit the extlinux/extlinux.conf file adding: `console=tty0 console=ttyS0,115200` to the end of the append line so it looks similar to:

  

- '''

+ ----

+ $ append ro root=UUID="LARGE UUID STRING OF TEXT" console=tty0 console=ttyS0,115200

+ ----

  

+ * Safely unmount the micro SD card

+ * Insert micro SD into Raspberry Pi, connect serial console, power on

  

- 1.  REDIRECT

- link:Architectures/ARM/Raspberry_Pi[Architectures/ARM/Raspberry Pi]

- '''

  

- See a typo, something missing or out of date, or anything else which can be

- improved? Edit this document at https://pagure.io/fedora-docs/quick-docs.

+ See a typo, something missing or out of date, or anything else which can be improved? 

+ Edit this document link:https://pagure.io/fedora-docs/quick-docs[here.]

Updated, corrected spelling, corrected grammar, fixed bad links, reformatted for ascii_doctor compatibility, etc. These docs should be formatted to the current spec now.

In the AsciiDoc recommended practices page, see the section on one sentence per line. This makes diffs easier to review since each sentence changes will only be one line.

In the Fedora docs, we decided to follow the Atx style for headers since it's less work to maintain. In this case, you want this header to be == Development environment.

Literal blocks also support syntax highlighting. For all of the Bash examples, if you add a special line above the literal blocks, it will look prettier. :smile:

[source,bash]
....
$ emacs hello.spec
....

As a note, if the link you are using does not have special characters, the link: part isn't needed, the https://example.com[cool site] is enough. But I think this comes down to preference.

I had a quick chat with @ssitani about literal lines or blocks. He suggest the preference for using literal blocks for code / commands when possible to improve maintainability and to take advantage of syntax highlighting.

In this case, I would rewrite this as…

[source,bash]
....
dnf install -y fedora-arm-installer
....

Whether you choose to use to prefix shell commands with $ or not is fine, but it should be consistent throughout the document.

1 new commit added

  • Changes titles and updated some headers.
6 years ago

I'd put this one into a literal block too, and then do the comment one line above the actual command instead of on the same line.

Might have been a pandoc conversion oversight, but this is still rendered as Mediawiki text. The extra three === at the end aren't needed.

I took a chat with @ssitani again, and it's better practice to omit punctuation like a colon from a header when possible.

One thing that I thought was nifty about AsciiDoc were Q&A blocks (Ctrl+F for qanda). Maybe this section would be a great candidate for using them?? I'd really like to see it! Maybe @jsmith @bex @ssitani have opinions here too.

It's a cleaner and a little easier to read when there's an empty line between a header and the main text.

I went through the doc and left some in-line comments. I hope these are helpful! Nice work so far – let me know if you want me to take another look later.

1 new commit added

  • Made each sentence it's own line. Minor spelling changes.
6 years ago

11 new commits added

  • Edited one-sentence-per-line.
  • Merge branch 'docs_branch' of ssh://pagure.io/forks/coremodule/fedora-docs/quick-docs into docs_branch
  • Made each sentence it's own line on create-hello-world-rpm.adoc. Header changes to both files.
  • Made each sentence it's own line. Minor spelling changes.
  • Changes titles and updated some headers.
  • Fixed bad links, spelling, grammar issues.
  • Fixed bad links, code snippits.
  • Formatting changes to raspberry pi quick doc.
  • Removed all non-asciidoc metadata.
  • change
  • Made each sentence it's own line on create-hello-world-rpm.adoc. Header changes to both files.
6 years ago

1 new commit added

  • Corrected literal block formatting.
6 years ago

This link is broken. To link internally to another page, you need to use the HTML syntax. So this link should be link:create-hello-world-rpm.html[How to create an RPM package].

This link is also broken. Since it's in the wiki, you'll have to be explicit. One idea to consider, I used an entities file in another repo to make a short link to the Fedora wiki. You can find the entities file here and an example of it here.

This is really picky, but I noticed Hello World is wrapped by two different types of apostrophes. 'Hello World"

From our discussion with @ssitani, it may be better to use a literal block (wrapped by hyphens) instead of the output block (wrapped by periods). For example:

[source,bash]
----
# dnf install fedora-packager @development-tools
----

I'm wondering about mentioning a specific Fedora release since that means this page needs to be updated every six months. Should we use an entity (e.g. {MAJORVER}) or say "Fedora 27 or later"? I might defer to @mattdm @bex @rkratky on this for best practice.

I have a stronger opinion about using an entity here, especially if we can always link to the latest stable version of Fedora and the correct name with an entity. @mattdm @bex @rkratky Thoughts here too?

@coremodule This doesn't block your pull request. I was disappointed to see there was no syntax highlighting for Bash since we're using it so often. I had a quick chat with @ryanlerch and @rkratky about this and there may be a better way to render this, but there was a question that @bex needed to answer.

One thing I thought was interesting, you can actually link IRC channels in AsciiDoc. The syntax for this is irc://irc.freenode.net/#fedora-arm[IRC via the #fedora-arm channel on Freenode].

I guess we can drop when it starts to ship from this line now. :smile:

Capitalization is a little odd here, I would write === Is there Raspberry Pi 3 aarch64 support? instead.

Same concern on hard-linking to a F27 image. I wonder if we can use that entity here too.

This link should be a pretty link instead of a plain URL. Maybe https://pagure.io/fedora-docs/quick-docs[fedora-docs/quick-docs]?

I took a quick pass on the Raspberry Pi article. Nice work, @coremodule. :thumbsup:

The Raspberry Pi article is a potentially interesting use case for an entity that uses the current major, stable release of Fedora. I left more detailed in-line comments, but I'd like to open up a conversation with @mattdm @bex @rkratky @ssitani about how this works or if we could write a doc that never has to be updated when we ship new RPi images!

I think we should just link to https://arm.fedoraproject.org/ and ditch the versioned links entirely.

There may be some other cases where we want a "CURRENTRELEASE" entity, but I don't think it's this.

1 new commit added

  • Modified some hard links to potentially obsolete infomation, other minor pruning before release.
6 years ago

1 new commit added

  • Header changes.
6 years ago

2 new commits added

  • Fixed broken links using attributes.
  • Created 'attributes.adoc' for attribute linking within docs.
6 years ago

This doesn't render correctly. Two fixes here:

  1. Add line of whitespace between include call and page title
  2. Attributes aren't loading because it's looking in the root of the document folder. Needs to be include::en-US/attributes.adoc[] and then it should pull the attributes in successfully.

@jflory It renders fine on my machine... I think it's a function of what is used to render the ascii_docs text; when I use the Mozilla plugin to render, it doesn't look right, but when I render it in Atom, it looks just as it should. I actually tried both options above with the Mozilla plugin and it wouldn't work, but worked with both in Atom. Is there a way to know exactly how the website is going to render the text?

There might be a missing wiki attribute here or you should link to the entire wiki URL. This one is currently broken.

This wiki link is also broken, same reason as before. It might be helpful to add a Fedora Wiki attribute, like this example. Otherwise, use the full URL here to render correctly.

I would do a hard return here to separate the "improve me!" blurb from the history section.

I'm not sure if it's good practice to include the title for the URL in the attribute? I'm not sure but I haven't seen it done before, so I'd turn to @bex @rkratky @zoglesby if they would have strong opinions on this.

please move these physically further up the nav

@jflory7 No problems with that. In fact, when done properly (following an established convention), it's great. URLs tend to change, so it's good to parametrize them when used multiple times in a doc.

This doc looks good to me! :thumbsup:

I am not sure why there is an attribute here if we only use the URL once ...

I finished my review. The Raspberry Pi article looks ready to me. :thumbsup: I found a few broken links on the Hello World! RPM doc.

Looking at @rkratky's comment, the entities file should be fine too as-is. :thumbsup:

@coremodule When I rendered the docs and opened it in the browser, I saw this:

Attributes not rendered correctly

I built the docs by updating the _distro_map.yml file from master to the branch name I'm currently working on. Then I ran asciibinder package to generate the HTML documents and I viewed those in my browser.

2 new commits added

  • Fixed asciidocs "attributes.adoc" header and bad links.
  • Edited formatting of _topic_maps and fixed bad links in create-hello-world-rpm.
6 years ago

Greetings from docs-ci! The temporary URL for this PR is ready at: http://fedora-docs-quick-docs-pr21-fedora-docs.apps.ci.centos.org

BuildID: 121

It might be worth adding a note that if you want to build RPMs in a directory other than ~/rpmbuild, that you can edit the "%_topdir" definition in ~/.rpmmacros

Please add a "$" prompt to the beginning of any commands that are supposed to be entered at the Linux shell. (This applies to many of the commands on this page.)

Only use source code syntax highlighting on a block that contains the text of a shell script, not for commands or script output. (This applies to many of the commands on your this page.)

Please change this to "Inside a Spec File". It is strongly discouraged to use literals inside of a title.

It's not absolutely necessary, but it might help to explain that "mock" is a tool that we use to build packages in a "clean" environment, so that package builds are more reproducible. Otherwise, the reader might be wondering "what is this mock thing and why do I need to do this configuration"

Can we please change this to say "you need to install a set of development tools" rather than "we need a set of tools".

No comma needed at the end of this line. In fact, it would be cleaner if you had a complete sentence before the command block, rather than having the block split the sentence.

"The following command sets up an RPM build area in your...", then the command block.

Then remove the second-half of the sentence from below the block.

Please use the dashes instead of the dots for this block. We should also add [source,RPMSpec] to turn on source highlighting (when it's supported for spec files in the future).

If we haven't mentioned what "rpmlint" is, we should just drop that clause and say "Please capitalize the first letter of the Summary field.

Let's change this to say that Group is a historical artifact and is no longer needed. You can (and should )remove it from your spec file. There's no reason to go into detail about the GROUPS stuff, as it's historical trivia at this point.

This should be rpm --changelog -q <packagename> -- and will only work for installed packages.

Only add [source,bash] for blocks that contain source code, not commands or command output

Please use the dash syntax instead of the dot syntax for this block.

2 new commits added

  • Fixed syntax highlighting on create-hello-world-RPM.adoc.
  • Removed syntax highlighting.
6 years ago

Greetings from docs-ci! The temporary URL for this PR is ready at: http://fedora-docs-quick-docs-pr21-fedora-docs.apps.ci.centos.org

BuildID: 123

@bstinson Where is a good place to file tickets for ideas for future improvements to the CI chain here? (For example, it'd be lovely if it could be aware that the PR changes create-hello-world-rpm.adoc and raspberry-pi.adoc and provide direct links to

The pipeline stuff probably needs to spin out into its own repo. I've created a project called Aquedoc for that purpose: https://pagure.io/aquedoc

File issues at will!

@coremodule can you rebase this PR and update us as to what needs review still? I see a lot of feedback above and don't want to double-review.

If you need help, let me know.

I rebased this and manually merged it.

Pull-Request has been closed by bex

6 years ago