src_rebrand.sh 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #!/bin/sh
  2. ########################################
  3. # name: src_rebrand.sh
  4. # main: jadedctrl
  5. # lisc: isc
  6. # desc: rebranding obsd base sources for
  7. # use in lbsd.
  8. ########################################
  9. . ./libdeblob.sh
  10. if test -z "$1"; then
  11. echo "usage: src_rebrand.sh source_dir"
  12. exit 2
  13. else
  14. SRC_DIR="$1"
  15. fi
  16. PATCH_DIR=/tmp/src_rebrand
  17. mkdir "$PATCH_DIR" 2> /dev/null
  18. # --------------------------------------
  19. arch_list="amd64 i386"
  20. rep "export OBSD=\"OpenBSD/\$ARCH \$VNAME\"" \
  21. "export OBSD=\"LibertyBSD/\$ARCH \$VNAME\"" \
  22. distrib/miniroot/dot.profile
  23. # --------------------------------------
  24. #iso_list="alpha amd64 hppa i386 sgi sparc sparc64 vax"
  25. iso_list="amd64 i386"
  26. for arch in $iso_list; do
  27. rep "OpenBSD \${OSREV} ${arch} Install CD" \
  28. "LibertyBSD \${OSREV} ${arch} Install" \
  29. distrib/$arch/iso/Makefile
  30. rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" \
  31. "Copyright (c) `date +%Y` -OpenBSD- and LibertyBSD projects" \
  32. distrib/$arch/iso/Makefile
  33. rep "Theo de Raadt <deraadt@openbsd.org>" \
  34. "Jaidyn Ann <jadedctrl@teknik.io>" \
  35. distrib/$arch/iso/Makefile
  36. rep "OpenBSD/\${MACHINE} \${OSREV} Install CD" \
  37. "LibertyBSD/\${MACHINE} \${OSREV} Install" \
  38. distrib/$arch/iso/Makefile
  39. done
  40. # --------------------------------------
  41. #cdfs_list="alpha amd64 i386 loongson sgi sparc sparc64 vax"
  42. cdfs_list="amd64 i386"
  43. for arch in $(echo $cdfs_list); do
  44. rep "OpenBSD \${OSREV} ${arch} bootonly CD" \
  45. "LibertyBSD \${OSREV} ${arch} bootonly" \
  46. distrib/$arch/ramdisk_cd/Makefile
  47. rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" \
  48. "Copyright (c) `date +%Y` -OpenBSD- and LibertyBSD projects" \
  49. distrib/$arch/ramdisk_cd/Makefile
  50. rep "Theo de Raadt <deraadt@openbsd.org>" \
  51. "Jaidyn Ann <jadedctrl@teknik.io>" \
  52. distrib/$arch/ramdisk_cd/Makefile
  53. rep "OpenBSD/${arch} \${OSREV} boot-only CD" \
  54. "LibertyBSD/${arch} \${OSREV} boot-only" \
  55. distrib/$arch/ramdisk_cd/Makefile
  56. done
  57. # --------------------------------------
  58. for arch in $(echo $arch_list); do
  59. rep "You will not be able to boot OpenBSD from \${1}." \
  60. "You will not be able to boot LibertyBSD from \${1}." \
  61. distrib/$arch/common/install.md
  62. done
  63. rep "#define DMESG_START \"OpenBSD \"" \
  64. "#define DMESG_START \"LibertyBSD \"" \
  65. usr.bin/sendbug/sendbug.c
  66. rep "bugs@openbsd.org" "jadedctrl@teknik.io" usr.bin/sendbug/sendbug.c
  67. rep "sysctl -n kern.version | sed 1q >" \
  68. "sysctl -n kern.version | sed 1q | sed 's/OpenBSD/LibertyBSD/' >" \
  69. etc/rc
  70. rep "kerninfo.sysname" "\"LibertyBSD\"" libexec/getty/main.c
  71. # Adding LBSD keys
  72. versions="64 66 67"
  73. local_key="files/keys/libertybsd-"
  74. lbsd_key="etc/signify/libertybsd-"
  75. for ver in $versions; do
  76. filecp ${local_key}${ver}-base.pub \
  77. ${lbsd_key}${ver}-base.pub
  78. filecp ${local_key}${ver}-pkg.pub \
  79. ${lbsd_key}${ver}-pkg.pub
  80. filecp ${local_key}${ver}-syspatch.pub \
  81. ${lbsd_key}${ver}-syspatch.pub
  82. filedel etc/signify/openbsd-${ver}-fw.pub
  83. done
  84. lbsd_key="./etc/signify/libertybsd-"
  85. m_path="distrib/sets/lists/base/mi"
  86. for ver in $versions; do
  87. lineadd "openbsd-${ver}-base.pub" "${lbsd_key}${ver}-base.pub" $m_path
  88. lineadd "openbsd-${ver}-pkg.pub" "${lbsd_key}${ver}-pkg.pub" $m_path
  89. lineadd "openbsd-${ver}-syspatch.pub" \
  90. "${lbsd_key}${ver}-syspatch.pub" $m_path
  91. linedel "openbsd-${ver}-fw.pub" $m_path
  92. done
  93. # --------------------------------------
  94. filecp files/motd etc/motd
  95. filecp files/root.mail etc/root/root.mail
  96. filecp files/install.sub distrib/miniroot/install.sub
  97. rep "openbsd-" "libertybsd-" usr.sbin/syspatch/syspatch.sh
  98. rep "OpenBSD" "LibertyBSD" usr.sbin/syspatch/syspatch.sh
  99. # --------------------------------------
  100. echo "Applying..."
  101. apply