]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Rewrite of packaging code.
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 6 May 2009 16:38:45 +0000 (18:38 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 6 May 2009 16:38:45 +0000 (18:38 +0200)
lfs/Config
lfs/cdrom [changed from symlink to file mode: 0644]
lfs/images
lfs/images-core [new symlink]
lfs/images-info [new symlink]
lfs/images-initramfs [new symlink]
lfs/images-overlays [new symlink]
lfs/pxe
make.sh
src/pakfire/decompressor

index 0b084615bff03c8d3ff3fedf840d3475a4a90be2..44a1bc7098c89f39e1fa8470151d68cbb909cdf7 100644 (file)
@@ -71,6 +71,8 @@ CONFIGURE_ARCH = \
 
 PKG_PACKAGE=$(PKG_NAME)-$(PKG_VER)-$(SNAME)$(PKG_REL).$(TARGET).ipk
 
+IMAGE_FILE  = $(IMAGES_DIR)/$(SNAME)-$(VERSION).sfs
+
 ###############################################################################
 # Common Macro Definitions
 ###############################################################################
@@ -112,11 +114,9 @@ define DO_PKG_INFO
 endef
 
 define DO_PACKAGE
-       if [ -n "$$ROOTFILE" ]; then \
-               NAME=$(NAME) SNAME=$(SNAME) VERSION=$(VERSION) KVER=$(KVER) \
-               TARGET=$(TARGET) MACHINE=$(MACHINE) IFS_TARGET=$(IFS_TARGET) \
-                       $(DIR_SOURCE)/pakfire/compressor $(PKG_PACKAGE) $$ROOTFILE; \
-       fi
+       NAME=$(NAME) SNAME=$(SNAME) VERSION=$(VERSION) KVER=$(KVER) \
+       TARGET=$(TARGET) MACHINE=$(MACHINE) IFS_TARGET=$(IFS_TARGET) \
+               $(DIR_SOURCE)/pakfire/compressor $(PKG_PACKAGE) $$ROOTFILE
 endef
 
 # For each package we create a list of files that it installed under 
deleted file mode 120000 (symlink)
index 5e798fa0ef25a954e199245461ba4f5cb982829a..0000000000000000000000000000000000000000
--- a/lfs/cdrom
+++ /dev/null
@@ -1 +0,0 @@
-images
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..c664ef8b257e9bbfe34b61bcd4db0a266ba7528a
--- /dev/null
+++ b/lfs/cdrom
@@ -0,0 +1,109 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+PKG_NAME   = cdrom
+PKG_VER    =
+PKG_REL    = -1
+
+THISAPP    = $(PKG_NAME)
+
+OBJECT     = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP)
+
+MAINTAINER =
+GROUP      =
+CORE       = no
+EXTRA      = no
+DEBUG      = no
+DEPS       = images-core images-info images-initramfs images-overlays
+
+URL        =
+LICENSE    =
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects =
+
+download: $(objects)
+
+info:
+       $(DO_PKG_INFO)
+
+install: $(OBJECT)
+
+package:
+       @$(DO_PACKAGE)
+
+$(objects):
+       @$(LOAD)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(OBJECT): $(objects)
+       @rm -rf $(CDROM_DIR)/* $(CDROM_DIR)/.$(SNAME)info
+
+       mkdir -pv $(CDROM_DIR)/{isolinux,doc}
+
+       # Copy image and all overlays
+       cp -vf $(IMAGE_FILE) $(IMAGES_DIR)/*.overlay $(CDROM_DIR)
+
+       # Install documentation
+       cp -vf $(DIR_SRC)/doc/{COPYING,ChangeLog,packages-list.txt} $(CDROM_DIR)/doc
+       $(INSTALL_CONFIG) $(DIR_CONF)/cdrom/README.txt > $(CDROM_DIR)/README
+
+       # Install kernel and initramfs
+       cp -vf $(IMAGES_DIR)/initramfs-$(VERSION).img $(CDROM_DIR)/isolinux/initrd0
+       cp -vf /boot/ipfirekernel-$(KVER) $(CDROM_DIR)/isolinux/$(SNAME)0
+
+       # If we have build the extras, we copy them on
+       # the disk
+ifeq "$(BUILD_EXTRAS)" "1"
+       # Copying extra packages to cdrom
+       mkdir -pv $(CDROM_DIR)/packages
+       cd $(DIR_PACKAGES) && cp -vf $(PACKAGES_EXTRA) $(CDROM_DIR)/packages
+endif
+
+       # Install isolinux & configuration
+       cp -vf /usr/share/syslinux/{isolinux.bin,vesamenu.c32} \
+               /usr/lib/memtest86+/memtest.bin \
+               $(DIR_CONF)/bootloader/splash.{jpg,lss} \
+               $(DIR_CONF)/bootloader/*.msg $(CDROM_DIR)/isolinux/
+       $(INSTALL_CONFIG) $(DIR_CONF)/bootloader/installer.conf \
+               > $(CDROM_DIR)/$(PREFIX)/isolinux.cfg
+
+       # Info file
+       echo "Release: $(NAME)-$(VERSION)" >> $(CDROM_DIR)/.$(SNAME)info
+       echo "Build host: $$(hostname -f)" >> $(CDROM_DIR)/.$(SNAME)info
+       echo "Date: $$(date -u)" >> $(CDROM_DIR)/.$(SNAME)info
+
+       cd $(CDROM_DIR) && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
+               -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
+               -boot-load-size 4 -boot-info-table . > $(IMAGES_DIR)/$(IMAGENAME).iso
+
+       @rm -rf $(CDROM_DIR)/* $(CDROM_DIR)/.$(SNAME)info
index 905d63ab676eed0a7a82f30dc61451d1fea303ab..eab199b73d05dcbf7dabce695fc194c3901114f2 100644 (file)
@@ -42,20 +42,24 @@ DEPS       =
 URL        =
 LICENSE    =
 
-IMAGE_FILE = $(IMAGES_DIR)/$(SNAME)-$(VERSION).img
+ifeq "$(firstword $(MAKEFILE_LIST))" "images-initramfs"
+       PASS = initramfs
+endif
+
+ifeq "$(firstword $(MAKEFILE_LIST))" "images-overlays"
+       PASS = overlays
+endif
 
-PASS       = $(firstword $(MAKEFILE_LIST))
+ifeq "$(firstword $(MAKEFILE_LIST))" "images-core"
+       PASS = core
+endif
 
-ifeq "$(PASS)" "pxe"
-       PREFIX = $(SNAME)-$(VERSION)
-else
-       DEPS2 = $(IMAGE_FILE)
-       PREFIX = isolinux
+ifeq "$(firstword $(MAKEFILE_LIST))" "images-info"
+       PASS = info
 endif
 
-ROOTFILES  = $(DIR_SOURCE)/rootfiles/core
-ifeq "$(BUILD_DEBUG)" "1"
-       ROOTFILES += $(DIR_SOURCE)/rootfiles/debug
+ifneq "$(PASS)" ""
+       PKG_NAME = images-$(PASS)
 endif
 
 ###############################################################################
@@ -81,96 +85,33 @@ $(objects):
 # Installation Details
 ###############################################################################
 
-$(IMAGE_FILE):
-       @rm -rf $(IMAGES_DIR)/$(SNAME)-$(VERSION).img /tmp/$(SNAME)-$(VERSION)
-
-       # For the moment, we extract all available packages.
-       cd $(DIR_PACKAGES) && $(DIR_SOURCE)/pakfire/decompressor --root=/tmp/$(SNAME)-$(VERSION) $(PACKAGES_CORE)
-
-       # Do some tests im the environment is sane
-       ldconfig -r /tmp/$(SNAME)-$(VERSION)
-
-       cd /tmp/$(SNAME)-$(VERSION) && mksquashfs * $(IMAGES_DIR)/$(SNAME)-$(VERSION).img -b 1M
-       rm -rf /tmp/$(SNAME)-$(VERSION)
-
-$(OBJECT): $(objects) $(DEPS2)
-       @rm -rf $(CDROM_DIR)/* $(CDROM_DIR)/.$(SNAME)info
+$(OBJECT): $(objects)
 
-ifeq "$(PASS)" "pxe"
-       mkdir -pv $(CDROM_DIR)/{pxelinux.cfg,$(PREFIX)}
+ifeq "$(PASS)" "info"
+       # info file
+       (echo "Release: $(NAME)-$(VERSION) ($(SLOGAN))"; \
+        echo "Build host: $$(hostname -f)"; \
+        echo "Date: $$(date -u)") >> $(IMAGES_DIR)/.$(SNAME)info
 endif
 
-ifeq "$(PASS)" "cdrom"
-       mkdir -pv $(CDROM_DIR)/{isolinux,doc}
-
-       cp -vf $(IMAGES_DIR)/$(SNAME)-$(VERSION).img $(CDROM_DIR)
-       cd $(CDROM_DIR) && unsquashfs -ls $(SNAME)-$(VERSION).img > $(SNAME)-$(VERSION).ls
-
-       cd $(INSTALLER_DIR) && mksquashfs * $(CDROM_DIR)/pomona-$(VERSION).overlay -b 1M
-
-       # These files won't be included in the iso
-       @rm -rf $(CDROM_DIR)/archive.{files,errors} $(CDROM_DIR)/tmp
-
-       # Other files
-       sed 's/VERSION/$(VERSION)/' $(DIR_CONF)/cdrom/README.txt > $(CDROM_DIR)/README
-       cp -vf $(DIR_SRC)/doc/COPYING $(CDROM_DIR)
-       cp -vf $(DIR_SRC)/doc/{ChangeLog,packages-list.txt} $(CDROM_DIR)/doc
+ifeq "$(PASS)" "initramfs"
+       mkliveramfs -v -f --with-net $(IMAGES_DIR)/initramfs-$(VERSION).img $(KVER)
 endif
 
-ifneq "$(PASS)" "$(THISAPP)"
-       cp -vf $(IMAGES_DIR)/initramfs-$(VERSION).img $(CDROM_DIR)/$(PREFIX)/initrd0
-       cp -vf /boot/ipfirekernel-$(KVER) $(CDROM_DIR)/$(PREFIX)/$(SNAME)0
+ifeq "$(PASS)" "core"
+       @rm -rf /tmp/$(SNAME)-$(VERSION)
 
-       cp -vf /usr/share/syslinux/vesamenu.c32 \
-               $(DIR_CONF)/bootloader/splash.{jpg,lss} \
-               $(DIR_CONF)/bootloader/*.msg \
-                       $(CDROM_DIR)/$(PREFIX)/
-endif
+       cd $(DIR_PACKAGES) && $(DIR_SOURCE)/pakfire/decompressor \
+               --root=/tmp/$(SNAME)-$(VERSION) $(PACKAGES_CORE)
 
-ifeq "$(PASS)" "pxe"
-       cp -vf /usr/share/syslinux/pxelinux.0 $(CDROM_DIR)/
-       sed     -e "s/SNAME/$(SNAME)/g" \
-               -e "s/NAME/$(NAME)/g" \
-               -e "s/VERSION/$(VERSION)/g" \
-               -e "s@$(SNAME)0@$(PREFIX)/$(SNAME)0@g" \
-               -e "s@initrd0@$(PREFIX)/initrd0@g" \
-               -e "s@splash@$(PREFIX)/splash@g" \
-               -e "s@vesamenu.c32@$(PREFIX)/vesamenu.c32@g" \
-               $(DIR_CONF)/bootloader/installer.conf \
-               > $(CDROM_DIR)/pxelinux.cfg/$(SNAME)-pxe-$(VERSION).model
-
-       sed -e "s@splash@$(PREFIX)/splash@g" \
-               -i $(CDROM_DIR)/$(PREFIX)/boot.msg
-
-       cd $(CDROM_DIR) && \
-               tar cfz $(IMAGES_DIR)/$(IMAGENAME).pxe.tar.gz *
-endif
+       # Do some tests im the environment is sane
+       ldconfig -r /tmp/$(SNAME)-$(VERSION)
 
-ifeq "$(PASS)" "cdrom"
-       cp -vf /usr/share/syslinux/isolinux.bin $(CDROM_DIR)/$(PREFIX)/
-
-       # Copying extra packages to cdrom
-       mkdir -pv $(CDROM_DIR)/packages
-       for package in $(PACKAGES_EXTRA); do \
-               cp -vf $(DIR_PACKAGES)/$$package $(CDROM_DIR)/packages; \
-       done
-       sed     -e "s/SNAME/$(SNAME)/g" \
-               -e "s/NAME/$(NAME)/g" \
-               -e "s/VERSION/$(VERSION)/g" \
-               $(DIR_CONF)/bootloader/installer.conf \
-               > $(CDROM_DIR)/$(PREFIX)/isolinux.cfg
-       cp -vf /usr/lib/memtest86+/memtest.bin $(CDROM_DIR)/$(PREFIX)/memtest
+       cd /tmp/$(SNAME)-$(VERSION) && mksquashfs * $(IMAGE_FILE) -b 1M -noappend
+       rm -rf /tmp/$(SNAME)-$(VERSION)
+endif
 
-       # info file
-       echo "Release: $(NAME)-$(VERSION)" >> $(CDROM_DIR)/.$(SNAME)info
-       echo "Build host: $$(hostname)" >> $(CDROM_DIR)/.$(SNAME)info
-       echo "Date: $$(date)" >> $(CDROM_DIR)/.$(SNAME)info
-       echo "SHA1: $$(sha1sum $(CDROM_DIR)/$(SNAME)-$(VERSION).img | awk '{ print $$1 }')" \
-               >> $(CDROM_DIR)/.$(SNAME)info
-
-       cd $(CDROM_DIR) && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
-               -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
-               -boot-info-table . > $(IMAGES_DIR)/$(IMAGENAME).iso
+ifeq "$(PASS)" "overlays"
+       # Creating installer's overlay
+       cd $(INSTALLER_DIR) && mksquashfs * $(IMAGES_DIR)/pomona-$(VERSION).overlay -b 1M -noappend
 endif
-       
-       @rm -rf $(CDROM_DIR)/* $(CDROM_DIR)/.$(SNAME)info
diff --git a/lfs/images-core b/lfs/images-core
new file mode 120000 (symlink)
index 0000000..5e798fa
--- /dev/null
@@ -0,0 +1 @@
+images
\ No newline at end of file
diff --git a/lfs/images-info b/lfs/images-info
new file mode 120000 (symlink)
index 0000000..5e798fa
--- /dev/null
@@ -0,0 +1 @@
+images
\ No newline at end of file
diff --git a/lfs/images-initramfs b/lfs/images-initramfs
new file mode 120000 (symlink)
index 0000000..5e798fa
--- /dev/null
@@ -0,0 +1 @@
+images
\ No newline at end of file
diff --git a/lfs/images-overlays b/lfs/images-overlays
new file mode 120000 (symlink)
index 0000000..5e798fa
--- /dev/null
@@ -0,0 +1 @@
+images
\ No newline at end of file
diff --git a/lfs/pxe b/lfs/pxe
index a9aea00ab1cb1c4825588d5ec974123e21e10b7c..0403dcd4694038275f7d895bd25cdb899bd45f56 100644 (file)
--- a/lfs/pxe
+++ b/lfs/pxe
@@ -37,7 +37,7 @@ GROUP      =
 CORE       = no
 EXTRA      = no
 DEBUG      = no
-DEPS       =
+DEPS       = images-initramfs
 
 URL        =
 LICENSE    =
@@ -70,9 +70,8 @@ $(objects):
 $(OBJECT): $(objects)
        @rm -rf $(PXE_DIR)/* && mkdir -pv $(PXE_DIR)/{pxelinux.cfg,$(SNAME)}
 
-       # Make image with networking support
-       mkliveramfs -f --with-net $(CDROM_DIR)/$(SNAME)/initrd0 $(KVER)
-
+       # Copy image with networking support
+       cp -vf $(IMAGES_DIR)/initramfs-$(VERSION).img $(CDROM_DIR)/$(SNAME)/initrd0
        cp -vf /boot/ipfirekernel-$(KVER) $(CDROM_DIR)/$(SNAME)/$(SNAME)0
        cp -vf /usr/share/syslinux/vesamenu.c32 \
                $(DIR_CONF)/bootloader/splash.{jpg,lss} \
diff --git a/make.sh b/make.sh
index 9b0ceaeb634dba5b3dc2e0914baa974f07bd63be..3e9e71a8c66af72558cd05107eaf95b696ecbcfc 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -472,8 +472,10 @@ packages_build() {
        beautify message DONE
 
        if [ ${EMB} -eq 0 ]; then
-               ipfire_make initramfs
-               ipfire_make images
+               ipfire_make images-core
+               ipfire_make images-info
+               ipfire_make images-initramfs
+               ipfire_make images-overlays
                ipfire_make pxe
                ipfire_make cdrom
 
index 337a4deab48592a4c9e246024806d857ff419334..75bc101f217e04c32d5dd7cfaad8fd6193db0ff7 100755 (executable)
@@ -50,6 +50,9 @@ if [ "$ROOT" != "/" ]; then
        fi
 fi
 
+# Sort all packages
+FILES=$(for i in $FILES; do echo $i; done | sort -u)
+
 for file in $FILES; do
        echo "Extracting $file..."
        lzma -cd $file | cpio -diu --no-absolute-filenames --quiet