mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Merge branch 'fifteen' of ssh://git.ipfire.org/pub/git/ipfire-2.x into fifteen
This commit is contained in:
@@ -113,4 +113,5 @@ else
|
||||
cd /install/cdrom && mkisofs -J -r -V "$(NAME)_$(VERSION)" \
|
||||
-b boot/isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
-c boot/isolinux/boot.catalog . > /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
|
||||
isohybrid /install/images/$(SNAME)-$(VERSION).$(MACHINE)-full-core$(CORE).iso
|
||||
endif
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# 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
|
||||
|
||||
VER = kernel
|
||||
|
||||
include linux2
|
||||
|
||||
PROG = linux-xen
|
||||
SUP_ARCH = i586
|
||||
252
lfs/linux2
252
lfs/linux2
@@ -1,252 +0,0 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# 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
|
||||
|
||||
PATCHLEVEL = .61
|
||||
VER = 2.6.32.61
|
||||
|
||||
THISAPP = linux-$(VER)
|
||||
DL_FILE = $(THISAPP).tar.xz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
CFLAGS =
|
||||
CXXFLAGS =
|
||||
|
||||
PAK_VER = 27
|
||||
DEPS = ""
|
||||
|
||||
# Normal build or XEN build.
|
||||
#
|
||||
|
||||
VERSUFIX=ipfire$(KCFG)
|
||||
|
||||
ifeq "$(HEADERS)" "1"
|
||||
ifeq "$(TOOLS)" "1"
|
||||
TARGET = $(DIR_INFO)/linux-libc-headers-$(VER)-$(VERSUFIX)-tools
|
||||
HEADERS_PREFIX = /tools
|
||||
else
|
||||
TARGET = $(DIR_INFO)/linux-libc-headers-$(VER)-$(VERSUFIX)
|
||||
HEADERS_PREFIX = /usr
|
||||
endif
|
||||
else
|
||||
TARGET = $(DIR_INFO)/linux-xen-$(VER)-$(VERSUFIX)
|
||||
endif
|
||||
|
||||
ifeq "$(MACHINE_TYPE)" "arm"
|
||||
HEADERS_ARCH=arm
|
||||
else
|
||||
HEADERS_ARCH=x86
|
||||
endif
|
||||
|
||||
ifeq "$(KCFG)" ""
|
||||
LASTKERNEL=1
|
||||
endif
|
||||
ifeq "$(KCFG)" "-kirkwood"
|
||||
LASTKERNEL=1
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
objects =$(DL_FILE) \
|
||||
netfilter-layer7-v2.22.tar.gz \
|
||||
patch-2.6.16-nath323-1.3.bz2 \
|
||||
reiser4-for-2.6.32.patch.bz2 \
|
||||
xen-patches-2.6.32-2g.tar.bz2
|
||||
|
||||
$(DL_FILE) = $(URL_IPFIRE)/$(DL_FILE)
|
||||
netfilter-layer7-v2.22.tar.gz = $(URL_IPFIRE)/netfilter-layer7-v2.22.tar.gz
|
||||
patch-2.6.16-nath323-1.3.bz2 = $(URL_IPFIRE)/patch-2.6.16-nath323-1.3.bz2
|
||||
reiser4-for-2.6.32.patch.bz2 = $(URL_IPFIRE)/reiser4-for-2.6.32.patch.bz2
|
||||
xen-patches-2.6.32-2g.tar.bz2 = $(URL_IPFIRE)/xen-patches-2.6.32-2g.tar.bz2
|
||||
|
||||
$(DL_FILE)_MD5 = 37e0afeb308b27a81dafa55c367a6105
|
||||
netfilter-layer7-v2.22.tar.gz_MD5 = 98dff8a3d5a31885b73341633f69501f
|
||||
patch-2.6.16-nath323-1.3.bz2_MD5 = f926409ff703a307baf54b57ab75d138
|
||||
reiser4-for-2.6.32.patch.bz2_MD5 = 3246397973d9271eb8e6d7c97c5d2d91
|
||||
xen-patches-2.6.32-2g.tar.bz2_MD5 = d259a847c9aa73cd6e5c3605d9657d66
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
||||
|
||||
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
md5 : $(subst %,%_MD5,$(objects))
|
||||
|
||||
dist:
|
||||
@$(PAK)
|
||||
###############################################################################
|
||||
# Downloading, checking, md5sum
|
||||
###############################################################################
|
||||
|
||||
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
||||
@$(CHECK)
|
||||
|
||||
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
||||
@$(LOAD)
|
||||
|
||||
$(subst %,%_MD5,$(objects)) :
|
||||
@$(MD5)
|
||||
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) $(DIR_SRC)/linux $(DIR_SRC)/linux-*-suse_xen_patches $(DIR_SRC)/xen-* && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
|
||||
|
||||
ln -svf linux-$(VER) $(DIR_SRC)/linux
|
||||
|
||||
ifeq "$(KCFG)" "-xen"
|
||||
# Apply gentoo Xen patches
|
||||
mkdir -p $(DIR_SRC)/xen-patches
|
||||
cd $(DIR_SRC)/xen-patches && tar jxf $(DIR_DL)/xen-patches-2.6.32-2g.tar.bz2
|
||||
|
||||
for x in `ls -1 $(DIR_SRC)/xen-patches/*.patch1`; do \
|
||||
echo "*********** [Patch: $$x]"; \
|
||||
cd $(DIR_APP) && pwd && patch -Np1 < $$x || exit 1; \
|
||||
done
|
||||
rm -rf $(DIR_SRC)/xen-patches
|
||||
|
||||
# Linux Intermediate Queueing Device
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-xen-imq-test2.patch
|
||||
else
|
||||
# Linux Intermediate Queueing Device
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32-imq-test2.patch
|
||||
endif
|
||||
|
||||
# Reiser4 (don't check if fail (some patches are already in xen patchset)
|
||||
-cd $(DIR_APP) && bzcat $(DIR_DL)/reiser4-for-2.6.32.patch.bz2 | patch -Np1
|
||||
|
||||
# ipp2p 0.8.2-pomng
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.8-ipp2p-0.8.2-pomng.patch
|
||||
|
||||
# Layer7-patch
|
||||
cd $(DIR_SRC) && rm -rf $(DIR_SRC)/netfilter-layer7-v2.22
|
||||
cd $(DIR_SRC) && tar xzf $(DIR_DL)/netfilter-layer7-v2.22.tar.gz
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch
|
||||
|
||||
# Add some more LED triggers
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.11-netdev-1.patch
|
||||
|
||||
# Huawei Android Phones (Vodafone V845, T-Mobile Pulse/mini ...)
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.15-option_add_huawei_android.patch
|
||||
|
||||
# Fix uevent PHYSDEVDRIVER
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_ipg-fix-driver-name.patch
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.27_mcs7830-fix-driver-name.patch
|
||||
|
||||
# Fix mv_cesa
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32-crypto-mv_cesa.patch
|
||||
|
||||
ifeq "$(KCFG)" "-kirkwood"
|
||||
# Add dreamplug,guruplug and icy 62x0 support on ARM-kirkwood
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.57-arm_kirkwood_setups.patch
|
||||
endif
|
||||
|
||||
ifeq "$(MACHINE_TYPE)" "arm"
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.45_align_ssb_modtable_32bit_boundary.patch
|
||||
endif
|
||||
|
||||
ifeq "$(HEADERS)" "1"
|
||||
# Install the header files
|
||||
cd $(DIR_APP) && make ARCH=$(HEADERS_ARCH) INSTALL_HDR_PATH=dest headers_install
|
||||
-mkdir -pv $(BUILDROOT)/$(HEADERS_PREFIX)/include
|
||||
cd $(DIR_APP) && find dest/include \( -name .install -o -name ..install.cmd \) -delete
|
||||
cd $(DIR_APP) && cp -rv dest/include/* $(BUILDROOT)/$(HEADERS_PREFIX)/include
|
||||
else
|
||||
|
||||
# Install ipfire logo
|
||||
cd $(DIR_APP) && cp -vf $(DIR_SRC)/config/kernel/ipfire_logo.ppm \
|
||||
drivers/video/logo/logo_linux_clut224.ppm
|
||||
|
||||
# Cleanup kernel source
|
||||
cp $(DIR_SRC)/config/kernel/kernel.config.$(MACHINE)-$(VERSUFIX) $(DIR_APP)/.config
|
||||
cd $(DIR_APP) && make CC="$(KGCC)" oldconfig
|
||||
cd $(DIR_APP) && make CC="$(KGCC)" clean
|
||||
cd $(DIR_APP) && sed -i -e 's/EXTRAVERSION\ =.*/EXTRAVERSION\ =\ $(PATCHLEVEL)-$(VERSUFIX)/' Makefile
|
||||
|
||||
ifeq "$(KCFG)" "-xen"
|
||||
cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" vmlinuz
|
||||
cd $(DIR_APP) && cp -v arch/i386/boot/vmlinuz /boot/vmlinuz-$(VER)-$(VERSUFIX)
|
||||
else
|
||||
ifeq "$(KCFG)" "-kirkwood"
|
||||
cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" uImage
|
||||
cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
|
||||
cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
|
||||
else
|
||||
cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" bzImage
|
||||
cd $(DIR_APP) && cp -v arch/i386/boot/bzImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
|
||||
endif
|
||||
endif
|
||||
cd $(DIR_APP) && cp -v System.map /boot/System.map-$(VER)-$(VERSUFIX)
|
||||
cd $(DIR_APP) && cp -v .config /boot/config-$(VER)-$(VERSUFIX)
|
||||
ln -sf vmlinuz-$(VER)-$(VERSUFIX) /boot/vmlinuz-$(VERSUFIX)
|
||||
ln -sf System.map-$(VER)-$(VERSUFIX) /boot/System.map-$(VERSUFIX)
|
||||
cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules
|
||||
cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
|
||||
cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
|
||||
|
||||
ifeq "$(LASTKERNEL)" "1"
|
||||
# Only do this once
|
||||
cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/
|
||||
|
||||
# Blacklist matroxfb_base
|
||||
echo "blacklist matroxfb_base" >> /etc/modprobe.d/framebuffer
|
||||
# Blacklist old framebuffer modules
|
||||
for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/video -name *fb.ko); do \
|
||||
echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
|
||||
done
|
||||
# Blacklist new drm framebuffer modules
|
||||
for f in $$(ls -1 /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/gpu/drm/*/*.ko); do \
|
||||
echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/framebuffer ; \
|
||||
done
|
||||
sed -i -e "s|.ko||g" /etc/modprobe.d/framebuffer
|
||||
|
||||
# Blacklist isdn modules
|
||||
for f in $$(find /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn -name *.ko); do \
|
||||
echo "blacklist $$(basename $$f)" >> /etc/modprobe.d/isdn ; \
|
||||
done
|
||||
sed -i -e "s|.ko||g" /etc/modprobe.d/isdn
|
||||
|
||||
# Disable ipv6 at runtime
|
||||
echo "options ipv6 disable_ipv6=1" > /etc/modprobe.d/ipv6
|
||||
endif
|
||||
|
||||
# Remove mISDN modules
|
||||
rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/mISDN
|
||||
rm -rvf /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/isdn/hardware/mISDN
|
||||
|
||||
ifneq "$(MACHINE_TYPE)" "arm"
|
||||
# Disable geode_aes modul
|
||||
mv /lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko \
|
||||
/lib/modules/$(VER)-$(VERSUFIX)/kernel/drivers/crypto/geode-aes.ko.off
|
||||
endif
|
||||
endif
|
||||
|
||||
@rm -rf $(DIR_SRC)/patch-o-matic* $(DIR_SRC)/iptables* $(DIR_SRC)/squashfs* $(DIR_SRC)/netfilter-layer7-*
|
||||
@$(POSTBUILD)
|
||||
101
lfs/usb-stick
101
lfs/usb-stick
@@ -1,101 +0,0 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# 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
|
||||
|
||||
VER = ipfire
|
||||
|
||||
THISAPP = usb-stick
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
check :
|
||||
|
||||
download :
|
||||
|
||||
md5 :
|
||||
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
IMGfdd := /install/images/$(SNAME)-$(VERSION)-install-usb-fdd.$(MACHINE)-full-core$(CORE).img
|
||||
IMGhdd := /install/images/$(SNAME)-$(VERSION)-install-usb-hdd.$(MACHINE)-full-core$(CORE).img
|
||||
IMGfs := /install/images/fs
|
||||
|
||||
DISKSIZE=120000
|
||||
|
||||
define COPY_TO_IMG
|
||||
mkdosfs -n IPFIRE -F 16 -I $$IMAGE && \
|
||||
for i in /0 `seq 0 7`; do \
|
||||
[ -e /dev/loop$${i} ] || continue; \
|
||||
if (! losetup /dev/loop$${i} >/dev/null 2>&1 ); then \
|
||||
LOOPDEV="/dev/loop$${i}"; \
|
||||
break; \
|
||||
fi; \
|
||||
done; \
|
||||
losetup $$LOOPDEV $$IMAGE && \
|
||||
mount -t vfat $$LOOPDEV /install/mnt && \
|
||||
cp -fR /install/cdrom/* /install/mnt && \
|
||||
mv /install/mnt/boot/isolinux /install/mnt/boot/syslinux && \
|
||||
mv /install/mnt/boot/syslinux/isolinux.cfg \
|
||||
/install/mnt/boot/syslinux/syslinux.cfg && \
|
||||
umount /install/mnt && \
|
||||
losetup -d $$LOOPDEV && \
|
||||
syslinux $$IMAGE
|
||||
endef
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
# usb-fdd superfloppy (partitionless)
|
||||
# compute size +32 blocks for bootsector/fat/etc...
|
||||
dd bs=1024 count=$$((`du -k -s /install/cdrom | awk '{print $$1}'` + 2048 )) \
|
||||
if=/dev/zero \
|
||||
of=$(IMGfdd)
|
||||
IMAGE=$(IMGfdd); $(COPY_TO_IMG)
|
||||
|
||||
# Partitionned images : make a file system bigger than iso size
|
||||
# that fit on 128MB key to let free space available
|
||||
# on the unique partition. Image will be compressed later
|
||||
dd bs=1k if=/dev/zero of=$(IMGfs) count=$(DISKSIZE)
|
||||
IMAGE=$(IMGfs); $(COPY_TO_IMG)
|
||||
|
||||
# usb-hdd (64 heads, 32 sectors geometry, on a partition 1)
|
||||
# use 64 heads as 256 does not work on Award bios (Asus A7V8X-X Gilles)
|
||||
# use 32 sectors a minima or device is not recognised as hard disk (Frank)
|
||||
# add 32 to IMGfs as first partition start at 32
|
||||
COUNT=$$((`du -k -s $(IMGfs) | awk '{print $$1}'` + 32 )); \
|
||||
dd bs=1k if=/dev/zero of=$(IMGhdd) count=$$COUNT
|
||||
# write mbr before partitioning save a 'not msdos fs' warning from sfdisk
|
||||
/usr/sbin/install-mbr -f $(IMGhdd)
|
||||
echo -e "0,,6,*\n;\n;\n;" | sfdisk -qLD -H 64 -S 32 $(IMGhdd)
|
||||
# copy the entire partition, make the fs and dd back
|
||||
dd if=$(IMGfs) of=$(IMGhdd) bs=512 seek=32
|
||||
|
||||
gzip -f9 $(IMGfdd) $(IMGhdd)
|
||||
rm -rf $$LFS/tmp/* $(IMGfs)
|
||||
146
lfs/xen-image
146
lfs/xen-image
@@ -1,7 +1,7 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
|
||||
# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
|
||||
# #
|
||||
# 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 #
|
||||
@@ -29,7 +29,7 @@ VER = ipfire
|
||||
THISAPP = xen-image
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
|
||||
KVER2 = `grep "^VER " $(DIR_SRC)/lfs/linux2 | sed "s| ||g" | cut -d"=" -f2`
|
||||
KERN_PACK = `grep "^PAK_VER " $(DIR_SRC)/lfs/linux | sed "s| ||g" | cut -d"=" -f2`
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
@@ -46,145 +46,21 @@ md5 :
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
IMGinst := /install/images/$(SNAME)-$(VERSION).xen.$(MACHINE)-full-core$(CORE).tar.bz2
|
||||
MNThdd := /install/harddisk
|
||||
|
||||
IMGboot := /install/images/$(SNAME)/$(SNAME)-boot.img
|
||||
IMGswap := /install/images/$(SNAME)/$(SNAME)-swap.img
|
||||
IMGroot := /install/images/$(SNAME)/$(SNAME)-root.img
|
||||
IMGvar := /install/images/$(SNAME)/$(SNAME)-var.img
|
||||
|
||||
SIZEboot := 30
|
||||
SIZEswap := 512
|
||||
SIZEroot := 512
|
||||
SIZEvar := 950
|
||||
IMGinst := /install/images/$(SNAME)-$(VERSION).xen.$(MACHINE)-downloader-core$(CORE).tar.bz2
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
rm -rf $(MNThdd) $(IMGinst) $(IMGroot) && mkdir -p $(MNThdd)
|
||||
mkdir -p /install/images/$(SNAME) # /boot
|
||||
|
||||
#Create bootimage
|
||||
dd bs=1M if=/dev/zero of=$(IMGboot) count=$(SIZEboot)
|
||||
mkfs.ext2 -F $(IMGboot)
|
||||
|
||||
#Create swapimage
|
||||
dd bs=1M if=/dev/zero of=$(IMGswap) count=$(SIZEswap)
|
||||
mkswap $(IMGswap)
|
||||
|
||||
#Create rootimage
|
||||
dd bs=1M if=/dev/zero of=$(IMGroot) count=$(SIZEroot)
|
||||
mkfs.ext3 -F $(IMGroot)
|
||||
|
||||
#Create varimage
|
||||
dd bs=1M if=/dev/zero of=$(IMGvar) count=$(SIZEvar)
|
||||
mkfs.ext3 -F $(IMGvar)
|
||||
|
||||
# Mount Images
|
||||
mount -o loop $(IMGroot) $(MNThdd)
|
||||
mkdir $(MNThdd)/boot
|
||||
mkdir $(MNThdd)/var
|
||||
mkdir $(MNThdd)/var/log
|
||||
mount -o loop $(IMGboot) $(MNThdd)/boot
|
||||
mount -o loop $(IMGvar) $(MNThdd)/var
|
||||
|
||||
# Install IPFire without kernel modules
|
||||
tar -C $(MNThdd)/ -xvf /install/cdrom/$(SNAME)-$(VERSION).tlz --lzma \
|
||||
--exclude=lib/modules* --exclude=boot*
|
||||
|
||||
#Install legacy Xen Kernel
|
||||
tar -C $(MNThdd)/opt/pakfire/tmp -xvf /install/packages/linux-xen-$(KVER2)-*.ipfire
|
||||
chroot $(MNThdd) /opt/pakfire/tmp/install.sh
|
||||
rm -rf $(MNThdd)/opt/pakfire/tmp/*
|
||||
|
||||
#Install pae Kernel
|
||||
tar -C $(MNThdd)/opt/pakfire/tmp -xvf /install/packages/linux-pae-$(KVER)-*.ipfire
|
||||
chroot $(MNThdd) /opt/pakfire/tmp/install.sh
|
||||
rm -rf $(MNThdd)/opt/pakfire/tmp/*
|
||||
|
||||
#Create grub menuentry for pygrub
|
||||
mkdir $(MNThdd)/boot/grub
|
||||
echo "timeout 10" > $(MNThdd)/boot/grub/grub.conf
|
||||
echo "default 0" >> $(MNThdd)/boot/grub/grub.conf
|
||||
echo "title IPFire (legacy XEN-Kernel)" >> $(MNThdd)/boot/grub/grub.conf
|
||||
echo " kernel /vmlinuz-$(KVER2)-ipfire-xen root=/dev/xvda3 rootdelay=10 panic=10 console=xvc0 ro" \
|
||||
>> $(MNThdd)/boot/grub/grub.conf
|
||||
echo " initrd /ipfirerd-$(KVER2)-xen.img" >> $(MNThdd)/boot/grub/grub.conf
|
||||
echo "# savedefault 0" >> $(MNThdd)/boot/grub/grub.conf
|
||||
echo "title IPFire (PAE-Kernel)" >> $(MNThdd)/boot/grub/grub.conf
|
||||
echo " kernel /vmlinuz-$(KVER)-ipfire-pae root=/dev/xvda3 rootdelay=10 panic=10 console=xvc0 ro" \
|
||||
>> $(MNThdd)/boot/grub/grub.conf
|
||||
echo " initrd /ipfirerd-$(KVER)-xen.img" >> $(MNThdd)/boot/grub/grub.conf
|
||||
echo "# savedefault 1" >> $(MNThdd)/boot/grub/grub.conf
|
||||
|
||||
ln -s grub.conf $(MNThdd)/boot/grub/menu.lst
|
||||
|
||||
#Copy the meta-info of linux-xen package
|
||||
cp -f /install/packages/meta-linux-xen $(MNThdd)/opt/pakfire/db/installed
|
||||
cp -f /install/packages/meta-linux-xen $(MNThdd)/opt/pakfire/db/meta
|
||||
cp -f /install/packages/meta-linux-pae $(MNThdd)/opt/pakfire/db/installed
|
||||
cp -f /install/packages/meta-linux-pae $(MNThdd)/opt/pakfire/db/meta
|
||||
|
||||
#Set default configuration
|
||||
echo "LANGUAGE=en" >> $(MNThdd)/var/ipfire/main/settings
|
||||
echo "HOSTNAME=$(SNAME)" >> $(MNThdd)/var/ipfire/main/settings
|
||||
echo "THEME=ipfire" >> $(MNThdd)/var/ipfire/main/settings
|
||||
touch $(MNThdd)/lib/modules/$(KVER2)-ipfire-xen/modules.dep
|
||||
mkdir $(MNThdd)/proc
|
||||
mount --bind /proc $(MNThdd)/proc
|
||||
mount --bind /dev $(MNThdd)/dev
|
||||
mount --bind /sys $(MNThdd)/sys
|
||||
chroot $(MNThdd) /usr/bin/perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
|
||||
sed -i -e "s|DEVICE1|/dev/xvda1|g" $(MNThdd)/etc/fstab
|
||||
sed -i -e "s|DEVICE2|/dev/xvda2|g" $(MNThdd)/etc/fstab
|
||||
sed -i -e "s|DEVICE3|/dev/xvda3|g" $(MNThdd)/etc/fstab
|
||||
sed -i -e "s|DEVICE4|/dev/xvda4|g" $(MNThdd)/etc/fstab
|
||||
|
||||
sed -i -e "s|FSTYPE|ext3|g" $(MNThdd)/etc/fstab
|
||||
|
||||
chroot $(MNThdd) /sbin/dracut --force --verbose /boot/ipfirerd-$(KVER2)-xen.img $(KVER2)-ipfire-xen
|
||||
chroot $(MNThdd) /sbin/dracut --force --verbose /boot/ipfirerd-$(KVER)-pae.img $(KVER)-ipfire-pae
|
||||
|
||||
#Remove root / fstab check
|
||||
rm -rf $(MNThdd)/etc/rc.d/rcsysinit.d/S19checkfstab
|
||||
#Remove console init
|
||||
rm -rf $(MNThdd)/etc/rc.d/rcsysinit.d/S70console
|
||||
|
||||
#Add xvc0 to securetty
|
||||
echo xvc0 >> $(MNThdd)/etc/securetty
|
||||
|
||||
#Add getty for xvc0
|
||||
echo "#Enable login for XEN" >> $(MNThdd)/etc/inittab
|
||||
echo "8:2345:respawn:/sbin/agetty xvc0 9600" >> $(MNThdd)/etc/inittab
|
||||
|
||||
#Disable some initskripts
|
||||
echo "#!/bin/sh" > $(MNThdd)/etc/rc.d/init.d/setclock
|
||||
echo "#!/bin/sh" > $(MNThdd)/etc/rc.d/init.d/keymap
|
||||
|
||||
#Remove autoload of acpi modules
|
||||
sed -i -e "s|^ac|#ac|g" $(MNThdd)/etc/sysconfig/modules
|
||||
sed -i -e "s|^battery|#battery|g" $(MNThdd)/etc/sysconfig/modules
|
||||
sed -i -e "s|^button|#button|g" $(MNThdd)/etc/sysconfig/modules
|
||||
sed -i -e "s|^fan|#fan|g" $(MNThdd)/etc/sysconfig/modules
|
||||
sed -i -e "s|^processor|#processor|g" $(MNThdd)/etc/sysconfig/modules
|
||||
sed -i -e "s|^thermal|#thermal|g" $(MNThdd)/etc/sysconfig/modules
|
||||
sed -i -e "s|^video|#video|g" $(MNThdd)/etc/sysconfig/modules
|
||||
|
||||
rm -rf /install/images/$(SNAME) $(IMGinst) && mkdir -p /install/images/$(SNAME)
|
||||
|
||||
# Copy readme and config
|
||||
cp $(DIR_SRC)/config/xen-image/* \
|
||||
/install/images/$(SNAME)
|
||||
|
||||
# Unmount
|
||||
umount $(MNThdd)/proc
|
||||
umount $(MNThdd)/dev
|
||||
umount $(MNThdd)/sys
|
||||
umount $(MNThdd)/var
|
||||
umount $(MNThdd)/boot
|
||||
umount $(MNThdd)
|
||||
|
||||
# Zerofree ext3 images to get better compression
|
||||
zerofree $(IMGboot)
|
||||
zerofree $(IMGroot)
|
||||
zerofree $(IMGvar)
|
||||
# configure image downloader
|
||||
sed -i -e "s/xxxSNAMExxx/$(SNAME)/" /install/images/$(SNAME)/xen-image-maker.sh
|
||||
sed -i -e "s/xxxVERSIONxxx/$(VERSION)/" /install/images/$(SNAME)/xen-image-maker.sh
|
||||
sed -i -e "s/xxxCORExxx/$(CORE)/" /install/images/$(SNAME)/xen-image-maker.sh
|
||||
sed -i -e "s/xxxKVERxxx/$(KVER)/" /install/images/$(SNAME)/xen-image-maker.sh
|
||||
sed -i -e "s/xxxKERN_PACKxxx/$(KERN_PACK)/" /install/images/$(SNAME)/xen-image-maker.sh
|
||||
|
||||
# Compress Image
|
||||
cd /install/images/ && tar -cvjf $(IMGinst) $(SNAME)
|
||||
|
||||
Reference in New Issue
Block a user