mirror of the now-defunct rocklinux.org
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.

69 lines
1.7 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/scripts/Build-Pkg
  11. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. #
  25. # bless-rs6k is Copyright (C) 2003 Rene Rebe
  26. #
  27. # $1: disk base dir
  28. # $2: cd number
  29. # $3: iso file
  30. yb_bin="${1}/boot/yaboot.rs6k"
  31. cd=$2
  32. iso=$3
  33. # function to return a 512 sized sector count
  34. sector_count() {
  35. echo `du -B 512 --apparent-size $1 | cut -f1`
  36. }
  37. if [ "$cd" != 1 ] ; then
  38. echo "Not the first CD - not blessing ..."
  39. exit 0
  40. fi
  41. # test
  42. cd_sec=`sector_count $iso`
  43. # calculate the size for a 512 byte alligned yaboot binary, padded with zeros
  44. yb_sec=`sector_count $yb_bin`
  45. yb_sec=$(( yb_sec + 1 ))
  46. echo "ISO sector count: $cd_sec Yaboot RS/6k binary sectors: $yb_sec"
  47. echo "RS/6k-blessing $iso ..."
  48. sfdisk -uS -f -q --no-reread $iso <<-EOT
  49. ;
  50. $cd_sec,$yb_sec,0x41,*
  51. ;
  52. ;
  53. EOT
  54. echo "done"
  55. echo "Attaching Yaboot binary with padded zeros ..."
  56. cat $yb_bin /dev/zero | dd bs=512 count=$yb_sec >> $iso