command: add new build flag '--kernel'

New flag '--kernel' is to override and select the kernel package to be
installed instead of running by 'get_kernel_package()'.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Ib70cd78d357d7f9ff599869da7f5617077305722
This commit is contained in:
Dongjin Kim
2022-05-06 15:41:52 +09:00
parent 4aec18ae6a
commit c0a37afdb0
2 changed files with 8 additions and 1 deletions

View File

@@ -402,6 +402,11 @@ do_preinstall() {
;;
esac
DEFAULT_KERNEL_PACKAGE=$(get_kernel_package)
[ ! "x${opt_kernel_package}" = "x" ] && DEFAULT_KERNEL_PACKAGE=${opt_kernel_package}
echo ${DEFAULT_KERNEL_PACKAGE}
FIXUPS=`ls -A1 ${rootfs_mnt}${fixups_dir}/*`
for fixup in ${FIXUPS}; do
sed -i \
@@ -410,7 +415,7 @@ do_preinstall() {
-e "s,@@DEFAULT_APT_OPTIONS@@,$(get_default_apt_options ${FLAVOUR}),g" \
-e "s,@@DEFAULT_FLAVOUR_PACKAGES@@,$(get_flavour_packages),g" \
-e "s,@@DEFAULT_BLACKLIST_PACKAGES@@,$(get_blacklist_packages),g" \
-e "s,@@DEFAULT_KERNEL_PACKAGE@@,$(get_kernel_package),g" \
-e "s,@@DEFAULT_KERNEL_PACKAGE@@,${DEFAULT_KERNEL_PACKAGE},g" \
-e "s,@@DEFAULT_BOOTSCRIPT_PACKAGE@@,$(get_bootscript_package),g" \
-e "s,@@DEFAULT_MACHINE_NAME@@,$(get_machine_name),g" \
-e "s,@@LINUX_KERNEL_CMDLINE@@,root=UUID=${UUID_ROOT} rootwait ro quiet,g" \

View File

@@ -21,6 +21,7 @@ usage() {
echo " --compress: compress the final OS image using 'xz'."
echo " --keep-builddir: prevent removing temporary directory"
echo " after building an image."
echo " --kernel: kernel package name to use"
exit 1
}
@@ -45,6 +46,7 @@ for opt in "$@"; do
--internal) opt_internal=true;;
--keep-builddir)
opt_keep_builddir=true;;
--kernel=*) opt_kernel_package="${opt#*=}";;
--custom=*)
opt_custom="${opt#*=}";;
esac