Add Ubuntu based isogen

CR made over debian-isogen for minimizing size and diff
Late, it should move to "ubuntu-isogen" folder

Change-Id: I44e9e55a1fa51e5ebba9ea80f189d793584ec646
This commit is contained in:
Nikolay Fedorov 2020-06-03 13:28:39 +04:00
parent eec2dc44e0
commit 3ca141f151
6 changed files with 25 additions and 25 deletions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ARG FROM=debian:stable
ARG FROM=ubuntu:latest
FROM ${FROM}

View File

@ -22,7 +22,7 @@ IMAGE_NAME ?= isogen
DOCKER_REGISTRY ?= quay.io
IMAGE_PREFIX ?= airshipit
IMAGE_TAG ?= latest
DISTRO ?= debian_stable
DISTRO ?= ubuntu_focal
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}-${DISTRO}
SH_TO_CHECK := $(wildcard files/*.sh )
PROXY ?= http://proxy.foo.com:8000

View File

@ -25,8 +25,6 @@ _debootstrap
chroot "${CHROOT}" < "${BASEDIR}/packages_install.sh"
_use_ubuntu_net_device_names
mkdir -p "${CLOUD_DATA_LATEST}"
cp "${BASEDIR}/meta_data.json" "${CLOUD_DATA_LATEST}"
cp "${USER_DATA}" "${CLOUD_DATA_LATEST}/user_data"

View File

@ -18,19 +18,11 @@ function _debootstrap (){
debootstrap \
--arch=amd64 \
--variant=minbase \
buster \
--foreign \
focal \
"${HOME}"/LIVE_BOOT/chroot \
http://ftp.debian.org/debian/
}
function _use_ubuntu_net_device_names (){
# this prioritizes the path policy over slot
# giving ubuntu compatible interface names
cat <<EOF>"${HOME}"/LIVE_BOOT/chroot/usr/lib/systemd/network/99-default.link
[Link]
NamePolicy=kernel database onboard path slot
MACAddressPolicy=persistent
EOF
http://archive.ubuntu.com/ubuntu/
chroot "${HOME}"/LIVE_BOOT/chroot /debootstrap/debootstrap --second-stage
}
function _make_kernel(){
@ -49,7 +41,7 @@ function _make_kernel(){
function _grub_install (){
cp /builder/grub.conf "${HOME}"/LIVE_BOOT/scratch/grub.cfg
touch "${HOME}/LIVE_BOOT/image/DEBIAN_CUSTOM"
touch "${HOME}/LIVE_BOOT/image/UBUNTU_FOCAL_CUSTOM"
grub-mkstandalone \
--format=i386-pc \
@ -79,14 +71,14 @@ function _make_iso(){
-boot-load-size 4 \
-boot-info-table \
--eltorito-catalog boot/grub/boot.cat \
-output "/config/debian-custom.iso" \
-output "/config/ubuntu-focal.iso" \
-graft-points \
"${HOME}/LIVE_BOOT/image" \
/boot/grub/bios.img="${HOME}/LIVE_BOOT/scratch/bios.img"
}
function _make_metadata(){
echo "bootImagePath: ${2:?}/debian-custom.iso" > "${1:?}"
echo "bootImagePath: ${2:?}/ubuntu-focal.iso" > "${1:?}"
}
function _check_input_data_set_vars(){

View File

@ -1,11 +1,11 @@
search --set=root --file /DEBIAN_CUSTOM
search --set=root --file /UBUNTU_FOCAL_CUSTOM
insmod all_video
set default="0"
set timeout=1
menuentry "Debian Live" {
menuentry "Ubuntu Focal Live" {
linux /vmlinuz boot=live nomodeset ip=frommedia gfxpayload=text overlay-size=70% cpu_init_udelay=10000 console=ttyS0,115200 verbose
initrd /initrd
}

View File

@ -14,12 +14,12 @@
# limitations under the License.
set -xe
echo "debian-live" > /etc/hostname
echo "ubuntu-live" > /etc/hostname
echo "127.0.0.1 localhost" > /etc/hosts
echo "deb http://archive.ubuntu.com/ubuntu focal universe" >> /etc/apt/sources.list
apt-get update && apt-get install -y --no-install-recommends \
linux-image-amd64 \
linux-generic \
live-boot \
cloud-init \
systemd-sysv \
apt-transport-https \
openssh-server \
@ -30,10 +30,20 @@ apt-get update && apt-get install -y --no-install-recommends \
bridge-utils \
tcpdump \
iputils-ping \
vlan
vlan \
locales \
lsb-release \
ebtables
# ensure we support bonding and 802.1q
echo 'bonding' >> /etc/modules
echo '8021q' >> /etc/modules
locale-gen en_US.UTF-8
systemctl enable systemd-networkd
echo 'br_netfilter' >> /etc/modules
apt-get install -y --no-install-recommends \
cloud-init
rm -rf /var/lib/apt/lists/*