My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
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
#!/bin/bash
#
# kexec auto-boot
# search for grub, kboot, syslinux, isolinux or mb_boot_tv boot confgs
# kexec boot the first one you find.
#
#
#
#
# ROOT is where the rootfs partition is mounted
ROOT=/mnt/rootfs
if [ ! -d "$ROOT" ]; then
mkdir $ROOT
fi

# sda is typically the appletv internal hard drive (there can be only one)
# sdb is typically a USB disk device (pen or HD)
#
#SEARCH1="`ls /dev/sd* | grep sd[b-h][1-9]`"
#SEARCH2=" `ls /dev/sda* | grep sd[a][1-9]`"
SEARCH1="`grep sd[b-h][1-9] /proc/partitions | awk '{print $4}'`"
SEARCH2=" `grep sd[a][1-9] /proc/partitions | awk '{print $4}'`"
SEARCH_PARTITIONS="$SEARCH1""$SEARCH2"
#echo $SEARCH_PARTITIONS

# search for boot configs
for x in $SEARCH_PARTITIONS; do
if `mount -o ro,noatime /dev/${x} $ROOT > /dev/null 2>&1`; then
BOOT_CONFIG=""
if [ -f "$ROOT/mb_boot_tv.conf" ]; then
echo "${x}/mb_boot_tv.conf found"
BOOT_CONFIG=$ROOT/mb_boot_tv.conf
#
elif [ -f "$ROOT/boot/mb_boot_tv.conf" ]; then
echo "${x}/boot/mb_boot_tv.conf found"
BOOT_CONFIG=$ROOT/boot/mb_boot_tv.conf
#

elif [ -f "$ROOT/boot/grub/menu.lst" ]; then
echo "${x}/boot/grub menu.lst found"
BOOT_CONFIG=$ROOT/boot/grub/menu.lst
#
elif [ -f "$ROOT/grub/menu.lst" ]; then
echo "${x}/grub menu.lst found"
BOOT_CONFIG=$ROOT/grub/menu.lst
#

elif [ -f "$ROOT/syslinux.cfg" ]; then
echo "${x}/syslinux.cfg found"
BOOT_CONFIG=$ROOT/syslinux.cfg
#
elif [ -f "$ROOT/isolinux.cfg" ]; then
echo "${x}/isolinux.cfg found"
BOOT_CONFIG=$ROOT/isolinux.cfg
#
elif [ -f "$ROOT/isolinux/isolinux.cfg" ]; then
echo "${x}/isolinux/isolinux.cfg found"
BOOT_CONFIG=$ROOT/isolinux/isolinux.cfg
#

elif [ -f "$ROOT/kboot.conf" ]; then
echo "${x}/kboot.conf found"
BOOT_CONFIG=$ROOT/kboot.conf
#
fi

if [ "$BOOT_CONFIG" != "" ]; then
# a bit odd way to do this because of the quoted
# --command-line params and I'm new to bash
echo "#!/bin/bash" > /tmp/kexec_load.sh
boot_parser --root="$ROOT" --config="$BOOT_CONFIG" >> /tmp/kexec_load.sh
chmod +x /tmp/kexec_load.sh
cat /tmp/kexec_load.sh
if /tmp/kexec_load.sh; then
echo "kexec jump to new kernel"
# umount all filesystem
cd /
umount -a
kexec -e
# if we get here, kexec failed
umount $ROOT
# mount everything again
mount -a
exit 1
fi
fi
#
umount $ROOT
fi
done

exit 0

Change log

r498 by davi...@4pi.com on Jun 15, 2008   Diff
sync with vmware build tree
Go to: 
Project members, sign in to write a code review

Older revisions

r493 by davi...@4pi.com on Jun 12, 2008   Diff
initial commit of recovery-0.7 kernel
and initramfs builds
All revisions of this file

File info

Size: 2631 bytes, 92 lines

File properties

svn:executable
*
Powered by Google Project Hosting