Commit Graph

200 Commits

Author SHA1 Message Date
Albert Hopkins df1d7650d8 Baselayout-2/openrc compatibility and stage4 tarballs.
The first major change here is the support of baselayout-2/openrc.  So far
Gentoo has not released a stage3 tarball with baselayout-2, but I've tested
this enough that I feel it works even when doing an upgrade.  The
baselayout-1 stuff has been converted, however it is recommended to not use
this until baselayout-2 is available in Gentoo stage3s as I don't want to
support converting, or you can do this:

stage4 tarball support.  I'm not sure why I didn't support this before.
Now not only can stage4 tarballs be build, instead of or in addition to
virtual appliance images, but stage4 tarballs can also be used in lieu of a
stage3.  There is a new "stage4" make target, and also when building the
Makefile will first look for stage4/<appliance>-stage4.tar.bz2 and if that
exists use it instead of the Gentoo stage3.  If you specify stage4 as a
target and also already have a stage4, then the Makefile will unpack the
stage4 into the chroot, perform updates, and then re-create the stage4
based on the updates (atomically).  In addition there is a new Makefile
variable, SOFTWARE.  The default value is "1" meaning it will call the
software target (thereby installing/updatein software), but if you set
SOFTWARE=0, then the software phase will not be run.  This can allow, for
example, to build a VM image from a stage4 without performing software
updates, in effect a straight stage4 to image for quick image building.

Since most appliances are pretty much based on the "base" appliance, one
could imply copy the base stage4 to the new appliance stage4 and start from
there, instead of having to start from a vanilla stage3, for example:

# cp stage4/base-stage4.tar.bz2 stage4/kde-stage4.tar.bz2
# make APPLIANCE=kde stage4

Will take the already existing base stage4 and simply update it to kde,
which will be easier/faster than starting from a stage3.

There are still some tweaks that need to be done for the stage4 support.
Specifically Makefile targets need to be written with the assumption that
they may be called more than once (e.g. updating a stage4 or going from
stage4 to image with SOFTWARE=1).  For the most part things work according
to that assumption, but there are a few things that need to be tweeked,
such as the inittab settings if one is building a "headed" image but it's
based off a headless stage4.  New appliance authors should also write their
"preinstall" and "postinstall" targets with the assmption that it may be
called more than once.
2011-05-17 20:44:04 -04:00
Albert Hopkins fe8ecee7c7 Replacing dhcpcd with dhcp (client only) 2011-04-22 22:20:01 -04:00
Albert Hopkins 1edf7ed990 New DASH Makefile variable, if set to "YES", will install app-shells/dash
and set it as the login shell for root.
2011-04-06 10:25:05 -04:00
Albert Hopkins 029d732f06 Tweaks:
* Added UDEV Makefile variable, if set to NO, will disable UDEV and use
  static /dev (defaults to YES)

* Run eselct python to get around "which python am i?" situation

* export "inroot" variable
2011-04-02 09:56:19 -04:00
Albert Hopkins af0db7e32e "eselect python set python2.6" is no longer necessary 2011-03-08 08:11:43 -05:00
Albert Hopkins 4841126b93 Makefile: created "inroot" macro for running commands in the chroot 2011-02-24 23:20:38 -05:00
Albert Hopkins f236ffc4bb xfce: replace mousepad with leafpad 2011-02-21 07:13:24 -05:00
Albert Hopkins db1cc15a3b New Makefile variable: EXTERNAL_KERNEL
If set to YES, then the kernel sources will not be installed and a kernel
is not built, nor is grub installed/configured.  This is can be useful when
building appliances for hypervisors such as Xen and Qemu/KVM which can run
from external kernel/initramfs configurations. Default is NO
2011-02-05 00:06:23 -05:00
Albert Hopkins 84911f1824 moved "rm -f umount" from "remove_checkpoints" to "clean" because if make
is run with parallel jobs the file may not exist yet for remove_checkpoints
to remove
2011-01-23 07:48:58 -05:00
Albert Hopkins a67cef9da2 Added global Makefile option to enable sshd in the appliance 2011-01-20 18:17:32 -05:00
Albert Hopkins 6745ad7bba Small tweak to allow downloading of stage3 and portage in parallel (with -j2) 2011-01-19 21:16:13 -05:00
Albert Hopkins 3b6351d610 New makefile variable, ROOT_PASSWORD, to set the (encrypted) root password 2011-01-11 22:47:14 -05:00
Albert Hopkins 93a6eaf2f6 Makefile: hard-code eselect python set python2.6 2011-01-11 17:00:09 -05:00
Albert Hopkins 76be9a9aa0 Makefile: make changing of root password and removing or portage tree both optional 2010-12-19 23:04:11 -05:00
Albert Hopkins f9ef73eb07 Force eth0 to release dhcp address on shutdown 2010-12-16 21:03:48 -05:00
Albert Hopkins 312faaa621 changed PROFILE variable to profile to avoid clobbering builds 2010-12-06 20:19:37 -05:00
Albert Hopkins 733ca07d0f export OVERLAY variable 2010-11-29 21:29:04 -05:00
Albert Hopkins c08d85dace Minor changes to make kde/unstable build again 2010-11-27 16:43:40 -05:00
Albert Hopkins 3bb8e3fd37 Makefile: change filesystem label 2010-11-26 07:33:45 -05:00
Albert Hopkins abe5e4d98f Makefile tweaks 2010-11-20 19:51:27 -05:00
Albert Hopkins e89d24ccfe I learned a lot about Makefiles :D
So, basically I re-architeched things a bit:

The appliance/Makefile.inc fiels are now appliance/Makefile (again). The
main Makefile will call "make -C appliance preinstall" and "postinstall"
(and in future "clean").  So I got rid of the ugly make variables/include
thing.  Some of the main Makefile's variables are exported to the
sub-makes.  Appliances don't really need $(APPLIANCE) anymore as the
appliance directory is their CWD.

Added some new targets and smarter targets.  I can do more with this, but
it's a big improvment from last time.  Still learning a lot of Makefile
magic (been reading other people's Makefiles).

Verified that "make -j3" works (at least on the base appliance) but will
kill your hard drive :D

Introduced "profiles"  Which are files with variables you want to override.
The file will be "include"ed by the main Makefile.  For example, I have a
file, "local.cfg" that looks like this:

--- 8< -----------------------------
CHROOT = /var/scratch/marduk/vabuild
HEADLESS = YES
PRUNE_CRITICAL = NO
VIRTIO = YES
TIMEZONE = EST5EDT
DISK_SIZE = 60.0G
SWAP_SIZE = 48
PKGDIR = /var/scratch/packages
NBD_DEV = /dev/nbd8

all: qcow
--- 8< ------------------------------

Then, e.g. i can run "make PROFILE=local APPLIANCE=kde".  If you don't
specify a PROFILE variable, then it will default to the empty string, which
means the main Makefile will attempt to include .cfg

So, for example i have:

   $ ln -s local.cfg .cfg
   $ make APPLIANCE=kde

Don't set PROFILE inside your .cfg file (why would you?).  Also, if the
[pro]file does not exist, the include fails silently.

I will put this info in the wiki eventually...
2010-11-13 18:22:18 -05:00
Albert Hopkins 63b8411f17 Should be compatible with 32bit guests 2010-11-06 18:46:07 -04:00
Albert Hopkins 26dac946ac * Pre-emerge xz-utils as some packages need this to unpack
* Clean up Makefile a little
2010-11-06 17:49:19 -04:00
Albert Hopkins 63cae4a119 Various fixes 2010-11-06 04:41:15 -04:00
Albert Hopkins 62801481e7 Make stage3 tarball always have the same filename 2010-11-05 10:52:04 -04:00
Albert Hopkins 295b1d9a96 Switch from ext4 to ext2 as an experiment 2010-11-05 08:59:18 -04:00
Albert Hopkins a5af02ae14 Move umounting in it's own target and don't ||true it 2010-11-05 08:06:13 -04:00
Albert Hopkins 7a21aed5fe * Use rsync --exclude-from instead of copying and removing
* Made a change so that "make -j2" works
2010-11-05 01:53:07 -04:00
Albert Hopkins 4f2bcd184e Merged changes 2010-11-04 23:25:47 -04:00
Albert Hopkins 543619d871 Various tweaks 2010-11-04 23:17:00 -04:00
Albert Hopkins 795211626e Make (hopefully) work with non-gentoo hosts 2010-11-04 23:10:54 -04:00
Albert Hopkins 717589eb4b Makefile(clean): umount each mount point individually 2010-10-26 20:00:50 -04:00
Albert Hopkins 7cf0f4ecf2 Changed from preinstall/postintall scripts to Makefile include files 2010-10-06 07:37:32 -04:00
Albert Hopkins 9b19fd1590 Makefile: introduce NBD_DEV variable to specify which nbd device to use 2010-10-03 11:29:27 -04:00
Albert Hopkins b95132a264 * Add ACCEPT_KEYWORDS Makefile option
* kde: Works now in ~amd64 also
* gnome: (Hopefully) works now in ~amd64 also
* Add xfce virtual appliance
* Add HEADLESS Makefile option that configures grub.conf and /etc/inittab
  to use serial console
2010-09-18 02:43:14 -04:00
Albert Hopkins 86182d95ed Actually copy $(TIMEZONE) to /etc/localtime 2010-09-07 07:42:18 -04:00
Albert Hopkins eaf9c7cf82 Don't match hostname to localhost in /etc/hosts 2010-08-15 15:22:24 -04:00
Albert Hopkins f0fb08c7ce Add power management to kernel config. Add acpid to VM installation. 2010-07-31 20:16:35 -04:00
Albert Hopkins abaf13ae2b Instad of masking python3, change default python to python2.6 to work around the stage3 problem.
This bug has been reported upstream:
http://bugs.gentoo.org/show_bug.cgi?id=330655
2010-07-31 16:12:35 -04:00
Albert Hopkins ea8ef5b795 Various cleanups. Maked python3. Added -pipe back go CFLAGS. 2010-07-31 06:53:21 -04:00
Albert Hopkins ac0dd5fe39 Fix so that the latest stage3 is unpacked if there are multiple tarballs
in the current directory.
2010-07-30 01:56:56 +00:00
Albert Hopkins 466d286685 Make so bind mount variables point to gentoo defaults.
Ensure that images can be built by a virtual machine

Removed "-pipe" from CFLAGS in make.conf for machines with low memory (such
as virtual machines)
2010-07-29 22:49:39 +00:00
Albert Hopkins c317172525 New teamplayer vm and kernel config update. 2010-07-21 23:08:35 -04:00
Albert Hopkins af260872d8 Enable a serial console in /etc/inittab 2010-07-10 19:32:08 -04:00
Albert Hopkins 22f53efe34 Make script is now modular, create a directory for your appliance, drop
some files in it and "make APPLIANCE=..."
2010-07-10 16:43:22 -04:00
Albert Hopkins a2cd06b30f Update system before world, lock passwords last. 2010-07-10 16:03:39 -04:00
Albert Hopkins 8a7b5f1700 Cleaned up Makefile and hopefully made it more modular. Added preinstall
and postinstall scripts for additional software
2010-07-10 14:04:04 -04:00
Albert Hopkins d500b91164 Makefile: don't attempt to fetch the stage3 if stage3 was already run 2010-07-09 20:49:58 -04:00
Albert Hopkins 0e2fb5bda6 Made Makefile a little bit smarter. 2010-07-09 20:22:55 -04:00
Albert Hopkins fe5646804c Initial commit 2010-07-08 23:22:37 -04:00