From Fedora Project Wiki
 
(7 intermediate revisions by 3 users not shown)
Line 10: Line 10:
To create a disk image remix for Fedora you will need to run 'Appliance-Tools' on an ARM host. For those without ARM hardware, this can be completed using QEMU and A15 emulation which can utilize more RAM. If you have ARM hardware you can safely ignore the QEMU portions.  
To create a disk image remix for Fedora you will need to run 'Appliance-Tools' on an ARM host. For those without ARM hardware, this can be completed using QEMU and A15 emulation which can utilize more RAM. If you have ARM hardware you can safely ignore the QEMU portions.  


=== Download the Fedora 20 Disk Image ===
=== Download the Fedora 24 Disk Image ===
First download the Minimal disk image for Fedora 20 and unpack.
First download the Minimal disk image for Fedora 24 (at the moment beta) and unpack it.


  wget http://download.fedoraproject.org/pub/fedora/linux/releases/20/Images/armhfp/Fedora-Minimal-armhfp-20-1-sda.raw.xz
  wget http://download.fedoraproject.org/pub/fedora/linux/releases/test/24_Beta/Spins/armhfp/images/Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw.xz
  unxz -v Fedora-Minimal-armhfp-20-1-sda.raw.xz
  unxz -v Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw.xz


If needed install 'libguestfs-tools' to extract the boot files and expand the disk image to make room for our remix image.
If needed install 'libguestfs-tools' to extract the boot files and expand the disk image to make room for the remix image.
   
   
  sudo yum install -y libguestfs-tools
  sudo dnf install -y libguestfs-tools
  sudo virt-copy-out -a Fedora-Minimal-armhfp-20-1-sda.raw /boot .
  virt-copy-out -a Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw /boot .
  qemu-img resize Fedora-Minimal-armhfp-20-1-sda.raw +10G # change this value to your desired size, it will need to be adequate for your disk image
  qemu-img resize Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw +10G # change this value to your desired size, it will need to be adequate for your disk image


Use QEMU to boot the new disk image using the vexpress-a15 dtb allowing for increased RAM usage (the example below uses 4G of RAM, adjust this to fit your hardware).
Use QEMU to boot the new disk image using the 'vexpress-a15' dtb allowing for increased RAM usage (the example below uses 4G of RAM, adjust this to fit your hardware).


  qemu-system-arm -machine vexpress-a15 -m 4096 -nographic -net nic -net user \
  qemu-system-arm -machine vexpress-a15 -m 4096 -nographic -net nic -net user \
-append "console=ttyAMA0,115200n8 rw root=/dev/mmcblk0p3 rootwait physmap.enabled=0" \
    -append "console=ttyAMA0,115200n8 rw root=/dev/mmcblk0p3 rootwait physmap.enabled=0" \
-kernel boot/vmlinuz-3.11.10-301.fc20.armv7hl+lpae \
    -kernel boot/vmlinuz-4.5.2-302.fc24.armv7hl \
-initrd boot/initramfs-3.11.10-301.fc20.armv7hl+lpae.img \
    -initrd boot/initramfs-4.5.2-302.fc24.armv7hl.img \
-dtb boot/dtb-3.11.10-301.fc20.armv7hl+lpae/vexpress-v2p-ca15_a7.dtb \
    -dtb boot/dtb-4.5.2-302.fc24.armv7hl/vexpress-v2p-ca15_a7.dtb \
-sd Fedora-Minimal-armhfp-20-1-sda.raw
    -sd Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw
 


Complete the initial setup on the first boot, login in as root, and enlarge the filesystem to consume the previously expanded disk space.
Complete the initial setup on the first boot, login in as root, and enlarge the filesystem to consume the previously expanded disk space.
Line 40: Line 39:
These are packages not in Fedora, for remixes this usually includes the kernel package but can also include other software you would like to add. If you are adding a custom kernel package it is recommended you add the Fedora kernel as an exclusion (ie - 'exclude=kernel*)' in the yum.conf.
These are packages not in Fedora, for remixes this usually includes the kernel package but can also include other software you would like to add. If you are adding a custom kernel package it is recommended you add the Fedora kernel as an exclusion (ie - 'exclude=kernel*)' in the yum.conf.


  mkdir -p yum/f20/{armhfp,SRPMS}
  mkdir -p yum/f24/{armhfp,SRPMS}


Add packages to be included in the Remix, and run 'createrepo' to create repomd files.  
Add packages to be included in the Remix, and run 'createrepo' to create repomd files.  


  createrepo yum/f20/armhfp/
  createrepo yum/f24/armhfp/
  createrepo yum/f20/SRPMS/
  createrepo yum/f24/SRPMS/


Copy files to your people account
Copy files to your people account
   
   
  scp -r yum $USER@fedorapeople.org:/public_html/
  scp -r yum $USER@fedorapeople.org:~/public_html/


=== Customize your kickstart ===
=== Customize your kickstart ===
A kickstart has been provided that was used to create a respin of Fedora 20 for the Pandaboard. You will minimally need to edit this and add your own repository URL and software to be installed. If you are adding software that is not in the official Fedora repositories you will also need to uncomment the section to remove the fedora-release-notes and fedora-logos packages, adding the alternate generic-release-notes and generic-logos. This example kickstart includes the XFCE desktop.  
A kickstart has been provided that was used to create a respin of Fedora 20 for the Pandaboard. You will minimally need to edit this and add your own repository URL and software to be installed.<b> If you are adding software that is not in the official Fedora repositories you will also need to uncomment the section to remove the fedora-release-notes and fedora-logos packages, adding the alternate generic-release-notes and generic-logos</b>. This example kickstart includes the XFCE desktop.  
* [http://pwhalen.fedorapeople.org/Fedora/20/Fedora-Xfce-VFAT-armhfp-20-Respin.ks Example Kickstart]
* [http://pwhalen.fedorapeople.org/Fedora/20/Fedora-Xfce-VFAT-armhfp-20-Respin.ks Example Kickstart]
The official Fedora kickstart files are kept in git, and maintained by the spins SIG.
These can be checked out as the starting point for your remix.
git clone https://git.fedorahosted.org/git/spin-kickstarts.git
cd spin-kickstarts
git checkout f24
All the kickstarts are broken down into snippets that you can put together using ksflatten, which is provided by the pykickstart package.
ksflatten -c fedora-arm-minimal.ks -o /tmp/remix-arm-minimal.ks
Edit the kickstart to taste, and proceed.


=== Use Appliance tools to Create the Remix ===
=== Use Appliance tools to Create the Remix ===
Line 68: Line 80:
  KICKSTART= # your kickstart
  KICKSTART= # your kickstart
  REMIXNAME= # remix name
  REMIXNAME= # remix name
RELEASE=24 # release number


appliance-creator -c $KICKSTART \
appliance-creator -c $KICKSTART \
-d -v --logfile /tmp/appliance.log --cache /tmp/koji-appliance \
-d -v --logfile /tmp/appliance.log --cache /tmp/koji-appliance \
-o app-output --format raw --name $REMIXNAME --version 20 --release $REMIXNAME  
-o app-output --format raw --name $REMIXNAME --version $RELEASE --release $REMIXNAME  
</pre>
</pre>



Latest revision as of 15:18, 18 May 2016


Creating a Fedora Remix for ARM

Fedora Guidelines

Before starting work on a Fedora Remix review the official guidelines for requirements.

Using Appliance-Tools on an ARM Host

To create a disk image remix for Fedora you will need to run 'Appliance-Tools' on an ARM host. For those without ARM hardware, this can be completed using QEMU and A15 emulation which can utilize more RAM. If you have ARM hardware you can safely ignore the QEMU portions.

Download the Fedora 24 Disk Image

First download the Minimal disk image for Fedora 24 (at the moment beta) and unpack it.

wget http://download.fedoraproject.org/pub/fedora/linux/releases/test/24_Beta/Spins/armhfp/images/Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw.xz
unxz -v Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw.xz

If needed install 'libguestfs-tools' to extract the boot files and expand the disk image to make room for the remix image.

sudo dnf install -y libguestfs-tools
virt-copy-out -a Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw /boot .
qemu-img resize Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw +10G # change this value to your desired size, it will need to be adequate for your disk image

Use QEMU to boot the new disk image using the 'vexpress-a15' dtb allowing for increased RAM usage (the example below uses 4G of RAM, adjust this to fit your hardware).

qemu-system-arm -machine vexpress-a15 -m 4096 -nographic -net nic -net user \
    -append "console=ttyAMA0,115200n8 rw root=/dev/mmcblk0p3 rootwait physmap.enabled=0" \
    -kernel boot/vmlinuz-4.5.2-302.fc24.armv7hl \
    -initrd boot/initramfs-4.5.2-302.fc24.armv7hl.img \
    -dtb boot/dtb-4.5.2-302.fc24.armv7hl/vexpress-v2p-ca15_a7.dtb \
    -sd Fedora-Minimal-armhfp-24_Beta-1.6-sda.raw

Complete the initial setup on the first boot, login in as root, and enlarge the filesystem to consume the previously expanded disk space.

resize2fs /dev/mmcblk0

Create a Repository for Remix Packages

These are packages not in Fedora, for remixes this usually includes the kernel package but can also include other software you would like to add. If you are adding a custom kernel package it is recommended you add the Fedora kernel as an exclusion (ie - 'exclude=kernel*)' in the yum.conf.

mkdir -p yum/f24/{armhfp,SRPMS}

Add packages to be included in the Remix, and run 'createrepo' to create repomd files.

createrepo yum/f24/armhfp/
createrepo yum/f24/SRPMS/

Copy files to your people account

scp -r yum $USER@fedorapeople.org:~/public_html/

Customize your kickstart

A kickstart has been provided that was used to create a respin of Fedora 20 for the Pandaboard. You will minimally need to edit this and add your own repository URL and software to be installed. If you are adding software that is not in the official Fedora repositories you will also need to uncomment the section to remove the fedora-release-notes and fedora-logos packages, adding the alternate generic-release-notes and generic-logos. This example kickstart includes the XFCE desktop.

The official Fedora kickstart files are kept in git, and maintained by the spins SIG. These can be checked out as the starting point for your remix.

git clone https://git.fedorahosted.org/git/spin-kickstarts.git
cd spin-kickstarts
git checkout f24

All the kickstarts are broken down into snippets that you can put together using ksflatten, which is provided by the pykickstart package.

ksflatten -c fedora-arm-minimal.ks -o /tmp/remix-arm-minimal.ks

Edit the kickstart to taste, and proceed.

Use Appliance tools to Create the Remix

Install appliance-tools.

yum install appliance-tools

An example kickstart is provided, this was used to create a Remix for the Pandaboard and can easily be adjusted.

Run the following command as root to create a disk image

 KICKSTART= # your kickstart
 REMIXNAME= # remix name
 RELEASE=24 # release number

appliance-creator -c $KICKSTART \
-d -v --logfile /tmp/appliance.log --cache /tmp/koji-appliance \
-o app-output --format raw --name $REMIXNAME --version $RELEASE --release $REMIXNAME 

This will create a compressed disk image in the folder '/root/app-output/$REMIXNAME/$REMIXNAME-sda.raw.xz'. This can be written to an SD card with

xzcat -v $REMIXNAME-sda.raw.xz > /dev/<location-of-your-media>

Prior to booting your device you will need to work out the details need - what the default boot file is, the command executed and load addresses to be used. If you would like supported added for your board in 'Arm-Boot-Config' please file a bugzilla with a 'printenv' of the default environmental variables in the version of U-Boot for your device.