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.

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