]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/altboot/files/altboot-menu/Advanced/35-kexec
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / altboot / files / altboot-menu / Advanced / 35-kexec
1 # !/bin/sh
2 M_TITLE="init=/bin/sh"
3
4 exit 0
5
6 # Only kernel 2.6 offers kexec support
7 uname -r | grep -q "^2.6" || exit 0
8
9 run_module() {
10         
11         test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"
12         
13         test -z "$KEXEC_KERNEL_DIR" && KEXEC_KERNEL_DIR="/boot" 
14         test -x "$KEXEC_BIN" || die "kexec-tools not found [$KEXEC_BIN]"
15         
16         # Mount /proc, etc
17         init_rootfs
18         
19         if test "`find "$KEXEC_KERNEL_DIR" -type f -name "*zImage*" | wc -l | tr -d " "`" -gt 1
20         then
21                 echo "Please choose a kernel to boot:"
22                 cd "$KEXEC_KERNEL_DIR"
23                 
24                 cnt=1
25                 for f in `ls -1 "$KEXEC_KERNEL_DIR"`
26                 do      
27                         echo "[$cnt] $f"
28                         let cnt=$cnt+1
29                 done
30                 
31                 while true
32                 do
33                         echo -n "Boot kernel: "
34                         read junk
35                         
36                         if test -n "$junk"
37                         then
38                                 cnt=1
39                                 for f in `ls -1 "$KEXEC_KERNEL_DIR"`
40                                 do      
41                                         if test "$cnt" = "$junk"
42                                         then
43                                                 KEXEC_KERNEL="$f"
44                                                 break
45                                         fi
46                                         let cnt=$cnt+1                                  
47                                 done
48                         fi
49                 done
50                 
51                 echo "kernel dir:[$KEXEC_KERNEL_DIR]"
52                 echo "Using kernel: [$KEXEC_KERNEL]"
53                 
54                                 
55         for 
56 }
57
58 case "$1" in
59 title)  echo "$M_TITLE";;
60 run)    run_module;;
61 esac
62