From 75e3f3c90fd471a24aeb48023af93d2b2b16466c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 13 May 2015 08:13:54 +0200 Subject: [PATCH] write script to generate outdir from filelist Signed-off-by: Nico Schottelius --- hacking/copy_files_for_iso.sh | 23 +++++++++++++++++++++++ hacking/filelist_from_package.sh | 7 +++++++ hacking/filelist_to_dir.sh | 18 ++++++++++++++++++ hacking/qemu-test.sh | 12 ++++++++++++ hacking/recursive-ldd.sh | 0 5 files changed, 60 insertions(+) create mode 100755 hacking/copy_files_for_iso.sh create mode 100755 hacking/filelist_from_package.sh create mode 100755 hacking/filelist_to_dir.sh create mode 100755 hacking/qemu-test.sh mode change 100644 => 100755 hacking/recursive-ldd.sh diff --git a/hacking/copy_files_for_iso.sh b/hacking/copy_files_for_iso.sh new file mode 100755 index 00000000..0318c072 --- /dev/null +++ b/hacking/copy_files_for_iso.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -ex + +testdir=./iso-root-dir + +# Create base +rm -rf "$testdir" +mkdir "$testdir" + +# Copy binaries + +# Copy kernel +mkdir -p "$testdir/boot" +cp /boot/vmlinuz-linux "$testdir/boot/kernel" +cp /boot/initramfs-linux-fallback.img "$testdir/boot/initramfs" + +# Create iso +genisoimage -v -V "cdist preos v0.1" \ + -cache-inodes -J -l \ + -r -no-emul-boot \ + -boot-load-size 4 -b isolinux.bin -c boot.cat -o cdist-preos.iso iso + diff --git a/hacking/filelist_from_package.sh b/hacking/filelist_from_package.sh new file mode 100755 index 00000000..58ac48f4 --- /dev/null +++ b/hacking/filelist_from_package.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Generate filelist excluding stuff that takes only space +for pkg in bash systemd util-linux; do + pacman -Qlq $pkg | grep -v \ + -e /usr/share/man/ +done diff --git a/hacking/filelist_to_dir.sh b/hacking/filelist_to_dir.sh new file mode 100755 index 00000000..3ce19b9f --- /dev/null +++ b/hacking/filelist_to_dir.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ "$#" -ne 1 ]; then + echo "$0 outdir" + exit 1 +fi + +outdir=$1; shift + +mkdir -p "$outdir" + +while read file; do + if [ -d "$file" ]; then + mkdir -p "$outdir$file" + else + cp --preserve=mode,links "$file" "$outdir$file" + fi +done diff --git a/hacking/qemu-test.sh b/hacking/qemu-test.sh new file mode 100755 index 00000000..03695222 --- /dev/null +++ b/hacking/qemu-test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ "$#" -ne 1 ]; then + echo "$0 iso" + exit 1 +fi + +iso=$1; shift + +qemu-system-x86_64 -m 512 -boot order=cd \ + -drive=$iso,media=cdrom + diff --git a/hacking/recursive-ldd.sh b/hacking/recursive-ldd.sh old mode 100644 new mode 100755