Dash:
[t2-trunk.git] / package / base / sysfiles / sysfiles.conf
blobf36243701dbfe5ade2165e3434cf8f0224d6d79a
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3
4 # T2 SDE: package/.../sysfiles/sysfiles.conf
5 # Copyright (C) 2004 - 2017 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
7
8 # More information can be found in the files COPYING and README.
9
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 main_sf() {
17         local services
18         cd $root/
20         echo "Creating various etc/* files ..."
21         for x in $( cd $confdir; echo etc_*.txt ); do
22                 y="${x%.txt}"; z="/"
23                 if [ -f "${y//_/$z}" ]; then
24                         echo "Found old ${y//_/$z} (don't overwrite)."
25                         touch "${y//_/$z}"
26                 else
27                         cp -v "$confdir/$x" "${y//_/$z}"
28                 fi
29         done
30         [ -f etc/HOSTNAME ] || echo localhost > etc/HOSTNAME
31         chmod +x etc/initscript etc/rc.d/rc
33         echo "Add missing entries to etc/services .."
34         services=`match_source_file -p services`
35         {       echo -e '\n# Entries from http://www.graffiti.com/services\n#'
36                 while read line; do
37                         prot=`echo $line | cut -f2 -d' '`
38                         grep -q " $prot " $root/etc/services || echo "$line"
39                 done < $services
40         } >> $root/etc/services
42         echo "Creating usr/sbin/sysnote ..."
43         cat > usr/sbin/sysnote << EOT
44 #!/bin/sh
45 ${EDITOR:-vi} /etc/conf/NOTE
46 chmod 600 /etc/conf/NOTE
47 chown 0:0 /etc/conf/NOTE
48 EOT
49         chmod +x usr/sbin/sysnote
51         echo "Create /etc/issue, /etc/issue.ansi and /etc/issue.net ... "
52         sdetxt="#t2sde $sdever $arch"
53         . $confdir/issue-std.sh
54         . $confdir/issue-ansi.sh
55         . $confdir/issue-net.sh
57         echo "Set ownership and permissions ... "
58         chmod 640   etc/shadow
59         chown 0:3   etc/shadow
60         chmod 750   etc/rc.d
61         touch       var/log/wtmp var/run/utmp
62         chmod 664   var/log/wtmp var/run/utmp
63         chown 0:5   var/log/wtmp var/run/utmp
65         echo "Creating etc/mtab ..."
66         # ln -fvs ../proc/mounts etc/mtab
67         touch etc/mtab
69         echo "Creating etc/crypttab ..."
70         touch etc/crypttab
72         echo "Creating etc/skel/.profile and etc/skel/.exrc ..."
73         cp $confdir/skel-profile.txt etc/skel/.profile
74         echo 'set showmode' > etc/skel/.exrc
76         echo "Creating etc/VERSION, etc/SDE-VERSION and etc/SDE-CONFIG ..."
77         rm -f  etc/{ROCK-,SDE-,}VERSION
78         rm -rf etc/{ROCK,SDE}-CONFIG
79         echo "T2 SDE $sdever (`date +%Y/%m/%d`)" > etc/SDE-VERSION
80         if [ -f $base/target/$target/version.txt ]; then
81                 cp -f $base/target/$target/version.txt etc/VERSION
82         else
83                 cp -f etc/SDE-VERSION etc/VERSION
84         fi
85         cp -r $base/config/$config/. etc/SDE-CONFIG
87         echo "Installing btee ..."
88         $CC -Wall $confdir/btee.c -o $root/sbin/btee
90         echo "Running postsysfiles.in scripts ..."
91         for x in $base/misc/*/postsysfiles.in; do
92                 [ -f $x ] && . $x
93         done
94         for x in $base/package/*/*/postsysfiles.in; do
95                 y=${x%/*}; y=${y##*/}
96                 if [ -f $x ] && pkginstalled "$y"; then
97                         . $x
98                 fi
99         done
102 autoextract=0
103 check_usrlocal=0
104 makeopt=
105 makeinstopt=
106 hook_add inmake 5 main_sf