@@ -21,14 +21,20 @@ reset_entry() {
2121}
2222
2323filedir=` dirname $file `
24+ DEBUG " filedir= $filedir "
2425bootdir=" ${bootdir%%/ } "
26+ DEBUG " bootdir= $bootdir "
2527bootlen=" ${# bootdir} "
28+ DEBUG " bootlen= $bootlen "
2629appenddir=" ${filedir: $bootlen } "
30+ DEBUG " appenddir= $appenddir "
2731
2832fix_path () {
2933 path=" $@ "
3034 if [ " ${path: 0: 1} " != " /" ]; then
35+ DEBUG " fix_path: path was $@ "
3136 path=" $appenddir /$path "
37+ DEBUG " fix_path: path is now $path "
3238 fi
3339}
3440
@@ -38,7 +44,10 @@ check_path() {
3844 local checkpath firstval
3945 checkpath=" $1 "
4046 firstval=" $( echo " $checkpath " | cut -d\ -f1) "
41- if ! [ -r " $bootdir$firstval " ]; then return 1; fi
47+ if ! [ -r " $bootdir$firstval " ]; then
48+ DEBUG " $bootdir$firstval doesn't exist"
49+ return 1;
50+ fi
4251 return 0
4352}
4453
@@ -111,26 +120,30 @@ grub_entry() {
111120 # TODO: differentiate between Xen and other multiboot kernels
112121 kexectype=" xen"
113122 kernel=" $val "
123+ DEBUG " grub_entry multiboot kernel= $kernel "
114124 ;;
115125 module* )
116126 case $val in
117127 --nounzip* ) val=` echo $val | cut -d\ -f2-` ;;
118128 esac
119129 fix_path $val
120130 modules=" $modules |module $path "
131+ DEBUG " grub_entry linux modules= $modules "
121132 ;;
122133 linux* )
123134 # Some configs have a device specification in the kernel
124135 # or initrd path. Assume this would be /boot and remove
125136 # it. Keep the '/' following the device, since this
126137 # path is relative to the device root, not the config
127138 # location.
139+ DEBUG " grub_entry : linux trimcmd prior of kernel/append parsing: $trimcmd "
128140 kernel=` echo $trimcmd | sed " s/([^)]*)//g" | cut -d\ -f2`
129141 append=` echo $trimcmd | cut -d\ -f3-`
130142 ;;
131143 initrd* )
132144 # Trim off device specification as above
133145 initrd=" $( echo " $val " | sed " s/([^)]*)//g" ) "
146+ DEBUG " grub_entry: linux initrd= $initrd "
134147 ;;
135148 esac
136149}
@@ -205,17 +218,20 @@ syslinux_entry() {
205218 state=" search"
206219 ;;
207220 * )
208- kernel=" ${val# " $bootdir " } "
221+ kernel=" $val "
222+ DEBUG " kernel= $kernel "
209223 esac
210224 ;;
211225 initrd* | INITRD* )
212- initrd=" ${val# " $bootdir " } "
226+ initrd=" $val "
227+ DEBUG " initrd= $initrd "
213228 ;;
214229 append* | APPEND* )
215230 if [ " $kexectype " = " multiboot" -o " $kexectype " = " xen" ]; then
216231 syslinux_multiboot_append
217232 else
218233 append=" $val "
234+ DEBUG " append= $append "
219235 fi
220236 ;;
221237 esac
0 commit comments