Jan Schaumann | 2 Mar 2011 18:20
Favicon
Gravatar

Re: ec2 amis

Jean-Yves Migeon <jean-yves.migeon <at> espci.fr> wrote:

> I will upload the 5.1 ones in a few hours, for all regions.

I see http://wiki.netbsd.org/amazon_ec2/ now lists ami-fe7c8f97, which
comes up and looks good, but I discovered the following slight problem:

# ls -l /dev/null
-rw-r--r--  1 root  wheel  0 Mar  2 17:15 /dev/null
# 

It'd also be really neat if we could have an AMI with both pkgsrc and a
populated /usr/src.

I'm looking into building such an image myself following the
instructions on the twiki, but if anybody else beats me to it, I'm sure
others would find that useful.

-Jan
Jean-Yves Migeon | 2 Mar 2011 20:50
Picon
Favicon

Re: ec2 amis

On 02.03.2011 18:20, Jan Schaumann wrote:
> Jean-Yves Migeon <jean-yves.migeon <at> espci.fr> wrote:
> 
>> I will upload the 5.1 ones in a few hours, for all regions.
> 
> I see http://wiki.netbsd.org/amazon_ec2/ now lists ami-fe7c8f97, which
> comes up and looks good, but I discovered the following slight problem:
> 
> # ls -l /dev/null
> -rw-r--r--  1 root  wheel  0 Mar  2 17:15 /dev/null
> # 

Borked pkg_add. I chroot()ed in the partition for 5.1, and executed a
pkg_add bluntly, which creates /dev/null through a pipe redirection.
Will fix that for other regions too.

> It'd also be really neat if we could have an AMI with both pkgsrc and a
> populated /usr/src.

Hmm. I have a problem there. While I can maintain NetBSD x.y
approximately sane from an "up-to-date" point of view, I won't rebuild
AMIs just for the fun of repackaging src/ and pkgsrc/ on a regular basis.

> I'm looking into building such an image myself following the
> instructions on the twiki, but if anybody else beats me to it, I'm sure
> others would find that useful.

Beware of packaging AMIs this way, unless you intend to maintain them in
the long run by regularly reuploading/cvs upping the image. Compared to
stable releases, src and pkgsrc are moving targets, and you can quickly
(Continue reading)

Thor Lancelot Simon | 2 Mar 2011 22:54
Picon
Favicon

Re: ec2 amis

On Wed, Mar 02, 2011 at 08:50:38PM +0100, Jean-Yves Migeon wrote:
> 
> Borked pkg_add. I chroot()ed in the partition for 5.1, and executed a
> pkg_add bluntly, which creates /dev/null through a pipe redirection.
> Will fix that for other regions too.

But why wasn't /dev populated?  Or did you run MAKEDEV after?

> Hmm. I have a problem there. While I can maintain NetBSD x.y
> approximately sane from an "up-to-date" point of view, I won't rebuild
> AMIs just for the fun of repackaging src/ and pkgsrc/ on a regular basis.

If you include an up to date (when you build the AMI) checkout of
/usr/src, the consumer can just run "cvs update" as desired to fetch the
new revisions.  It saves a lot of I/O.

Thor

Jean-Yves Migeon | 2 Mar 2011 23:22
Picon
Favicon

Re: ec2 amis

On 02.03.2011 22:54, Thor Lancelot Simon wrote:
> On Wed, Mar 02, 2011 at 08:50:38PM +0100, Jean-Yves Migeon wrote:
>>
>> Borked pkg_add. I chroot()ed in the partition for 5.1, and executed a
>> pkg_add bluntly, which creates /dev/null through a pipe redirection.
>> Will fix that for other regions too.
> 
> But why wasn't /dev populated?  Or did you run MAKEDEV after?

Yep, the tar file is missing the /dev content

This is somewhat mitigated by init(8), as it executes MAKEDEV if
/dev/console is missing (IIRC). But MAKEDEV won't overwrite a node if it
is already present, and given that /dev/null is...

>> Hmm. I have a problem there. While I can maintain NetBSD x.y
>> approximately sane from an "up-to-date" point of view, I won't rebuild
>> AMIs just for the fun of repackaging src/ and pkgsrc/ on a regular basis.
> 
> If you include an up to date (when you build the AMI) checkout of
> /usr/src, the consumer can just run "cvs update" as desired to fetch the
> new revisions.  It saves a lot of I/O.

Fair enough :) Will do.

--

-- 
Jean-Yves Migeon
jeanyves.migeon <at> free.fr

(Continue reading)

Thor Lancelot Simon | 2 Mar 2011 23:32
Picon
Favicon

Re: ec2 amis

On Wed, Mar 02, 2011 at 11:22:03PM +0100, Jean-Yves Migeon wrote:
> On 02.03.2011 22:54, Thor Lancelot Simon wrote:
> > On Wed, Mar 02, 2011 at 08:50:38PM +0100, Jean-Yves Migeon wrote:
> >>
> >> Borked pkg_add. I chroot()ed in the partition for 5.1, and executed a
> >> pkg_add bluntly, which creates /dev/null through a pipe redirection.
> >> Will fix that for other regions too.
> > 
> > But why wasn't /dev populated?  Or did you run MAKEDEV after?
> 
> Yep, the tar file is missing the /dev content

I don't think it's "missing".  It is intentional that none of the tar files
contain the contents of /dev, because extracting the tar file on a
system with an incompatible interpretation of the device major and minor
numbers would give a result potentially much more harmful than an
empty /dev.  So running MAKEDEV *on a NetBSD system of the right
architecture* after extracting the tar file is an important thing to do.

> This is somewhat mitigated by init(8), as it executes MAKEDEV if
> /dev/console is missing (IIRC). But MAKEDEV won't overwrite a node if it
> is already present, and given that /dev/null is...

Also, this way you don't get persistent device permissions.

Thor

Jean-Yves Migeon | 4 Mar 2011 00:25
Picon
Favicon

Re: ec2 amis

On 02.03.2011 20:50, Jean-Yves Migeon wrote:
>> It'd also be really neat if we could have an AMI with both pkgsrc and a
>> populated /usr/src.

wiki updated: http://wiki.netbsd.org/amazon_ec2/#index3h1

Currently building Tokyo region, Amazon just added it a day ago.

--

-- 
Jean-Yves Migeon
jeanyves.migeon <at> free.fr

Jean-Yves Migeon | 4 Mar 2011 00:28
Picon
Favicon

Re: ec2 amis

On 04.03.2011 00:25, Jean-Yves Migeon wrote:
> On 02.03.2011 20:50, Jean-Yves Migeon wrote:
>>> It'd also be really neat if we could have an AMI with both pkgsrc and a
>>> populated /usr/src.
> 
> wiki updated: http://wiki.netbsd.org/amazon_ec2/#index3h1
> 
> Currently building Tokyo region, Amazon just added it a day ago.

BTW: /dev populated, src/ and pkgsrc/ are present too (but I would
recommend cvs up'ing first, heh).

--

-- 
Jean-Yves Migeon
jeanyves.migeon <at> free.fr

Jan Schaumann | 4 Mar 2011 00:47
Favicon
Gravatar

Re: ec2 amis

Jean-Yves Migeon <jeanyves.migeon <at> free.fr> wrote:
> On 04.03.2011 00:25, Jean-Yves Migeon wrote:
> > On 02.03.2011 20:50, Jean-Yves Migeon wrote:
> >>> It'd also be really neat if we could have an AMI with both pkgsrc and a
> >>> populated /usr/src.
> > 
> > wiki updated: http://wiki.netbsd.org/amazon_ec2/#index3h1
> > 
> > Currently building Tokyo region, Amazon just added it a day ago.
> 
> BTW: /dev populated, src/ and pkgsrc/ are present too (but I would
> recommend cvs up'ing first, heh).

Awesome - thanks a lot!
-Jan
Jan Schaumann | 4 Mar 2011 04:25
Favicon
Gravatar

building ec2 amis

Hello,

I'm trying to follow http://wiki.netbsd.org/amazon_ec2/ to build a new
AMI, but I've not been successful.  After

su root ./build.sh -O ../obj -T ../tools -D ../dest -R ../release -U -V \
	INSTALLSETS="base etc" install=/mnt/ec2

I find that /mnt/ec2 looks not completely populated.  /mnt/ec2/etc/rc.d/ is
empty, as is /mnt/ec2/etc/ssh/; running

makefs -t ffs -B le -s 256m -N /mnt/ec2/etc/ -o density=32k \
	/tmp/NetBSD-AMI.img /mnt/ec2/ 

then yields:

makefs: Unable to use user and group databases in `/mnt/ec2/etc'

Is it possible that there are some steps missing from the wiki?

-Jan
Jean-Yves Migeon | 4 Mar 2011 14:30
Picon

Re: building ec2 amis

 On Thu, 3 Mar 2011 22:25:42 -0500, Jan Schaumann 
 <jschauma <at> netmeister.org> wrote:
> Hello,
>
> I'm trying to follow http://wiki.netbsd.org/amazon_ec2/ to build a 
> new
> AMI, but I've not been successful.  After
>
> su root ./build.sh -O ../obj -T ../tools -D ../dest -R ../release -U 
> -V \
> 	INSTALLSETS="base etc" install=/mnt/ec2
>
> I find that /mnt/ec2 looks not completely populated.  
> /mnt/ec2/etc/rc.d/ is
> empty, as is /mnt/ec2/etc/ssh/; running
>
> makefs -t ffs -B le -s 256m -N /mnt/ec2/etc/ -o density=32k \
> 	/tmp/NetBSD-AMI.img /mnt/ec2/
>
> then yields:
>
> makefs: Unable to use user and group databases in `/mnt/ec2/etc'
>
> Is it possible that there are some steps missing from the wiki?

 Most likely, the etc set is not extracted, because of [1].

 You need a -current updated src/; patch for -5 has a pull-up request. 
 But it's still in the pipe, as it is a commodity fix.

(Continue reading)


Gmane