Make shdir a complete path to ease it's use.
[catalyst.git] / targets / support / netboot2-final.sh
1 #!/bin/bash
2
3 source ${clst_shdir}/support/functions.sh
4 source ${clst_shdir}/support/filesystem-functions.sh
5
6
7 extract_kernels ${clst_target_path}boot
8
9 # Move kernel binaries to ${clst_target_path}kernels, and
10 # move everything else to ${clst_target_path}kernels/misc
11 mkdir ${clst_target_path}kernels
12 mkdir ${clst_target_path}kernels/misc
13
14 for x in ${clst_boot_kernel}; do
15         mv ${clst_target_path}boot/${x} ${clst_target_path}kernels
16         mv ${clst_target_path}boot/${x}.igz ${clst_target_path}kernels/misc
17         mv ${clst_target_path}boot/System.map* ${clst_target_path}kernels/misc/System.map-${x}
18 done
19
20 rmdir ${clst_target_path}boot
21
22 # Any post-processing necessary for each architecture can be done here.  This
23 # may include things like sparc's elftoaout, x86's PXE boot, etc.
24 case ${clst_hostarch} in
25         alpha)
26                 sleep 0
27                 ;;
28         arm)
29                 sleep 0
30                 ;;
31         hppa)
32                 # Only one kernel should be there
33                 kname=${clst_boot_kernel[0]}
34                 rm -f ${clst_target_path}/${kname}-hppa.lif
35
36                 palo \
37                         -k ${clst_target_path}/kernels/${kname} \
38                         -r ${clst_target_path}/kernels/misc/${kname}.igz \
39                         -s ${clst_target_path}/${kname}-hppa.lif \
40                         -f /dev/null \
41                         -b /usr/share/palo/iplboot \
42                         -c "0/vmlinux initrd=0/ramdisk root=/dev/ram0" \
43                         || exit 1
44
45                 ;;
46         sparc*)
47                 if [ "${clst_subarch}" == "sparc" ]; then
48                         piggyback=piggyback
49                 else
50                         piggyback=piggyback64
51                 fi
52                 for x in ${clst_boot_kernel}; do
53                         elftoaout ${clst_target_path}/kernels/${x} -o ${clst_target_path}${x}-a.out
54                         ${piggyback} ${clst_target_path}/${x}-a.out ${clst_target_path}kernels/misc/System.map-${x} ${clst_target_path}kernels/misc/${x}.igz
55                 done
56                 ;;
57         ia64)
58                 sleep 0
59                 ;;
60         x86|amd64)
61                 sleep 0
62                 ;;
63 esac
64 exit $?