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.

134 lines
4.1 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 - 2003 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. mkdir -p etc/conf etc/rc.d etc/stone.d
  27. for x in $( cd $confdir ; echo etc_*.txt ) ; do
  28. y="${x%.txt}" ; z="/"
  29. if [ -f "${y//_/$z}" ]
  30. then
  31. echo "Found old ${y//_/$z} (don't overwrite)."
  32. touch "${y//_/$z}"
  33. else
  34. cp -v "$confdir/$x" "${y//_/$z}"
  35. fi
  36. done
  37. [ -f etc/HOSTNAME ] || echo localhost > etc/HOSTNAME
  38. chmod +x etc/initscript etc/rc.d/rc
  39. echo "Add missing entries to etc/services .."
  40. services=$( echo "$desc_D" | egrep 'services[^ ]*.txt' | \
  41. tr ' ' '\t' | tr -s '\t' | cut -f2 )
  42. { echo -e '\n# Entries from http://www.graffiti.com/services\n#'
  43. while read line ; do
  44. prot=`echo $line | cut -f2 -d' '`
  45. grep -q " $prot " $root/etc/services || echo "$line"
  46. done < $archdir/$services
  47. } >> $root/etc/services
  48. echo "Creating usr/sbin/sysnote ..."
  49. cat > usr/sbin/sysnote << EOT
  50. #!/bin/sh
  51. ${EDITOR:-vi} /etc/conf/NOTE
  52. chmod 600 /etc/conf/NOTE
  53. chown 0.0 /etc/conf/NOTE
  54. EOT
  55. chmod +x usr/sbin/sysnote
  56. echo "Installing the stone setup tool ..."
  57. cp -v $confdir/stone.sh usr/sbin/stone
  58. chmod +x usr/sbin/stone ; mkdir -p etc/stone.d
  59. for x in $( cd $confdir ; echo stone_*.sh ) ; do
  60. cp -v $confdir/$x etc/stone.d/${x#stone_}
  61. done
  62. echo "Create /etc/issue, /etc/issue.ansi and /etc/issue.net ... "
  63. rocktxt="ROCK Linux $rockver $arch"
  64. . $confdir/issue-std.sh
  65. . $confdir/$ROCKCFG_SYSFILE_ANSI_ISSUE
  66. . $confdir/issue-net.sh
  67. echo "Set ownership and permissions ... "
  68. chmod 640 etc/shadow
  69. chown 0:3 etc/shadow
  70. chmod 750 etc/rc.d
  71. touch var/log/wtmp var/run/utmp
  72. chmod 664 var/log/wtmp var/run/utmp
  73. chown 0:5 var/log/wtmp var/run/utmp
  74. echo "Creating etc/mtab ..."
  75. # ln -fvs ../proc/mounts etc/mtab
  76. touch etc/mtab
  77. echo "Creating etc/skel/.profile and etc/skel/.exrc ..."
  78. cp $confdir/skel-profile.txt etc/skel/.profile
  79. echo 'set showmode' > etc/skel/.exrc
  80. echo "Creating etc/VERSION, etc/ROCK-VERSION and etc/ROCK-CONFIG ..."
  81. echo "ROCK Linux $rockver (`date +%Y/%m/%d`)" > etc/ROCK-VERSION
  82. ln -sf ROCK-VERSION etc/VERSION ; rm -rf etc/ROCK-CONFIG
  83. cp -r $base/config/$config/. etc/ROCK-CONFIG
  84. echo "Installing btee ..."
  85. cmd="$CC -Wall -O2 $confdir/btee.c -o $root/sbin/btee"
  86. echo "$cmd" ; $cmd
  87. echo "Installing rc ..."
  88. cmd="$CC -Wall -O2 $confdir/rc.c -o $root/sbin/rc"
  89. echo "$cmd" ; $cmd
  90. echo "Installing mkpkg and helpers ..."
  91. cmd="$CC -Wall -O2 $base/misc/tools-source/fl_stparse.c -o $root/usr/lib/fl_stparse"
  92. echo "$cmd" ; $cmd
  93. cmd="$CC -Wall -O2 $base/misc/tools-source/fl_wrparse.c -o $root/usr/lib/fl_wrparse"
  94. echo "$cmd" ; $cmd
  95. cp $confdir/mkpkg.sh $root/usr/sbin/mkpkg
  96. chmod +x $root/usr/sbin/mkpkg
  97. echo "Installing hwscan ..."
  98. cp -v $confdir/hwscan.awk $root/sbin/hwscan
  99. chmod +x $root/sbin/hwscan
  100. echo "Installing 'system' init script ..."
  101. install_init system $confdir/system.init
  102. if [ $stagelevel -gt 1 ] ; then
  103. echo "Running postsysfiles.in scripts ..."
  104. for x in $base/misc/*/postsysfiles.in
  105. do [ -f $x ] && . $x ; done
  106. for x in $base/package/*/*/postsysfiles.in
  107. do
  108. y=${x%/*}; y=${y##*/}
  109. if [ -f $x ] && pkgcheck "$y" "X"
  110. then . $x; fi
  111. done
  112. fi ; true
  113. }
  114. custmain="main_sf"
  115. autoextract=0
  116. check_usrlocal=0