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.

82 lines
2.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_image.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. . $base/target/share/functions.in
  17. set -e
  18. mkdir -p $imagelocation ; cd $imagelocation
  19. # just in case it is still there from the last run
  20. (umount proc ; umount dev) 2>/dev/null
  21. echo "Creating root file-system file lists ..."
  22. pkg_skip=" ccache distcc "
  23. for pkg in `grep '^X ' $base/config/$config/packages | cut -d ' ' -f 5`; do
  24. # include the package?
  25. if [ "${pkg_skip/ $pkg /}" == "$pkg_skip" ] ; then
  26. cut -d ' ' -f 2 $build_root/var/adm/flists/$pkg || true
  27. fi
  28. done | (
  29. # quick and dirty filter
  30. grep -v -e 'lib/[^/]*\.a$'
  31. ) | sort -u > ../files-wanted
  32. # for rsync with --delete we can not use file lists, since rsync does not
  33. # delete in that mode - instead we need to generate a negative list
  34. time find $build_root -mount -wholename $build_root/TOOLCHAIN -prune -o -printf '%P\n' |
  35. sort -u > ../files-all
  36. # the difference
  37. diff -u ../files-all ../files-wanted |
  38. sed -n -e '/var\/adm\/olist/d' -e '/var\/adm\/logs/d' \
  39. -e '/var\/adm\/dep-debug/d' -e '/var\/adm\/cache/d' -e 's/^-//p' > ../files-exclude
  40. echo "proc/*
  41. dev/*
  42. */share/doc/*
  43. var/adm/olist
  44. var/adm/logs
  45. var/adm/dep-debug
  46. var/adm/cache" >> ../files-exclude
  47. echo "Syncing root file-system (this may take some time) ..."
  48. [ -e $imagelocation/bin ] && v="-v" || v=
  49. time rsync -artH $v --delete --exclude-from ../files-exclude \
  50. --exclude TOOLCHAIN --delete-excluded $build_root/ $imagelocation/
  51. rm ../files-{wanted,all,exclude}
  52. echo "Overlaying root file-system with target defined files ..."
  53. copy_and_parse_from_source $base/target/share/livecd/rootfs $imagelocation
  54. copy_and_parse_from_source $base/target/$target/rootfs $imagelocation
  55. [ "$inject_hook" ] && "$inject_hook"
  56. echo "Running ldconfig and other postinstall scripts ..."
  57. mount /dev dev --bind
  58. mount none proc -t proc
  59. for x in sbin/ldconfig var/adm/postinstall/*; do
  60. case $x in
  61. */scrollkeeper) echo "$x left out" ;;
  62. *) chroot . /$x && true
  63. esac
  64. done
  65. umount proc
  66. umount dev
  67. echo "Squashing root file-system (this may take some time) ..."
  68. time mksquashfs * $isofsdir/live.squash -noappend
  69. du -sh $isofsdir/live.squash