Remove deprecated disk-image-get-kernel
This script has been deprecated in favor of the baremetal element for some time. Lets remove it. Change-Id: Idd7db766a039ba8e74f0e98e74eb27246e753f4b
This commit is contained in:
parent
96c134b429
commit
8cf37064a5
@ -1,5 +1,4 @@
|
|||||||
include bin/disk-image-create
|
include bin/disk-image-create
|
||||||
include bin/disk-image-get-kernel
|
|
||||||
include bin/element-info
|
include bin/element-info
|
||||||
include bin/ramdisk-image-create
|
include bin/ramdisk-image-create
|
||||||
graft lib
|
graft lib
|
||||||
|
@ -37,10 +37,6 @@ What tools are there?
|
|||||||
To generate kernel+ramdisk pair for use with ironic, use
|
To generate kernel+ramdisk pair for use with ironic, use
|
||||||
ramdisk-image-create -o deploy.ramdisk deploy-ironic
|
ramdisk-image-create -o deploy.ramdisk deploy-ironic
|
||||||
|
|
||||||
* disk-image-get-kernel filename : **DEPRECATED** Extract the appropriate
|
|
||||||
kernel and ramdisk to use when doing PXE boot using filename as the image
|
|
||||||
for a machine. Consider using the `baremetal` element, rather than this tool.
|
|
||||||
|
|
||||||
* elements can be found in the top level elements directory.
|
* elements can be found in the top level elements directory.
|
||||||
|
|
||||||
* element-info : Extract information about elements.
|
* element-info : Extract information about elements.
|
||||||
|
@ -1,90 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Copyright 2012 Hewlett-Packard Development Company, L.P.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
# not use this file except in compliance with the License. You may obtain
|
|
||||||
# a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SCRIPTNAME=$(basename $0)
|
|
||||||
SCRIPT_HOME=$(dirname $0)
|
|
||||||
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
|
|
||||||
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
|
|
||||||
else
|
|
||||||
export _PREFIX=$SCRIPT_HOME/..
|
|
||||||
fi
|
|
||||||
export _LIB=$_PREFIX/lib
|
|
||||||
source $_LIB/die
|
|
||||||
|
|
||||||
function show_options () {
|
|
||||||
echo "Usage: $SCRIPTNAME -i <image> [-d <outdir>] [-o <prefix]"
|
|
||||||
echo
|
|
||||||
echo "Options:"
|
|
||||||
echo " -i filename -- extract kernel + ramdisk from this file"
|
|
||||||
echo " -d dir -- save files in \$dir; defaults to /tmp"
|
|
||||||
echo " -o prefix -- set the prefix of the output files; defaults to 'baremetal'"
|
|
||||||
echo " eg, baremetal-vmlinuz and baremetal-initrd"
|
|
||||||
echo " -x -- turn on tracing"
|
|
||||||
echo " -h -- print this message"
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
echo 'DEPRECATED: Please consider using the `baremetal` element.'
|
|
||||||
echo
|
|
||||||
|
|
||||||
TEMP=`getopt -o hd:i:o:x -n $SCRIPTNAME -- "$@"`
|
|
||||||
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
|
|
||||||
|
|
||||||
# Note the quotes around `$TEMP': they are essential!
|
|
||||||
eval set -- "$TEMP"
|
|
||||||
|
|
||||||
export OUT_DIR=/tmp
|
|
||||||
export OUT_PFX=baremetal
|
|
||||||
|
|
||||||
while true ; do
|
|
||||||
case "$1" in
|
|
||||||
-d) export OUT_DIR=$2; shift 2 ;;
|
|
||||||
-i) export IMAGE_FILE=$2; shift 2 ;;
|
|
||||||
-o) export OUT_PFX=$2; shift 2 ;;
|
|
||||||
-h) show_options;;
|
|
||||||
-x) shift; set -x;;
|
|
||||||
--) shift ; break ;;
|
|
||||||
*) echo "Internal error!" ; exit 1 ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ ! -n "$IMAGE_FILE" ]]; then
|
|
||||||
die "You must specify an image to read from with -i \$filename"
|
|
||||||
elif [[ ! -r "$IMAGE_FILE" ]]; then
|
|
||||||
die "Image file $IMAGE_FILE is not readable"
|
|
||||||
fi
|
|
||||||
|
|
||||||
source $_LIB/img-defaults
|
|
||||||
source $_LIB/common-functions
|
|
||||||
source $_LIB/img-functions
|
|
||||||
|
|
||||||
echo "Extracting kernel + ramdisk from $IMAGE_FILE to $OUT_PFX-vmlinuz and $OUT_PFX-initrd in $OUT_DIR"
|
|
||||||
|
|
||||||
ensure_nbd
|
|
||||||
|
|
||||||
# sets WORK_DIR
|
|
||||||
mount_qcow_image $IMAGE_FILE
|
|
||||||
|
|
||||||
select_boot_kernel_initrd $WORK_DIR
|
|
||||||
|
|
||||||
sudo cp $BOOTDIR/$KERNEL $OUT_DIR/$OUT_PFX-vmlinuz
|
|
||||||
sudo cp $BOOTDIR/$RAMDISK $OUT_DIR/$OUT_PFX-initrd
|
|
||||||
sudo chmod a+r $OUT_DIR/$OUT_PFX-vmlinuz
|
|
||||||
sudo chmod a+r $OUT_DIR/$OUT_PFX-initrd
|
|
||||||
|
|
||||||
unmount_qcow_image
|
|
@ -24,12 +24,6 @@ Components
|
|||||||
|
|
||||||
ramdisk-image-create -o deploy.ramdisk deploy-ironic
|
ramdisk-image-create -o deploy.ramdisk deploy-ironic
|
||||||
|
|
||||||
`disk-image-get-kernel filename`
|
|
||||||
|
|
||||||
**DEPRECATED** Extract the appropriate kernel and ramdisk to use when doing
|
|
||||||
PXE boot using filename as the image for a machine. Consider using the
|
|
||||||
:ref:`element-baremetal` element, rather than this tool.
|
|
||||||
|
|
||||||
|
|
||||||
`element-info`
|
`element-info`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user