Code Monkey home page Code Monkey logo

rpi2-fedora-image-builder's Introduction

NOTE: Fedora now produces official images for the Raspberry Pi now. This project is no longer maintained.

Server: https://mirrors.kernel.org/fedora/releases/25/Server/armhfp/images/

Workstation: https://mirrors.kernel.org/fedora/releases/25/Workstation/armhfp/images/

Other spins: https://mirrors.kernel.org/fedora/releases/25/Spins/armhfp/images/

Fedora Image Builder for Raspberry Pi 2

This is a script that transforms the official Fedora armhfp images into a disk image that is bootable by the Raspberry Pi 2.

Usage

By default, mkimage.sh will create a Fedora minimal image with a 50MB boot filesystem and a 900MB root filesystem. If you wish to change these defaults, create a settings.conf file using settings.conf.example as a template.

IMAGEURL="http://mirror.pnl.gov/fedora/linux/releases/21/Images/armhfp/Fedora-Minimal-armhfp-21-5-sda.raw.xz"
# size in MB
BOOTSIZE=50
ROOTSIZE=900

Then simply run the script as root (root privileges are needed to mount filesystem images as loop block devices)

sudo ./mkimage

The script

  • Downloads the official image from IMAGEURL
  • Decompresses the official image
  • Strips the root filesystem image out of the official image (root.img)
  • Creates a vfat boot partition image (boot.img) of size BOOTSIZE
  • Clones the raspberrypi/firmware repository from Github
  • Copies the boot files into the boot filesystem
  • Resizes the root filesystem to ROOTSIZE
  • Copies the kernel modules into the root filesystem
  • Generates an /etc/fstab
  • Creates a disk image file, partitions it, and copies the boot and root filesystem images into the created partitions

NOTE: This will take a considerable amount of disk space and time depending on your disk and internet speeds. If default settings are used, the disk space requirement is 4.4GB.

To remove all temporary resources needed for building, use the clean.sh script

fbturbo

The fbturbo driver (https://github.com/ssvb/xf86-video-fbturbo) allows for basic 2D hardware acceleration using the VideoCore GPU. This improves performance for things like window drawing. To have the driver included in the final image, copy these files from the sample-resources into the resources directory

cp sample-resources/xorg.conf sample-resources/fbturbo_drv.so resources

config.txt

You can add your custom config.txt to the resources directory and it will be included in the boot filesystem of the final image

rpi2-fedora-image-builder's People

Contributors

adammck avatar danilofalcao avatar sjenning avatar teppot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpi2-fedora-image-builder's Issues

Kernel updates

What is the best solution to kernel updates? dnf tries hard with kernels from the official repo but it won't work at the moment.

Line 41, the --show flag is needed on Ubuntu

Line 41, the --show flag is needed on Ubuntu
ex. change
ROOTOFFSET=$(partx $IMAGEFILE | tail -n 1 | awk '{print $2}')
to:
ROOTOFFSET=$(partx --show $IMAGEFILE | tail -n 1 | awk '{print $2}')

without the show flag you get:
#3: 1087488- 3432447 ( 2344960 sectors, 1200 MB)
instead of
3 1087488 3432447 2344960 1.1G
So it things 3: is the offset rather than 1087488

Issue when using yum

Hi,

First of all, thank you for creating this builder.
I successfully used your work to boot my rpi. However, I can't install any software using yum.
The file /etc/yum.repo.d.fedora.repo has the baseurl field commented:

name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

Is it expected or should am I doing something wrong?
Thanks for help

Panic at boot

Hi,
First, thanks for these scripts that run very well, as far as the image building is concerned.

However, whatever the F21 or F22 image I use, it always ends up with a panic at boot:

kernel panic, attempted to kill init exitcode=0x00000004

This comes just after recognition of the USB hub (sorry, no capture possible).
I tried without command line and with a cmdline.txt telling the rootfs, rootfstype, elevator=deadline, rootwait... without success.
The config.txt only sets config_hdmi_boost=5.

Did you experience the same problem and do you have any hints ?

Thanks in advance.

F22 Minimal - default settings build fails

Hi, building Fedora 22 Minimal fails when using default size settings:

Using settings.conf
BOOTSIZE is 50 MB
ROOTSIZE is 900 MB
IMAGEFILE is Fedora-Minimal-armhfp-22-3-sda.raw
Extracting image...
Extracting rootfs...
Creating boot partition...
Mounting boot filesystem...
Calling boot scripts...
scripts/boot/10_firmware.sh
Cloning firmware repo...
Cloning into 'firmware'...
remote: Counting objects: 3890, done.
remote: Compressing objects: 100% (2070/2070), done.
remote: Total 3890 (delta 1643), reused 2200 (delta 1537), pack-reused 0
Receiving objects: 100% (3890/3890), 73.61 MiB | 1.25 MiB/s, done.
Resolving deltas: 100% (1643/1643), done.
Checking connectivity... done.
Copying boot files...
scripts/boot/20_config.sh
Unmounting boot filesystem...
Preparing root partition...
resize2fs 1.42.12 (29-Aug-2014)
resize2fs: New size smaller than minimum (275276)

But it builds and works fine when I change BOOTSIZE and ROOTSIZE (as I do anyways).

uuid file not found

hello spartacus06,

First of all thank you for this script and the job you've done around, Fedora needs this one specially for no technical person like me , for sure :)

So actually i get an error during the mkimage.sh's script saying that the file uuid can't be found although it's there :/
Since i couldn't find the reason i decided to sign up to Git and report the bug, or may be the problem comes from me but i don't know what i am doing wrong, i hope you can give me a clue .

See what i've got when i run the mkimage.sh script with the -x argument :

-->> rpi2-fedora-image-builder

ls
sample-resources/ scripts/ clean.sh* Fedora-Minimal-armhfp-22-3-sda.raw.xz LICENSE mkimage.sh* README.md settings.conf.example
-->> rpi2-fedora-image-builder
sudo sh -x mkimage.sh
[sudo] password for scud4b:

  • set -u
    +++ readlink -f mkimage.sh
    ++ dirname /home/scud4b/git/rpi2-fedora-image-builder/mkimage.sh
  • SCRIPTDIR=/home/scud4b/git/rpi2-fedora-image-builder
  • export RESOURCEDIR=/home/scud4b/git/rpi2-fedora-image-builder/resources
  • RESOURCEDIR=/home/scud4b/git/rpi2-fedora-image-builder/resources
  • export MNTDIR=/home/scud4b/git/rpi2-fedora-image-builder/mnt
  • MNTDIR=/home/scud4b/git/rpi2-fedora-image-builder/mnt
  • [[ -d /home/scud4b/git/rpi2-fedora-image-builder/resources ]]
  • mkdir /home/scud4b/git/rpi2-fedora-image-builder/resources
  • [[ -d /home/scud4b/git/rpi2-fedora-image-builder/mnt ]]
  • mkdir /home/scud4b/git/rpi2-fedora-image-builder/mnt
  • IMAGEURL=http://mirror.pnl.gov/fedora/linux/releases/22/Images/armhfp/Fedora-Minimal-armhfp-22-3-sda.raw.xz
  • BOOTSIZE=100
  • ROOTSIZE=1800
  • COMPRESS=0
  • [[ ! -f settings.conf ]]
  • echo 'No settings.conf found, using defaults'
    No settings.conf found, using defaults
  • IMAGEFILE=Fedora-Minimal-armhfp-22-3-sda.raw.xz
  • IMAGEFILE=Fedora-Minimal-armhfp-22-3-sda.raw
  • echo 'BOOTSIZE is 100 MB'
    BOOTSIZE is 100 MB
  • echo 'ROOTSIZE is 1800 MB'
    ROOTSIZE is 1800 MB
  • echo 'IMAGEFILE is Fedora-Minimal-armhfp-22-3-sda.raw'
    IMAGEFILE is Fedora-Minimal-armhfp-22-3-sda.raw
  • rm -f root.img boot.img Fedora-Minimal-armhfp-22-3-sda.raw.img
  • [[ ! -f Fedora-Minimal-armhfp-22-3-sda.raw.xz ]]
  • [[ ! -f Fedora-Minimal-armhfp-22-3-sda.raw ]]
  • echo 'Extracting image...'
    Extracting image...
  • xzdec Fedora-Minimal-armhfp-22-3-sda.raw.xz
    ++ tail -n 1
    ++ partx --show Fedora-Minimal-armhfp-22-3-sda.raw
    ++ awk '{print $2}'
  • ROOTOFFSET=1087488
  • echo 'Extracting rootfs...'
    Extracting rootfs...
  • dd if=Fedora-Minimal-armhfp-22-3-sda.raw bs=512 skip=1087488 of=root.img
  • echo 'Creating boot partition...'
    Creating boot partition...
  • BOOTSIZE_MB=100M
  • truncate -s 100M boot.img
  • mkfs.vfat boot.img
  • echo 'Mounting boot filesystem...'
    Mounting boot filesystem...
  • sudo mount boot.img /home/scud4b/git/rpi2-fedora-image-builder/mnt
  • echo 'Calling boot scripts...'
    Calling boot scripts...
  • for i in 'scripts/boot/*.sh'
  • [[ -x scripts/boot/10_firmware.sh ]]
  • echo scripts/boot/10_firmware.sh
    scripts/boot/10_firmware.sh
  • bash scripts/boot/10_firmware.sh
    Cloning firmware repo...
    Clonage dans 'firmware'...
    remote: Counting objects: 3916, done.
    remote: Compressing objects: 100% (2098/2098), done.
    remote: Total 3916 (delta 1657), reused 2332 (delta 1537), pack-reused 0
    Réception d'objets: 100% (3916/3916), 74.05 MiB | 1.39 MiB/s, fait.
    Résolution des deltas: 100% (1657/1657), fait.
    Vérification de la connectivité... fait.
    Extraction des fichiers: 100% (3654/3654), fait.
    Copying boot files...
  • RET=0
  • [[ 0 -ne 0 ]]
  • for i in 'scripts/boot/*.sh'
  • [[ -x scripts/boot/20_config.sh ]]
  • echo scripts/boot/20_config.sh
    scripts/boot/20_config.sh
  • bash scripts/boot/20_config.sh
  • RET=0
  • [[ 0 -ne 0 ]]
  • [[ 0 -ne 0 ]]
  • echo 'Unmounting boot filesystem...'
    Unmounting boot filesystem...
  • sudo umount /home/scud4b/git/rpi2-fedora-image-builder/mnt
  • echo 'Preparing root partition...'
    Preparing root partition...
  • grep XFS
  • file root.img
  • e2fsck -fp root.img
  • ROOTSIZE_MB=1800M
  • resize2fs root.img 1800M
    resize2fs 1.42.12 (29-Aug-2014)
  • truncate -s 1800M root.img
  • echo 'Mounting root filesystem...'
    Mounting root filesystem...
  • sudo mount root.img /home/scud4b/git/rpi2-fedora-image-builder/mnt
  • blkid -o export root.img
  • . uuid
    mkimage.sh: ligne 91 : .: uuid : fichier introuvable (meaning file not found in english)

But as you can see the file uuid is here:
-->> rpi2-fedora-image-builder

ls
mnt/ sample-resources/ boot.img Fedora-Minimal-armhfp-22-3-sda.raw LICENSE README.md settings.conf.example
resources/ scripts/ clean.sh* Fedora-Minimal-armhfp-22-3-sda.raw.xz mkimage.sh* root.img uuid
->> rpi2-fedora-image-builder
ls -lh
total 3,2G
drwxr-xr-x. 2 root root 4,0K 23.06.2015 18:42 mnt/
drwxr-xr-x. 3 root root 4,0K 23.06.2015 18:43 resources/
drwxrwxr-x. 2 scud4b scud4b 4,0K 23.06.2015 18:37 sample-resources/
drwxrwxr-x. 4 scud4b scud4b 4,0K 23.06.2015 18:37 scripts/
-rw-r--r--. 1 root root 100M 23.06.2015 18:44 boot.img
-rwxrwxr-x. 1 scud4b scud4b 69 23.06.2015 18:37 clean.sh*
-rw-r--r--. 1 root root 1,8G 23.06.2015 18:43 Fedora-Minimal-armhfp-22-3-sda.raw
-rw-rw-r--. 1 scud4b scud4b 288M 21.06.2015 22:34 Fedora-Minimal-armhfp-22-3-sda.raw.xz
-rw-rw-r--. 1 scud4b scud4b 1,1K 23.06.2015 18:37 LICENSE
-rwxrwxr-x. 1 scud4b scud4b 3,5K 23.06.2015 18:37 mkimage.sh*
-rw-rw-r--. 1 scud4b scud4b 2,5K 23.06.2015 18:37 README.md
-rw-r--r--. 1 root root 1,8G 23.06.2015 19:58 root.img
-rw-rw-r--. 1 scud4b scud4b 161 23.06.2015 18:37 settings.conf.example
-rw-r--r--. 1 root root 78 23.06.2015 18:44 uuid
-->> rpi2-fedora-image-builder
df -h
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
devtmpfs 1,5G 0 1,5G 0% /dev
tmpfs 1,5G 72K 1,5G 1% /dev/shm
tmpfs 1,5G 1,1M 1,5G 1% /run
tmpfs 1,5G 0 1,5G 0% /sys/fs/cgroup
/dev/sda7 20G 15G 3,2G 83% /
tmpfs 1,5G 2,6M 1,5G 1% /tmp
tmpfs 303M 0 303M 0% /run/user/991
tmpfs 303M 12K 303M 1% /run/user/1000
/dev/loop0 1,7G 761M 944M 45% /home/scud4b/git/rpi2-fedora-image-builder/mnt
-->> rpi2-fedora-image-builder
cat uuid
DEVNAME=root.img
LABEL=_/
UUID=7c321d6b-f2b0-4783-9576-e3dfe657f9b3
TYPE=ext4

Info system

-->> rpi2-fedora-image-builder

groups
scud4b wheel
-->> rpi2-fedora-image-builder
inxi -S -! 31
System: Kernel: 4.0.5-300.fc22.i686 i686 (32 bit) Desktop: Xfce 4.12.2 Distro: Fedora release 22 (Twenty Two)

Thanks by advance for your help

device tree loading and spi bus

Hi,
I'm trying to use the spi bus to connect a led screen. However, there is no mention of /dev/spidev0.0 in the filesystem.
I'm not very litterate in kernel config, so I may certainly be missing something, but do you know if that bus is supposed to appear, or should I start the kernel with a specific option to load the 'dtb' and hence have access to the bus?

Thank you for your input.

Successfully on creating image, but nothing happen when plugged in RPI 2

I had successfully on creating image Fedora-Minimal-armhfp-22-3, under Fedora 21 x64 bit running on VMWare Player.
Then, create image on Micro SD using Win32DiskImager.
After plugging in on RPI 2, when turn on, nothing boot happen.
The light red and green in RPI 2 lights continuously.
But, when using Raspbian, on booting, green light will be blinking.
Any clue to get this image works ?

Kernel from raspberrypi/firmware doesn't have XFS support built-in, which F22 server uses for rootfs

Hello,

i tried several times to run Fedora-Server but i have got this error, when i run it on the first boot :

Panic: VFS: Unable to mount root fs on unknown-block(179,2)
entering kdb (current=0xb9900000, pid 1) on processor 0 due to keyboard entry

I've tried to fix the problem with gparted which it did, indeed i saw it detected apparently a problem with XFS that it repaired.
So i boot the fixed sd card into the RPi2 and again i have the same error .

Of course i checked the sha1sum after download the raw file, i built many times a new .img file and tried .xz format (cleaned the cache and files between each attempt) ,and i also used different sd card .

I know many factors could be involved into this issue according what i've found on internet, but since i don't have this error with Fedora Minimal or Raspian i think may be this could be something else .

I am afraid that is a trouble too technical for me but whatever i wanted to report it to let you guys know it, and you probably know better than me what to do in this case .

Thank you .

Unable to build Fedora Server 22

Hi, this is what I get when I try to build Fedora-Server-armhfp-22-3-sda.raw

Using settings.conf
BOOTSIZE is 100 MB
ROOTSIZE is 2000 MB
IMAGEFILE is Fedora-Server-armhfp-22-3-sda.raw
Extracting image...
Extracting rootfs...
Creating boot partition...
Mounting boot filesystem...
Calling boot scripts...
scripts/boot/10_firmware.sh
Cloning firmware repo...
Cloning into 'firmware'...
remote: Counting objects: 3890, done.
remote: Compressing objects: 100% (2070/2070), done.
remote: Total 3890 (delta 1640), reused 2371 (delta 1537), pack-reused 0
Receiving objects: 100% (3890/3890), 73.60 MiB | 1.24 MiB/s, done.
Resolving deltas: 100% (1640/1640), done.
Checking connectivity... done.
Copying boot files...
scripts/boot/20_config.sh
Unmounting boot filesystem...
Preparing root partition...
e2fsck: Bad magic number in super-block while trying to open root.img

Fedora-Server-armhfp-24-1.2-sda.raw.img not booting

I git cloned the repository today, manually downloaded the .xz and compared the sha256 checksum. everything is correct there.

After using mkimage.sh and using dd to write the output to various different SD cards I am unable to boot the RPI2.

dd bs=1M if=Fedora-Server-armhfp-24-1.2-sda.raw.img of=/dev/sdg status=progress

Each attempt produces the same error;
PANIC: VFS: Unable to mount root fs on unknoqn-block(179,2)
Entering kdb (current=0xb9908000, pid 1) on processor 2 due to Keyboard Entry

There is a trace above but I'm unable to scrollback / copy the errors.

Is the latest F24 release verified as working?

Fedora-Minimal-armhfp-rpi-21-5-sda.raw.xz

Hello,
Is there a change you have a link for Fedora-Minimal-armhfp-rpi-21-5-sda.raw.xz F21 is EOL by now. Or maybe upload it on this repo with the release feature of Github?
Thanks

Local Image

Hi Seth, is there a possible to create a local directory to store images in the "settings.conf" which should be used during the installation before the "IMAGEURL=" is used to download the image?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.