src_rebrand.sh 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. # Rebranding amd64 images
  27. rep "export OBSD=\"OpenBSD/\$ARCH \$VNAME\"" "export OBSD=\"LibertyBSD/\$ARCH \$VNAME\"" distrib/miniroot/dot.profile
  28. #iso_list="alpha amd64 hppa i386 sgi sparc sparc64 vax"
  29. iso_list="amd64 i386"
  30. for arch in $(echo $iso_list)
  31. do
  32. rep "OpenBSD \${OSREV} ${arch} Install CD" "LibertyBSD \${OSREV} ${arch} Install CD" distrib/$arch/iso/Makefile
  33. rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" "Copyright (c) `date +%Y` The *OpenBSD* and LibertyBSD projects" distrib/$arch/iso/Makefile
  34. rep "Theo de Raadt <deraadt@openbsd.org>" "Riley Baird <riley@openmailbox.org>" distrib/$arch/iso/Makefile
  35. rep "OpenBSD/\${MACHINE} \${OSREV} Install CD" "LibertyBSD/\${MACHINE} \${OSREV} Install CD" distrib/$arch/iso/Makefile
  36. done
  37. #cdfs_list="alpha amd64 i386 loongson sgi sparc sparc64 vax"
  38. cdfs_list="amd64 i386"
  39. for arch in $(echo $cdfs_list)
  40. do
  41. rep "OpenBSD \${OSREV} ${arch} bootonly CD" "LibertyBSD \${OSREV} ${arch} bootonly CD" distrib/$arch/cdfs/Makefile
  42. rep "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" "Copyright (c) `date +%Y` The *OpenBSD* and LibertyBSD projects" distrib/$arch/cdfs/Makefile
  43. rep "Theo de Raadt <deraadt@openbsd.org>" "Riley Baird <riley@openmailbox.org>" distrib/$arch/cdfs/Makefile
  44. rep "OpenBSD/${arch} \${OSREV} boot-only CD" "LibertyBSD/${arch} \${OSREV} boot CD" distrib/$arch/cdfs/Makefile
  45. done
  46. # Distrib changes for all archs
  47. for arch in $(echo $arch_list)
  48. do
  49. rep "${arch}-openbsd" "${arch}-libertybsd" distrib/sets/lists/base/md.$arch
  50. lineadd "./usr/bin/uname" "./usr/bin/uname-obsd" distrib/sets/lists/base/md.$arch
  51. 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
  52. done
  53. 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"
  54. for dir in $dir_list
  55. do
  56. rep "UNAME_SYSTEM=\`(uname -s) 2>/dev/null\`" "UNAME_SYSTEM=\`(echo OpenBSD) 2>/dev/null\`" gnu/${dir}/config.guess
  57. done
  58. lineadd "openbsd) osname=openbsd" "$(space 22) osvers=\"$3\"\n$(space 22) ;;\n$(space 14) libertybsd) osname=libertybsd\n$(space 22) osvers=\"$3\"\n$(space 22) ;;" gnu/usr.bin/perl/Configure
  59. #rep "openbsd) osname=openbsd" "libertybsd) osname=libertybsd" gnu/usr.bin/perl/Configure
  60. rep "interix|dragonfly|bitrig" "libertybsd|interix|dragonfly|bitrig" gnu/usr.bin/perl/Configure
  61. rep "dragonfly\*|bitrig*" "libertybsd\*|dragonfly\*|bitrig\*" gnu/usr.bin/perl/Makefile.SH
  62. rep "-openbsd" "-libertybsd" gnu/usr.bin/perl/Makefile.bsd-wrapper
  63. filecp gnu/usr.bin/perl/hints/openbsd.sh gnu/usr.bin/perl/hints/libertybsd.sh
  64. rep "#define DMESG_START \"OpenBSD \"" "#define DMESG_START \"LibertyBSD \"" usr.bin/sendbug/sendbug.c
  65. rep "bugs@openbsd.org" "bugs@libertybsd.net" usr.bin/sendbug/sendbug.c
  66. filecp files/motd etc/motd
  67. filecp files/root.mail etc/root/root.mail
  68. filecp files/install.sub distrib/miniroot/install.sub
  69. apply