Show some progress messages along the build process
This commit is contained in:
parent
7ea5be2bf9
commit
98c72eec57
19
Makefile
19
Makefile
|
@ -88,6 +88,7 @@ $(RAW_IMAGE):
|
||||||
qemu-img create -f raw $(RAW_IMAGE) $(DISK_SIZE)
|
qemu-img create -f raw $(RAW_IMAGE) $(DISK_SIZE)
|
||||||
|
|
||||||
partitions: $(RAW_IMAGE)
|
partitions: $(RAW_IMAGE)
|
||||||
|
@./echo Creating partition layout
|
||||||
parted -s $(RAW_IMAGE) mklabel gpt
|
parted -s $(RAW_IMAGE) mklabel gpt
|
||||||
parted -s $(RAW_IMAGE) mkpart primary 1 $(DISK_SIZE)
|
parted -s $(RAW_IMAGE) mkpart primary 1 $(DISK_SIZE)
|
||||||
parted -s $(RAW_IMAGE) set 1 boot on
|
parted -s $(RAW_IMAGE) set 1 boot on
|
||||||
|
@ -98,6 +99,7 @@ partitions: $(RAW_IMAGE)
|
||||||
touch partitions
|
touch partitions
|
||||||
|
|
||||||
mounts: stage3
|
mounts: stage3
|
||||||
|
@./echo Creating chroot in $(CHROOT)
|
||||||
mkdir -p $(CHROOT)
|
mkdir -p $(CHROOT)
|
||||||
if [ ! -e mounts ] ; then \
|
if [ ! -e mounts ] ; then \
|
||||||
mount -t proc none $(CHROOT)/proc; \
|
mount -t proc none $(CHROOT)/proc; \
|
||||||
|
@ -107,13 +109,16 @@ mounts: stage3
|
||||||
touch mounts
|
touch mounts
|
||||||
|
|
||||||
sync_portage:
|
sync_portage:
|
||||||
|
@./echo Grabbing latest portage snapshot
|
||||||
rsync --no-motd -L $(RSYNC_MIRROR)/snapshots/portage-latest.tar.bz2 portage-latest.tar.bz2
|
rsync --no-motd -L $(RSYNC_MIRROR)/snapshots/portage-latest.tar.bz2 portage-latest.tar.bz2
|
||||||
touch sync_portage
|
touch sync_portage
|
||||||
|
|
||||||
portage: sync_portage stage3
|
portage: sync_portage stage3
|
||||||
|
@./echo Unpacking portage snapshot
|
||||||
rm -rf $(CHROOT)/usr/portage
|
rm -rf $(CHROOT)/usr/portage
|
||||||
tar xjf portage-latest.tar.bz2 -C $(CHROOT)/usr
|
tar xjf portage-latest.tar.bz2 -C $(CHROOT)/usr
|
||||||
ifeq ($(EMERGE_RSYNC),YES)
|
ifeq ($(EMERGE_RSYNC),YES)
|
||||||
|
@./echo Syncing portage tree
|
||||||
$(inroot) emerge --sync --quiet
|
$(inroot) emerge --sync --quiet
|
||||||
endif
|
endif
|
||||||
ifdef PKGDIR
|
ifdef PKGDIR
|
||||||
|
@ -130,10 +135,12 @@ preproot: stage3 mounts portage
|
||||||
stage3:
|
stage3:
|
||||||
mkdir -p $(CHROOT)
|
mkdir -p $(CHROOT)
|
||||||
ifdef stage4-exists
|
ifdef stage4-exists
|
||||||
|
@./echo Using stage4 tarball: $(STAGE4_TARBALL)
|
||||||
tar xjpf "$(STAGE4_TARBALL)" -C $(CHROOT)
|
tar xjpf "$(STAGE4_TARBALL)" -C $(CHROOT)
|
||||||
else
|
else
|
||||||
rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/latest-stage3.txt .
|
rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/latest-stage3.txt .
|
||||||
rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/`tail -n 1 latest-stage3.txt` stage3-$(ARCH)-latest.tar.bz2
|
rsync --no-motd $(RSYNC_MIRROR)/releases/`echo $(ARCH)|sed 's/i.86/x86/'`/autobuilds/`tail -n 1 latest-stage3.txt` stage3-$(ARCH)-latest.tar.bz2
|
||||||
|
@./echo Using stage3 tarball
|
||||||
tar xjpf stage3-$(ARCH)-latest.tar.bz2 -C $(CHROOT)
|
tar xjpf stage3-$(ARCH)-latest.tar.bz2 -C $(CHROOT)
|
||||||
endif
|
endif
|
||||||
touch stage3
|
touch stage3
|
||||||
|
@ -159,6 +166,7 @@ kernel: base_system $(KERNEL_CONFIG) kernel.sh
|
||||||
$(inroot) cp /usr/share/zoneinfo/$(TIMEZONE) /etc/localtime
|
$(inroot) cp /usr/share/zoneinfo/$(TIMEZONE) /etc/localtime
|
||||||
echo $(TIMEZONE) > "$(CHROOT)"/etc/timezone
|
echo $(TIMEZONE) > "$(CHROOT)"/etc/timezone
|
||||||
ifneq ($(EXTERNAL_KERNEL),YES)
|
ifneq ($(EXTERNAL_KERNEL),YES)
|
||||||
|
@./echo Configuring kernel
|
||||||
cp $(KERNEL_CONFIG) $(CHROOT)/root/kernel.config
|
cp $(KERNEL_CONFIG) $(CHROOT)/root/kernel.config
|
||||||
cp kernel.sh $(CHROOT)/tmp/kernel.sh
|
cp kernel.sh $(CHROOT)/tmp/kernel.sh
|
||||||
KERNEL=$(KERNEL) EMERGE="$(EMERGE)" USEPKG="$(USEPKG)" MAKEOPTS="$(MAKEOPTS)" \
|
KERNEL=$(KERNEL) EMERGE="$(EMERGE)" USEPKG="$(USEPKG)" MAKEOPTS="$(MAKEOPTS)" \
|
||||||
|
@ -168,6 +176,7 @@ endif
|
||||||
touch kernel
|
touch kernel
|
||||||
|
|
||||||
$(SWAP_FILE): preproot
|
$(SWAP_FILE): preproot
|
||||||
|
@./echo Creating swap file: $(SWAP_FILE)
|
||||||
dd if=/dev/zero of=$(SWAP_FILE) bs=1M count=$(SWAP_SIZE)
|
dd if=/dev/zero of=$(SWAP_FILE) bs=1M count=$(SWAP_SIZE)
|
||||||
/sbin/mkswap $(SWAP_FILE)
|
/sbin/mkswap $(SWAP_FILE)
|
||||||
|
|
||||||
|
@ -200,6 +209,7 @@ endif
|
||||||
touch sysconfig
|
touch sysconfig
|
||||||
|
|
||||||
systools: sysconfig compile_options
|
systools: sysconfig compile_options
|
||||||
|
@./echo Installing standard system tools
|
||||||
$(inroot) $(EMERGE) -n $(USEPKG) app-admin/metalog
|
$(inroot) $(EMERGE) -n $(USEPKG) app-admin/metalog
|
||||||
$(inroot) /sbin/rc-update add metalog default
|
$(inroot) /sbin/rc-update add metalog default
|
||||||
$(inroot) $(EMERGE) -n $(USEPKG) sys-power/acpid
|
$(inroot) $(EMERGE) -n $(USEPKG) sys-power/acpid
|
||||||
|
@ -217,6 +227,7 @@ endif
|
||||||
|
|
||||||
grub: stage3 grub.conf kernel partitions
|
grub: stage3 grub.conf kernel partitions
|
||||||
ifneq ($(EXTERNAL_KERNEL),YES)
|
ifneq ($(EXTERNAL_KERNEL),YES)
|
||||||
|
@./echo Installing Grub
|
||||||
$(inroot) $(EMERGE) -nN $(USEPKG) sys-boot/grub
|
$(inroot) $(EMERGE) -nN $(USEPKG) sys-boot/grub
|
||||||
cp grub.conf $(CHROOT)/boot/grub/grub.conf
|
cp grub.conf $(CHROOT)/boot/grub/grub.conf
|
||||||
ifeq ($(VIRTIO),YES)
|
ifeq ($(VIRTIO),YES)
|
||||||
|
@ -229,6 +240,7 @@ endif
|
||||||
touch grub
|
touch grub
|
||||||
|
|
||||||
build-software: systools issue etc-update.conf $(CRITICAL) $(WORLD)
|
build-software: systools issue etc-update.conf $(CRITICAL) $(WORLD)
|
||||||
|
@./echo Building $(APPLIANCE)-specific software
|
||||||
$(MAKE) -C $(APPLIANCE) preinstall
|
$(MAKE) -C $(APPLIANCE) preinstall
|
||||||
cp etc-update.conf $(CHROOT)/etc/
|
cp etc-update.conf $(CHROOT)/etc/
|
||||||
|
|
||||||
|
@ -239,6 +251,7 @@ build-software: systools issue etc-update.conf $(CRITICAL) $(WORLD)
|
||||||
$(inroot) $(EMERGE) $(USEPKG) --update --newuse --deep `cat $(WORLD)` $(EXTRA_WORLD)
|
$(inroot) $(EMERGE) $(USEPKG) --update --newuse --deep `cat $(WORLD)` $(EXTRA_WORLD)
|
||||||
$(gcc_config)
|
$(gcc_config)
|
||||||
|
|
||||||
|
@./echo Running revdep-rebuild and prelink
|
||||||
# Need gentoolkit to run revdep-rebuild
|
# Need gentoolkit to run revdep-rebuild
|
||||||
$(inroot) $(EMERGE) -1n $(USEPKG) app-portage/gentoolkit sys-devel/prelink
|
$(inroot) $(EMERGE) -1n $(USEPKG) app-portage/gentoolkit sys-devel/prelink
|
||||||
$(inroot) revdep-rebuild -i
|
$(inroot) revdep-rebuild -i
|
||||||
|
@ -276,6 +289,7 @@ device-map: $(RAW_IMAGE)
|
||||||
echo '(hd0) ' $(RAW_IMAGE) > device-map
|
echo '(hd0) ' $(RAW_IMAGE) > device-map
|
||||||
|
|
||||||
image: kernel software device-map grub.shell grub dev.tar.bz2 motd.sh
|
image: kernel software device-map grub.shell grub dev.tar.bz2 motd.sh
|
||||||
|
@./echo Installing files to $(RAW_IMAGE)
|
||||||
mkdir -p loop
|
mkdir -p loop
|
||||||
mount -o noatime $(NBD_DEV)p1 loop
|
mount -o noatime $(NBD_DEV)p1 loop
|
||||||
mkdir -p gentoo
|
mkdir -p gentoo
|
||||||
|
@ -304,11 +318,13 @@ endif
|
||||||
touch image
|
touch image
|
||||||
|
|
||||||
$(QCOW_IMAGE): $(RAW_IMAGE) image
|
$(QCOW_IMAGE): $(RAW_IMAGE) image
|
||||||
|
@./echo Creating $(QCOW_IMAGE)
|
||||||
qemu-img convert -f raw -O qcow2 -c $(RAW_IMAGE) $(QCOW_IMAGE)
|
qemu-img convert -f raw -O qcow2 -c $(RAW_IMAGE) $(QCOW_IMAGE)
|
||||||
|
|
||||||
qcow: $(QCOW_IMAGE)
|
qcow: $(QCOW_IMAGE)
|
||||||
|
|
||||||
$(XVA_IMAGE): $(RAW_IMAGE) image
|
$(XVA_IMAGE): $(RAW_IMAGE) image
|
||||||
|
@./echo Creating $(XVA_IMAGE)
|
||||||
xva.py --disk=$(RAW_IMAGE) --is-hvm --memory=256 --vcpus=1 --name=$(APPLIANCE) \
|
xva.py --disk=$(RAW_IMAGE) --is-hvm --memory=256 --vcpus=1 --name=$(APPLIANCE) \
|
||||||
--filename=$(XVA_IMAGE)
|
--filename=$(XVA_IMAGE)
|
||||||
|
|
||||||
|
@ -316,11 +332,13 @@ xva: $(XVA_IMAGE)
|
||||||
|
|
||||||
|
|
||||||
$(VMDK_IMAGE): $(RAW_IMAGE) image
|
$(VMDK_IMAGE): $(RAW_IMAGE) image
|
||||||
|
@./echo Creating $(VMDK_IMAGE)
|
||||||
qemu-img convert -f raw -O vmdk $(RAW_IMAGE) $(VMDK_IMAGE)
|
qemu-img convert -f raw -O vmdk $(RAW_IMAGE) $(VMDK_IMAGE)
|
||||||
|
|
||||||
vmdk: $(VMDK_IMAGE)
|
vmdk: $(VMDK_IMAGE)
|
||||||
|
|
||||||
$(STAGE4_TARBALL): software kernel rsync-excludes rsync-excludes-critical
|
$(STAGE4_TARBALL): software kernel rsync-excludes rsync-excludes-critical
|
||||||
|
@./echo Creating stage4 tarball: $(STAGE4_TARBALL)
|
||||||
mkdir -p stage4
|
mkdir -p stage4
|
||||||
mkdir -p gentoo
|
mkdir -p gentoo
|
||||||
mount -o bind $(CHROOT) gentoo
|
mount -o bind $(CHROOT) gentoo
|
||||||
|
@ -333,6 +351,7 @@ stage4: $(STAGE4_TARBALL)
|
||||||
|
|
||||||
|
|
||||||
umount:
|
umount:
|
||||||
|
@./echo Attempting to unmount chroot mounts
|
||||||
ifdef PKGDIR
|
ifdef PKGDIR
|
||||||
umount $(CHROOT)/var/portage/packages
|
umount $(CHROOT)/var/portage/packages
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue