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.

57 lines
1.7 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/livecd/build_initrd.sh
  6. # Copyright (C) 2006 - 2008 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="T2 @Live"
  18. . $base/target/share/initrd.in
  19. . $base/lib/boot/boot.in
  20. cd $build_toolchain
  21. # Additional initrd overlay
  22. #
  23. rm -rf initramfs
  24. mkdir -p initramfs/{bin,sbin}
  25. cp $base/target/share/livecd/{init,init2} initramfs/
  26. chmod +x initramfs/{init,init2}
  27. # For each available kernel:
  28. #
  29. boot_cd_pre $isofsdir
  30. for x in `egrep 'X .* KERNEL .*' $base/config/$config/packages |
  31. cut -d ' ' -f 5` ; do
  32. kernel=${x/_*/}
  33. moduledir="`grep lib/modules $build_root/var/adm/flists/$kernel |
  34. cut -d ' ' -f 2 | cut -d / -f 1-3 | uniq | head -n 1`"
  35. kernelver=${moduledir/*\/}
  36. initrd="initrd-$kernelver.img"
  37. kernelimg=`ls $build_root/boot/vmlinu?_$kernelver`
  38. kernelimg=${kernelimg##*/}
  39. cp $build_root/boot/vmlinu?_$kernelver $isofsdir/boot/
  40. cp $build_root/boot/$initrd $isofsdir/boot/
  41. extend_initrd $isofsdir/boot/$initrd $build_toolchain/initramfs
  42. boot_cd_add $isofsdir $kernelver "$boot_title" \
  43. /boot/$kernelimg /boot/$initrd
  44. done
  45. boot_cd_post $isofsdir