--- /dev/null
+#!/bin/bash
+
+set -e
+set -x
+
+USER=frank
+
+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
+ 2.6.*-gentoo*)
+ TARG="-gentoo-2.6"
+ ;;
+ 2.6*)
+ TARG="-2.6"
+ ;;
+ *)
+ TARG=""
+ ;;
+esac
+
+TARG_LAST=${TARG}-last
+
+echo "Creating initramfs ..."
+cd $( dirname $0 ) || exit 1
+
+uid=$( id -u )
+username=$( id -un )
+gid=$( id -g )
+groupname=$( id -gn )
+
+if [ "${uid}" = "0" ] ; then
+ python makeinitramfs.py
+else
+ su -c "python makeinitramfs.py"
+fi
+
+if [ ! -f initramfs ] ; then
+ echo "File 'initramfs' not found." >&2
+ exit 5
+fi
+
+if [ "${uid}" = "0" ] ; then
+ chown ${USER} initramfs
+else
+ su -c "chown ${username}:${groupname} initramfs"
+fi
+
+
+# vim: ts=4 expandtab