From a1f003bd9c6fa01906c5d36399564afa605f67ba Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 13 May 2015 09:24:55 +0200 Subject: [PATCH] get iso to boot into kernel + initramfs Signed-off-by: Nico Schottelius --- hacking/.gitignore | 2 ++ hacking/README | 6 ++++++ hacking/add_kernel_isolinux.sh | 29 +++++++++++++++++++++++++++++ hacking/all.sh | 10 ++++++++++ hacking/qemu-test.sh | 2 +- 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 hacking/.gitignore create mode 100755 hacking/add_kernel_isolinux.sh create mode 100755 hacking/all.sh diff --git a/hacking/.gitignore b/hacking/.gitignore new file mode 100644 index 00000000..e3f3d036 --- /dev/null +++ b/hacking/.gitignore @@ -0,0 +1,2 @@ +iso/ +*.iso diff --git a/hacking/README b/hacking/README index ffd4f6a0..d5aa9423 100644 --- a/hacking/README +++ b/hacking/README @@ -10,3 +10,9 @@ - binlist - bootstrap of os -> root permissions! + +- uefi support + [9:15] wurzel:hacking% pacman -Ql syslinux | grep ldlin + syslinux /usr/lib/syslinux/bios/ldlinux.c32 + syslinux /usr/lib/syslinux/efi32/ldlinux.e32 + syslinux /usr/lib/syslinux/efi64/ldlinux.e64 diff --git a/hacking/add_kernel_isolinux.sh b/hacking/add_kernel_isolinux.sh new file mode 100755 index 00000000..ec7b610c --- /dev/null +++ b/hacking/add_kernel_isolinux.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# FIXME: Write cdist type / explorer that finds +# package for a file, distro independent + +if [ "$#" -ne 1 ]; then + echo "$0 dir-out" + exit 1 +fi + +dir=$1; shift +boot=$dir/boot + +mkdir -p "$boot" +cp /boot/vmlinuz-linux \ + /boot/initramfs-linux-fallback.img \ + /usr/lib/syslinux/bios/isolinux.bin \ + "$boot" + +cp /usr/lib/syslinux/bios/ldlinux.c32 \ + "$dir" + +cat > "$dir/isolinux.cfg" << eof +default preos +label preos +title cdist PreOS +linux /boot/vmlinuz-linux +initrd /boot/initramfs-linux-fallback.img +eof diff --git a/hacking/all.sh b/hacking/all.sh new file mode 100755 index 00000000..c1b4fb93 --- /dev/null +++ b/hacking/all.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +dir=./iso +iso=preos.iso + +./filelist_from_package.sh | ./filelist_to_dir.sh "$dir" +./add_kernel_isolinux.sh "$dir" +./create_iso.sh "$dir" "$iso" diff --git a/hacking/qemu-test.sh b/hacking/qemu-test.sh index 03695222..02afc2e6 100755 --- a/hacking/qemu-test.sh +++ b/hacking/qemu-test.sh @@ -8,5 +8,5 @@ fi iso=$1; shift qemu-system-x86_64 -m 512 -boot order=cd \ - -drive=$iso,media=cdrom + -drive file=$iso,media=cdrom