--- /dev/null
+#!/bin/bash
+if ! type -p mkisofs >/dev/null; then
+ echo "mkisofs not found." >&2
+ exit 2
+fi
+
+if ! type -p cdrecord >/dev/null; then
+ echo "cdrecord not found." >&2
+ exit 2
+fi
+
+if [ ! -d "$1" ]; then
+ echo "you have to specify a directory to burn on the cd" >&2
+ exit 1
+fi
+
+mkisofs -J -R -C $( cdrecord -msinfo) -M ATAPI:0,0,0 $* | cdrecord -v -multi -data -
+
--- /dev/null
+#!/bin/bash
+
+echo_action() {
+ action="$1"
+ shift
+ printf " %-8s %s\n" "$action" "$*"
+}
+
+KERNEL_VERSION=$1
+if [ -z "${KERNEL_VERSION}" ] ; then
+ KERNEL_VERSION=$( uname -r )
+fi
+
+case $KERNEL_VERSION in
+ *-gentoo*)
+ TARG="-gentoo"
+ ;;
+ *)
+ TARG=""
+ ;;
+esac
+
+TARG_CUR=${TARG}-cur
+TARG_LAST=${TARG}-last
+
+SRC_INIT_SCRIPT="/root/work/initramfs-init-$(hostname).sh"
+if [ ! -f "${SRC_INIT_SCRIPT}" ] ; then
+ echo "File '${SRC_INIT_SCRIPT}' doesn't exists." >&2
+ exit 3
+fi
+if [ ! -x "${SRC_INIT_SCRIPT}" ] ; then
+ echo "File '${SRC_INIT_SCRIPT}' is not executable." >&2
+ exit 3
+fi
+
+for bin in /bin/busybox /sbin/lvm.static; do
+ if [ ! -x "${bin}" ] ; then
+ echo "Binary '${bin}' doesn't exists." >&2
+ exit 3
+ fi
+done
+
+exit 0
+
+echo
+echo "Creating initramfs ..."
+if [ -d /usr/src/initramfs ] ; then
+ echo_action 'RM' '/usr/src/initramfs'
+ rm -rf /usr/src/initramfs
+fi
+echo_action 'MKDIR' '/usr/src/initramfs'
+mkdir -p /usr/src/initramfs
+cd /usr/src/initramfs || exit 5
+
+echo_action 'MKDIR' 'baselayout'
+mkdir -p bin lib dev etc mnt/root proc root sbin sys
+echo_action 'CP' 'devices'
+cp -a /dev/{null,zero,console,tty,sd}* dev/
+echo_action 'CP' 'busybox'
+cp -a /bin/busybox bin/busybox
+echo_action 'CP' 'init'
+cp -p "${SRC_INIT_SCRIPT}" ./init
+chmod +x ./init
+
+echo_action 'LN' 'mdev'
+ln -s ../bin/busybox sbin/mdev
+
+echo_action 'CP' 'lvm.static'
+cp -a /sbin/lvm.static sbin/
+
+i=0
+IMAGE=$( printf "/boot/initramfs.%s.%02d.cpio.gz" "${KERNEL_VERSION}" $i )
+while [ -f "${IMAGE}" ] ; do
+ i=$(( i + 1 ))
+ IMAGE=$( printf "/boot/initramfs.%s.%02d.cpio.gz" "${KERNEL_VERSION}" $i )
+done
+
+echo_action "CPIO" "${IMAGE}"
+find . -print0 | cpio --null -o --format=newc | gzip -9 >"${IMAGE}"
+
+# vim: ts=4 expandtab
--- /dev/null
+#!/bin/bash
+if ! type -p mkisofs >/dev/null; then
+ echo "mkisofs not found." >&2
+ exit 2
+fi
+
+if ! type -p cdrecord >/dev/null; then
+ echo "cdrecord not found." >&2
+ exit 2
+fi
+
+if [ ! -d "$1" ]; then
+ echo "you have to specify a directory to burn on the cd" >&2
+ exit 1
+fi
+
+mkisofs -J -R $* | cdrecord -v -multi -data -
+