# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/sysfiles/sysfiles.conf # Copyright (C) 2004 - 2023 The T2 SDE Project # Copyright (C) 1998 - 2003 ROCK Linux Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- main_sf() { local services cd $root/ echo "Creating various etc/* files ..." for x in $(cd $confdir; echo etc_*.txt); do y="${x%.txt}" z="/" if [ -f "${y//_/$z}" ]; then echo "Found old ${y//_/$z} (don't overwrite)." touch "${y//_/$z}" else cp -v "$confdir/$x" "${y//_/$z}" fi done [ -f etc/hostname ] || echo localhost > etc/hostname chmod +x etc/initscript etc/rc.d/rc echo "Add missing entries to etc/services .." services=`match_source_file -p services` { echo -e '\n# Entries from http://www.graffiti.com/services\n#' while read line; do prot=`echo $line | cut -f2 -d' '` grep -q " $prot " $root/etc/services || echo "$line" done < $services } >> $root/etc/services echo "Creating usr/sbin/sysnote ..." cat > usr/sbin/sysnote << EOT #!/bin/sh ${EDITOR:-vi} /etc/conf/NOTE chmod 600 /etc/conf/NOTE chown 0:0 /etc/conf/NOTE EOT chmod +x usr/sbin/sysnote echo "Create /etc/issue, /etc/issue.ansi and /etc/issue.net ..." sdetxt="T2 SDE $sdever $arch" . $confdir/issue-std.sh . $confdir/issue-ansi.sh . $confdir/issue-net.sh echo "Set ownership and permissions ..." chmod 640 etc/shadow chown 0:3 etc/shadow chmod 750 etc/rc.d touch var/log/wtmp var/run/utmp chmod 664 var/log/wtmp var/run/utmp chown 0:5 var/log/wtmp var/run/utmp echo "Creating etc/mtab ..." ln -fsv /proc/mounts etc/mtab echo "Creating etc/skel/.profile and etc/skel/.exrc ..." cp $confdir/skel-profile.txt etc/skel/.profile echo 'set showmode' > etc/skel/.exrc echo "Creating etc/VERSION, etc/SDE-VERSION and etc/SDE-CONFIG ..." rm -f etc/{ROCK-,SDE-,}VERSION rm -rf etc/{ROCK,SDE}-CONFIG echo "T2 SDE $sdever (`date +%Y/%m/%d`)" > etc/SDE-VERSION if [ -f $base/target/$target/version.txt ]; then cp -f $base/target/$target/version.txt etc/VERSION else cp -f etc/SDE-VERSION etc/VERSION fi cp -r $base/config/$config/. etc/SDE-CONFIG echo "Installing btee ..." $CC -Wall $confdir/btee.c -o $root/sbin/btee echo "Running postsysfiles.in scripts ..." for x in $base/misc/*/postsysfiles.in; do [ -f $x ] && . $x done for x in $base/package/*/*/postsysfiles.in; do y=${x%/*} y=${y##*/} if [ -f $x ] && pkginstalled "$y"; then . $x fi done } autoextract=0 check_usrlocal=0 makeopt= makeinstopt= hook_add inmake 5 main_sf