[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Offical Non-marketplace AMIs?



On 03/31/2013 06:07 PM, Brian Gupta wrote:
> Are there any plans to publish non-marketplace AMIs?
>
> Thanks,
> Brian
Hi,

Yes, I am working on building images with a small
shell script, directly on Debian, thanks to some
input from Julien Danjou and others.

Currently, I have the following script:

PARTED=/sbin/parted
qemu-img create debian.img 4G
${PARTED} -s debian.img mktable msdos    
${PARTED} -s -a optimal debian.img mkpart primary ext3 1M 100%    
kpartx -av debian.img
mkfs.ext3 /dev/mapper/loop0p1
MOUNT_DIR=`mktemp -d -t build-debimg.XXXXXX`
mount -o loop /dev/mapper/loop0p1 ${MOUNT_DIR}
debootstrap --verbose \
       
--include=openssh-server,python,python-argparse,python-cheetah,python-configobj,python-oauth,python-software-properties,python-yaml,python-boto,python-prettytable
\
        wheezy ${MOUNT_DIR} http://localhost:9999/debian
rm -f ${MOUNT_DIR}/etc/ssh/ssh_host_*
PKGS="cloud-init cloud-tools cloud-initiramfs-growroot"
for i in $PKGS ; do
        cp ${i}_*.deb ${MOUNT_DIR}
        chroot ${MOUNT_DIR} dpkg -i ${i}_*.deb     
        rm ${MOUNT_DIR}/${i}_*.deb
done
extlinux --install ${MOUNT_DIR}
umount ${MOUNT_DIR}
losetup -d /dev/mapper/loop0p1

I haven't tested the final result, (and the extlinux part)
and it would also need some qemu-img calls to
transform the image into a much more efficient qcow2
format. I'm just putting the above barely to give an idea
of what it could look like. Though critics would be
appreciated, this is far from being a finished work.

Note that the above dpkg -i hack is because the cloud*
packages aren't available in Wheezy. I'm not sure how
to solve that problem, and I'm quite sure that the
release team would refuse to have new packages at
this time of the release. Any idea to solve this in a
better way?

Is the extlinux a good choice?

Thoughts?

Thomas


Reply to: