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.

155 lines
4.8 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 - 2005 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. if [ ! -f etc/network/config ]; then
  64. cp -vf $confdir/rocknet_config etc/network/config
  65. fi
  66. chmod +x etc/network/rocknet
  67. for x in $( cd $confdir; echo rocknet_{*.sh,README,getprofile}; ); do
  68. dst="${x#rocknet_}"; z="/"; dst="${dst//_/$z}"
  69. cp -vf $confdir/$x etc/network/$dst
  70. done
  71. cp -vf $confdir/ifup.sh sbin/ifup
  72. chmod +x etc/network/getprofile sbin/ifup
  73. ln -sf ifup sbin/ifdown
  74. echo "Create /etc/issue, /etc/issue.ansi and /etc/issue.net ... "
  75. rocktxt="ROCK Linux $rockver $arch"
  76. . $confdir/issue-std.sh
  77. . $confdir/$ROCKCFG_SYSFILE_ANSI_ISSUE
  78. . $confdir/issue-net.sh
  79. echo "Set ownership and permissions ... "
  80. chmod 640 etc/shadow
  81. chown 0:3 etc/shadow
  82. chmod 750 etc/rc.d
  83. touch var/log/wtmp var/run/utmp
  84. chmod 664 var/log/wtmp var/run/utmp
  85. chown 0:5 var/log/wtmp var/run/utmp
  86. echo "Creating etc/mtab ..."
  87. # ln -fvs ../proc/mounts etc/mtab
  88. touch etc/mtab
  89. echo "Creating etc/skel/.profile and etc/skel/.exrc ..."
  90. cp $confdir/skel-profile.txt etc/skel/.profile
  91. echo 'set showmode' > etc/skel/.exrc
  92. echo "Creating etc/VERSION, etc/ROCK-VERSION and etc/ROCK-CONFIG ..."
  93. echo "ROCK Linux $rockver (`date +%Y/%m/%d`)" > etc/ROCK-VERSION
  94. ln -sf ROCK-VERSION etc/VERSION ; rm -rf etc/ROCK-CONFIG
  95. cp -r $base/config/$config/. etc/ROCK-CONFIG
  96. sed -i -e "s,ROCKCFG_SRC_TMPFS='.',ROCKCFG_SRC_TMPFS='0',g" etc/ROCK-CONFIG/config
  97. echo "Installing btee ..."
  98. cmd="$CC -Wall -O2 $confdir/btee.c -o $root/sbin/btee"
  99. echo "$cmd" ; $cmd
  100. echo "Installing rc ..."
  101. cmd="$CC -Wall -O2 $confdir/rc.c -o $root/sbin/rc"
  102. echo "$cmd" ; $cmd
  103. echo "Installing mkpkg and helpers ..."
  104. cmd="$CC -Wall -O2 $base/misc/tools-source/fl_stparse.c -o $root/usr/lib/fl_stparse"
  105. echo "$cmd" ; $cmd
  106. cmd="$CC -Wall -O2 $base/misc/tools-source/fl_wrparse.c -o $root/usr/lib/fl_wrparse"
  107. echo "$cmd" ; $cmd
  108. cp $confdir/mkpkg.sh $root/usr/sbin/mkpkg
  109. chmod +x $root/usr/sbin/mkpkg
  110. echo "Installing hwscan ..."
  111. cp -v $confdir/hwscan.awk $root/sbin/hwscan
  112. chmod +x $root/sbin/hwscan
  113. echo "Installing postinstall ..."
  114. cp -v $confdir/sbin_postinstall.sh $root/usr/sbin/postinstall
  115. chmod +x $root/usr/sbin/postinstall
  116. echo "Installing 'system' init script ..."
  117. install_init system $confdir/system.init
  118. echo "Installing 'network' init script ..."
  119. install_init network $confdir/network.init
  120. if [ $stagelevel -gt 1 ] ; then
  121. echo "Running postsysfiles.in scripts ..."
  122. for x in $base/misc/*/postsysfiles.in
  123. do [ -f $x ] && . $x ; done
  124. for x in $base/package/*/*/postsysfiles.in
  125. do
  126. y=${x%/*}; y=${y##*/}
  127. if [ -f $x ] && pkginstalled "$y"
  128. then . $x; fi
  129. done
  130. fi ; true
  131. }
  132. custmain="main_sf"
  133. autoextract=0
  134. check_usrlocal=0