blob: 96d2f7d88149f9c385215e91c84c8d6af5db526a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
#!/bin/sh
action() { echo $1; shift; $*; }
DATE=`date +%Y%m%d-%Hh%M`
KADIR="/ka2"
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
echo -e "\t\t\tWelcome to \\033[1;36mMageia\\033[0;39m Linux"
action "Remounting root filesystem in read-write mode" mount -n -o remount,rw /
echo "Starting udev"
mkdir /run
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
mkdir -p /run/udev/rules.d
export UDEVRULESD=/run/udev/rules.d
mount -t devtmpfs -o mode=0755,nosuid devtmpfs /dev
mkdir /dev/pts
mkdir /dev/shm
mount /dev/pts
mount /dev/shm
/lib/udev/udevd --daemon --resolve-names=never
udevadm trigger --type=subsystems --action=add
udevadm trigger --type=devices --action=add
ln -s /tmp/stage2/etc/* /etc 2>/dev/null
# make passwd changable
rm -f /etc/passwd
cp /tmp/stage2/etc/passwd /etc/
mkdir -p /mnt /var/log
>/etc/mtab
mount -f /
mount -f /proc
# Set the hostname.
action "Setting hostname rescue" hostname rescue
echo rescue > /etc/HOSTNAME
# Loads common modules ( no kerneld :( )
echo "Loading additional modules..."
load() { modprobe $* 2>/dev/null; }
load ide-gd_mod
load ide-cd_mod
load floppy
load af_packet
load isofs
load vfat
load ext3
load ext4
load reiserfs
load xfs
load jfs
load loop
load sd_mod
load sr_mod
echo "Setting local loop"
/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0
/sbin/route add 127.0.0.1 lo
# disable the weird echoprt in cooked mode for user interaction:
stty sane
#LANGUAGE (filled by make_rescue_img)
grep -q noauto /proc/cmdline || drvinst SERIAL_USB
partimage_default_dir=/data/box
partimage_dir=`perl -lne 'print $1 if /BOX=(\S+)/' /proc/cmdline`
[ -z "$partimage_dir" ] && partimage_dir=$partimage_default_dir
partimage_server=`perl -lne 'print $1 if /\bpserver=(\S+)/' /proc/cmdline`
if grep -q save_all /proc/cmdline; then
partimage_whole_disk -s $partimage_server save_all $partimage_default_dir
elif grep -q rest_all /proc/cmdline; then
if [ -d /tmp/image$partimage_dir ]; then
partimage_whole_disk rest_all /tmp/image$partimage_dir
else
partimage_whole_disk -s $partimage_server rest_all $partimage_dir
fi
elif grep -q oem /proc/cmdline; then
/tmp/image/oem-rescue.sh
elif grep -q restore /proc/cmdline; then
/usr/sbin/restore-image.sh
elif grep -q kamethod /proc/cmdline; then
echo "Welcome to Ka"
drvinst
ln -sf /tmp/stage2/ka $KADIR
ln -sf /tmp/stage2/disk /disk
cd $KADIR
echo "-------- Starting LOG server -------------"
perl send_status.pl > /tmp/kacmd &
exec ./ka_replication.sh > /tmp/ka_log-$HOSTNAME-$DATE 2>&1
elif ! grep -q expert /proc/cmdline; then
echo "starting GUI"
rescue-gui
fi
|