src_rebrand.sh 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/sh
  2. #########################
  3. # Name: src_rebrand.sh
  4. # Main: jadedctrl
  5. # Lisc: ISC
  6. # Desc: Rebranding OBSD base
  7. # sources for use in
  8. # LBSD.
  9. #########################
  10. # Usage: src_rebrand.sh $SRC_DIR
  11. . ./libdeblob.sh
  12. PATCH_DIR=/tmp/src_rebrand
  13. if [ -e $PATCH_DIR ]
  14. then
  15. self_destruct_sequence $PATCH_DIR
  16. else
  17. mkdir $PATCH_DIR
  18. fi
  19. if test -z $1
  20. then
  21. SRC_DIR=/usr/src
  22. else
  23. SRC_DIR=$1
  24. fi
  25. arch_list="amd64 i386"
  26. rep "export OBSD=\"OpenBSD/\$ARCH \$VNAME\"" "export OBSD=\"LibertyBSD/\$ARCH \$VNAME\"" distrib/miniroot/dot.profile
  27. #iso_list="alpha amd64 hppa i386 sgi sparc sparc64 vax"
  28. iso_list="amd64 i386"
  29. for arch in $(echo $iso_list)
  30. do
  31. rep "OpenBSD \${OSREV} ${arch} Install CD" "LibertyBSD \${OSREV} ${arch} Install CD" distrib/$arch/iso/Makefile
  32. rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" "Copyright (c) `date +%Y` The *OpenBSD* and LibertyBSD projects" distrib/$arch/iso/Makefile
  33. rep "Theo de Raadt <deraadt@openbsd.org>" "Riley Baird <riley@openmailbox.org>" distrib/$arch/iso/Makefile
  34. rep "OpenBSD/\${MACHINE} \${OSREV} Install CD" "LibertyBSD/\${MACHINE} \${OSREV} Install CD" distrib/$arch/iso/Makefile
  35. done
  36. #cdfs_list="alpha amd64 i386 loongson sgi sparc sparc64 vax"
  37. cdfs_list="amd64 i386"
  38. for arch in $(echo $cdfs_list)
  39. do
  40. rep "OpenBSD \${OSREV} ${arch} bootonly CD" "LibertyBSD \${OSREV} ${arch} bootonly CD" distrib/$arch/cdfs/Makefile
  41. rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" "Copyright (c) `date +%Y` The *OpenBSD* and LibertyBSD projects" distrib/$arch/cdfs/Makefile
  42. rep "Theo de Raadt <deraadt@openbsd.org>" "Riley Baird <riley@openmailbox.org>" distrib/$arch/cdfs/Makefile
  43. rep "OpenBSD/${arch} \${OSREV} boot-only CD" "LibertyBSD/${arch} \${OSREV} boot CD" distrib/$arch/cdfs/Makefile
  44. done
  45. # Distrib changes for all archs
  46. for arch in $(echo $arch_list)
  47. do
  48. rep "${arch}-openbsd" "${arch}-libertybsd" distrib/sets/lists/base/md.$arch
  49. rep "You will not be able to boot OpenBSD from \${1}." "You will not be able to boot LibertyBSD from \${1}." distrib/$arch/common/install.md
  50. done
  51. dir_list="lib/libiberty lib/libobjc lib/libstdc++ share usr.bin/binutils usr.bin/binutils-2.17 usr.bin/gcc usr.bin/texinfo ../usr.sbin/bind ../usr.sbin/unbound"
  52. for dir in $dir_list
  53. do
  54. rep "UNAME_SYSTEM=\`(uname -s) 2>/dev/null\`" "UNAME_SYSTEM=\`(echo OpenBSD) 2>/dev/null\`" gnu/${dir}/config.guess
  55. done
  56. dircp files/uname-obsd usr.bin/uname-obsd
  57. lineadd "./usr/bin/uname" "./usr/bin/uname-obsd" distrib/sets/lists/base/mi
  58. rep "uname " "uname" distrib/sets/lists/base/mi
  59. rep "uname-obsd " "uname-obsd" distrib/sets/lists/base/mi
  60. rep "uname" "uname uname-obsd" usr.bin/Makefile
  61. lineadd "uname.1" "./usr/share/man/man1/uname-obsd.1" distrib/sets/lists/man/mi
  62. lineadd "openbsd) osname=openbsd" "$(space 15) libertybsd) osname=libertybsd" gnu/usr.bin/perl/Configure
  63. lineadd "openbsd) osname=openbsd" "$(space 23) ;;" gnu/usr.bin/perl/Configure
  64. lineadd "openbsd) osname=openbsd" "$(space 23) osvers=\"\$3\"" gnu/usr.bin/perl/Configure
  65. rep "osname=openbsd" "osname=libertybsd" gnu/usr.bin/perl/Configure
  66. rep "interix|dragonfly|bitrig" "libertybsd|interix|dragonfly|bitrig" gnu/usr.bin/perl/Configure
  67. rep "dragonfly\*|bitrig*" "libertybsd\*|dragonfly\*|bitrig\*" gnu/usr.bin/perl/Makefile.SH
  68. rep "-openbsd" "-libertybsd" gnu/usr.bin/perl/Makefile.bsd-wrapper
  69. filecp gnu/usr.bin/perl/hints/openbsd.sh gnu/usr.bin/perl/hints/libertybsd.sh
  70. rep "#define DMESG_START \"OpenBSD \"" "#define DMESG_START \"LibertyBSD \"" usr.bin/sendbug/sendbug.c
  71. rep "bugs@openbsd.org" "bugs@libertybsd.net" usr.bin/sendbug/sendbug.c
  72. # Adding LBSD keys
  73. filecp files/keys/libertybsd-61-base.pub etc/signify/libertybsd-61-base.pub
  74. filecp files/keys/libertybsd-61-pkg.pub etc/signify/libertybsd-61-pkg.pub
  75. filecp files/keys/libertybsd-61-syspatch.pub etc/signify/libertybsd-61-syspatch.pub
  76. filecp files/keys/libertybsd-62-base.pub etc/signify/libertybsd-62-base.pub
  77. filecp files/keys/libertybsd-62-pkg.pub etc/signify/libertybsd-62-pkg.pub
  78. filecp files/keys/libertybsd-62-syspatch.pub etc/signify/libertybsd-62-syspatch.pub
  79. rep "openbsd-" "libertybsd-" distrib/sets/lists/base/mi
  80. rep "-59-base.pub" "-59.pub" distrib/sets/lists/base/mi
  81. linedel "./etc/signify/openbsd-59-pkg.pub" distrib/sets/lists/base/mi
  82. linedel "./etc/signify/openbsd-60-base.pub" distrib/sets/lists/base/mi
  83. linedel "./etc/signify/openbsd-60-fw.pub" distrib/sets/lists/base/mi
  84. linedel "./etc/signify/openbsd-60-pkg.pub" distrib/sets/lists/base/mi
  85. filecp files/motd etc/motd
  86. filecp files/root.mail etc/root/root.mail
  87. filecp files/install.sub distrib/miniroot/install.sub
  88. rep "openbsd-" "libertybsd-" usr.sbin/syspatch/syspatch.sh
  89. rep "OpenBSD" "LibertyBSD" usr.sbin/syspatch/syspatch.sh
  90. apply