From Fedora Project Wiki

Livemedia-modifier

Introduction

As of Fedora 17 all disk images can be produced using Fedora tools. Disk images created for the Pandaboard require an additional step before use due to the unique paritioning requirements, and the nessecity of the 'MLO' being the first file written to the 'boot' partition. Vesatile express also requires the user extract the kernel, initramfs and kermodules in order to boot the disk image. The 'livemedia-modifier' tool was written to augment the output of 'livemedia-creator', and prepare the disk images for use.

Pandaboard

Images can be created for the Pandaboard using 'livemedia-creator', these images will not be bootable until they have been 'fixed'. The script will mount the disk image partitions, reformat the boot partition, and copy the files from the root filesystem in the correct order. This will result in a bootable Pandaboard disk image.

You will first need to create the Pandaboard disk image using 'livemedia-creator'

livemedia-creator  --make-disk 
                   --no-virt --image-only 
                   --keep-image --armplatform=omap 
                   --ks=<location-of-kickstart>

The disk image produced will be available in '/var/tmp/disk<random>.img'. This image will not yet be bootable and will require one additional step as follows:

livemedia-modifier --image=<location-of-file.img> --platform=omap

Below is example out for an omap disk:

[root@thinkpad Desktop]# ./livemedia-modifier --image=2012-09-18-f18-panda-deploy.img --platform=omap
Mount :: [/dev/mapper/loop0p3] -> [/mnt/root]
Mount :: [/dev/mapper/loop0p1] -> [/mnt/boot]
Mkdir :: [/mnt/root/boot]
Mkdir :: [/mnt/root/boot/uboot]
Move :: [/mnt/boot/grub] -> [/mnt/root/boot/grub]
Move :: [/mnt/boot/uImage] -> [/mnt/root/boot/uImage]
Move :: [/mnt/boot/klist.txt] -> [/mnt/root/boot/klist.txt]
Move :: [/mnt/boot/boot.scr] -> [/mnt/root/boot/boot.scr]
Move :: [/mnt/boot/initramfs-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap.img] -> [/mnt/root/boot/initramfs-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap.img]
Move :: [/mnt/boot/.vmlinuz-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap.hmac] -> [/mnt/root/boot/.vmlinuz-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap.hmac]
Move :: [/mnt/boot/System.map-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap] -> [/mnt/root/boot/System.map-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap]
Move :: [/mnt/boot/config-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap] -> [/mnt/root/boot/config-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap]
Move :: [/mnt/boot/vmlinuz-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap] -> [/mnt/root/boot/vmlinuz-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap]
Move :: [/mnt/boot/uImage-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap] -> [/mnt/root/boot/uImage-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap]
Move :: [/mnt/boot/uInitrd-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap] -> [/mnt/root/boot/uInitrd- 3.6.0-0.rc4.git0.1.fc18.armv7hl.omap]
Move :: [/mnt/boot/uInitrd] -> [/mnt/root/boot/uInitrd]
Move :: [/mnt/boot/initrd-plymouth.img] -> [/mnt/root/boot/initrd-plymouth.img]
Move :: [/mnt/boot/uEnv.txt] -> [/mnt/root/boot/uEnv.txt]
Mkfs :: /dev/mapper/loop0p1
mkfs.vfat 3.0.12 (29 Oct 2011)
unable to get drive geometry, using default 255/63
Copy :: [/mnt/root/usr/share/uboot-panda/MLO] -> [/mnt/boot/MLO]
Copy :: [/mnt/root/usr/share/uboot-panda/u-boot.img] -> [/mnt/boot/u-boot.img]
Copy :: [/mnt/root/usr/share/uboot-panda/u-boot.bin] -> [/mnt/boot/u-boot.bin]
Copy :: [/mnt/root/boot/uInitrd-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap] -> [/mnt/boot/uInitrd-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap]
Copy :: [/mnt/root/boot/boot.scr] -> [/mnt/boot/boot.scr]
Copy :: [/mnt/root/boot/klist.txt] -> [/mnt/boot/klist.txt]
Copy :: [/mnt/root/boot/uInitrd] -> [/mnt/boot/uInitrd]
Copy :: [/mnt/root/boot/uImage] -> [/mnt/boot/uImage]
Copy :: [/mnt/root/boot/uImage-3.6.0-0.rc4.git0.1.fc18.armv7hl.omap] -> [/mnt/boot/uImage- 3.6.0-0.rc4.git0.1.fc18.armv7hl.omap]
Copy :: [/mnt/root/boot/uEnv.txt] -> [/mnt/boot/uEnv.txt]
Wrote :: [/mnt/root/etc/fstab] <- [0C5E-28BB]
Wrote :: [/mnt/root/etc/sysconfig/uboot]
loop deleted : /dev/loop0
Modification completed successfully!
[root@thinkpad Desktop]# 


Once this has completed you are now ready to copy the image to SD card.

dd if=<image-location>.img of=/dev/<location-of-sd> 

Insert into your Pandaboard and boot.

Versatile Express

The disk image produced by 'livemedia-creator' for Versatile Express (vexpress) emulation using QEMU, will require an additional step before use. In order to boot the image you will need to extract the kernel, initramfs and kernel modules. This can be done manually or with use of the provided modifier tool. You will first need to create the Pandaboard disk image using 'livemedia-creator'

livemedia-creator  --make-disk 
                   --no-virt --image-only 
                   --keep-image --armplatform=vexpress 
                   --ks=<location-of-kickstart>

The disk image will be available in '/var/tmp/disk<random>.img'. This image will not yet be bootable and will require one additional step as follows(to be run as root):

livemedia-modifier --image=<location-of-file.img> --platform=vexpress

Below is an exampe of its output:

[root@thinkpad Desktop]# ./livemedia-modifier --image=2012-09-17-vexpress.img --platform=vexpress
Mount :: [/dev/mapper/loop0p3] -> [/mnt/root]
Mount :: [/dev/mapper/loop0p1] -> [/mnt/boot]
Mkdir :: [/mnt/root/boot]
Mkdir :: [/mnt/root/boot/uboot]
Move :: [/mnt/boot/System.map-3.4.6-2.0.arm1.fc17.armv7hl] -> [/mnt/root/boot/System.map-3.4.6-2.0.arm1.fc17.armv7hl]
Move :: [/mnt/boot/initramfs-3.4.6-2.0.arm1.fc17.armv7hl.img] -> [/mnt/root/boot/initramfs-3.4.6-2.0.arm1.fc17.armv7hl.img]
Move :: [/mnt/boot/klist.txt] -> [/mnt/root/boot/klist.txt]
Move :: [/mnt/boot/uImage] -> [/mnt/root/boot/uImage]
Move :: [/mnt/boot/uImage-3.4.6-2.0.arm1.fc17.armv7hl] -> [/mnt/root/boot/uImage-3.4.6-2.0.arm1.fc17.armv7hl]
Move :: [/mnt/boot/uInitrd-3.4.6-2.0.arm1.fc17.armv7hl] -> [/mnt/root/boot/uInitrd-3.4.6-2.0.arm1.fc17.armv7hl]
Move :: [/mnt/boot/grub2] -> [/mnt/root/boot/grub2]
Move :: [/mnt/boot/.vmlinuz-3.4.6-2.0.arm1.fc17.armv7hl.hmac] -> [/mnt/root/boot/.vmlinuz-3.4.6-2.0.arm1.fc17.armv7hl.hmac]
Move :: [/mnt/boot/grub] -> [/mnt/root/boot/grub]
Move :: [/mnt/boot/vmlinuz-3.4.6-2.0.arm1.fc17.armv7hl] -> [/mnt/root/boot/vmlinuz-3.4.6-2.0.arm1.fc17.armv7hl]
Move :: [/mnt/boot/uInitrd] -> [/mnt/root/boot/uInitrd]
Move :: [/mnt/boot/boot.scr] -> [/mnt/root/boot/boot.scr]
Move :: [/mnt/boot/config-3.4.6-2.0.arm1.fc17.armv7hl] -> [/mnt/root/boot/config-3.4.6-2.0.arm1.fc17.armv7hl]
Move :: [/mnt/boot/lost+found] -> [/mnt/root/boot/lost+found]
Mkfs :: /dev/mapper/loop0p1
mkfs.vfat 3.0.12 (29 Oct 2011)
unable to get drive geometry, using default 255/63
Copy :: [/mnt/root/boot/uInitrd-3.4.6-2.0.arm1.fc17.armv7hl] -> [/mnt/boot/uInitrd-3.4.6-2.0.arm1.fc17.armv7hl]
Copy :: [/mnt/root/boot/uImage] -> [/mnt/boot/uImage]
Copy :: [/mnt/root/boot/klist.txt] -> [/mnt/boot/klist.txt]
Copy :: [/mnt/root/boot/uImage-3.4.6-2.0.arm1.fc17.armv7hl] -> [/mnt/boot/uImage-3.4.6-2.0.arm1.fc17.armv7hl]
Copy :: [/mnt/root/boot/boot.scr] -> [/mnt/boot/boot.scr]
Copy :: [/mnt/root/boot/uInitrd] -> [/mnt/boot/uInitrd]
Wrote :: [/mnt/root/etc/fstab] <- [D2FE-1440]
Wrote :: [/mnt/root/etc/sysconfig/uboot]
vexpress-Mkdir :: [./arm-vexpress-mmcblk0]
vexpress-Copy :: [/mnt/root/boot] -> [./arm-vexpress-mmcblk0/boot]
vexpress-Copy :: [/mnt/root/lib/modules] -> [./arm-vexpress-mmcblk0/lib/modules]
vexpress-Wrote :: [./arm-vexpress-mmcblk0/boot/boot-vexpress]
vexpress-Wrote :: [./arm-vexpress-mmcblk0/boot/boot-vexpress+x]
vexpress-Tar :: [./arm-vexpress-mmcblk0]
loop deleted : /dev/loop0
Modification completed successfully!
[root@thinkpad Desktop]#

The 'livemedia-modifier' will create a tarball of the files needed to boot including two scripts that can be used to boot using XFCE or command line.

Using vexpress

Once the tarball has completed you can extract the image by using

 tar xvJf <name-of-tarball>.tar.xz

Then switch to the directory containing the boot scripts.

 cd <name-of-directory>/boot/

Choose the appropriate boot option, with or with the use of a graphical user interface.

 ./boot

Extracting the kernel and initramfs

When you upgrade the kernel on vexpress, you will then need to extract the kernel and initramfs from the disk image for use during subsequent boots. The livemedia-modifier script automates this process, and with the appropriate option will not create a tarball, but only extract the needed bits for booting: