diff --git a/custom/EFI-grub/.gitignore b/custom/EFI-grub/.gitignore new file mode 100644 index 0000000..e7d1c10 --- /dev/null +++ b/custom/EFI-grub/.gitignore @@ -0,0 +1,2 @@ +grub-built +*.EFI diff --git a/custom/EFI-grub/build-grub.sh b/custom/EFI-grub/build-grub.sh new file mode 100755 index 0000000..0c53651 --- /dev/null +++ b/custom/EFI-grub/build-grub.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -e +DIR="$(readlink -f .)" + +# Dependencies: xfonts-unifont + +cd git +./autogen.sh + +./configure --prefix="$DIR/grub-built" --with-platform=efi --enable-grub-mkfont + +make -j`nproc` + +make install + +# Install font +make unicode.pf2 +cp -v unicode.pf2 ../ diff --git a/custom/EFI-grub/efi-grub.sh b/custom/EFI-grub/efi-grub.sh new file mode 100755 index 0000000..05512a6 --- /dev/null +++ b/custom/EFI-grub/efi-grub.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +PATH="./grub-built/bin:$PATH" + +MODULES="normal" +MODULES="$MODULES part_gpt part_msdos" # Partition tables +MODULES="$MODULES fat ntfs exfat iso9660" # Filesystems +MODULES="$MODULES linux chain" # Boot targets +MODULES="$MODULES help reboot halt" # Utilities +MODULES="$MODULES ls search search_fs_file" # Utilities +MODULES="$MODULES usb_keyboard at_keyboard all_video" # Hardware support +MODULES="$MODULES gfxterm font" # Graphical terminal +MODULES="$MODULES configfile sleep" # TEMP - Debugging + +grub-mkimage --format=x86_64-efi --output=BOOTX64.EFI --config=embed.cfg --prefix=/EFI/BOOT $MODULES + +sizeMB=$(set -- $(du -m BOOTX64.EFI); echo $1) + +dd if=/dev/zero of=efiboot.img bs=1M count=$sizeMB + +mkdosfs -F 12 efiboot.img + +mkdir -p efiboot +sudo mount -o loop efiboot.img efiboot + +sudo mkdir -p efiboot/EFI/BOOT + +sudo cp BOOTX64.EFI efiboot/EFI/BOOT/ + +sudo umount efiboot diff --git a/custom/EFI-grub/efiboot.img b/custom/EFI-grub/efiboot.img new file mode 100644 index 0000000..4f28aba Binary files /dev/null and b/custom/EFI-grub/efiboot.img differ diff --git a/custom/EFI-grub/embed.cfg b/custom/EFI-grub/embed.cfg new file mode 100644 index 0000000..fd89c4d --- /dev/null +++ b/custom/EFI-grub/embed.cfg @@ -0,0 +1,2 @@ +search --set=root --file /dban.bzi +set prefix=($root) diff --git a/custom/EFI-grub/git b/custom/EFI-grub/git index 4e0f8f6..e54c99a 160000 --- a/custom/EFI-grub/git +++ b/custom/EFI-grub/git @@ -1 +1 @@ -Subproject commit 4e0f8f66e321cf1051c0e01f6fbcc6fc35a807b6 +Subproject commit e54c99aaff5e5f6f5d3b06028506c57e66d8ef77 diff --git a/custom/EFI-grub/grub.cfg b/custom/EFI-grub/grub.cfg new file mode 100644 index 0000000..3dfa610 --- /dev/null +++ b/custom/EFI-grub/grub.cfg @@ -0,0 +1,13 @@ +set timeout=-1 + +if loadfont ${prefix}/unicode.pf2 +then + insmod gfxterm + set gfxmode=auto + set gfxpayload=keep + terminal_output gfxterm +fi + +menuentry "DBAN (interactive)" { + linux /dban.bzi nuke="dwipe" silent +} diff --git a/custom/EFI-grub/unicode.pf2 b/custom/EFI-grub/unicode.pf2 new file mode 100644 index 0000000..d178170 Binary files /dev/null and b/custom/EFI-grub/unicode.pf2 differ diff --git a/isohybrid b/isohybrid deleted file mode 100755 index 4edd874..0000000 Binary files a/isohybrid and /dev/null differ diff --git a/isoroot/i586/SOURCE b/isoroot/i586/SOURCE new file mode 100644 index 0000000..343123d --- /dev/null +++ b/isoroot/i586/SOURCE @@ -0,0 +1,2 @@ +ISOLINUX source can be obtained here: http://www.syslinux.org/wiki/index.php?title=Download +We are currently using v6.03 diff --git a/isoroot/i586/isohdpfx.bin b/isoroot/i586/isohdpfx.bin new file mode 100644 index 0000000..8937173 Binary files /dev/null and b/isoroot/i586/isohdpfx.bin differ diff --git a/master.sh b/master.sh index 47388fd..6b5c943 100755 --- a/master.sh +++ b/master.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e BR2_CONFIG=buildroot/.config @@ -14,10 +15,9 @@ OUTDIR=isoroot/${BR2_ARCH}/output INDIR=isoroot/${BR2_ARCH}/input VOLUME="DBAN v$DBAN_VERSION ($BR2_ARCH)" -ISOHYBRID=0 PRERELEASE=0 -GIT_TAG=$(git describe --tags --exact-match 2>/dev/null) +GIT_TAG=$(git describe --tags --exact-match 2>/dev/null || true) if [ -z "$GIT_TAG" -o "${GIT_TAG%/*}" = "nightly" ]; then GIT_VERSION=$(git log -1 --date=format:"%Y%m%d" --pretty=format:"%cd-g%h") VOLUME="DBAN $GIT_VERSION" @@ -26,16 +26,24 @@ fi BZIMAGE_DIR= +mkdir -p $OUTDIR + +MKISOFS="xorriso -as mkisofs" MKISOFS_ARGS=() case "${BR2_ARCH}" in i586) test ! -r "$INDIR/isolinux.bin" && echo "$0: $INDIR/isolinux.bin is missing." && exit 3 MKISOFS_ARGS+=(-b isolinux.bin -c isolinux.cat -no-emul-boot -boot-load-size 4 -boot-info-table) MKISOFS_ARGS+=(-V "$VOLUME") - ISOHYBRID=1 + # Copy GRUB files + for file in efiboot.img grub.cfg unicode.pf2; do + cp -v "custom/EFI-grub/$file" "$OUTDIR/" + done + MKISOFS_ARGS+=(-isohybrid-mbr "$INDIR/../isohdpfx.bin" -isohybrid-gpt-basdat -eltorito-alt-boot -e efiboot.img -no-emul-boot) ;; powerpc) test ! -r "$INDIR/ppc/yaboot" && echo "$0: $INDIR/ppc/yaboot is missing." && exit 3 + MKISOFS="mkisofs" MKISOFS_ARGS+=(-chrp-boot -hfs -no-cache-inodes -no-desktop -part -r) MKISOFS_ARGS+=(-map "$OUTDIR/ppc/map") MKISOFS_ARGS+=(-hfs-bless "$OUTDIR/ppc") @@ -56,9 +64,8 @@ else OUTNAME="dban-${GIT_VERSION}_linux-${BR2_LINUX_KERNEL_VERSION}_${BR2_ARCH}.iso" fi -mkdir -p $OUTDIR cp -r isoroot/generic/* $OUTDIR/ cp -r $INDIR/* $OUTDIR/ -mkisofs -o "$OUTNAME" "${MKISOFS_ARGS[@]}" "$OUTDIR" -[ "$ISOHYBRID" = "1" ] && ./isohybrid "$OUTNAME" +echo "> $MKISOFS -o $OUTNAME ${MKISOFS_ARGS[@]} $OUTDIR" +$MKISOFS -o "$OUTNAME" "${MKISOFS_ARGS[@]}" "$OUTDIR" ls -ll "$OUTNAME"