Subject: [alpine-devel] Notes on Alpine 2.4.2 in Amazon EC2

From: Nathan Angelacos <[email-masked]>
Date: Sun, 27 May 2012 09:00:47 -0700

Just some notes on trying to get Alpine Linux running on an EC2 instance.

As of 27 May 2012, The Amazon Linux AMI includes pv-grub, so trying an 
alternate kernel is fairly simple:

* Start the instance (its some variant of redhat)
* wget the alpine iso and copy the /boot and /apk directories to the EC2 
  instance /
* create a apkovl.tar.gz that includes the ssh public keys, starts 
openssh, etc.; place the apkovl in /

The /boot/grub/grub.conf looks like this:

default=0
fallback=1
timeout=3
hiddenmenu

title Alpine Linux
root (hd0)
kernel /boot/grsec alpine_dev=xvda1:ext4 
modules=loop,squashfs,sd-mod,ext4 console=hvc0
initrd /boot/grsec.gz

title Amazon Linux AMI (PV)
root (hd0)
kernel /boot/vmlinuz-3.2.12-3.2.4.amzn1.i686 root=LABEL=/ console=hvc0
initrd /boot/initramfs-3.2.12-3.2.4.amzn1.i686.img

----

What doesn't work:

* Booting the 32bit kernel reports:
   ERROR: Invalid kernel: 'elf_xen_note_check: ERROR: Will only load 
images built for the generic loader or Linux images
   xc_dom_oparse_image returned -I

http://wiki.alpinelinux.org/wiki/Talk:Create_Alpine_Linux_PV_DomU says 
that's because the kernel uses PVOps and its running on 64 bit hardware.

* Booting the 64bit kernel reports:
   can only boot x86 32 PAE kernels, not xen-3.0-x86_64
   Error 13: Invalid or unsupported executable format

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Nathan Angelacos <[email-masked]>
Date: Thu, 31 May 2012 18:56:29 -0700

Thanks to all for the help - Alpine Linux is now live in the  Amazon EC2 
cloud.  The following isn't pretty (no prepackaged AMI or anything) - 
more like duct-tape and fishing line - but its a start.

Pre setup:
   * Set up a local box so that it does
     * dhcp on eth0
     * starts sshd
     * put your public key in /root/.ssh/authorized_keys
     * set the root password
     * lbu include root/.ssh
     * You may wish to delete the /etc/ssh/*key* files, so that they are 
created  on the new box
   * lbu package amazon.apkovl.tar.gz
     * IMPORTANT:  If you are building this on a 32bit box, delete 
etc/apk/arch from the apkovl.tar.gz file

* Create an instance, use Amazon Linux, *64bit* version
* Copy the amazon.apkovl.tar.gz to the instance
* Log in, sudo
* Move the apkovl.tar.gz to /
* wget the latest alpinelinux *x86_64* iso. 32bit won't work
* Copy alpinelinux to the EBS harddrive
   * mkdir x;
   * mount alpine*.iso x -o loop
   * cd x
   * cp -av apks /
   * cp boot/* /boot
   * cd
* Edit the /boot/grub/grub.conf so that it looks something like this:

> default=0
> fallback=1
> timeout=3
> hiddenmenu
>
> title Alpine Linux
> root (hd0)
> kernel /boot/grsec alpine_dev=xvda1:ext4 modules=loop,squashfs,sd-mod,ext4 console=hvc0 pax_nouderef BOOT_IMAGE=/boot/grsec
> initrd /boot/grsec.gz
>
>

    * syslinux automatically adds the BOOT_IMAGE to the kernel command 
line; grub does not.

* Reboot

---

---

From: Dubiousjim <[email-masked]>
Date: Fri, 1 Jun 2012 09:50:19 -0400

> more like duct-tape and fishing line - but its a start.

I added some of the messages in this thread to the wiki. They need to be
cleaned up, but at least the information is there to start from.

http://wiki.alpinelinux.org/wiki/Running_Alpine_Linux_in_Amazon_EC2

If you think it's not ready to be aired there yet, apologies and go
ahead and delete it.

-- 
Dubiousjim
[email-masked]

---

---

From: Nathan Angelacos <[email-masked]>
Date: Fri, 01 Jun 2012 08:33:20 -0700

> If you think it's not ready to be aired there yet, apologies and go

That was "The Right Thing To Do(tm)"  Thanks!

(Ugly is good - might encourage me to clean it up :) once we have an AMI)

---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 29 May 2012 17:09:56 +0200

On Sun, 27 May 2012 09:00:47 -0700
 
>    Error 13: Invalid or unsupported executable format

I built a kernel dedicated for virtual guests. One of the goals is to
make it as small as possible. I have no idea if it even boots at this
point but feedback is welcome.

I'd like it to include drivers for qemu/kvm, xen, vmware, virtualbox
and hyper-v guests.

It is in edge/testing and is named linux-virt-grsec.

Thanks!

-nc

---

---

From: "V.Krishn" <[email-masked]>
Date: Wed, 30 May 2012 23:25:53 +0530

> It is in edge/testing and is named linux-virt-grsec.

Can we see a bootable iso in edge/releases or a wiki help page on how to 
create one. It would be great to have a lighter iso suited for virtual guests. 
I could test using kvm and install/test pmreader on it.
(http://insteps.net/pr/a/pmwiki/Apps/PmReader-help-v1-1)

Thanks.
-- 
Regards.
V.Krishn

---

---

From: Natanael Copa <[email-masked]>
Date: Wed, 30 May 2012 21:45:37 +0200

On Wed, 30 May 2012 23:25:53 +0530
"V.Krishn" <[email-masked]> wrote:

> > I built a kernel dedicated for virtual guests. One of the goals is
> > to make it as small as possible. I have no idea if it even boots at
> > this point but feedback is welcome.
> > 
> Can we see a bootable iso in edge/releases or a wiki help page on how
> to create one. It would be great to have a lighter iso suited for
> virtual guests. I could test using kvm and install/test pmreader on
> it. (http://insteps.net/pr/a/pmwiki/Apps/PmReader-help-v1-1)

I built one for testing
http://dev.alpinelinux.org/~ncopa/alpine/alpine-virt/

> Thanks.

I think kernel config might needs some tweaking still.

-nc

---

---

From: "V.Krishn" <[email-masked]>
Date: Fri, 1 Jun 2012 16:17:19 +0530

> I think kernel config might needs some tweaking still.

Tested installing http://insteps.net/pr/a/pmwiki/Apps/PmReader-help-v1-1
on alpine-virt-120531-x86.iso .
Kvm/qemu command:
kvm -cdrom alpine-virt-120531-x86.iso -net nic,model=virtio -net user -redir 
tcp:5558::80

Things look great.

packages  tested from v2.4/edge repo:
php-apache2, php-xml, avfs, unionfs-fuse

Is it possible for someone to provide a testing account at Amazon EC2/AWS. 
(Looks like even signing a development account requires a credit card)

-- 
Regards.
V.Krishn

---