1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/stone/stone_mod_setup.sh
3 # Copyright (C) 2004 - 2021 The T2 SDE Project
4 # Copyright (C) 1998 - 2003 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 # This module should only be executed once directly after the installation
19 for _dev
in /dev
/disk
/by-uuid
/*; do
20 local d
=$
(readlink
$_dev)
22 if [ "$d" = $dev ]; then
31 tmp1
=`mktemp` ; tmp2
=`mktemp`
33 # some defaults and fallbacks
35 none /proc proc defaults 0 0
36 none /dev devtmpfs mode=755 0 0
37 none /dev/pts devpts defaults 0 0
38 none /dev/shm tmpfs defaults 0 0
39 none /sys sysfs defaults 0 0
40 none /tmp tmpfs nosuid,nodev,noexec 0 0
43 # currently mounted filesystems
44 sed -e "s/ nfs [^ ]\+/ nfs rw/" < /etc
/mtab |
45 sed "s/ rw,/ /; s/ rw / defaults /" >> $tmp2
46 # currently active swaps
47 sed -e 1d
-e 's/ .*//' -e 's,.*$,& none swap defaults 0 0,' \
50 # sort resulting entries and grab the last (e.g. non-default) one
51 cut
-f2 -d' ' < $tmp2 |
sort -u |
while read dn
; do
52 grep " $dn " $tmp2 |
tail -n 1 |
53 while read dev point
type residual
; do
57 echo $dev $point $type $residual && continue ;;
61 echo $dev $point $type $residual ;;
63 echo $dev $point $type ${residual%0 0} 0 1 ;;
65 echo $dev $point $type ${residual%0 0} 0 2 ;;
72 for (c=1; c<=NF; c++) if (ss[c] < length(\$c)) ss[c]=length(\$c);
75 for (c=1; c<NF; c++) printf "%-*s",ss[c]+2,\$c;
79 gawk
-f $tmp2 $tmp1 $tmp1 > /etc
/fstab
81 while read a b c d e f
; do
82 printf "%-60s %s\n" "$(
85 printf "%-25s %s
" "$a" "$b"
89 done < /etc
/fstab |
tr ' ' '\240' > $tmp1
91 gui_message $
'Auto-created /etc/fstab file:\n\n'"$( cat $tmp1 )"
96 if [ "$SETUPG" = dialog
] ; then
97 tmp1
="`mktemp`" ; tmp2
="`mktemp`" ; rc
=0
98 gui_dialog
--nocancel --passwordbox "Setting a root password. `
99 `Type password:" 8 70 > $tmp1
100 gui_dialog
--nocancel --passwordbox "Setting a root password. `
101 `Retype password:" 8 70 > $tmp2
102 if [ -s $tmp1 ] && cmp -s $tmp1 $tmp2 ; then
103 echo -n "root:" > $tmp1 ; echo >> $tmp2
104 cat $tmp1 $tmp2 | chpasswd
106 gui_message
"Password 1 and password 2 are `
107 `not the same" ; rc
=1
118 type -p ldconfig
&& ldconfig
119 export gui_nocancel
=1
122 $STONE general set_keymap
123 while ! set_rootpw
; do :; done
127 # run the stone modules that registered itself for the first SETUP pass
128 while read -u 200 a b c cmd
; do
130 done 200< <( grep -h '^# \[SETUP\] [0-9][0-9] ' \
131 $SETUPD/mod_
*.sh |
sort )
135 # run the postinstall scripts right here
136 for x
in /etc
/postinstall.d
/* ; do
137 [ -f $x ] ||
continue
138 echo "Running $x ..."