tools: Upgrade to bookworm distribution
1.Use Debian bookworm dockerfile; 2.Use the DEBIAN_DISTRIBUTION environment variable instead; 3.Add the bookworm binary package list to support multi distros; TestPlan: PASS: ./stx-init-env --rebuild --cache PASS: stx shell Story: 2011048 Task: 49683 Change-Id: I78367521365c3143f56cde8eae129b7e9890a659 Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
This commit is contained in:
parent
7c9d8e4907
commit
54737363ea
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,420 @@
|
|||
---
|
||||
name: starlingx
|
||||
machine: intel-x86-64
|
||||
image_type:
|
||||
- iso
|
||||
- ostree-repo
|
||||
debootstrap-mirror: deb-merge-all
|
||||
package_feeds: []
|
||||
package_type: external-debian
|
||||
wic:
|
||||
OSTREE_WKS_BOOT_SIZE: ''
|
||||
OSTREE_WKS_EFI_SIZE: --size=32M
|
||||
OSTREE_WKS_ROOT_SIZE: ''
|
||||
OSTREE_WKS_FLUX_SIZE: ''
|
||||
OSTREE_FLUX_PART: fluxdata
|
||||
gpg:
|
||||
gpg_path: /tmp/.lat_gnupg_root
|
||||
ostree:
|
||||
gpgid: Wind-River-Linux-Sample
|
||||
gpgkey: $OECORE_NATIVE_SYSROOT/usr/share/genimage/rpm_keys/RPM-GPG-PRIVKEY-Wind-River-Linux-Sample
|
||||
gpg_password: windriver
|
||||
grub:
|
||||
BOOT_GPG_NAME: SecureBootCore
|
||||
BOOT_GPG_PASSPHRASE: SecureCore
|
||||
BOOT_KEYS_DIR: $OECORE_NATIVE_SYSROOT/usr/share/bootfs/boot_keys
|
||||
BOOT_GPG_KEY: $OECORE_NATIVE_SYSROOT/usr/share/bootfs/boot_keys/BOOT-GPG-PRIVKEY-SecureBootCore
|
||||
BOOT_SINGED_SHIM: $IMAGE_ROOTFS/usr/lib/shim/bootx64.efi
|
||||
BOOT_SINGED_SHIMTOOL: $IMAGE_ROOTFS/usr/lib/shim/mmx64.efi
|
||||
BOOT_SINGED_GRUB: $IMAGE_ROOTFS/boot/efi/EFI/BOOT/grubx64.efi
|
||||
BOOT_EFITOOL: $IMAGE_ROOTFS/usr/lib/efitools/x86_64-linux-gnu/LockDown.efi
|
||||
BOOT_GRUB_CFG: $IMAGE_ROOTFS/boot/efi/EFI/BOOT/grub.cfg
|
||||
BOOT_NOSIG_GRUB: $IMAGE_ROOTFS/boot/efi/EFI/BOOT/bootx64-nosig.efi
|
||||
EFI_SECURE_BOOT: disable
|
||||
packages: []
|
||||
external-packages: []
|
||||
include-default-packages: '0'
|
||||
rootfs-pre-scripts:
|
||||
- |
|
||||
# The StarlingX customize pacakges includes:
|
||||
# - ostree 2019.1
|
||||
export PATH=/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
|
||||
chroot $IMAGE_ROOTFS bash << SCRIPT_ENDOF
|
||||
set -e
|
||||
# Speed up apt/dpkg used for running build-image
|
||||
echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/unsafe-io
|
||||
apt update
|
||||
apt install -y --no-install-recommends linux-image-stx-amd64 linux-rt-image-stx-amd64 grub-common
|
||||
apt install -y --allow-downgrades --allow-unauthenticated --no-install-recommends ostree ostree-boot libostree-1-1 ostree-upgrade-mgr
|
||||
apt install --no-install-recommends -y ifupdown
|
||||
apt install -y bc vim uuid-runtime iputils-ping
|
||||
# Move dpkg database to /usr so it's accessible after the OS /var is
|
||||
# mounted, but make a symlink so it works without modifications to
|
||||
# dpkg or apt
|
||||
mv /var/lib/dpkg /usr/share/dpkg/database
|
||||
ln -sr /usr/share/dpkg/database /var/lib/dpkg
|
||||
SCRIPT_ENDOF
|
||||
rootfs-post-scripts:
|
||||
- |-
|
||||
# Set bash as default shell
|
||||
ln -snf --relative $IMAGE_ROOTFS/bin/bash $IMAGE_ROOTFS/bin/sh
|
||||
- |-
|
||||
# FIXME: OSTree will not set up a link to scratch automagically. Need to
|
||||
# relocate scratch to a more ostree friendly locale
|
||||
mkdir $IMAGE_ROOTFS/var/rootdirs/scratch
|
||||
ln -snf --relative $IMAGE_ROOTFS/var/rootdirs/scratch $IMAGE_ROOTFS/scratch
|
||||
- |-
|
||||
# Make /opt/branding to writable (To make end-user enable to place their branding archive)
|
||||
mkdir $IMAGE_ROOTFS/var/branding
|
||||
mkdir -p $IMAGE_ROOTFS/var/rootdirs/opt
|
||||
ln -snf --relative $IMAGE_ROOTFS/var/branding $IMAGE_ROOTFS/var/rootdirs/opt/branding
|
||||
- |-
|
||||
cat /dev/null > $IMAGE_ROOTFS/etc/resolv.conf
|
||||
- |-
|
||||
cat /dev/null > $IMAGE_ROOTFS/etc/apt/sources.list
|
||||
- |-
|
||||
# Only used for running build-image
|
||||
rm -f etc/dpkg/dpkg.cfg.d/unsafe-io
|
||||
- |-
|
||||
# There is ${IMAGE_ROOTFS}/var/pxeboot/grubx64.efi from parent linux installed
|
||||
# For secure boot feature, it should be replaced with the right one
|
||||
if [ "$EFI_SECURE_BOOT" = enable ]; then
|
||||
install -m 0644 ${IMAGE_ROOTFS}/boot/efi/EFI/BOOT/grubx64.efi ${IMAGE_ROOTFS}/var/pxeboot/grubx64.efi
|
||||
fi
|
||||
environments:
|
||||
- NO_RECOMMENDATIONS="1"
|
||||
- DEBIAN_FRONTEND=noninteractive
|
||||
- KERNEL_PARAMS=crashkernel=2048M apparmor=0 security=apparmor
|
||||
ostree:
|
||||
ostree_use_ab: '0'
|
||||
ostree_osname: debian
|
||||
ostree_skip_boot_diff: '2'
|
||||
ostree_remote_url: ''
|
||||
ostree_install_device: '/dev/sda'
|
||||
OSTREE_GRUB_USER: root
|
||||
OSTREE_GRUB_PW_FILE: $OECORE_NATIVE_SYSROOT/usr/share/bootfs/boot_keys/ostree_grub_pw
|
||||
OSTREE_FDISK_BLM: 2506
|
||||
OSTREE_FDISK_BSZ: 512
|
||||
OSTREE_FDISK_RSZ: 20480
|
||||
OSTREE_FDISK_VSZ: 20480
|
||||
OSTREE_FDISK_FSZ: 32
|
||||
OSTREE_CONSOLE: console=ttyS0,115200
|
||||
debootstrap-key: ''
|
||||
apt-keys:
|
||||
- /opt/LAT/pubkey.rsa
|
||||
iso-grub-entry: |
|
||||
submenu 'UEFI Debian Controller Install' --unrestricted --id=standard {
|
||||
menuentry 'Serial Console' --unrestricted --id=serial {
|
||||
set fallback=1
|
||||
efi-watchdog enable 0 1200
|
||||
linux /bzImage-std %BOOT_PARAMS% traits=controller defaultkernel=vmlinuz-*[!t]-amd64
|
||||
initrd @INITRD@
|
||||
}
|
||||
menuentry 'Graphical Console' --unrestricted --id=graphical {
|
||||
set fallback=1
|
||||
efi-watchdog enable 0 1200
|
||||
linux /bzImage-std %BOOT_PARAMS% traits=controller defaultkernel=vmlinuz-*[!t]-amd64 console=tty1
|
||||
initrd @INITRD@
|
||||
}
|
||||
}
|
||||
|
||||
submenu 'UEFI Debian All-in-one Install' --unrestricted --id=aio {
|
||||
menuentry 'Serial Console' --unrestricted --id=serial {
|
||||
set fallback=1
|
||||
efi-watchdog enable 0 1200
|
||||
linux /bzImage-std %BOOT_PARAMS% traits=controller,worker defaultkernel=vmlinuz-*[!t]-amd64
|
||||
initrd @INITRD@
|
||||
}
|
||||
menuentry 'Graphical Console' --unrestricted --id=graphical {
|
||||
set fallback=1
|
||||
efi-watchdog enable 0 1200
|
||||
linux /bzImage-std %BOOT_PARAMS% traits=controller,worker defaultkernel=vmlinuz-*[!t]-amd64 console=tty1
|
||||
initrd @INITRD@
|
||||
}
|
||||
}
|
||||
|
||||
submenu 'UEFI Debian All-in-one (lowlatency) Install' --unrestricted --id=aio-lowlat {
|
||||
menuentry 'Serial Console' --unrestricted --id=serial {
|
||||
set fallback=1
|
||||
efi-watchdog enable 0 1200
|
||||
linux /bzImage-rt %BOOT_PARAMS% traits=controller,worker,lowlatency defaultkernel=vmlinuz-*-rt-amd64 efi=runtime
|
||||
initrd @INITRD@
|
||||
}
|
||||
menuentry 'Graphical Console' --unrestricted --id=graphical {
|
||||
set fallback=1
|
||||
efi-watchdog enable 0 1200
|
||||
linux /bzImage-rt %BOOT_PARAMS% traits=controller,worker,lowlatency defaultkernel=vmlinuz-*-rt-amd64 efi=runtime console=tty1
|
||||
initrd @INITRD@
|
||||
}
|
||||
}
|
||||
|
||||
iso-syslinux-entry: |
|
||||
menu start
|
||||
ontimeout 1
|
||||
|
||||
menu begin
|
||||
menu title Debian Controller Install
|
||||
menu default
|
||||
|
||||
label 1
|
||||
menu label Serial Console
|
||||
kernel /bzImage-std
|
||||
ipappend 2
|
||||
append initrd=@INITRD@ %BOOT_PARAMS% traits=controller defaultkernel=vmlinuz-*[!t]-amd64
|
||||
|
||||
label 2
|
||||
menu label Graphical Console
|
||||
kernel /bzImage-std
|
||||
ipappend 2
|
||||
append initrd=@INITRD@ %BOOT_PARAMS% traits=controller defaultkernel=vmlinuz-*[!t]-amd64 console=tty1
|
||||
menu end
|
||||
|
||||
menu begin
|
||||
menu title Debian All-in-one Install
|
||||
|
||||
label 3
|
||||
menu label Serial Console
|
||||
kernel /bzImage-std
|
||||
ipappend 2
|
||||
append initrd=@INITRD@ %BOOT_PARAMS% traits=controller,worker defaultkernel=vmlinuz-*[!t]-amd64
|
||||
|
||||
label 4
|
||||
menu label Graphical Console
|
||||
kernel /bzImage-std
|
||||
ipappend 2
|
||||
append initrd=@INITRD@ %BOOT_PARAMS% traits=controller,worker defaultkernel=vmlinuz-*[!t]-amd64 console=tty1
|
||||
menu end
|
||||
|
||||
menu begin
|
||||
menu title Debian All-in-one (lowlatency) Install
|
||||
|
||||
label 5
|
||||
menu label Serial Console
|
||||
kernel /bzImage-rt
|
||||
ipappend 2
|
||||
append initrd=@INITRD@ %BOOT_PARAMS% traits=controller,worker,lowlatency defaultkernel=vmlinuz-*-rt-amd64
|
||||
|
||||
label 6
|
||||
menu label Graphical Console
|
||||
kernel /bzImage-rt
|
||||
ipappend 2
|
||||
append initrd=@INITRD@ %BOOT_PARAMS% traits=controller,worker,lowlatency defaultkernel=vmlinuz-*-rt-amd64 console=tty1
|
||||
menu end
|
||||
|
||||
iso-post-script: |
|
||||
cd ${ISO_DIR}
|
||||
|
||||
# 0. Prepare
|
||||
# According to `multiple-kernels' in lat yaml, install std
|
||||
# or rt kernel to ISO
|
||||
for k in ${OSTREE_MULTIPLE_KERNELS}; do
|
||||
if [ "${k%%-rt-amd64}" != "${k}" ]; then
|
||||
cp ${DEPLOY_DIR_IMAGE}/${k} bzImage-rt
|
||||
if [ -e ${DEPLOY_DIR_IMAGE}/${k}.sig ]; then
|
||||
cp ${DEPLOY_DIR_IMAGE}/${k}.sig bzImage-rt.sig
|
||||
fi
|
||||
else
|
||||
cp ${DEPLOY_DIR_IMAGE}/${k} bzImage-std
|
||||
if [ -e ${DEPLOY_DIR_IMAGE}/${k}.sig ]; then
|
||||
cp ${DEPLOY_DIR_IMAGE}/${k}.sig bzImage-std.sig
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# 1. Kickstart
|
||||
mkdir -p kickstart
|
||||
# 1.1 Kickstart example for PXE
|
||||
cat << ENDOF > kickstart/pxe-ks.cfg
|
||||
lat-disk --install-device=/dev/disk/by-path/pci-0000:af:00.0-scsi-0:2:0:0
|
||||
ENDOF
|
||||
|
||||
# 1.2 Kickstart example for ISO
|
||||
cat << ENDOF > kickstart/iso-ks.cfg
|
||||
lat-disk --install-device=/dev/sda
|
||||
ENDOF
|
||||
|
||||
# 1.3 Kickstart from image rootfs (provided by package platform-kickstarts)
|
||||
if [ -e $IMAGE_ROOTFS/var/www/pages/feed/rel-*/kickstart/kickstart.cfg ]; then
|
||||
cp $IMAGE_ROOTFS/var/www/pages/feed/rel-*/kickstart/kickstart.cfg kickstart/
|
||||
fi
|
||||
|
||||
if [ -e $IMAGE_ROOTFS/var/www/pages/feed/rel-*/kickstart/miniboot.cfg ]; then
|
||||
cp $IMAGE_ROOTFS/var/www/pages/feed/rel-*/kickstart/miniboot.cfg kickstart/
|
||||
fi
|
||||
|
||||
if [ -d $IMAGE_ROOTFS/var/www/pages/feed/rel-*/kickstart/centos ]; then
|
||||
cp -r $IMAGE_ROOTFS/var/www/pages/feed/rel-*/kickstart/centos kickstart/
|
||||
fi
|
||||
|
||||
# 2. PXE
|
||||
mkdir -p pxeboot/pxelinux.cfg
|
||||
|
||||
# 2.1 Kernel and initramfs
|
||||
install -m 644 bzImage* pxeboot
|
||||
install -m 644 initrd* pxeboot
|
||||
|
||||
# 2.2 Bootloader
|
||||
# 2.2.1 Legacy BIOS PXE
|
||||
cp $OECORE_TARGET_SYSROOT/usr/share/syslinux/pxelinux.0 pxeboot/
|
||||
cp isolinux/isolinux.cfg pxeboot/pxelinux.cfg/default
|
||||
for f in libcom32.c32 ldlinux.c32 libutil.c32 vesamenu.c32; do
|
||||
cp isolinux/$f pxeboot/
|
||||
done
|
||||
|
||||
# 2.2.2 EFI PXE
|
||||
cp -a EFI pxeboot
|
||||
if [ -e ${IMAGE_ROOTFS}/boot/efi/EFI/BOOT/bootx64-nosig.efi ]; then
|
||||
cp ${IMAGE_ROOTFS}/boot/efi/EFI/BOOT/bootx64-nosig.efi pxeboot/EFI/BOOT/
|
||||
fi
|
||||
|
||||
# 2.3 Edit grub.cfg and pxelinux.cfg/default
|
||||
# 2.3.1 Drop to install from local ostree repo
|
||||
sed -i "s#instl=/ostree_repo#@BOOTPARAMS@#g" \
|
||||
pxeboot/EFI/BOOT/grub.cfg \
|
||||
pxeboot/pxelinux.cfg/default
|
||||
|
||||
# 2.3.2 Install from remote ostree repo
|
||||
sed -i "s#insturl=file://NOT_SET#insturl=http://pxecontroller:8080/feed/debian/ostree_repo#g" \
|
||||
pxeboot/EFI/BOOT/grub.cfg \
|
||||
pxeboot/pxelinux.cfg/default
|
||||
|
||||
# 2.3.3 Configure kickstart url
|
||||
BOOT_PARAMS="ks=http://pxecontroller:8080/feed/debian/kickstart/pxe-ks.cfg"
|
||||
|
||||
# 2.3.4 Verbose installation
|
||||
#BOOT_PARAMS="${BOOT_PARAMS} instsh=2"
|
||||
|
||||
# 2.3.5 Update boot params
|
||||
sed -i "s#@BOOTPARAMS@#${BOOT_PARAMS}#g" \
|
||||
pxeboot/EFI/BOOT/grub.cfg \
|
||||
pxeboot/pxelinux.cfg/default
|
||||
|
||||
# 2.3.6 Add `Boot from hard drive' entry to grub.cfg
|
||||
cat <<ENDOF>> pxeboot/EFI/BOOT/grub.cfg
|
||||
|
||||
export skip_check_cfg
|
||||
menuentry 'UEFI Boot from hard drive' {
|
||||
search --set=root --label otaefi
|
||||
configfile /efi/boot/grub.cfg
|
||||
}
|
||||
ENDOF
|
||||
|
||||
# 2.4 Tweak PXE if EFI secure boot enabled
|
||||
if [ "$EFI_SECURE_BOOT" = enable ]; then
|
||||
# On some host, PXE make bootx64.efi search grubx64.efi
|
||||
# from tftp/ dir other than tftp/EFI/BOOT/
|
||||
install -m 0644 EFI/BOOT/grubx64.efi pxeboot/
|
||||
|
||||
# Resign grub.cfg
|
||||
rm pxeboot/EFI/BOOT/grub.cfg.sig
|
||||
echo 'SecureCore' | gpg --pinentry-mode loopback \
|
||||
--batch \
|
||||
--homedir /tmp/.lat_gnupg_root \
|
||||
-u SecureBootCore \
|
||||
--detach-sign \
|
||||
--passphrase-fd 0 \
|
||||
pxeboot/EFI/BOOT/grub.cfg
|
||||
fi
|
||||
|
||||
# 2.5 copy pxeboot config template files to pxeboot/pxelinux.cfg
|
||||
mkdir -p pxeboot/pxelinux.cfg.files
|
||||
cp ${IMAGE_ROOTFS}/var/pxeboot/pxelinux.cfg.files/efi-pxe-* pxeboot/pxelinux.cfg.files/
|
||||
cp ${IMAGE_ROOTFS}/var/pxeboot/pxelinux.cfg.files/pxe-* pxeboot/pxelinux.cfg.files/
|
||||
|
||||
# 2.6 upgrades directory and upgrade meta files
|
||||
RELEASE_VER=$(cat ${IMAGE_ROOTFS}/etc/build.info | grep SW_VERSION | cut -f2 -d'=' | tr -d '"')
|
||||
mkdir -p upgrades
|
||||
cp ${IMAGE_ROOTFS}/etc/pxeboot-update-${RELEASE_VER}.sh upgrades/
|
||||
cp ${IMAGE_ROOTFS}/usr/sbin/deploy-precheck upgrades/
|
||||
cp ${IMAGE_ROOTFS}/usr/sbin/upgrade_utils.py upgrades/
|
||||
cp ${IMAGE_ROOTFS}/opt/upgrades/import.sh upgrades/
|
||||
cp ${IMAGE_ROOTFS}/opt/upgrades/metadata.xml upgrades/
|
||||
cp ${IMAGE_ROOTFS}/usr/sbin/usm_load_import upgrades/
|
||||
sed -i "s/xxxSW_VERSIONxxx/${RELEASE_VER}/g" upgrades/metadata.xml
|
||||
mkdir -p patches
|
||||
cp ${IMAGE_ROOTFS}/etc/software/*-metadata.xml upgrades/
|
||||
cp ${IMAGE_ROOTFS}/etc/software/*-metadata.xml patches/
|
||||
echo -n "VERSION=${RELEASE_VER}" > upgrades/version
|
||||
mkdir -p upgrades/software-deploy
|
||||
# Copy all software-deploy scripts to upgrades/software-deploy in ISO
|
||||
cp ${IMAGE_ROOTFS}/usr/sbin/software-deploy/* upgrades/software-deploy/
|
||||
|
||||
# 3. ISO
|
||||
# 3.1 Edit grub.cfg and isolinux.cfg
|
||||
# 3.1.1 Configure local kickstart url and LVM root and fluxdata device
|
||||
BOOT_PARAMS="ks=file:///kickstart/kickstart.cfg"
|
||||
BOOT_PARAMS="${BOOT_PARAMS} inst_ostree_root=/dev/mapper/cgts--vg-root--lv"
|
||||
BOOT_PARAMS="${BOOT_PARAMS} inst_ostree_var=/dev/mapper/cgts--vg-var--lv"
|
||||
|
||||
# 3.1.2 Verbose installation
|
||||
#BOOT_PARAMS="${BOOT_PARAMS} instsh=2"
|
||||
|
||||
# 3.1.3 Update boot params
|
||||
sed -i "s#instl=/ostree_repo#& ${BOOT_PARAMS}#g" \
|
||||
EFI/BOOT/grub.cfg \
|
||||
isolinux/isolinux.cfg
|
||||
|
||||
# According to `default-kernel' in lat yaml, set which
|
||||
# bootloader menu entry to boot
|
||||
sed -i "s/^DEFAULT .*//g" \
|
||||
isolinux/isolinux.cfg
|
||||
|
||||
if [ "${OSTREE_DEFAULT_KERNEL%%-rt-amd64}" != "${OSTREE_DEFAULT_KERNEL}" ]; then
|
||||
# Boot rt kernel by default
|
||||
sed -i "s/ set default=.*/ set default=2/g" \
|
||||
EFI/BOOT/grub.cfg
|
||||
else
|
||||
# Boot std kernel by default
|
||||
sed -i "s/ set default=.*/ set default=0/g" \
|
||||
EFI/BOOT/grub.cfg
|
||||
fi
|
||||
|
||||
# 3.2 Resign grub.cfg if EFI secure boot enabled
|
||||
if [ "$EFI_SECURE_BOOT" = enable ]; then
|
||||
rm EFI/BOOT/grub.cfg.sig
|
||||
echo 'SecureCore' | gpg --pinentry-mode loopback \
|
||||
--batch \
|
||||
--homedir /tmp/.lat_gnupg_root \
|
||||
-u SecureBootCore \
|
||||
--detach-sign \
|
||||
--passphrase-fd 0 \
|
||||
EFI/BOOT/grub.cfg
|
||||
fi
|
||||
|
||||
# Update the grub.cfg in efi.img according to above setting.
|
||||
# Don't update grub.cfg.sig because the grub.cfg signature checking
|
||||
# has been omitted.
|
||||
mdel -i efi.img ::/EFI/BOOT/grub.cfg
|
||||
mcopy -i efi.img EFI/BOOT/grub.cfg ::/EFI/BOOT/
|
||||
|
||||
# Put the controller-0 pxeboot install grub menu samples and
|
||||
# setup script into a new the ISO's pxeboot/samples directory.
|
||||
install -v -d -m 0755 pxeboot/samples
|
||||
install -m 0555 ${IMAGE_ROOTFS}/usr/sbin/pxeboot_setup.sh pxeboot/samples
|
||||
echo "See pxeboot_setup.sh --help for usage details" > pxeboot/samples/README
|
||||
install -m 0664 ${IMAGE_ROOTFS}/var/pxeboot/pxelinux.cfg.files/pxeboot.cfg.debian pxeboot/samples
|
||||
install -m 0664 ${IMAGE_ROOTFS}/var/pxeboot/pxelinux.cfg.files/efi-pxeboot.cfg.debian pxeboot/samples
|
||||
|
||||
# Added CERTS into efi.img
|
||||
if [ "$EFI_SECURE_BOOT" = enable ]; then
|
||||
mmd -i efi.img ::/CERTS
|
||||
mcopy -i efi.img -s /localdisk/CERTS/* ::/CERTS/
|
||||
mkdir images
|
||||
ln -snf ../efi.img images/efiboot.img
|
||||
fi
|
||||
|
||||
# Generate package list file in the iso root
|
||||
echo "Verifying package list for ${IMAGE_NAME}"
|
||||
if [ -f "/localdisk/workdir/${IMAGE_NAME}/packages.yaml" ]; then
|
||||
echo "Copying ISO package list"
|
||||
cp /localdisk/workdir/${IMAGE_NAME}/packages.yaml sw_package_list.yaml
|
||||
fi
|
||||
|
||||
initramfs-sign-script: |
|
||||
echo "End of initramfs-sign-script!"
|
||||
|
||||
multiple-kernels: vmlinuz-*[!t]-amd64 vmlinuz-*-rt-amd64
|
||||
default-kernel: vmlinuz-*[!t]-amd64
|
||||
system:
|
||||
- contains:
|
||||
- /localdisk/deploy/lat-initramfs.yaml
|
|
@ -0,0 +1,133 @@
|
|||
---
|
||||
name: starlingx-initramfs-ostree-image
|
||||
machine: intel-x86-64
|
||||
image_type:
|
||||
- initramfs
|
||||
debootstrap-mirror: deb-merge-all
|
||||
package_feeds: []
|
||||
package_type: external-debian
|
||||
gpg:
|
||||
gpg_path: /tmp/.lat_gnupg_root
|
||||
ostree:
|
||||
gpgid: Wind-River-Linux-Sample
|
||||
gpgkey: $OECORE_NATIVE_SYSROOT/usr/share/genimage/rpm_keys/RPM-GPG-PRIVKEY-Wind-River-Linux-Sample
|
||||
gpg_password: windriver
|
||||
grub:
|
||||
BOOT_GPG_NAME: SecureBootCore
|
||||
BOOT_GPG_PASSPHRASE: SecureCore
|
||||
BOOT_KEYS_DIR: $OECORE_NATIVE_SYSROOT/usr/share/bootfs/boot_keys
|
||||
BOOT_GPG_KEY: $OECORE_NATIVE_SYSROOT/usr/share/bootfs/boot_keys/BOOT-GPG-PRIVKEY-SecureBootCore
|
||||
packages:
|
||||
- apt-utils
|
||||
- base-passwd
|
||||
- bash
|
||||
- bc
|
||||
- bind9-dnsutils
|
||||
- bnxt-en
|
||||
- bnxt-en-rt
|
||||
- busybox
|
||||
- bzip2
|
||||
- ca-certificates
|
||||
- curl
|
||||
- dosfstools
|
||||
- e2fsprogs
|
||||
- efibootmgr
|
||||
- eject
|
||||
- fdisk
|
||||
- findutils
|
||||
- firmware-qlogic
|
||||
- gawk
|
||||
- glib-networking
|
||||
- gnupg
|
||||
- grep
|
||||
- grub2
|
||||
- gzip
|
||||
- iavf
|
||||
- iavf-rt
|
||||
- iavf-cvl-2.54
|
||||
- iavf-cvl-2.54-rt
|
||||
- iavf-cvl-4.10
|
||||
- iavf-cvl-4.10-rt
|
||||
- ice
|
||||
- ice-rt
|
||||
- ice-cvl-2.54
|
||||
- ice-cvl-2.54-rt
|
||||
- ice-cvl-4.10
|
||||
- ice-cvl-4.10-rt
|
||||
- i40e
|
||||
- i40e-rt
|
||||
- i40e-cvl-2.54
|
||||
- i40e-cvl-2.54-rt
|
||||
- i40e-cvl-4.10
|
||||
- i40e-cvl-4.10-rt
|
||||
- ifupdown
|
||||
- initramfs-ostree
|
||||
- iproute2
|
||||
- isc-dhcp-client
|
||||
- isc-dhcp-common
|
||||
- kbd
|
||||
- kmod
|
||||
- libostree-1-1
|
||||
- linux-image-stx-amd64
|
||||
- linux-rt-image-stx-amd64
|
||||
- mdadm
|
||||
- mlnx-ofed-kernel-modules
|
||||
- mlnx-ofed-kernel-modules-rt
|
||||
- mount
|
||||
- mttyexec
|
||||
- multipath-config
|
||||
- multipath-tools
|
||||
- multipath-tools-boot
|
||||
- open-iscsi
|
||||
- ostree-boot
|
||||
- ostree
|
||||
- parted
|
||||
- procps
|
||||
- psmisc
|
||||
- pv
|
||||
- iputils-ping
|
||||
- rng-tools
|
||||
- rpm2cpio
|
||||
- rsync
|
||||
- sed
|
||||
- tar
|
||||
- udev
|
||||
- udhcpc
|
||||
- util-linux
|
||||
- uuid-runtime
|
||||
- vim
|
||||
- watchdog
|
||||
- wget
|
||||
external-packages: []
|
||||
include-default-packages: '0'
|
||||
rootfs-pre-scripts:
|
||||
- echo "run script before do_rootfs in $IMAGE_ROOTFS"
|
||||
rootfs-post-scripts:
|
||||
- |-
|
||||
# Reduce rootfs size AMAP
|
||||
export PATH=/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
|
||||
chroot $IMAGE_ROOTFS bash << SCRIPT_ENDOF
|
||||
# Each time modify this file, change the version number below.
|
||||
echo "Initramfs bookworm yaml file V-1.0.0" > /var/log/rootfs_install.log
|
||||
dpkg-query -l >> /var/log/rootfs_install.log
|
||||
set -x
|
||||
rm -rf /boot/*
|
||||
rm -rf /var/lib/* /var/cache/*
|
||||
rm -rf /usr/share/man /usr/share/doc /usr/share/zoneinfo /usr/share/vim
|
||||
SCRIPT_ENDOF
|
||||
- |-
|
||||
# Set bash as default shell
|
||||
ln -snf --relative $IMAGE_ROOTFS/bin/bash $IMAGE_ROOTFS/bin/sh
|
||||
- |-
|
||||
# Update the installer script with partition size parameters
|
||||
# so they don't have to be specified on the grub command line
|
||||
sed -i "s/^FSZ=.*/FSZ=32/g" ${IMAGE_ROOTFS}/install
|
||||
sed -i "s/^BSZ=.*/BSZ=512/g" ${IMAGE_ROOTFS}/install
|
||||
sed -i "s/^RSZ=.*/RSZ=20480/g" ${IMAGE_ROOTFS}/install
|
||||
sed -i "s/^VSZ=.*/VSZ=20480/g" ${IMAGE_ROOTFS}/install
|
||||
environments:
|
||||
- NO_RECOMMENDATIONS="1"
|
||||
- DEBIAN_FRONTEND=noninteractive
|
||||
debootstrap-key: ''
|
||||
apt-keys:
|
||||
- /opt/LAT/pubkey.rsa
|
|
@ -0,0 +1,50 @@
|
|||
acpica-tools 20200925-8
|
||||
autoconf-archive 20220903-3
|
||||
autogen 1:5.18.16-5
|
||||
autogen-doc 1:5.18.16-5
|
||||
cmake 3.25.1-1
|
||||
cmake-data 3.25.1-1
|
||||
docutils-doc 0.19+dfsg-6
|
||||
doxygen 1.9.4-4
|
||||
dwarves 1.24-4.1
|
||||
fonts-mathjax 2.7.9+dfsg-1
|
||||
g++-12 12.2.0-14
|
||||
git 1:2.39.2-1.1
|
||||
git-man 1:2.39.2-1.1
|
||||
git-review 2.3.1-1
|
||||
guile-2.2-libs 2.2.7+1-9
|
||||
hwdata 0.368-1
|
||||
libcap-dev 1:2.66-4
|
||||
libclang-cpp16 1:16.0.6-15~deb12u1
|
||||
libclang1-16 1:16.0.6-15~deb12u1
|
||||
liberror-perl 0.17029-2
|
||||
libhwloc-dev 2.9.0-1
|
||||
libhwloc15 2.9.0-1
|
||||
libjs-mathjax 2.7.9+dfsg-1
|
||||
libjson-c-dev 0.16-2
|
||||
libjsoncpp25 1.9.5-4
|
||||
libltdl-dev 2.4.7-5
|
||||
libncurses-dev 6.4-4
|
||||
libnuma-dev 2.0.16-1
|
||||
libopts25-dev 1:5.18.16-5
|
||||
librhash0 1.4.3-3
|
||||
libsimdjson14 3.0.1-1
|
||||
libstdc++-12-dev 12.2.0-14
|
||||
libxapian30 1.4.22-1
|
||||
pandoc 2.17.1.1-2~deb12u1
|
||||
pandoc-data 2.17.1.1-2~deb12u1
|
||||
pkg-config 1.8.1-1
|
||||
pybind11-dev 2.10.3-1
|
||||
python3-oslo.messaging 14.0.0-2
|
||||
python3-prometheus-client 0.16.0-0.1
|
||||
python-requests-doc 2.28.1+dfsg-1
|
||||
python3-doc 3.11.2-1
|
||||
python3-intelhex 2.3.0-2
|
||||
python3-pybind11 2.10.3-1
|
||||
python3-thriftpy 0.3.9+ds1-2+b3
|
||||
python3.11-doc 3.11.2-6
|
||||
sphinx-doc 5.3.0-4
|
||||
trace-cmd 3.1.6-1
|
||||
tree 2.1.0-1
|
||||
unzip 6.0-28
|
||||
usb.ids 2024.01.20-0+deb12u1
|
|
@ -0,0 +1,9 @@
|
|||
#The OS binary packages that depended by StarlingX patched packages,
|
||||
#but they are not in the base packages list
|
||||
# This installs kdump and its dependency on Debian
|
||||
makedumpfile 1:1.7.2-1
|
||||
kexec-tools 1:2.0.25-3+b1
|
||||
crash 8.0.2-1
|
||||
liblzo2-2 2.10-2
|
||||
pigz 2.6-1
|
||||
yajl-tools 2.1.0-3+deb12u2
|
|
@ -0,0 +1,2 @@
|
|||
libhwloc-dev 2.9.0-1
|
||||
libhwloc15 2.9.0-1
|
|
@ -0,0 +1,26 @@
|
|||
python3-keystoneauth1 5.0.0-2
|
||||
python3-keystonemiddleware 10.1.0-4
|
||||
python3-mock 4.0.3-4
|
||||
python3-osc-lib 2.6.2-2
|
||||
python3-osc-placement 4.0.0-2
|
||||
python3-pyro4 4.82-2
|
||||
python3-oslo.cache 3.2.0-1
|
||||
python3-oslo.concurrency 5.0.1-3
|
||||
python3-oslo.config 1:9.0.0-3
|
||||
python3-oslo.context 5.0.0-2
|
||||
python3-oslo.db 12.1.0-3
|
||||
python3-oslo.i18n 5.1.0-3
|
||||
python3-oslo.log 5.0.1-1
|
||||
python3-oslo.messaging 14.0.0-2
|
||||
python3-oslo.metrics 0.5.0-2
|
||||
python3-oslo.middleware 5.0.0-2
|
||||
python3-oslo.policy 4.0.0-2
|
||||
python3-oslo.serialization 5.0.0-2
|
||||
python3-oslo.service 3.0.0-2
|
||||
python3-oslo.upgradecheck 2.0.0-2
|
||||
python3-oslo.utils 6.0.1-2
|
||||
python3-oslo.versionedobjects 3.0.1-2
|
||||
python3-serpent 1.41-1
|
||||
python3-sqlalchemy 1.4.46+ds1-1
|
||||
python3-stevedore 4.0.2-2
|
||||
python3-swiftclient 1:4.1.0-2
|
|
@ -8,23 +8,23 @@ proxyport = 8080
|
|||
buildbranch = master
|
||||
manifest = default.xml
|
||||
ostree_osname = debian
|
||||
debian_distribution = bullseye
|
||||
debian_version = 11.3
|
||||
debian_distribution = bookworm
|
||||
debian_version = 12.5
|
||||
|
||||
# These URLs must contain snapshots of debian & debian-security repos.
|
||||
# We will append debian_snapshot_timestamp to each of them when creating
|
||||
# apt.sources lists
|
||||
#debian_snapshot_base = http://snapshot.debian.org/archive/debian
|
||||
debian_snapshot_base = https://mirror.starlingx.windriver.com/mirror/debian/debian/snapshot.debian.org/archive/debian
|
||||
debian_snapshot_base = http://snapshot.debian.org/archive/debian
|
||||
#debian_security_snapshot_base = http://snapshot.debian.org/archive/debian-security
|
||||
debian_security_snapshot_base = https://mirror.starlingx.windriver.com/mirror/debian/debian/snapshot.debian.org/archive/debian-security
|
||||
debian_snapshot_timestamp = 20220331T000000Z
|
||||
debian_security_snapshot_base = http://snapshot.debian.org/archive/debian-security
|
||||
debian_snapshot_timestamp = 20240302T211138Z
|
||||
|
||||
[builder]
|
||||
uid = 1000
|
||||
myuname = builder
|
||||
release = 6.0
|
||||
dist = bullseye
|
||||
release = 9.0
|
||||
dist = bookworm
|
||||
stx_dist = .stx
|
||||
debfullname = STX Builder
|
||||
debemail = stx.builder@opendev.org
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#
|
||||
# Copyright (C) 2021-2022 Wind River Systems,Inc.
|
||||
#
|
||||
FROM golang:1.17.5-bullseye AS builder
|
||||
FROM golang:1.21.1-bookworm AS builder
|
||||
LABEL stage=builder
|
||||
|
||||
|
||||
|
@ -20,14 +20,16 @@ LABEL stage=builder
|
|||
RUN mkdir -p $GOPATH/src/github.com/aptly-dev/aptly && \
|
||||
git clone https://github.com/masselstine/aptly $GOPATH/src/github.com/aptly-dev/aptly && \
|
||||
cd $GOPATH/src/github.com/aptly-dev/aptly && \
|
||||
go mod init && go mod download && go mod vendor && go mod verify && \
|
||||
go mod init && go get && \
|
||||
go get -t github.com/aptly-dev/aptly/context && \
|
||||
go mod vendor && go mod verify && \
|
||||
export TRAVIS_TAG="StarlingX_Master_v1.0.0" && \
|
||||
make install && \
|
||||
cd $GOPATH && \
|
||||
curl -O https://nginx.org/keys/nginx_signing.key && apt-key add ./nginx_signing.key
|
||||
|
||||
# Build our actual container
|
||||
FROM debian:bullseye
|
||||
FROM debian:bookworm
|
||||
|
||||
MAINTAINER mark.asselstine@windriver.com
|
||||
|
||||
|
@ -38,7 +40,7 @@ RUN apt-get -q -y update && apt-get -y install --no-install-recommends ca-certif
|
|||
|
||||
# Add Nginx repository and install required packages
|
||||
RUN apt-get -q update && apt-get -y install gnupg2 && \
|
||||
echo "deb http://nginx.org/packages/debian/ bullseye nginx" > /etc/apt/sources.list.d/nginx.list && \
|
||||
echo "deb http://nginx.org/packages/debian/ bookworm nginx" > /etc/apt/sources.list.d/nginx.list && \
|
||||
apt-key add ./nginx_signing.key && \
|
||||
apt-get -q update && apt-get -y install \
|
||||
aptly \
|
||||
|
|
|
@ -12,14 +12,18 @@
|
|||
#
|
||||
# Copyright (C) 2021-2022 Wind River Systems,Inc.
|
||||
#
|
||||
FROM debian:bullseye
|
||||
FROM debian:bookworm
|
||||
|
||||
ENV container=docker \
|
||||
PATH=/opt/LAT/lat:$PATH
|
||||
|
||||
RUN echo "deb-src http://deb.debian.org/debian bullseye main" >> /etc/apt/sources.list && \
|
||||
echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/sources.list && \
|
||||
echo "deb http://deb.debian.org/debian bullseye contrib" >> /etc/apt/sources.list
|
||||
RUN echo "deb-src http://deb.debian.org/debian bookworm main" >> /etc/apt/sources.list && \
|
||||
echo "deb http://deb.debian.org/debian bookworm contrib" >> /etc/apt/sources.list
|
||||
|
||||
# pass --break-system-packages to pip
|
||||
# https://salsa.debian.org/cpython-team/python3/-/blob/python3.11/debian/README.venv#L58
|
||||
RUN echo "[global]" >> /etc/pip.conf && \
|
||||
echo "break-system-packages = true" >> /etc/pip.conf
|
||||
|
||||
# Update certificates
|
||||
RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates
|
||||
|
|
|
@ -12,12 +12,17 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM debian:bullseye
|
||||
FROM debian:bookworm
|
||||
|
||||
MAINTAINER Chen Qi <Qi.Chen@windriver.com>
|
||||
|
||||
ARG LAT_BINARY_RESOURCE_PATH=https://mirror.starlingx.windriver.com/mirror/lat-sdk/lat-sdk-20231206
|
||||
|
||||
# pass --break-system-packages to pip
|
||||
# https://salsa.debian.org/cpython-team/python3/-/blob/python3.11/debian/README.venv#L58
|
||||
RUN echo "[global]" >> /etc/pip.conf && \
|
||||
echo "break-system-packages = true" >> /etc/pip.conf
|
||||
|
||||
# Update certificates
|
||||
RUN apt-get -y update && apt-get -y install --no-install-recommends ca-certificates && update-ca-certificates
|
||||
|
||||
|
|
|
@ -12,9 +12,15 @@
|
|||
#
|
||||
# Copyright (C) 2021-2022 Wind River Systems,Inc.
|
||||
#
|
||||
FROM debian:bullseye
|
||||
FROM debian:bookworm
|
||||
|
||||
RUN echo "deb-src http://deb.debian.org/debian bookworm main" >> /etc/apt/sources.list
|
||||
|
||||
# pass --break-system-packages to pip
|
||||
# https://salsa.debian.org/cpython-team/python3/-/blob/python3.11/debian/README.venv#L58
|
||||
RUN echo "[global]" >> /etc/pip.conf && \
|
||||
echo "break-system-packages = true" >> /etc/pip.conf
|
||||
|
||||
RUN echo "deb-src http://deb.debian.org/debian bullseye main" >> /etc/apt/sources.list
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Update certificates
|
||||
|
|
|
@ -34,8 +34,8 @@ sudo apt-get update
|
|||
|
||||
# create deb-local-binary empty repo for building first package, certainly the developer
|
||||
# also could select to download the other binary list in deb-mirror-tools directory with
|
||||
# debdownloader command, for example we download the base-bullseye.lst before building
|
||||
# image.
|
||||
# debdownloader command, for example we download the base-${DEBIAN_DISTRIBUTION}.lst
|
||||
# before building image.
|
||||
TMPLIST=`mktemp /tmp/XXXXXX.lst`
|
||||
debdownloader $TMPLIST
|
||||
rm $TMPLIST
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
deb [trusted=yes] https://mirror.starlingx.windriver.com/mirror/debian/debian/ftp.ca.debian.org/debian/ bullseye main
|
||||
deb-src [trusted=yes] https://mirror.starlingx.windriver.com/mirror/debian/debian/ftp.ca.debian.org/debian/ bullseye main
|
||||
deb [trusted=yes] https://mirror.starlingx.windriver.com/mirror/debian/debian/ftp.ca.debian.org/debian/ buster main
|
||||
deb-src [trusted=yes] https://mirror.starlingx.windriver.com/mirror/debian/debian/ftp.ca.debian.org/debian/ buster main
|
||||
deb [trusted=yes] https://mirror.starlingx.windriver.com/mirror/debian/debian/deb.debian.org/debian/ bookworm main
|
||||
deb-src [trusted=yes] https://mirror.starlingx.windriver.com/mirror/debian/debian/deb.debian.org/debian/ bookworm main
|
||||
|
|
|
@ -18,10 +18,13 @@ from flask import Flask
|
|||
from flask import jsonify
|
||||
from flask import request
|
||||
import logging
|
||||
import subprocess
|
||||
|
||||
STX_DISTRO = 'bullseye'
|
||||
STX_ARCH = 'amd64'
|
||||
PKG_BUILDER_LOG = '/localdisk/pkgbuilder.log'
|
||||
STX_LOCALRC = '/usr/local/bin/stx/stx-localrc'
|
||||
CMD = 'grep "^export DEBIAN_DISTRIBUTION=.*" %s | cut -d \\= -f 2' % STX_LOCALRC
|
||||
STX_DISTRO = subprocess.check_output(CMD, shell=True).decode().split("\n")[0].strip('"')
|
||||
|
||||
app = Flask(__name__)
|
||||
app.debug = True
|
||||
|
|
|
@ -225,10 +225,10 @@ class Debbuilder:
|
|||
def is_parent_config(self, parent_chroot_name, target_config):
|
||||
# The name of config file for the parent schroot has two parts:
|
||||
# chroot_name + '-' + random number
|
||||
# e.g. bullseye-amd64-user-yWJpyF
|
||||
# e.g. ${DEBIAN_DISTRIBUTION}-amd64-user-yWJpyF
|
||||
# The name of config file for the cloned schroot has three parts:
|
||||
# chroot_name + '-' + random number + '-' + sequence
|
||||
# e.g. bullseye-amd64-user-yWJpyF-1
|
||||
# e.g. ${DEBIAN_DISTRIBUTION}-amd64-user-yWJpyF-1
|
||||
conf_file_suffix = target_config.replace(parent_chroot_name + '-', '')
|
||||
if '-' not in conf_file_suffix:
|
||||
return True
|
||||
|
@ -253,9 +253,9 @@ class Debbuilder:
|
|||
|
||||
# Try to find the parent chroot
|
||||
user_dir = os.path.join(STORE_ROOT, user, project)
|
||||
# e.g bullseye-amd64-user
|
||||
# e.g ${DEBIAN_DISTRIBUTION}-amd64-user
|
||||
parent_chroot_name = '-'.join([self.attrs['dist'], self.attrs['arch'], user])
|
||||
# e.g /localdisk/pkgbuilder/user/stx/chroots/bullseye-amd64-user
|
||||
# e.g /localdisk/pkgbuilder/user/stx/chroots/${DEBIAN_DISTRIBUTION}-amd64-user
|
||||
parent_chroot_path = os.path.join(user_dir, 'chroots', parent_chroot_name)
|
||||
if not os.path.exists(parent_chroot_path):
|
||||
self.logger.error("Failed to find the parent chroot %s", parent_chroot_path)
|
||||
|
@ -289,7 +289,7 @@ class Debbuilder:
|
|||
self.logger.info("Target cloned chroot %s is ready, updated config", cloned_chroot_path)
|
||||
# For the cloned chroot, the schroot config file also need to be created
|
||||
# Try to find the config file of parent schroot and take it as template
|
||||
# e.g. it is /etc/chroots/chroot.d/bullseye-amd64-user-yWJpyF
|
||||
# e.g. it is /etc/chroots/chroot.d/${DEBIAN_DISTRIBUTION}-amd64-user-yWJpyF
|
||||
schroot_conf_dir = os.listdir(os.path.join('/etc/schroot/chroot.d'))
|
||||
for conf in schroot_conf_dir:
|
||||
if self.is_parent_config(parent_chroot_name, conf):
|
||||
|
@ -417,7 +417,7 @@ class Debbuilder:
|
|||
user_dir = os.path.join(STORE_ROOT, user, project)
|
||||
user_chroots_dir = os.path.join(user_dir, 'chroots')
|
||||
for chroot in dst_chroots:
|
||||
# e.g. the chroot name is 'chroot:bullseye-amd64-<user>-1'
|
||||
# e.g. the chroot name is 'chroot:${DEBIAN_DISTRIBUTION}-amd64-<user>-1'
|
||||
self.logger.debug('The current chroot is %s', chroot)
|
||||
chroot = chroot.split(':')[1]
|
||||
self.logger.debug('The name of chroot: %s', chroot)
|
||||
|
|
|
@ -58,7 +58,7 @@ class SchrootsPool:
|
|||
self.logger.error('There are no schroots found, exit')
|
||||
return False
|
||||
for sname in schroots:
|
||||
# Filter 'chroot:bullseye-amd64-<user>' as the backup chroot
|
||||
# Filter 'chroot:${DEBIAN_DISTRIBUTION}-amd64-<user>' as the backup chroot
|
||||
if len(sname.split('-')) >= 4 and not self.exists(sname):
|
||||
self.schroots.append(Schroot(sname.strip(), 'idle'))
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue