#
# Quick script to work on an unpacked initrd for booting the OS.
# Usually this will be used if there is a problem with the new
# initrd generated from kernel.SlackBuild
# Usually the initrd tree will be left in:
#   /root/tmp/build-kernel_kirkwood/initrd-tree 
#
# so we cd into that directory, make changes then run this script
# which creates a new initrd in the tftpboot directory of the
# ARMedslack host server.
# 

echo "Updating module dependencies"
find lib/modules -type d -mindepth 1 -maxdepth 1 -printf "%f\n" | xargs -i depmod {} -b.

 find . | cpio -o -H newc | gzip -fv > ../tmprepack.gz
mkimage \
  -A arm \
  -O linux \
  -T ramdisk \
  -C gzip \
  -n "TEST Slackware ARM ramdisk" \
  -d ../tmprepack.gz \
  /mnt/prisroot/tftpboot/armedslack/uinitrd-kirkwood
