# Common configuration and targets for i386 and amd64 systems. # May be needed in rare cases. #SYSLINUX_OPTS = -s # The DOS volume id to use for DOS floppies. This is a 32 bit hexadecimal # number. DOS_VOLUME_ID = deb00001 # The DOS volume label to use for DOS floppies. This is a 11 character # string. DOS_VOLUME_LABEL := "$(shell echo "$(DISTRIBUTION_NAME) Inst" | cut -b1-11)" # The image to use for a syslinux splash screen. #SPLASH_PNG=boot/x86/pics/klowner.png SPLASH_PNG=boot/x86/pics/ubuntu.png # The directory boot screens for syslinux will go in. BOOT_SCREEN_DIR = GFXBOOT_LANGS := $(sort en $(basename $(notdir $(wildcard boot/x86/po/*.po)))) # Location for Xen example configuration. XENCFG = $(SOME_DEST)/$(EXTRANAME)xm-debian.cfg # The font to load in GRUB GRUB_FONT = /usr/share/grub/ascii.pf2 # Create syslinux config. .PHONY: x86_syslinux x86_syslinux: -rm -rf $(TEMP_SYSLINUX)/* mkdir -p $(TEMP_SYSLINUX) TYPE=$(SYSLINUX_CFG) INCLUDE_GTK=$(INITRD_GTK) DESKTOP=$(DESKTOP) \ syslinux-cfgs boot/x86 $(TEMP_SYSLINUX) # Extract GRUB EFI files. .PHONY: x86_grub_efi x86_grub_efi: ifeq ($(GRUB_EFI),y) SIGNED_IMAGE="$(KERNELNAME_ALT_SUFFIX)" efi-image $(TEMP_GRUB_EFI) x86_64-efi x64 endif # Compress binaries to save more space. # Doesn't really save much since we gzip the image later though. .PHONY: arch_tree arch_tree: ifdef UPX for bin in $(UPX_BINS); do \ $(UPX) -9 $(TREE)/$$bin; \ done endif # Create a bootable image. .PHONY: arch_boot arch_boot: x86_syslinux ifdef UPX $(UPX) -f -9 $(TEMP_KERNEL) || true endif mkfs.msdos -i $(DOS_VOLUME_ID) -n $(DOS_VOLUME_LABEL) -C $(TEMP_BOOT) $(FLOPPY_SIZE) # syslinux is used to make the image bootable syslinux $(SYSLINUX_OPTS) $(TEMP_BOOT) mcopy -i$(TEMP_BOOT) $(TEMP_KERNEL) ::linux mcopy -i$(TEMP_BOOT) $(TEMP_INITRD) ::initrd.gz if [ -n "$(INITRD_GTK)" ]; then \ mcopy -i$(TEMP_BOOT) $(INITRD_GTK) ::initrdg.gz; \ fi # generate a disk label makelabel $(DISK_LABEL) $(BUILD_DATE) > $(TEMP)/disk.lbl mcopy -i$(TEMP_BOOT) $(TEMP)/disk.lbl ::disk.lbl # syslinux configs [ "$(BOOTMENU_BEEP)" = y ] && beep="$$(printf '\a')"; \ subdirs=""; \ $(foreach file,$(shell syslinux-cfgs "$(TEMP_SYSLINUX)"), \ subdir=`dirname $(file)`; \ outfile=$(file); \ if [ "$$subdir" != "." ] && \ ! echo "$$subdirs " | grep -q " $$subdir "; then \ mmd -i$(TEMP_BOOT) ::$$subdir; \ subdirs="$$subdirs $$subdir"; \ fi; \ cat $(TEMP_SYSLINUX)/$(file) \ | bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DEBIAN_VERSION "$(DEBIAN_VERSION)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ BUILD_DATE "$(BUILD_DATE)" \ KERNEL linux INITRD initrd.gz \ INITRD_GTK initrdg.gz \ VIDEO_MODE $(VIDEO_MODE) \ VIDEO_MODE_GTK $(VIDEO_MODE_GTK) \ BEEP "$$beep" \ SYSLINUX_CFG syslinux.cfg \ | todos | mcopy -i$(TEMP_BOOT) - ::$$outfile; \ ) # syslinux help screens if [ -z "$(OMIT_BOOT_HELP)" ]; then \ set -e; \ $(foreach file,$(wildcard $(TEMP_BOOT_SCREENS)/*.txt), \ if [ -e $(file).withgtk ] && [ -n "$(INITRD_GTK)" ]; then \ mcopy -i$(TEMP_BOOT) $(file).withgtk ::`basename $(file)`; \ else \ mcopy -i$(TEMP_BOOT) $(file) ::`basename $(file)`; \ fi; \ ) \ fi if [ "$(SYSLINUX_CFG)" != prompt ]; then \ mcopy -i$(TEMP_BOOT) /usr/lib/syslinux/modules/bios/vesamenu.c32 ::vesamenu.c32; \ mcopy -i$(TEMP_BOOT) /usr/lib/syslinux/modules/bios/libcom32.c32 ::libcom32.c32; \ mcopy -i$(TEMP_BOOT) /usr/lib/syslinux/modules/bios/libutil.c32 ::libutil.c32 ; \ if [ -e $(TEMP_BOOT_SCREENS)/splash.png ]; then \ mcopy -i$(TEMP_BOOT) $(TEMP_BOOT_SCREENS)/splash.png ::splash.png; \ fi; \ fi # win32-loader if [ -z "$(OMIT_WIN32_LOADER)" ]; then \ (mcopy -i$(TEMP_BOOT) /usr/share/win32/win32-loader.exe ::setup.exe ; \ mcopy -i$(TEMP_BOOT) /usr/share/win32/win32-loader/g2ldr ::g2ldr ; \ mcopy -i$(TEMP_BOOT) /usr/share/win32/win32-loader/g2ldr.mbr ::g2ldr.mbr ; \ \ (printf "[installer]\n"; \ printf "arch=$(ARCH)\n"; \ printf "default_desktop=gnome\n"; \ if [ -n "$(INITRD_GTK)" ]; then \ printf "$(ARCH)/linux=linux\n$(ARCH)/initrd=initrd.gz\n"; \ printf "$(ARCH)/gtk/linux=linux\n$(ARCH)/gtk/initrd=initrdg.gz\n"; \ else \ printf "user_interface=text\n"; \ printf "$(ARCH)/linux=linux\n$(ARCH)/initrd=initrd.gz\n"; \ fi; \ printf "\n[grub]\ng2ldr=g2ldr\ng2ldr.mbr=g2ldr.mbr\n") \ | todos | mcopy -i$(TEMP_BOOT) - ::win32-loader.ini) \ || (mdel -i$(TEMP_BOOT) ::setup.exe ::g2ldr ::g2ldr.mbr ::win32-loader.ini ; \ echo "*** Failed to add win32-loader, probably out of space." >&2) ; \ fi $(if $(GZIPPED),gzip -v9f $(TEMP_BOOT)) # A non-bootable image, as used by the root floppy, is just a bare initrd. .PHONY: arch_root arch_root: # Pad the initrd to the floppy size. dd if=$(TEMP_INITRD) bs=$(shell expr $(FLOPPY_SIZE) \* 1024) count=1 of=$(TEMP_ROOT) conv=sync # Set up syslinux/elilo help screens. .PHONY: arch_boot_screens arch_boot_screens: -rm -f $(TEMP_BOOT_SCREENS)/* mkdir -p $(TEMP_BOOT_SCREENS) $(foreach SCREEN,$(wildcard boot/x86/*.txt boot/x86/*.txt.with* boot/x86/*.txt.live boot/x86/*.msg boot/x86/*.msg.live), \ bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DEBIAN_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" \ SYSDIR "$(BOOT_SCREEN_DIR)" \ < $(SCREEN) > $(TEMP_BOOT_SCREENS)/`basename $(SCREEN)`\ ;) if [ -n "$(SPLASH_PNG)" ]; then \ cp $(SPLASH_PNG) $(TEMP_BOOT_SCREENS)/splash.png; \ fi # isolinux CD info directory, including help screens and an isolinux.cfg. # Note that the configuration is extensively manipulated by debian-cd to # support all the available CD/DVD variants. # Supply elilo configuration too for Intel-based Macs, and GRUB EFI # configuration. .PHONY: arch_cd_info_dir arch_cd_info_dir: x86_syslinux x86_grub_efi -rm -f $(TEMP_CD_INFO_DIR)/* mkdir -p $(TEMP_CD_INFO_DIR) cp -a $(TEMP_BOOT_SCREENS)/*.txt $(TEMP_CD_INFO_DIR) if [ -n "$(INITRD_GTK)" ]; then \ cp -a $(TEMP_BOOT_SCREENS)/*.txt.withgtk $(TEMP_CD_INFO_DIR); \ fi if [ -e $(TEMP_BOOT_SCREENS)/splash.png ]; then \ cp -a $(TEMP_BOOT_SCREENS)/splash.png $(TEMP_CD_INFO_DIR); \ fi [ "$(BOOTMENU_BEEP)" = y ] && beep="$$(printf '\a')"; \ $(foreach file,$(shell syslinux-cfgs "$(TEMP_SYSLINUX)"), \ subdir=`dirname $(file)`; \ outfile=$(file); \ if [ "$$subdir" != "." ]; then \ mkdir -p $(TEMP_CD_INFO_DIR)/$$subdir; \ fi; \ if [ $$outfile = syslinux.cfg ]; then \ outfile=isolinux.cfg; \ fi; \ cat $(TEMP_SYSLINUX)/$(file) \ | bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DEBIAN_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" \ KERNEL /%install%/vmlinuz \ INITRD /%install%/initrd.gz \ INITRD_GTK /%install%/gtk/initrd.gz \ AMD_KERNEL /%install-amd%/vmlinuz \ AMD_INITRD /%install-amd%/initrd.gz \ AMD_INITRD_GTK /%install-amd%/gtk/initrd.gz \ VIDEO_MODE $(VIDEO_MODE) \ VIDEO_MODE_GTK $(VIDEO_MODE_GTK) \ BEEP "$$beep" \ SYSLINUX_CFG isolinux.cfg \ > $(TEMP_CD_INFO_DIR)/$$outfile; \ ) if [ "$(GRUB_EFI)" = y ]; then \ set -e; \ mkdir -p $(TEMP_CD_INFO_DIR)/grub/x86_64-efi; \ cp -a $(TEMP_GRUB_EFI)/efi.img $(TEMP_CD_INFO_DIR)/grub/; \ cat boot/x86/grub/grub-efi.cfg \ | bootvars-subst KERNEL /%install%/vmlinuz \ INITRD /%install%/initrd.gz \ > $(TEMP_CD_INFO_DIR)/grub/grub.cfg; \ cp -a $(GRUB_FONT) $(TEMP_CD_INFO_DIR)/grub/font.pf2; \ cp -a $(TEMP_GRUB_EFI)/boot/grub/x86_64-efi/* \ $(TEMP_CD_INFO_DIR)/grub/x86_64-efi/; \ fi # win32-loader if [ -z "$(OMIT_WIN32_LOADER)" ]; then \ cp /usr/share/win32/win32-loader.exe $(TEMP_CD_INFO_DIR)/setup.exe; \ cp /usr/share/win32/win32-loader/g2ldr $(TEMP_CD_INFO_DIR)/g2ldr; \ cp /usr/share/win32/win32-loader/g2ldr.mbr $(TEMP_CD_INFO_DIR)/g2ldr.mbr; \ \ (printf "[installer]\n"; \ printf "arch=$(ARCH)\n"; \ printf "default_desktop=gnome\n"; \ if [ -n "$(INITRD_GTK)" ]; then \ printf "$(ARCH)/linux=install/vmlinuz\n$(ARCH)/initrd=install/initrd.gz\n"; \ printf "$(ARCH)/gtk/linux=install/vmlinuz\n$(ARCH)/gtk/initrd=install/gtk/initrd.gz\n"; \ else \ printf "user_interface=text\n"; \ printf "$(ARCH)/linux=install/vmlinuz\n$(ARCH)/initrd=install/initrd.gz\n"; \ fi; \ printf "\n[grub]\ng2ldr=g2ldr\ng2ldr.mbr=g2ldr.mbr\n") \ | todos > $(TEMP_CD_INFO_DIR)/win32-loader.ini; \ fi set -e; for lang in $(GFXBOOT_LANGS); do \ if [ "$$lang" != en ]; then \ po4a-translate -f docbook -m boot/x86/help.xml \ -p boot/x86/po/$$lang.po \ -l $(TEMP)/help-$$lang.xml; \ src=$(TEMP)/help-$$lang.xml; \ else \ src=boot/x86/help.xml; \ fi; \ if [ -e "$$src" ]; then \ help-to-gfxboot.py $$src install \ | bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DISTRIBUTION_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" \ > $(TEMP_CD_INFO_DIR)/$$lang.hlp; \ help-to-gfxboot.py $$src live \ | bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DISTRIBUTION_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" \ > $(TEMP_CD_INFO_DIR)/$$lang.hlp.live; \ fi; \ done cat boot/x86/elilo.conf \ | bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DEBIAN_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" \ SYSDIR "/elilo/" \ KERNEL /install/vmlinuz INITRD /install/initrd.gz \ > $(TEMP_CD_INFO_DIR)/elilo.conf .PHONY: arch_miniiso arch_miniiso: x86_syslinux x86_grub_efi -rm -f $(TEMP_CD_TREE)/* mkdir -p $(TEMP_CD_TREE) cp /usr/lib/ISOLINUX/isolinux.bin $(TEMP_CD_TREE) cp /usr/lib/syslinux/modules/bios/vesamenu.c32 $(TEMP_CD_TREE) cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $(TEMP_CD_TREE) cp /usr/lib/syslinux/modules/bios/libcom32.c32 $(TEMP_CD_TREE) cp /usr/lib/syslinux/modules/bios/libutil.c32 $(TEMP_CD_TREE) mkdir -p $(TEMP_CD_TREE)/.disk echo "$(DISTRIBUTION_NAME) $(DEBIAN_VERSION) \"$(DEBIAN_RELEASE)\" - $(ARCH) ($(BUILD_DATE))" > $(TEMP_CD_TREE)/.disk/mini-info $(foreach file,$(wildcard boot/x86/*.txt), \ cat $(file) | \ bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DEBIAN_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" "" \ > $(TEMP_CD_TREE)/`basename $(file)`; \ ) if [ -e $(TEMP_BOOT_SCREENS)/splash.png ]; then \ cp $(TEMP_BOOT_SCREENS)/splash.png $(TEMP_CD_TREE); \ fi ln -f $(TEMP_KERNEL) $(TEMP_CD_TREE)/linux ln -f $(TEMP_INITRD) $(TEMP_CD_TREE)/initrd.gz [ "$(BOOTMENU_BEEP)" = y ] && beep="$$(printf '\a')"; \ $(foreach file,$(shell syslinux-cfgs "$(TEMP_SYSLINUX)"), \ subdir=`dirname $(file)`; \ outfile=$(file); \ if [ "$$subdir" != "." ]; then \ mkdir -p $(TEMP_CD_TREE)/$$subdir; \ fi; \ if [ $$outfile = syslinux.cfg ]; then \ outfile=isolinux.cfg; \ fi; \ cat $(TEMP_SYSLINUX)/$(file) \ | bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DEBIAN_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" \ KERNEL linux \ INITRD initrd.gz \ INITRD_GTK /install/gtk/initrd.gz \ VIDEO_MODE $(VIDEO_MODE) \ VIDEO_MODE_GTK $(VIDEO_MODE_GTK) \ BEEP "$$beep" \ SYSLINUX_CFG isolinux.cfg \ | todos > $(TEMP_CD_TREE)/$$outfile; \ ) if [ "$(GRUB_EFI)" = y ]; then \ set -e; \ mkdir -p $(TEMP_CD_TREE)/boot/grub/x86_64-efi; \ cp -a $(TEMP_GRUB_EFI)/efi.img $(TEMP_CD_TREE)/boot/grub/; \ cat boot/x86/grub/grub-efi.cfg \ | bootvars-subst KERNEL /linux \ INITRD /initrd.gz \ > $(TEMP_CD_TREE)/boot/grub/grub.cfg; \ cp -a $(GRUB_FONT) $(TEMP_CD_TREE)/boot/grub/font.pf2; \ cp -a $(TEMP_GRUB_EFI)/boot/grub/x86_64-efi/* \ $(TEMP_CD_TREE)/boot/grub/x86_64-efi/; \ fi # win32-loader if [ -z "$(OMIT_WIN32_LOADER)" ]; then \ cp /usr/share/win32/win32-loader.exe $(TEMP_CD_TREE)/setup.exe; \ cp /usr/share/win32/win32-loader/g2ldr $(TEMP_CD_TREE)/g2ldr; \ cp /usr/share/win32/win32-loader/g2ldr.mbr $(TEMP_CD_TREE)/g2ldr.mbr; \ \ (printf "[installer]\n"; \ printf "arch=$(ARCH)\n"; \ printf "default_desktop=gnome\n"; \ if [ "$(TYPE)" = "netboot/gtk" ]; then \ printf "user_interface=graphical\n"; \ printf "$(ARCH)/gtk/linux=linux\n$(ARCH)/gtk/initrd=initrd.gz\n"; \ else \ printf "user_interface=text\n"; \ printf "$(ARCH)/linux=linux\n$(ARCH)/initrd=initrd.gz\n"; \ fi; \ printf "\n[grub]\ng2ldr=g2ldr\ng2ldr.mbr=g2ldr.mbr\n") \ | todos > $(TEMP_CD_TREE)/win32-loader.ini; \ fi if [ "$(GRUB_EFI)" = y ]; then \ genisoimage -r -J -b isolinux.bin -c boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot \ -efi-boot boot/grub/efi.img -no-emul-boot \ -o $(TEMP_MINIISO) $(TEMP_CD_TREE); \ else \ genisoimage -r -J -b isolinux.bin -c boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -o $(TEMP_MINIISO) $(TEMP_CD_TREE); \ fi geniso_hybrid_plus_firmware_partition $(TEMP_MINIISO) # Netboot files .PHONY: arch_netboot_dir arch_netboot_dir: x86_syslinux -rm -f $(TEMP_NETBOOT_DIR) mkdir -p $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH) cp $(TEMP_INITRD) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH) cp $(TEMP_KERNEL) $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/linux cp /usr/lib/PXELINUX/pxelinux.0 $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH) mkdir -p $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/pxelinux.cfg mkdir -p $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR) cp /usr/lib/syslinux/modules/bios/vesamenu.c32 $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR) cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR) cp /usr/lib/syslinux/modules/bios/libcom32.c32 $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR) cp /usr/lib/syslinux/modules/bios/libutil.c32 $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR) [ "$(BOOTMENU_BEEP)" = y ] && beep="$$(printf '\a')"; \ $(foreach file,$(shell syslinux-cfgs "$(TEMP_SYSLINUX)"), \ subdir=`dirname $(file)`; \ outfile=$(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR)/$(file); \ if [ "$$subdir" != "." ]; then \ mkdir -p $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR)/$$subdir; \ fi; \ cat $(TEMP_SYSLINUX)/$(file) \ | bootvars-subst MEDIA_TYPE "$(MEDIA_TYPE)" \ DISTRIBUTION_NAME "$(DISTRIBUTION_NAME)" \ DEBIAN_VERSION "$(DEBIAN_VERSION)" \ BUILD_DATE "$(BUILD_DATE)" \ SYSDIR "$(BOOT_SCREEN_DIR)" \ KERNEL $(NETBOOT_PATH)/linux \ INITRD $(NETBOOT_PATH)/initrd.gz \ VIDEO_MODE $(VIDEO_MODE) \ BEEP "$$beep" \ SYSLINUX_CFG syslinux.cfg \ > $$outfile; \ ) # This is where pxelinux looks for the config file. ln -sf ../boot-screens/syslinux.cfg \ $(TEMP_NETBOOT_DIR)/$(NETBOOT_PATH)/pxelinux.cfg/default # This symlink is required as pxelinux always looks in the root # of the tftp server for its config. rm -f $(TEMP_NETBOOT_DIR)/pxelinux.cfg ln -sf $(NETBOOT_PATH)/pxelinux.cfg $(TEMP_NETBOOT_DIR)/pxelinux.cfg # This symlink is not strictly required, but it allows more usual # dhcp server setups to work without modification. rm -f $(TEMP_NETBOOT_DIR)/pxelinux.0 ln -sf $(NETBOOT_PATH)/pxelinux.0 $(TEMP_NETBOOT_DIR)/pxelinux.0 # This link is required because pxelinux only looks in the tftp root # for this library (it does a PATH search for any others). ln -sf $(BOOT_SCREEN_DIR)ldlinux.c32 $(TEMP_NETBOOT_DIR)/ldlinux.c32 set -e; \ $(foreach file,$(wildcard $(TEMP_BOOT_SCREENS)/*.txt), \ cp $(file) $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR); \ ) if [ -n "$(SPLASH_PNG)" ]; then \ cp $(SPLASH_PNG) $(TEMP_NETBOOT_DIR)/$(BOOT_SCREEN_DIR)/splash.png; \ fi .PHONY: xen_config xen_config: sed -e "s/@ARCH@/$(ARCH)/g" \ -e "s/@XEN_INSTALL_METHOD@/$(XEN_INSTALL_METHOD)/g" \ -e "s/@DEBIAN_RELEASE@/$(DEBIAN_RELEASE)/g" \ $(XENCFG) chmod 644 $(XENCFG) update-manifest $(XENCFG) $(MANIFEST-XENCFG)