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.

138 lines
4.2 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/sysfiles/sysfiles.conf
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. main_sf() {
  23. local services
  24. cd $root/
  25. echo "Creating various etc/* files ..."
  26. for x in $( cd $confdir ; echo etc_*.txt ) ; do
  27. y="${x%.txt}" ; y="${y//_//}"
  28. if [ -f "${y}" ]
  29. then
  30. echo "Found old ${y} (don't overwrite)."
  31. touch "${y}"
  32. else
  33. cp -v "$confdir/$x" "${y}"
  34. fi
  35. done
  36. chmod +x etc/initscript etc/rc.d/rc etc/rc.d/sysinit
  37. echo "Add missing entries to etc/services ..."
  38. services=$( echo "$desc_D" | egrep 'services[^ ]*.txt' | \
  39. tr ' ' '\t' | tr -s '\t' | cut -f2 )
  40. { echo -e '\n# Entries from http://www.graffiti.com/services\n#'
  41. while read line ; do
  42. prot=`echo $line | cut -f2 -d' '`
  43. grep -q " $prot " $root/etc/services || echo "$line"
  44. done < $archdir/$services
  45. } >> $root/etc/services
  46. echo "Creating usr/sbin/sysnote ..."
  47. cat > usr/sbin/sysnote << EOT
  48. #!/bin/sh
  49. ${EDITOR:-vi} /etc/conf/NOTE
  50. chmod 600 /etc/conf/NOTE
  51. chown 0:0 /etc/conf/NOTE
  52. EOT
  53. chmod +x usr/sbin/sysnote
  54. echo "Create /etc/issue, /etc/issue.ansi and /etc/issue.net ... "
  55. rocktxt="ROCK Linux $rockver $arch"
  56. . $confdir/issue-std.sh
  57. . $confdir/$ROCKCFG_SYSFILE_ANSI_ISSUE
  58. . $confdir/issue-net.sh
  59. echo "Set ownership and permissions ... "
  60. chmod 640 etc/shadow
  61. chown 0:3 etc/shadow
  62. chmod 750 etc/rc.d
  63. touch var/log/wtmp var/run/utmp
  64. chmod 664 var/log/wtmp var/run/utmp
  65. chown 0:5 var/log/wtmp var/run/utmp
  66. echo "Creating etc/mtab ..."
  67. # ln -fvs ../proc/mounts etc/mtab
  68. touch etc/mtab
  69. echo "Creating example etc/skel/.profile ..."
  70. cp $confdir/skel-profile.txt etc/skel/.profile
  71. echo "Creating etc/VERSION, etc/ROCK-VERSION and etc/ROCK-CONFIG ..."
  72. echo "ROCK Linux $rockver (`date +%Y/%m/%d`)" > etc/ROCK-VERSION
  73. ln -sf ROCK-VERSION etc/VERSION ; rm -rf etc/ROCK-CONFIG
  74. cp -r $base/config/$config/. etc/ROCK-CONFIG
  75. sed -i -e "s,ROCKCFG_SRC_TMPFS='.',ROCKCFG_SRC_TMPFS='0',g" etc/ROCK-CONFIG/config
  76. echo "Installing btee ..."
  77. cmd="$CC -Wall -O2 $confdir/btee.c -o $root/sbin/btee"
  78. echo "$cmd" ; $cmd
  79. echo "Installing rc ..."
  80. cmd="$CC -Wall -O2 $confdir/rc.c -o $root/sbin/rc"
  81. echo "$cmd" ; $cmd
  82. echo "Installing mkpkg and helpers ..."
  83. cmd="$CC -Wall -O2 $base/misc/tools-source/fl_stparse.c -o $root/usr/lib/fl_stparse"
  84. echo "$cmd" ; $cmd
  85. cmd="$CC -Wall -O2 $base/misc/tools-source/fl_wrparse.c -o $root/usr/lib/fl_wrparse"
  86. echo "$cmd" ; $cmd
  87. cp $confdir/mkpkg.sh $root/usr/sbin/mkpkg
  88. chmod +x $root/usr/sbin/mkpkg
  89. echo "Installing postinstall ..."
  90. cp -v $confdir/sbin_postinstall.sh $root/usr/sbin/postinstall
  91. chmod +x $root/usr/sbin/postinstall
  92. for x in console devfs localfs swap system system-state
  93. do
  94. echo "Installing '$x' init script ..."
  95. install_init $x $confdir/$x.init
  96. done
  97. echo "Exporting LINGUAS environment variable ..."
  98. if [ "$ROCKCFG_LINGUAS" == "all" ] ; then
  99. echo "# export LINGUAS=" > $root/etc/profile.d/linguas
  100. elif [ "$ROCKCFG_LINGUAS" == "none" ] ; then
  101. echo "export LINGUAS=" > $root/etc/profile.d/linguas
  102. else
  103. echo "export LINGUAS=\"$ROCKCFG_LINGUAS\"" > $root/etc/profile.d/linguas
  104. fi
  105. if [ $stagelevel -gt 1 ] ; then
  106. echo "Running postsysfiles.in scripts ..."
  107. for x in $base/misc/*/postsysfiles.in
  108. do [ -f $x ] && . $x ; done
  109. for x in $base/package/*/*/postsysfiles.in
  110. do
  111. y=${x%/*}; y=${y##*/}
  112. if [ -f $x ] && pkginstalled "$y"
  113. then . $x; fi
  114. done
  115. fi ; true
  116. }
  117. custmain="main_sf"
  118. autoextract=0
  119. check_usrlocal=0