src_rebrand.sh 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. mkdir "$PATCH_DIR/ADD_usr.bin^uname-obsd"
  57. cp "$SRC_DIR/usr.bin/uname/Makefile" "$PATCH_DIR/ADD_usr.bin^uname-obsd/Makefile"
  58. cp "$SRC_DIR/usr.bin/uname/uname.c" "$PATCH_DIR/ADD_usr.bin^uname-obsd/uname-obsd.c"
  59. cp "files/man/uname-obsd.1" "$PATCH_DIR/ADD_usr.bin^uname-obsd/uname-obsd.1"
  60. sed -i 's/fputs(u.sysname, stdout);/fputs("OpenBSD", stdout);/' "$PATCH_DIR/ADD_usr.bin^uname-obsd/uname-obsd.c"
  61. sed -i 's/uname/uname-obsd/' "$PATCH_DIR/ADD_usr.bin^uname-obsd/Makefile"
  62. lineadd "./usr/bin/uname" "./usr/bin/uname-obsd" distrib/sets/lists/base/mi
  63. rep "uname " "uname" distrib/sets/lists/base/mi
  64. rep "uname-obsd " "uname-obsd" distrib/sets/lists/base/mi
  65. rep "uname" "uname uname-obsd" usr.bin/Makefile
  66. lineadd "uname.1" "./usr/share/man/man1/uname-obsd.1" distrib/sets/lists/man/mi
  67. lineadd "openbsd) osname=openbsd" "$(space 15) libertybsd) osname=libertybsd" gnu/usr.bin/perl/Configure
  68. lineadd "openbsd) osname=openbsd" "$(space 23) ;;" gnu/usr.bin/perl/Configure
  69. lineadd "openbsd) osname=openbsd" "$(space 23) osvers=\"\$3\"" gnu/usr.bin/perl/Configure
  70. rep "osname=openbsd" "osname=libertybsd" gnu/usr.bin/perl/Configure
  71. rep "interix|dragonfly|bitrig" "libertybsd|interix|dragonfly|bitrig" gnu/usr.bin/perl/Configure
  72. rep "dragonfly\*|bitrig*" "libertybsd\*|dragonfly\*|bitrig\*" gnu/usr.bin/perl/Makefile.SH
  73. rep "-openbsd" "-libertybsd" gnu/usr.bin/perl/Makefile.bsd-wrapper
  74. filecp gnu/usr.bin/perl/hints/openbsd.sh gnu/usr.bin/perl/hints/libertybsd.sh
  75. rep "#define DMESG_START \"OpenBSD \"" "#define DMESG_START \"LibertyBSD \"" usr.bin/sendbug/sendbug.c
  76. rep "bugs@openbsd.org" "bugs@libertybsd.net" usr.bin/sendbug/sendbug.c
  77. # Adding LBSD keys
  78. filecp files/keys/libertybsd-61-base.pub etc/signify/libertybsd-61-base.pub
  79. filecp files/keys/libertybsd-61-pkg.pub etc/signify/libertybsd-61-pkg.pub
  80. filecp files/keys/libertybsd-61-syspatch.pub etc/signify/libertybsd-61-syspatch.pub
  81. filecp files/keys/libertybsd-62-base.pub etc/signify/libertybsd-62-base.pub
  82. filecp files/keys/libertybsd-62-pkg.pub etc/signify/libertybsd-62-pkg.pub
  83. filecp files/keys/libertybsd-62-syspatch.pub etc/signify/libertybsd-62-syspatch.pub
  84. linedel "./etc/signify/openbsd-59-pkg.pub" distrib/sets/lists/base/mi
  85. linedel "./etc/signify/openbsd-60-base.pub" distrib/sets/lists/base/mi
  86. linedel "./etc/signify/openbsd-60-fw.pub" distrib/sets/lists/base/mi
  87. linedel "./etc/signify/openbsd-60-pkg.pub" distrib/sets/lists/base/mi
  88. rep "openbsd-" "libertybsd-" distrib/sets/lists/base/mi
  89. rep "-59-base.pub" "-59.pub" distrib/sets/lists/base/mi
  90. filecp files/motd etc/motd
  91. filecp files/root.mail etc/root/root.mail
  92. filecp files/install.sub distrib/miniroot/install.sub
  93. rep "openbsd-" "libertybsd-" usr.sbin/syspatch/syspatch.sh
  94. rep "OpenBSD" "LibertyBSD" usr.sbin/syspatch/syspatch.sh
  95. apply