[tyndur-devel] [PATCH v2 1/2] Bauen von CD-Images mit GRUB 2
Kevin Wolf ·
From: Johannes Pfeiffer <j.pfeiffer93 at gmx.de> Signed-off-by: Johannes Pfeiffer <j.pfeiffer93 at gmx.de> Signed-off-by: Kevin Wolf <kevin at tyndur.org> --- Makefile | 17 +++++++++++---- build/config/grub2_cdrom.cfg | 19 +++++++++++++++++ build/scripts/grub2_cdrom | 45 ++++++++++++++++++++++++++++++++++++++++++ buildmk.sh | 3 ++ 4 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 build/config/grub2_cdrom.cfg create mode 100755 build/scripts/grub2_cdrom diff --git a/Makefile b/Makefile index 9b63409..93ddf9b 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PPC=fpc -n -Cn -CX -Ttyndur -Fu../lib/units -Fu../units ASM_ELF=nasm -felf -O99 ASM_BIN=nasm -fbin -O99 -BUILD_ROOT=/home/kevin/entwicklung/tyndur/build/output +BUILD_ROOT=/home/johannes/Programme/Tyndur/tyndur/build/output BUILD_DIR=$(BUILD_ROOT) AS=as -32 @@ -22,14 +22,18 @@ obj: subdirs: $(MAKE) --no-print-directory -sC doc - $(MAKE) --no-print-directory -sC patches $(MAKE) --no-print-directory -sC src -clean: - rm -f *.o *.a *.mod +clean_objs: + rm -f *.o *.a *.mod *.ppu link.res ppas.sh tyndur + +softclean: clean_objs + for file in *; do if [ -f "$$file/Makefile" -a \( ! -f "$$file/.nobuild" -o -f "$$file/.ignorenobuild" \) ]; then $(MAKE) -sC "$$file" softclean; fi done + +clean: clean_objs for file in *; do if [ -f "$$file/Makefile" -a \( ! -f "$$file/.nobuild" -o -f "$$file/.ignorenobuild" \) ]; then $(MAKE) -sC "$$file" clean; rm "$$file/Makefile"; fi done -.SILENT: all makefiles subdirs obj clean clean_root updateroot image-floppy image-hd test-qemu test-qemu-hd +.SILENT: all makefiles subdirs obj clean softclean clean_objs clean_root updateroot image-floppy image-hd test-qemu test-qemu-hd clean: clean_root clean_root: @@ -49,6 +53,9 @@ image-hd: updateroot image-cdrom: updateroot build/scripts/image_cdrom +grub2-cdrom: updateroot + build/scripts/grub2_cdrom + test-qemu: image-floppy qemu -serial stdio -fda build/images/floppy.img -boot a -net user -net nic,model=rtl8139 | tee qemu-serial.log diff --git a/build/config/grub2_cdrom.cfg b/build/config/grub2_cdrom.cfg new file mode 100644 index 0000000..02f1c9a --- /dev/null +++ b/build/config/grub2_cdrom.cfg @@ -0,0 +1,19 @@ +#Boot timeout +timeout = 10 + +#boote standardmäÃig die deutsche Version +default = 0 + +#deutsche Version +menuentry "Tyndur (Deutsch)" { + multiboot /boot/tyndur debug=s + module /modules/init boot=file:/ + module /modules/ata + module /modules/ext2 + module /modules/iso9660 + module /modules/pci + module /modules/ramoverlay + module /modules/console servmgr:/term servmgr:/term + module /modules/servmgr foo ata:/atapi10"|"iso9660:/ vterm:/vterm8/out ata iso9660 console pci ext2 ramoverlay + boot +} diff --git a/build/scripts/grub2_cdrom b/build/scripts/grub2_cdrom new file mode 100755 index 0000000..406b603 --- /dev/null +++ b/build/scripts/grub2_cdrom @@ -0,0 +1,45 @@ +# Copyright (c) 20010 The tyndur Project. All rights reserved. +# +# This code is derived from software contributed to the tyndur Project +# by Johannes Pfeiffer. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by the tyndur Project +# and its contributors. +# 4. Neither the name of the tyndur Project nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#Konfigurationsdateien kopieren +cp build/config/grub2_cdrom.cfg build/root/boot/grub/grub.cfg +cp -r build/root-cdrom/config build/root/ +cp -r build/root-common/config build/root/ + +#CD Image erstellen +grub-mkrescue --output=build/images/grub2-cdrom-tyndur.iso build/root/ + +#Konfigurationsdateien wieder löschen +rm -r build/root/config +#Nachricht für den Fall, dass xorriso nicht installiert ist +echo "Falls es zu Error 127 während der Erstellung des CD-Images kommt, hilft es das Paket XORRISO zu installieren." diff --git a/buildmk.sh b/buildmk.sh index b9d4194..35df2d8 100644 --- a/buildmk.sh +++ b/buildmk.sh @@ -258,6 +258,9 @@ image-hd: updateroot image-cdrom: updateroot build/scripts/image_cdrom +grub2-cdrom: updateroot + build/scripts/grub2_cdrom + test-qemu: image-floppy $LOST_TOOLS_QEMU -serial stdio -fda build/images/floppy.img -boot a -net user -net nic,model=rtl8139 | tee qemu-serial.log -- 1.6.0.2