add flag to geninstaller to install local subiquity

This commit is contained in:
Michael Hudson-Doyle 2017-01-11 14:53:53 +13:00
parent d6ab3e304e
commit d88ff7bf9a
1 changed files with 14 additions and 3 deletions

View File

@ -23,6 +23,7 @@ LOGFILE="geninstaller.log"
TOPDIR=./ TOPDIR=./
USQUERY=installer/usquery USQUERY=installer/usquery
RESOURCES=installer/resources RESOURCES=installer/resources
LOCAL_SUBIQUITY=no
PKG_DEPS=" PKG_DEPS="
qemu-utils qemu-utils
kpartx kpartx
@ -61,7 +62,6 @@ INSTALLER_DEPS=(
"probert" "probert"
"xfsprogs" "xfsprogs"
"curtin" "curtin"
"subiquity"
) )
CACHEDIR="" CACHEDIR=""
GRUB_MODS="configfile fat part_gpt part_msdos cat echo test search search_label search_fs_uuid boot chain linux reboot halt normal efi_gop efi_uga font gfxterm gfxterm_menu gfxterm_background gfxmenu serial" GRUB_MODS="configfile fat part_gpt part_msdos cat echo test search search_label search_fs_uuid boot chain linux reboot halt normal efi_gop efi_uga font gfxterm gfxterm_menu gfxterm_background gfxmenu serial"
@ -577,6 +577,9 @@ generate_img() {
for installer_package in "${INSTALLER_DEPS[@]}"; do for installer_package in "${INSTALLER_DEPS[@]}"; do
packages="$packages $installer_package" packages="$packages $installer_package"
done done
if [ "${LOCAL_SUBIQUITY}" = "no" ]; then
packages="$packages subiquity"
fi
sudo mv ${resolvconf} ${resolvconf}.old && sudo mv ${resolvconf} ${resolvconf}.old &&
sudo cp /etc/resolv.conf ${resolvconf} && sudo cp /etc/resolv.conf ${resolvconf} &&
@ -599,6 +602,13 @@ generate_img() {
log "Failed to install packages on rootfs"; log "Failed to install packages on rootfs";
return 1; return 1;
} }
if [ "${LOCAL_SUBIQUITY}" = "yes" ]; then
dpkg-buildpackage -uc -us
V=$(dpkg-parsechangelog -SVersion)
sudo cp ../subiquity_${V}*.deb ../subiquitycore_${V}*.deb ${mnt}
sudo chroot ${mnt} sh -c 'dpkg -i *.deb'
sudo chroot ${mnt} apt-get install -f
fi
log "Cleaning up overlay apt cache" log "Cleaning up overlay apt cache"
local before=( `sudo du -sk ${upper}` ) local before=( `sudo du -sk ${upper}` )
@ -658,8 +668,8 @@ parse_args() {
# args: # args:
[ $# -lt 1 ] && { usage; exit 0; } [ $# -lt 1 ] && { usage; exit 0; }
OPTS_LONG="arch:,bootloader:,download:,help,release:,stream:,verbose,version:" OPTS_LONG="arch:,bootloader:,download:,help,release:,stream:,verbose,version:,local-subiquity"
OPTS="a:b:d:hor:s:vV:" OPTS="a:b:d:hor:s:vV:l"
ARGS=`getopt --name "$PROG" --long $OPTS_LONG --options $OPTS -- "$@"` ARGS=`getopt --name "$PROG" --long $OPTS_LONG --options $OPTS -- "$@"`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$PROG: usage error (use -h for help)" >&2 echo "$PROG: usage error (use -h for help)" >&2
@ -684,6 +694,7 @@ parse_args() {
-s | --stream) STREAM="$2"; shift;; -s | --stream) STREAM="$2"; shift;;
-V | --version) VERSION="$2"; shift;; -V | --version) VERSION="$2"; shift;;
-v | --verbose) VERBOSE="yes";; -v | --verbose) VERBOSE="yes";;
-l | --local-subiquity) LOCAL_SUBIQUITY="yes";;
--) shift; break;; # end of options --) shift; break;; # end of options
esac esac
shift shift