OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8 KiB

  1. #!/bin/bash
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: target/share/install/build_initrd.sh
  6. # Copyright (C) 2006 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. set -e
  17. [ "$boot_title" ] || boot_title="OpenSDE Installation"
  18. . $base/target/share/initrd.in
  19. . $base/target/share/boot.in
  20. cd $build_toolchain
  21. # Additional initrd overlay
  22. #
  23. rm -rf initramfs
  24. mkdir -p initramfs/{bin,sbin}
  25. # TODO: add gzip ip
  26. cp $build_root/usr/embutils/{tar,readlink,rmdir} initramfs/bin/
  27. cp $build_root/usr/bin/fget initramfs/bin/
  28. cp $build_root/usr/sbin/ipconfig initramfs/bin/
  29. cp $base/target/share/install/init initramfs/
  30. chmod +x initramfs/init
  31. # For each available kernel:
  32. #
  33. arch_boot_cd_pre $isofsdir
  34. for x in `egrep 'X .* KERNEL .*' $base/config/$config/packages |
  35. cut -d ' ' -f 5` ; do
  36. kernel=${x/_*/}
  37. moduledir="`grep lib/modules $build_root/var/adm/flists/$kernel |
  38. cut -d ' ' -f 2 | cut -d / -f 1-3 | uniq | head -n 1`"
  39. kernelver=${moduledir/*\/}
  40. initrd="initrd-$kernelver.img"
  41. kernelimg=`ls $build_root/boot/vmlinu?_$kernelver`
  42. kernelimg=${kernelimg##*/}
  43. cp $build_root/boot/vmlinu?_$kernelver $isofsdir/boot/
  44. cp $build_root/boot/$initrd $isofsdir/boot/
  45. extend_initrd $isofsdir/boot/$initrd $build_toolchain/initramfs
  46. arch_boot_cd_add $isofsdir $kernelver "$boot_title" \
  47. /boot/$kernelimg /boot/$initrd
  48. done
  49. arch_boot_cd_post $isofsdir