6/12/09

Creating a Fedora 11 image

Fedora 11 is out. I made a fedora 11 image as my domU. The steps for making a Fedora 11 image is little different than those for Fedora 10 that I have described here. But there are some caveats, all related to RPM.

First you have must rpm version > 4.6, otherwise you have have this MD5 errors (fedora 11 doesn't use md5 checksum anymore).

Second, the new rpm in fedora 11 use LUA, but liblua.so is not installed by yum groupinstall. So inside fedora 11, we have this chicken and egg problem. To install liblua.so from liblua.rpm (and anything else from rpm) we need rpm; but to run rpm, we need liblua.so. To solve this, just copy liblua.so from fedora 10 to fedora 11's /usr/lib when fedora 11's image is mounted in fedora 10.

Other than these, everything's fine with making Fedora 11 image.

6 comments:

Renich said...

Hey, man! Can you be a bit more specific about the rpm version? Do I have to downgrade it?

How about reconfiguring it to use MD5? Is it a must in Amazon to use md5?

And about the LUA, just intall lua-devel and that's it, no?

Check out this output:

[renich@introdesk ~]$ yum provides "*/liblua.so"
Loaded plugins: fastestmirror, merge-conf, presto, refresh-packagekit, remove-with-leaves
lua-devel-5.1.4-2.fc11.i586 : Development files for lua
Repo : fedora
Matched from:
Filename : /usr/lib/liblua.so



lua-devel-5.1.4-2.fc11.x86_64 : Development files for lua
Repo : fedora
Matched from:
Filename : /usr/lib64/liblua.so



lua-devel-5.1.4-3.fc11.x86_64 : Development files for lua
Repo : updates
Matched from:
Filename : /usr/lib64/liblua.so



lua-devel-5.1.4-3.fc11.i586 : Development files for lua
Repo : updates
Matched from:
Filename : /usr/lib/liblua.so

Wensheng Wang said...

My problem with MD5 is probably specific to my case. I was creating a Fedora 11 image from an old fedora. If you are creating image from within Fedora10 or Fedora11 itself. There should be no problem because rpm's already good version.

About lua, in a freshly created and booted F11 image, there's no liblua because "yum groupinstall" did install it. But rpm depends on lua. but you can not install lua with yum because yum is just a python script that use rpm. That's why I said it's chicken/egg problem

Renich said...

Ok, what if I use ext4... will it boot? It doesn't use the local /boot, right?

Wensheng Wang said...

never used ext4 on domU so I don't know. I always use xfs.
For sure the kernel from xen doesn't work with ext4 because it's 2.6.18. But I guess pv-ops kernel after 2.6.30 should work.

Olivier said...

Hi - Just to confirm there are no RPM related issued when the image is created from within F11.

Here is my code:

#!/bin/sh

# works only from within a F11 system - due to RPM dependencies

ver=11
arch=x86_64

# clear stuff
umount -d /mnt/loop/proc
umount -d /mnt/loop

# create some basic directories
mkdir /mnt/loop/dev
mkdir /mnt/loop/proc
mkdir /mnt/loop/etc
for i in console null zero ; do /sbin/MAKEDEV -d /mnt/loop/dev -x $i ; done

# create basic fstab
cat << E O L > /mnt/loop/etc/fstab
/dev/sda1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
EOL

# create proc dir
mkdir /mnt/loop/proc
mount -t proc none /mnt/loop/proc

# create file system image
dd if=/dev/zero of=fc$ver-$arch.img bs=1M count=1 seek=2048
/sbin/mke2fs -F -j fc$ver-$arch.img

# mount image as loop file
mkdir /mnt/loop
mount -o loop fc$ver-$arch.img /mnt/loop


# create local yum conf file for Fedora
cat << EOL > /tmp/yumec2.conf
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
exclude=*-debuginfo
gpgcheck=0
obsoletes=1
reposdir=/dev/null

[base]
name=Fedora Core $ver - $arch - Base
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$ver&arch=$arch
enabled=1

[updates-released]
name=Fedora Core $ver - $arch - Released Updates
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$ver&arch=$arch
enabled=1
EOL

# install base packages into image
yum -c /tmp/yumec2.conf --installroot=/mnt/loop -y groupinstall Base
yum -c /tmp/yumec2.conf --installroot=/mnt/loop -y clean packages

# cleaning
mv /mnt/loop/lib/tls /mnt/loop/lib/tls-disabled
mv /mnt/loop/lib64/tls /mnt/loop/lib64/tls-disabled


# flush file system buffers
sync

# unmount
umount -d /mnt/loop/proc
umount -d /mnt/loop

romarin12 said...

Hi all,

I've been using the above codes to create a F13 image.

For some reasons, when this image is created from within a F13 machine, the image cannot be launched: it goes from 'pending' to 'terminated'. The console output is empty and the IP address is not allocated.

Interestingly, when the F13 image is created from within a F11 machine, it can be launched, works well, but cannot be re-bundled... If I try to ec2-bundle-vol, ec2-upload-bundle, ec2-register it, the new image also goes from 'pending' to 'terminated' when launched.

I believe something has changed from F11 to F13, as my scripts still work fine to bundle a re-bundle a F11 image.

Have you came across something like that ?

Thanks,

Olivier.