1 |
#!/bin/bash |
#!/bin/bash |
2 |
# $Id$ |
# $Id$ |
3 |
|
|
4 |
|
# setup exit trap for reboot |
5 |
|
trap_exit() |
6 |
|
{ |
7 |
|
if [[ -f /.dist-upgrade ]] |
8 |
|
then |
9 |
|
rm -f /.dist-upgrade |
10 |
|
# force a reboot at this point here |
11 |
|
( sleep 3 && reboot -f & ); exit 0 |
12 |
|
fi |
13 |
|
} |
14 |
|
trap "trap_exit" EXIT |
15 |
|
|
16 |
|
# get a suitable environment |
17 |
|
source /etc/profile |
18 |
|
|
19 |
MAGERC="/etc/mage.rc" |
MAGERC="/etc/mage.rc" |
20 |
MAGEPROFILE="alx-060" |
MAGEPROFILE="alx-060" |
21 |
NEW_MAGE_DISTRIBUTION="unstable" |
NEW_MAGE_DISTRIBUTION="unstable" |
27 |
CONFIGRC="/etc/alxconfig-ng/config.rc" |
CONFIGRC="/etc/alxconfig-ng/config.rc" |
28 |
NEW_ALX_NETWORKING="dhcp" |
NEW_ALX_NETWORKING="dhcp" |
29 |
NEW_ALX_DHCP_PROG="/sbin/udhcpc" |
NEW_ALX_DHCP_PROG="/sbin/udhcpc" |
30 |
NEW_ALX_DHCP_START="-T 10" |
NEW_ALX_DHCP_START="-T 10 -t 5 -n -i" |
31 |
NEW_ALX_DHCP_STOP="" |
NEW_ALX_DHCP_STOP="" |
32 |
|
NEW_MIN_DISK_SPACE="85000" |
33 |
|
|
34 |
read_value() |
read_value() |
35 |
{ |
{ |
76 |
|
|
77 |
# fix config.rc |
# fix config.rc |
78 |
CONFIG="${CONFIGRC}" |
CONFIG="${CONFIGRC}" |
79 |
updateconfig ALX_NETWORKING ALX_DHCP_PROG ALX_DHCP_START ALX_DHCP_STOP |
updateconfig ALX_NETWORKING ALX_DHCP_PROG ALX_DHCP_START ALX_DHCP_STOP MIN_DISK_SPACE |
80 |
|
|
81 |
# fix profile |
# fix profile |
82 |
if [[ $(readlink /etc/mage-profile) != */${MAGEPROFILE} ]] |
if [[ $(readlink /etc/mage-profile) != */${MAGEPROFILE} ]] |
113 |
touch /.dist-upgrade |
touch /.dist-upgrade |
114 |
fi |
fi |
115 |
|
|
116 |
|
# check for -f option |
117 |
|
if [[ -n $(magequery -h | grep -- -f) ]] |
118 |
|
then |
119 |
|
# uninstall all /usr/X11R6 packages first |
120 |
|
for i in $(magequery -f /usr/X11R6 | sed 's:.*/\(.*\)-.*-r.*:\1:') |
121 |
|
do |
122 |
|
mage uninstall ${i} |
123 |
|
done |
124 |
|
fi |
125 |
|
# if /usr/X11R6 is a directoy, simply delete it with the content |
126 |
|
[ -d /usr/X11R6 ] && rm -rf /usr/X11R6 |
127 |
|
|
128 |
# install new toolchain if not exist |
# install new toolchain if not exist |
129 |
TOOLCHAIN="$(< /etc/mage-profile/toolchain.defaults)" |
TOOLCHAIN="$(< /etc/mage-profile/toolchain.defaults)" |
130 |
if [[ -z $(magequery -n ${TOOLCHAIN}) ]] |
if [[ -z $(magequery -n ${TOOLCHAIN}) ]] |
179 |
do |
do |
180 |
# excludes |
# excludes |
181 |
case ${i} in |
case ${i} in |
182 |
|
alxconfig-ng) continue ;; |
183 |
|
alxinstall-ng) continue ;; |
184 |
kernel-alx) continue ;; |
kernel-alx) continue ;; |
185 |
kernel26-alx) continue ;; |
kernel26-alx) continue ;; |
186 |
kernel-sources-alx) continue ;; |
kernel-sources-alx) continue ;; |
236 |
rm -f /.orphaned |
rm -f /.orphaned |
237 |
fi |
fi |
238 |
|
|
239 |
if [[ -f /.dist-upgrade ]] |
#if [[ -f /.dist-upgrade ]] |
240 |
then |
#then |
241 |
rm -f /.dist-upgrade |
# rm -f /.dist-upgrade |
242 |
# force a reboot at this point here |
# # force a reboot at this point here |
243 |
reboot -f |
# ( reboot -f & ); exit 0 |
244 |
fi |
#fi |