Debian Codegraph @

scripts/sbin/drbl-prepare-pxelinux

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # Steven Shiau <steven _at_ clonezilla org>, Ceasar Sun <ceasar _at_ nchc org tw>
3 # License: GPL
4 # Description: prepare the pxelinux by using the files on the system or download and extract the required programs for DRBL.
5 DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"
6
7 . $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions
8 [scip-shell system . . `[`. -e /etc/drbl/drbl-ocs.confscip-shell filesystem . . `/etc/drbl/drbl-ocs.conf`. ] && . /etc/drbl/drbl-ocs.confscip-shell source . . `/etc/drbl/drbl-ocs.conf`.
9 [scip-shell system . . `[`. -e $DRBL_SCRIPT_PATH/sbin/ocs-functions ] && . $DRBL_SCRIPT_PATH/sbin/ocs-functions
10
11 # Local settings
12 # Not existing in ubuntu syslinux package: gpxelinux.0 sanboot.c32 hdt.c32
13 # The files are in /usr/lib/syslinux/ on Ubuntu 10.04 syslinux 3.63.
14 # Debian has syslinux-common, and the above files are in syslinux-common, but ubuntu 10.04 does not, and ubuntu 11.04 does.
15 # For Syslinux 5, new .c32 are required: ldlinux.c32, libcom32.c32, libutil.c32
16 DRBL_NEED_PXELINUX_common="isolinux.bin memdisk pxelinux.0 lpxelinux.0 gpxelinux.0 mbr.bin"
17 DRBL_NEED_PXELINUX_modules="menu.c32 vesamenu.c32 chain.c32 mboot.c32 sanboot.c32 hdt.c32 $sys_pxelinux_v5p_required_c32"
18 DRBL_NEED_PXELINUX="$DRBL_NEED_PXELINUX_common $DRBL_NEED_PXELINUX_modules"
19 # By default we only copy the required files to $pxelinux_binsrc_dir. This option will allow us to copy files to dir $pxecfg_pd.
20 deploy_to_system_too="no"
21 # default not verbose
22 verbose="no"
23
24 # Functions
25 USAGEscip-shell shell shell-project 0.0.0 USAGE().() {
26 echoscip-shell system . . echo. "Put the pxelinux files in DRBL package repository"
27 echoscip-shell system . . echo. "Usage: $0 [OPTION]"
28 echoscip-shell system . . echo. "OPTION:"
29 echoscip-shell system . . echo. "-u, --from-upstream Use the binary from upstream ($syslinux_binsrc_url). If this option is not assigned, DRBL will try to use the pxelinux from your GNU/Linux distribution."
30 echoscip-shell system . . echo. "-pv, --pxelinux-version VERSION The pxelinux version to be used with -u|--from-upstream. If not assigned, the version number specified in drbl.conf will be used."
31 echoscip-shell system . . echo. "-d, --deploy-to-system-too Deploy the files to DRBL system ($pxecfg_pd), too."
32 echoscip-shell system . . echo. "-v, --verbose show verbose messages."
33 echoscip-shell system . . echo. "Ex: To use the pxelinux 4.04 from $syslinux_binsrc_url, run '$0 -u -pv 4.04'"
34 }
35
36 #
37 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo().() {
38 local pxelinux_extracted_bin_abs_path="$1" # source dir name
39 local pxelinux_system_abs_path="$2" # destination dir name
40 [scip-shell system . . `[`. -z "$pxelinux_extracted_bin_abs_path" ] && return 1
41 [scip-shell system . . `[`. -z "$pxelinux_system_abs_path" ] && return 1
42 echoscip-shell system . . echo. -n "Putting required pxelinux files to $pxelinux_system_abs_path... "
43 mkdirscip-shell system . . mkdir. -p $pxelinux_system_abs_path
44 installscip-shell system . . install. -o root -g root -m 644 $pxelinux_extracted_bin_abs_path/* $pxelinux_system_abs_path
45 pxelinux_v="$(LC_ALL=C stringsscip-shell system . . strings. $pxelinux_file | grepscip-shell system . . grep. "^PXELINUX")"
46 echoscip-shell system . . echo. $pxelinux_v > $pxelinux_binsrc_dir/VERSION
47 echoscip-shell system . . echo. "done!"
48 } # end of put_pxelinux_bin_2_drbl_repo
49
50 #
51 put_upstream_pxelinuxscip-shell shell shell-project 0.0.0 put_upstream_pxelinux().(){
52 # Function to use the upstream binary directly
53 local ver="$1"
54 local tmp_wd syslinux_tarball syslinux_ver_subdir
55 if [scip-shell system . . `[`. -z "$ver" ]; then
56 [scip-shell system . . `[`. "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE
57 echoscip-shell system . . echo. "No upstream syslinux/pxelinux version was assigned. Program terminated."
58 [scip-shell system . . `[`. "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
59 USAGEscip-shell shell shell-project 0.0.0 USAGE().
60 exit 1
61 fi
62 syslinux_tarball="syslinux-${ver}.tar.xz"
63 tmp_wd="$(LC_ALL=C mktempscip-shell system . . mktemp. -d /tmp/syslinux_tmp.XXXXXXXscip-shell filesystem . . `/tmp/syslinux_tmp.XXXXXXX`.)"
64 mkdirscip-shell system . . mkdir. -p $tmp_wd/upstream
65 if [scip-shell system . . `[`. -z "$(echoscip-shell system . . echo. $ver | grepscip-shell system . . grep. -iE -- "-pre[[:digit:]]+")" ]; then
66 # Stable release, not testing version.
67 # Convert the version number to subdir name, e..g 4.04 -> 4.xx
68 syslinux_ver_subdir="$(LC_ALL=C echoscip-shell system . . echo. "$ver" | sedscip-shell system . . sed. -r -e "s/\.[[:digit:]]*$/\.xx/g")"
69 else
70 # Testing release. File name is like: syslinux-6.02-pre16.tar.xz
71 # The URL for such a testing version is like: http://free.nchc.org.tw/syslinux/Testing/6.02/
72 syslinux_ver_subdir="$(LC_ALL=C echoscip-shell system . . echo. "$ver" | sedscip-shell system . . sed. -r -e "s/-pre[[:digit:]]+$//g")"
73 syslinux_ver_subdir="Testing/$syslinux_ver_subdir"
74 fi
75 #echo -n "Downloading ${ver} syslinux/pxelinux files from $syslinux_binsrc_url... "
76 #LC_ALL=C wget $wget_opt -P $tmp_wd $syslinux_binsrc_url/$branch_path/$syslinux_tarball
77 echoscip-shell system . . echo. "Downloading $syslinux_binsrc_url/$syslinux_ver_subdir/$syslinux_tarball..."
78 LC_ALL=C wget $wget_opt -P $tmp_wd $syslinux_binsrc_url/$syslinux_ver_subdir/$syslinux_tarball
79 echoscip-shell system . . echo. "done!"
80 LC_ALL=C tarscip-shell system . . tar. -xJf $tmp_wd/$syslinux_tarball -C $tmp_wd/upstream
81 mkdirscip-shell system . . mkdir. -p $tmp_wd/extracted/syslinux
82 echoscip-shell system . . echo. "Extracting the required files for DRBL..."
83 # Check if the tarball contains multiple arch (bios, efi32, and efi64) support.
84 if [scip-shell system . . `[`. -n "$(findscip-shell system . . find. $tmp_wd/upstream -iname "efi64" -type d 2>/dev/nullscip-shell filesystem . . `/dev/null`.)" ]; then
85 syslinux_arch="multiple"
86 else
87 syslinux_arch="single"
88 fi
89 case "$syslinux_arch" in
90 "single")
91 for iprog in $DRBL_NEED_PXELINUX; do
92 findscip-shell system . . find. $tmp_wd/upstream -name "$iprog" -type f -exec cp -af $v_opt {} $tmp_wd/extracted/syslinux/ \;
93 done
94 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd/extracted/syslinux/ $pxelinux_binsrc_dir/bios/
95 ;;
96 "multiple")
97 # For syslinux 6.x, *.c32 modules for different arch are put in bios/, efi32, or efi64/
98 for iprog in $DRBL_NEED_PXELINUX_common; do
99 findscip-shell system . . find. $tmp_wd/upstream -name "$iprog" -type f -exec cp -af $v_opt {} $tmp_wd/extracted/syslinux/ \;
100 done
101 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd/extracted/syslinux/ $pxelinux_binsrc_dir/bios/
102 rmscip-shell system . . rm. -f $v_opt $tmp_wd/extracted/syslinux/*
103 for iarch in bios efi32 efi64; do
104 for iprog in $DRBL_NEED_PXELINUX_modules; do
105 # Here we search the files under syslinux/
106 findscip-shell system . . find. $tmp_wd/upstream/*/$iarch/ -name "$iprog" -type f -exec cp -af $v_opt {} $tmp_wd/extracted/syslinux/ \;
107 done
108 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd/extracted/syslinux/ $pxelinux_binsrc_dir/$iarch/
109 rmscip-shell system . . rm. -f $v_opt $tmp_wd/extracted/syslinux/*
110 done
111 # Some more extra files for efi32 and efi64
112 findscip-shell system . . find. $tmp_wd/upstream/*/efi32/ -name "syslinux.efi" -type f -exec \
113 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi32/ \;
114 findscip-shell system . . find. $tmp_wd/upstream/*/efi32/ -name "ldlinux.e32" -type f -exec \
115 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi32/ \;
116 findscip-shell system . . find. $tmp_wd/upstream/*/efi64/ -name "syslinux.efi" -type f -exec \
117 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi64/ \;
118 findscip-shell system . . find. $tmp_wd/upstream/*/efi64/ -name "ldlinux.e64" -type f -exec \
119 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi64/ \;
120 ;;
121 esac
122 if [scip-shell system . . `[`. -d "$tmp_wd" -a -n "$(echoscip-shell system . . echo. "$tmp_wd" | grepscip-shell system . . grep. -i syslinux_tmp)" ]; then
123 rmscip-shell system . . rm. -rf $tmp_wd
124 fi
125 } # end of put_upstream_pxelinux
126 #
127 put_distribution_pxelinuxscip-shell shell shell-project 0.0.0 put_distribution_pxelinux().() {
128 # Function to use the package from distribution.
129 local possible_syslinux_pkgs req_syslinux_pkg_name syslinux_pkgs
130 # First we find pxelinux, then syslinux-common, then syslinux. The order is important.
131 possible_syslinux_pkgs="pxelinux syslinux-common syslinux-nonlinux syslinux"
132 # Package name:
133 # Debian: syslinux-common, for syslinux 6.x, sub-packages, pxelinux is available.
134 # Ubuntu: 10.04: syslinux, > 10.10: syslinux-common
135 # Fedora <=20: syslinux, >= 21: syslinux-nonlinux, by Ceasar
136 # Suse: syslinux
137 for i in $possible_syslinux_pkgs; do
138 if $query_pkglist_exist_cmd $i &>/dev/nullscip-shell filesystem . . `/dev/null`.; then
139 req_syslinux_pkg_name="$i"
140 break
141 fi
142 done
143 tmp_wd="$(LC_ALL=C mktempscip-shell system . . mktemp. -d /tmp/pxelinux_tmp.XXXXXXXscip-shell filesystem . . `/tmp/pxelinux_tmp.XXXXXXX`.)"
144 if [scip-shell system . . `[`. -n "$req_syslinux_pkg_name" ]; then
145 # Found on the system
146 # The syslinux-common version on Debian might be like: 2:4.02+dfsg-7, to compare the version, we'd better to strip the "2:"
147 # syslinux_pkg_ver="$(LC_ALL=C dpkg-query -W -f='${Version}\n' $req_syslinux_pkg_name | sed -r -e "s/^[[:digit:]]*://g")"
148 # echo "Syslinux package version: $syslinux_pkg_ver"
149 # For Redhat-like system, there might return more than one file on a system, i.e. one file belongs to 2 rpm packages.
150 pxelinux_bin="$(LC_ALL=C $query_pkglist_cmd $req_syslinux_pkg_name | grepscip-shell system . . grep. -Ew "pxelinux.0$" | sortscip-shell system . . sort. | headscip-shell system . . head. -n 1)"
151 if [scip-shell system . . `[`. -n "$pxelinux_bin" ]; then
152 pxelinux_v="$(LC_ALL=C stringsscip-shell system . . strings. $pxelinux_bin | grepscip-shell system . . grep. "^PXELINUX")"
153 echoscip-shell system . . echo. "Found $pxelinux_bin in this system:"
154 echoscip-shell system . . echo. "PXELinux version: $pxelinux_v"
155 echoscip-shell system . . echo. "Copying the PXELinux files to DRBL local repository..."
156 # For syslinux 6.x, on Debian another sub-package "pxelinux" from syslinux is separated, and pxelinux.0 is put in /usr/lib/PXELINUX/pxelinux.0, while those *.c32 moduels are in /usr/lib/syslinux/modules/{bios,efi32,efi64}
157 pxelinux_bin_dir="$(LC_ALL=C dirnamescip-shell system . . dirname. $pxelinux_bin)"
158
159 # This part works for both syslinux <= 5 and >=6
160 # For syslinux >=5, collect and put pxelinux.0, lpxelinux.0, gpxelinux.0, and all *.c32
161 # For syslinux >=6, collect and put only pxelinux.0, lpxelinux.0, and gpxelinux.0 because only these 3 files are under $pxelinux_bin_dir/
162 for iprog in $DRBL_NEED_PXELINUX; do
163 findscip-shell system . . find. $pxelinux_bin_dir -name "$iprog" -type f -exec cp -af $v_opt {} $tmp_wd/ \;
164 done
165 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd $pxelinux_binsrc_dir/bios/
166 rmscip-shell system . . rm. -f $v_opt $tmp_wd/*
167 # Centos 7 only provides syslinux 4 which lacks lpxelinux.0.
168 # For compability with DRBL which requires syslinux >= v5, just link it to pxelinux.0
169 if [scip-shell system . . `[`. ! -e "$pxelinux_binsrc_dir/bios/lpxelinux.0" ]; then
170 (cd $pxelinux_binsrc_dir/bios/; lnscip-shell system . . ln. -fs pxelinux.0 lpxelinux.0)
171 fi
172
173 # This part works for syslinux >=6
174 # Those *.c32, isolinux.bin, memdisk, and mbr.bin are copied in this part for syslinux >=6
175 # The above find command only find /usr/lib/PXELINUX for syslinux >=6, but isolinux.bin and memdisk are required. It will search /usr/lib/syslinux if syslinux <=5
176 if [scip-shell system . . `[`. -d /usr/lib/ISOLINUX/scip-shell filesystem . . `/usr/lib/ISOLINUX/`. ]; then
177 findscip-shell system . . find. /usr/lib/ISOLINUX/scip-shell filesystem . . `/usr/lib/ISOLINUX/`. -name "isolinux.bin" -type f -exec \
178 cp -af $v_opt {} $tmp_wd/ \;
179 fi
180 # When syslinux <=6, memdisk will be put by the above find command. No need to copy again.
181 if [scip-shell system . . `[`. -d /usr/lib/syslinux/scip-shell filesystem . . `/usr/lib/syslinux/`. -a ! -e $pxelinux_binsrc_dir/bios/memdisk ]; then
182 findscip-shell system . . find. /usr/lib/syslinux/scip-shell filesystem . . `/usr/lib/syslinux/`. -name "memdisk" -type f -exec \
183 cp -af $v_opt {} $tmp_wd/ \;
184 fi
185 for iarch in bios efi32 efi64; do
186 for iprog in $DRBL_NEED_PXELINUX; do
187 if [scip-shell system . . `[`. -d $pxelinux_bin_dir/../syslinux/modules/$iarch/ ]; then
188 findscip-shell system . . find. $pxelinux_bin_dir/../syslinux/modules/$iarch/ -name "$iprog" \
189 -type f -exec cp -af $v_opt {} $tmp_wd/ \;
190 fi
191 if [scip-shell system . . `[`. "$iarch" = "bios" ]; then
192 # This part is only for mbr.bin of bios, not for efi32 or efi64.
193 # For Debian/Ubuntu, mbr.bin is located in /usr/lib/syslinux/mbr/mbr.bin. Therefore we need to find /usr/lib/syslinux/mbr/, too.
194 # For Fedora/Centos, mbr.bin is located in /usr/share/syslinux/
195 # while since pxelinux_bin=/usr/share/syslinux/pxelinux.0 so pxelinux_bin_dir=/usr/share/syslinux
196 findscip-shell system . . find. $pxelinux_bin_dir/../syslinux/{,mbr/} -name "mbr.bin" \
197 -type f -exec cp -af $v_opt {} $tmp_wd/ \; &>/dev/nullscip-shell filesystem . . `/dev/null`.
198 fi
199 done
200 if [scip-shell system . . `[`. -n "$(lsscip-shell system . . ls. $tmp_wd/* 2>/dev/nullscip-shell filesystem . . `/dev/null`.)" ]; then
201 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd $pxelinux_binsrc_dir/$iarch/
202 fi
203 rmscip-shell system . . rm. -f $v_opt $tmp_wd/*
204 done
205 # Some more extra files for efi32 and efi64
206 if [scip-shell system . . `[`. -d /usr/lib/SYSLINUX.EFI/scip-shell filesystem . . `/usr/lib/SYSLINUX.EFI/`. ]; then
207 findscip-shell system . . find. /usr/lib/SYSLINUX.EFI/efi32/scip-shell filesystem . . `/usr/lib/SYSLINUX.EFI/efi32/`. -name "syslinux.efi" -type f -exec \
208 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi32/ \;
209 findscip-shell system . . find. /usr/lib/SYSLINUX.EFI/efi64/scip-shell filesystem . . `/usr/lib/SYSLINUX.EFI/efi64/`. -name "syslinux.efi" -type f -exec \
210 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi64/ \;
211 fi
212 if [scip-shell system . . `[`. -d /usr/lib/syslinux/modules/scip-shell filesystem . . `/usr/lib/syslinux/modules/`. ]; then
213 findscip-shell system . . find. /usr/lib/syslinux/modules/efi32/scip-shell filesystem . . `/usr/lib/syslinux/modules/efi32/`. -name "ldlinux.e32" -type f -exec \
214 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi32/ \;
215 findscip-shell system . . find. /usr/lib/syslinux/modules/efi64/scip-shell filesystem . . `/usr/lib/syslinux/modules/efi64/`. -name "ldlinux.e64" -type f -exec \
216 install -o root -g root -m 644 {} $pxelinux_binsrc_dir/efi64/ \;
217 fi
218 else
219 [scip-shell system . . `[`. "$BOOTUP" = "color" ] && $SETCOLOR_WARNING
220 echoscip-shell system . . echo. "Package of pxelinux was installed, but pxelinux boot file not found!"
221 [scip-shell system . . `[`. "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL
222 fi
223 else
224 # Download and extract it. The reason we do not install it is we do not want to bother the server's boot menu
225 mkdirscip-shell system . . mkdir. -p $tmp_wd/{extracted,upstream}
226 echoscip-shell system . . echo. "Trying to download syslinux from distribution repository..."
227 if [scip-shell system . . `[`. -e /etc/debian_versionscip-shell filesystem . . `/etc/debian_version`. ]; then
228 # Debian
229 syslinux_pkgs=""
230 for ipkg in $possible_syslinux_pkgs; do
231 if [scip-shell system . . `[`. -n "$(LC_ALL=C apt-cachescip-shell system . . apt-cache. show $ipkg 2>/dev/nullscip-shell filesystem . . `/dev/null`.)" ]; then
232 syslinux_pkgs="$syslinux_pkgs $ipkg"
233 fi
234 done
235 echoscip-shell system . . echo. "Related syslinux package(s) on repository: $syslinux_pkgs"
236 # Clean all stale deb files in the cache dir. Otherwise there might be some old version of debs exist in the cache dir.
237 LC_ALL=C apt-getscip-shell system . . apt-get. clean
238 LC_ALL=C apt-getscip-shell system . . apt-get. -d --reinstall install $syslinux_pkgs
239 for i in $syslinux_pkgs; do
240 LC_ALL=C dpkgscip-shell system . . dpkg. --extract /var/cache/apt/archives/${i}_*.deb $tmp_wd/upstream
241 done
242 for iprog in $DRBL_NEED_PXELINUX; do
243 findscip-shell system . . find. $tmp_wd/upstream -name "$iprog" -type f -exec cp -af $v_opt {} $tmp_wd/extracted \;
244 done
245 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd/extracted $pxelinux_binsrc_dir/bios/
246 elif [scip-shell system . . `[`. -e /etc/SuSE-releasescip-shell filesystem . . `/etc/SuSE-release`. ]; then
247 # SuSE
248 # The binary for syslinux-common in openSuse 11.3 is: /boot/pxelinux.bin
249 # TODO: Clean cached files in /var/cache/zypp/packages/
250 LC_ALL=C zypper install -d -f -y syslinux
251 pxelinux_rpm="$(LC_ALL=C findscip-shell system . . find. /var/cache/zypp/packages/scip-shell filesystem . . `/var/cache/zypp/packages/`. -name "syslinux-*.rpm" -print)"
252 (
253 cd $tmp_wd/upstream
254 LC_ALL=C rpm2cpio "$pxelinux_rpm" | cpio -idm
255 )
256 for iprog in $DRBL_NEED_PXELINUX; do
257 findscip-shell system . . find. $tmp_wd/upstream -name "$iprog" -type f -exec cp -af $v_opt {} $tmp_wd/extracted \;
258 done
259 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd/extracted $pxelinux_binsrc_dir/bios/
260 else
261 # RH-like
262 LC_ALL=C yumdownloader --destdir $tmp_wd syslinux
263 (
264 cd $tmp_wd/upstream
265 LC_ALL=C rpm2cpio $tmp_wd/syslinux*.rpm | cpio -idm
266 )
267 for iprog in $DRBL_NEED_PXELINUX; do
268 findscip-shell system . . find. $tmp_wd/upstream -name "$iprog" -type f -exec cp -af $v_opt {} $tmp_wd/extracted \;
269 done
270 put_pxelinux_bin_2_drbl_reposcip-shell shell shell-project 0.0.0 put_pxelinux_bin_2_drbl_repo(). $tmp_wd/extracted $pxelinux_binsrc_dir/bios/
271 fi
272 fi
273 if [scip-shell system . . `[`. -d "$tmp_wd" -a -n "$(LC_ALL=C echoscip-shell system . . echo. "$tmp_wd" | grepscip-shell system . . grep. -i pxelinux_tmp)" ]; then
274 rmscip-shell system . . rm. -rf $tmp_wd
275 fi
276 } # end of put_distribution_pxelinux
277
278 ############
279 ### MAIN ###
280 ############
281
282 while [scip-shell system . . `[`. $# -gt 0 ]; do
283 case "$1" in
284 -u|--from-upstream) shift; mode="from-upstream" ;;
285 -pv|--pxelinux-version)
286 shift;
287 if [scip-shell system . . `[`. -z "$(echoscip-shell system . . echo. $1 |grepscip-shell system . . grep. ^-.)" ]; then
288 # skip the -xx option, in case
289 pxelinux_ver_requested="$1"
290 [scip-shell system . . `[`. -z "$pxelinux_ver_requested" ] && USAGEscip-shell shell shell-project 0.0.0 USAGE(). && exit 1
291 shift
292 fi
293 ;;
294 -d|--deploy-to-system-too) shift; deploy_to_system_too="yes" ;;
295 -v|--verbose) shift; verbose="yes" ;;
296 *) USAGEscip-shell shell shell-project 0.0.0 USAGE(). && exit 1 ;;
297 esac
298 done
299 # mode is essential
300 [scip-shell system . . `[`. -z "$mode" ] && mode="from-distribution"
301 [scip-shell system . . `[`. -z "$pxelinux_ver_requested" ] && pxelinux_ver_requested="$SYS_PXELINUX_VER_DEF"
302
303 if [scip-shell system . . `[`. "$verbose" = "yes" ]; then
304 v_opt="-v"
305 fi
306
307 case "$mode" in
308 from-distribution) put_distribution_pxelinuxscip-shell shell shell-project 0.0.0 put_distribution_pxelinux(). ;;
309 from-upstream) put_upstream_pxelinuxscip-shell shell shell-project 0.0.0 put_upstream_pxelinux(). $pxelinux_ver_requested ;;
310 esac
311
312 if [scip-shell system . . `[`. "$deploy_to_system_too" = "yes" ]; then
313 echoscip-shell system . . echo. "Putting required pxelinux files in DRBL system dir $pxecfg_pd... "
314 prepare-files-for-PXE-client -p
315 echoscip-shell system . . echo. "done!"
316 fi
317
318 exit 0