Commit Graph

183 Commits

Author SHA1 Message Date
Albert Hopkins 5889d9f251 Makefile: touch the portage tarball after downloading
Just in case.
2015-03-09 11:19:23 +00:00
Albert Hopkins b92d617f84 Makefile: clean: Remove temporary image files 2015-03-01 12:49:04 +00:00
Albert Hopkins 58d4bad383 Makefile: PORTAGE_DIR: touch the directory when it's unpacked.
Otherwise it retains the same timestamp as the tarball, which may not
trigger a stage4 rebuild.
2015-03-01 12:47:02 +00:00
Albert Hopkins 1a36e228c0 Makefile:STAGE4_TARBALL: Fix typo
Target should have been "PORTAGE_DIR" and not "PORTAGE"
2015-03-01 12:46:18 +00:00
Albert Hopkins 95e3d1e9af Makefile: make the default target "stage4" instead of "image" 2015-03-01 01:55:57 +00:00
Albert Hopkins f4e8a22ddb Makefile: use /usr/bin/basename in a few echo statements 2015-03-01 01:52:49 +00:00
Albert Hopkins 86311ebd9f Makefile: Get rid of BUILD_SOFTWARE option.
It's hardly useful anymore.
2015-03-01 01:31:55 +00:00
Albert Hopkins 07c96253dc Merge SWAP_FILE and SYSCONFIG targets into PREPROOT
They were small targets and PREPROOT is pretty much responsible for that
anyway.
2015-03-01 01:06:24 +00:00
Albert Hopkins bc22178119 Makefile: add sync_stage3 to .PHONY 2015-02-28 22:36:23 +00:00
Albert Hopkins 9562528920 stage4: Remove "build_stage4" and don't force stage4 to build every time
The stage4 target, specifically the STAGE4_TARBALL target now depends on
the portage/ directory, the appliances/<appliance>/ directory and the
stage3 tarball.  It will not be rebuild if these are up-to-date.  Therefore
other targets that depend on stage4 (e.g. RAW_IMAGE) won't force stage4 to
be rebuilt if it is up to date.

If you want to force a stage4 rebuild, for example if the appliance pulls
from a live VCS, then the recommended way to do this is:

    $ touch appliances/<appliance>
    $ make APPLIANCE=<appliance> stage4
2015-02-28 22:35:45 +00:00
Albert Hopkins c8c9bc1a1f Make the other image/ targets depend on $(RAW_IMAGE).
Instead of "image" so that if the raw image is built and up-to-date then it
need not be rebuilt to satisfy the other image targets.  This excludes the
stage4 "image" which of course is necessary to build the $(RAW_IMAGE)
target.
2015-02-28 22:30:01 +00:00
Albert Hopkins dff2e32481 Makefile: make the $(RAW_IMAGE) target install the stage4 files.
The raw image making was kind of split up, with different targets to create
the image, partition, copy files, install grub, etc.  This change makes it
all one target.  After "make image" is done, or, e.g., "make images/base.img"
then the resulting file will be built and contain all the necessary files.

This make the $(RAW_IMAGE) target more uniform with the other image/
targets.  It will also make the other image/ targets easier to satify.
2015-02-28 22:27:39 +00:00
Albert Hopkins e28fcda122 Fix package.* files installation to work with new stage3's
The new (2015-02) stage3 tarballs use package.* directories instead of
files, causing the files to fail to be copied over.  This change instead
copies them to the directories, creating them if they don't already exist.
2015-02-28 22:20:50 +00:00
Albert Hopkins d66a465456 Makefile: Make the systools target inside the chroot 2015-02-27 22:25:56 +00:00
Albert Hopkins 27f7653ee7 Makefile: Make the sysconfig target inside the chroot 2015-02-27 22:12:46 +00:00
Albert Hopkins 1a9d97d016 Makefile: Make the preproot target inside the chroot 2015-02-27 22:05:17 +00:00
Albert Hopkins 13512c8cbf Makefile: Make the software target inside the chroot 2015-02-27 21:46:57 +00:00
Albert Hopkins 3ca8e68168 Makefile: Make the grub target inside the chroot 2015-02-27 21:35:15 +00:00
Albert Hopkins 8ef1630fdb Makefile: Make the kernel target inside the chroot 2015-02-27 21:20:43 +00:00
Albert Hopkins 0c12afc476 Makefile: build compile_options inside the chroot 2015-02-27 20:44:52 +00:00
Albert Hopkins da9e895652 Makefile: Make the stage3 target inside the chroot
Then we don't have to manually clean it (it gets clean on the stage4
target).
2015-02-27 20:37:14 +00:00
Albert Hopkins 8240a836e1 Makefile:$(RAW_IMAGE) add stage4 tarball as a dependency.
If not then re-making the image won't happen if the image already exists
but older than the stage4.
2015-02-27 20:10:20 +00:00
Albert Hopkins 0799c48705 Makefile:preproot: Make sure we've always got a local copy of resolv.conf
Or else network will fail inside the chroot.
2015-02-27 20:09:13 +00:00
Albert Hopkins c9a81d2806 The great systemd commit.
This change converts the appliances from openrc to systemd.  In addition,
systemd needs to at least be be installed on the build machine as we now
use systemd-nspawn instead of chroot/bind mounts do to the fact that
systemd-nspawn is much more robust and lese prone to errors.  In addition:

* All stage4 tarballs and images are now stored in the images/ directory by
  default.

* A package dir is now required and is set up in the packages/ directory by
  default.

* The portage directory is not unpacked in the chroot every time anymore
  and is instead bind-mounted from a directory by systemd-nspawn.  This is
  the portage/ directory by default.

* In addition there is a distfiles/ directory (by default) which is
  bind-mounted in the chroot.  It does what you'd probably expect.

* The Makefile learned new target, eclean, which will run eclean-dist and
  eclean-pkg to clean out obsolete distfiles and binary packages.

* The REMOVE_PORTAGE_TREE option is removed as portage is no longer
  installed.

* The unused/untested PRUNE_CRITICAL functionality has been removed.  I
  have no idea if it worked and if it didn't I didn't want to fix it.

* As appliances are always using systemd, UDEV is no longer optional.

* Timezones and hostnames are now handled by systemd (systemd-firstboot).

* Stage4 tarballs are now directly importable as systemd containers (and
  probably docker too though I haven't tested that yet).

* A number of packages (for example dhcpd, acpid) have been removed from the
  appliances when systemd provides equivalent functionality.

* We no longer override etc-update.conf.  There's no reason.

* A number of Makefile targets, checkpoints, temp files, etc have been
  removed as they are no longer needed.
2015-02-22 15:32:16 +00:00
Albert Hopkins 50a4a28567 Makefile: Name images/tarball after appliance name not hostname.
The reason being that when you are distributing an image you are likely
distributing an general appliance, not a specific host so it makes sense
that the image name be the name of the appliance and not, e.g., ln33.  This
can always be overriden on the command line or in a profile.
2015-02-21 13:21:05 +00:00
Albert Hopkins efeeb737b6 Makefile: export RSYNC_MIRROR
Another forgotten artifact from cs bcbd924efc3a.
2015-02-21 13:17:08 +00:00
Albert Hopkins f61e01f1dd sync_stage3: Use a helper script
The Makefile logic was lousy and broken.  Add a more robust helper script.
2015-02-16 18:03:44 +00:00
Albert Hopkins 9aecaedcd6 Makefile: image, stage4: clean up after oneself
Make these targets that have temporary targets/mount-points clean up after
themselves.
2014-08-30 18:12:04 +00:00
Albert Hopkins 1fe98b6b7c Makefile: don't pass $(USEPKG) to @preserved-rebuild
... kinda defeats the purpose.
2014-08-30 16:53:30 +00:00
Albert Hopkins fd40aac3bf Makefile: export USEPKG so that submakes can use it.
I thought this was already being done, but apparently not.
2014-06-14 21:51:21 +00:00
Albert Hopkins 4b01342bf1 Makefile: use losetup instead of qemu-nbd for loop mounting.
It's more dynamic, is faster, and the newer versions support auto-creating
device nodes for partions.  So it's prefereable to qemu-nbd.
2014-06-11 15:59:57 +00:00
Albert Hopkins f79cc8a353 Move appliances/configs/scripts to seperate directories.
Instead of having everything in the root directory, split them in seperate
directories (appliances, scripts, & configs).  This makes things a little
tidier.

Also added a now Makefile target, appliance-list, that prints a list of the
available appliances.  The split directory change made this easier.
2014-06-09 02:26:17 +00:00
Albert Hopkins 62e960d256 Makefile: Change the way we sync the stae3 (again)
It wassn't working for x86.. although I swore it did before...
2014-01-06 15:13:31 +00:00
Albert Hopkins 977fcd0d9c Long-overdue updates (phase 1) 2014-01-04 20:22:40 +00:00
Albert Hopkins 65d7f57a96 Makefile: Fix stage3 rsync (again) 2013-12-21 21:17:19 +00:00
Albert Hopkins 1510c83387 Makefile:sysconfig: remove deps for which there is no target.
They were already satisfied by the "preproot" target.

I found these errors when I tried "make -j2" (which still doesn' work yet,
but oh wel...)
2013-10-13 15:56:23 +00:00
Albert Hopkins 6d55ed0e69 Remove "archiving" options from tar commands.
GNU Tar can (usually) handle this automagically
2013-10-13 15:56:20 +00:00
Albert Hopkins a48eda1931 Makefile: Fix *_IMAGE targets.
So that the rebuild the image instead of using the existing one.
2013-09-29 01:38:29 +00:00
Albert Hopkins e53380d138 Makefile: Add a help target. 2013-09-16 23:26:48 +00:00
Albert Hopkins bc45946ca6 Makefile: add hostname to /etc/hostname 2013-09-08 01:14:57 +00:00
Albert Hopkins 5c52a3d2fa Makefile: ALlow for creation of swap-less appliances.
Also fix a bug where fstab (and hostname) were not (always) being updated.
2013-09-01 16:06:08 +00:00
Albert Hopkins 5dec02b5eb Makefile: Don't depend on the static dev tarball anymore.
devtmpfs can take care of this now.  So remove the dep and the tarball.
Also move the removal udev from init in the build-software target.
2013-09-01 15:15:47 +00:00
Albert Hopkins 9b62ddde0b Makefile: clean: Lazily umount filesystems. 2013-09-01 14:14:12 +00:00
Albert Hopkins eec5dbac8f Makefile: mkfs: Leave no reserved space for root. 2013-08-31 01:28:48 +00:00
Albert Hopkins 67239a5154 Makefile: We no longer use DOWNLOAD_DIR, so don't create it. 2013-08-30 19:05:43 +00:00
Albert Hopkins c902250e0d Makefile: unmount lazily so we don't have to sleep. 2013-08-27 19:54:41 +00:00
Albert Hopkins 3851a3fffb Don't autosync the stage3 tarball. 2013-08-26 21:21:17 +00:00
Albert Hopkins 4f16e5da66 Don't autosync portage. 2013-08-25 09:24:46 +00:00
Albert Hopkins e4e67f6e8e Makefile: Use saner options for mkfs.ext4
The previous ones didn't work anymore and where overly-complicated anyway.
2013-08-19 19:47:11 +00:00
Albert Hopkins 991a2885a7 Makefile: Change the way we find stage3s.
The current method no longer works because the text file now contains
non-stage3 files, etc.  Eventually this needs to be cleaned up a little
better (using a helper script), but for now we add some extra greps.
2013-08-19 18:21:15 +00:00
Albert Hopkins 344f1bb1eb Makefile: update to the first profile. 2013-07-22 13:13:55 +00:00
Albert Hopkins 81df9f06fa Use CURDIR instead of PWD. 2012-12-29 16:29:42 +00:00
Albert Hopkins efb798385f Add kernel config support for 32bit. 2012-12-23 07:32:28 +00:00
Albert Hopkins f4f5393f64 Introduce appliance-level make.conf 2012-12-23 01:47:26 +00:00
Albert Hopkins b9200a5214 Makefile: change the way we test if the world file is empty.
Use stat(1) instead of catting the file.
2012-12-22 01:05:02 +00:00
Albert Hopkins 63bd1bdad8 Actually enable 32bit builds.
This only works with paravirt so far.  Need to create a kernel .config for
x86.
2012-12-21 19:12:25 +00:00
Albert Hopkins d2eb7124a7 Use busybox for dhcp and acpi. 2012-12-16 15:49:21 +00:00
Albert Hopkins 4eeb3c6028 Various update to Makefile and make.conf. 2012-12-10 18:13:55 +00:00
Albert Hopkins 431b02c267 Use xz compression for stage4 tarballs.
* And remove dud stage4 removal in "clean" target.
2012-11-15 13:30:30 +00:00
Albert Hopkins c296f81f35 Remove prelinking.. it doesn't seem to make any difference and only take up time. 2012-07-01 12:19:15 +00:00
Albert Hopkins 98c72eec57 Show some progress messages along the build process 2012-06-29 02:44:00 +00:00
Albert Hopkins 048bdee1d1 Makefile: add extra inodes to images in mkfs 2012-06-28 11:35:05 +00:00
Albert Hopkins 7cd3603efa Makefile: various updates 2012-05-25 16:33:40 +00:00
Albert Hopkins 9beba9e7be Makefile performance tweaks. Remove previous $(CHROOT)/usr/portage prior to unpacking. 2012-02-02 14:11:59 +00:00
Albert Hopkins c7a56139e2 Added "Airport" virtual appliance: see https://bitbucket.org/marduk/airport 2012-01-09 21:21:06 +00:00
Albert Hopkins 2ba82fb92b Add EXTRA_WORLD Makefile variable to add extra packages to world 2011-11-16 11:44:32 +00:00
Albert Hopkins 86c20fb37a Switch to GUID partitioning 2011-10-04 16:36:19 +00:00
Albert Hopkins 4ef87cf061 Makefile: missing "else" caused udev to be enabled when UDEV=NO 2011-09-16 14:37:35 +00:00
Albert Hopkins 421a03dada Fix issue where /sys wasn't being mounted with UDEV=NO 2011-07-21 10:32:09 +00:00
Albert Hopkins 682d0e14aa Fix problem where kernel.sh wasn't actually building a new kernel. 2011-07-17 22:10:57 +00:00
Albert Hopkins d2d0adf57e Makfile: fixed bug where PRUNE_CRITICAL=YES didn't work 2011-07-15 15:25:54 +00:00
Albert Hopkins acef5c4a24 Added custom /etc/motd to each image (based on a script)
Removed minimal use flag for pambase as it disables motd
2011-07-12 20:15:55 +00:00
Albert Hopkins 962ae4b1e7 Default chroot directory should not fail when used in the appliance's Makefile 2011-07-07 01:40:20 +00:00
Albert Hopkins 581a30ec7f Only enable serial console when HEADLESS=YES 2011-07-01 13:58:26 -04:00
Albert Hopkins c5ffd84db2 * Move all the kernel-building logic to a seperate shell script
* Make the Makefile less ugly and embarrassing (I hope)

* Remove the stage3 devnode fix as the latest stage3s appear fixed
2011-06-29 00:43:12 -04:00
Albert Hopkins 23e20007a9 Make it so no kernel is compiled if a kernel is installed in /boot and an
emerge will only install the same kernel.

This (and other) logic really needs to be moved out of Makefile and into a
shell script where it can be better maintained and not look so ugly.
2011-06-28 08:20:05 -04:00
Albert Hopkins 3077913344 * kernel: Don't pass "-n" to emerge when emerging the kernel as stage4s
don't have the kernel sources and subsequent builds will fail

* kernel: Remove any old kernel and modules before installing new

* Don't link /bin/sh to dash if DASH != YES

* Add appliance name and creation date comments to package list files
2011-06-27 06:43:59 -04:00
Albert Hopkins a545aca3b2 UDEV=NO: Don't delete and then re-create dev nodes that are in the tarball.
Also create more virtio disk nodes
2011-06-25 21:48:16 -04:00
Albert Hopkins 1878dd94d9 Make package list a Makefile variable
Add .lst files to .hgignore
2011-06-25 13:44:02 -04:00
Albert Hopkins 6f594daebb Since RIT.edu's mirror is 30+ days behind, switch rsync mirror to GA Tech 2011-06-24 22:48:07 -04:00
Albert Hopkins 40330d8858 Add preliminary support for Xen Virtual Appliance (xva) images. 2011-06-23 09:09:41 -04:00
Albert Hopkins d86cb09e04 * New Makefile variable PKGLIST. When set to 1 will create a file outside the
appliance with the list of installed packages on that appliance.  PKGLIST
  is off by default.

* Works with baselayout-2 stage3s, including the fix for the current broken
  stage3 tarballs.

* The new stage3 tarballs are much more limited as far as what dev nodes
  are included.  In addition to being broken stage3s themselves, it also
  broke the UDEV=NO option.  So I have included my own device node tarball
  which is installed when UDEV=NO.

* Put double quotes around hostname in /etc/conf.d/hostname.
2011-06-22 21:42:59 -04:00
Albert Hopkins ea6bda4f2e Don't set system Python to python-3* 2011-06-08 07:23:19 -04:00
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