forked from brl/citadel
Bruce Leidl
64d91cb68c
Updated Recipes * colord 1.4.5 * dconf 0.40.0 * gdm 40.0 * geoclue 2.5.7 * geocode-glib 3.26.2 * gevix2_ 0.12.1 * gjs 1.68.0 * glib2 2.68.0 * gnome-autoar 0.3.1 * gnome-backgrounds 40.0 * gnome-control-center 40.0 * gnome-desktop 40.0 * gnome-disk-utility 40.1 * gnome-keyring 40.0 * gnome-screenshot 40.0 * gnome-session 40.1.1 * gnome-settings-daemon 40.0.1 * gnome-shell 40.0 * gnome-system-monitor 40.1 * gnome-terminal 3.40.1 * gsettings-desktop-schemas 40.0 * ibus 1.5.23 * iwd 1.13 * kernel 5.12.1 * keyutils 1.6.1 * libgee 0.20.4 * libgit2 1.1.0 * libgweather 40.0 * libhandy 1.2.0 (poky) * libseccomp 2.5.1 * libssh2 1.9.0 (poky) * lvm2 2.03.11 * meson 0.57.1 (poky) * mutter 40.0 * nano 5.6 * NetworkManager 1.30.2 * network-manager-applet 1.18.0 * nspr 4.29 * pango 1.48.2 (poky) * plymouth 0.9.5+git * udisks 2.9.2 * upower 0.99.11 * vte 0.64.0 * yelp-tools 3.32.2 * yelp-xsl 3.36.0
189 lines
5.8 KiB
BlitzBasic
189 lines
5.8 KiB
BlitzBasic
DESCRIPTION = ""
|
|
HOMEPAGE = ""
|
|
LICENSE = "MIT"
|
|
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
|
SECTION = ""
|
|
DEPENDS = "mtools-native syslinux syslinux-native dosfstools-native coreutils-native parted-native"
|
|
|
|
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|
|
|
inherit deploy
|
|
require citadel-image.inc
|
|
|
|
KERNEL_CMDLINE = "root=/dev/mapper/rootfs citadel.verbose intel_iommu=off fstab=no luks=no splash"
|
|
|
|
do_rootfs() {
|
|
install_efi_files
|
|
install_syslinux_files
|
|
install_image_files
|
|
}
|
|
|
|
do_rootfs[dirs] = "${TOPDIR}"
|
|
do_rootfs[cleandirs] = "${S} ${IMAGE_ROOTFS}"
|
|
do_rootfs[umask] = "022"
|
|
do_rootfs[depends] += "\
|
|
citadel-rootfs-image:do_image_complete \
|
|
citadel-extra-image:do_image_complete \
|
|
citadel-kernel-image:do_image_complete \
|
|
base-realmfs-image:do_deploy \
|
|
citadel-kernel:do_deploy \
|
|
systemd-boot:do_deploy \
|
|
"
|
|
addtask rootfs after do_configure before do_build
|
|
|
|
install_efi_files() {
|
|
install -d ${IMAGE_ROOTFS}/EFI/BOOT
|
|
install ${DEPLOY_DIR_IMAGE}/systemd-bootx64.efi -T ${IMAGE_ROOTFS}/EFI/BOOT/bootx64.efi
|
|
install ${DEPLOY_DIR_IMAGE}/bzImage ${IMAGE_ROOTFS}/bzImage-${CITADEL_KERNEL_VERSION}
|
|
|
|
install -d ${IMAGE_ROOTFS}/loader/entries
|
|
make_loader_conf > ${IMAGE_ROOTFS}/loader/loader.conf
|
|
make_install_conf > ${IMAGE_ROOTFS}/loader/entries/install.conf
|
|
}
|
|
|
|
SYSLINUX_MODULES = "ldlinux.c32 menu.c32 libutil.c32 gptmbr.bin"
|
|
|
|
install_syslinux_files() {
|
|
install -d ${IMAGE_ROOTFS}/syslinux
|
|
make_syslinux_conf > ${IMAGE_ROOTFS}/syslinux/syslinux.cfg
|
|
for m in ${SYSLINUX_MODULES}; do
|
|
install ${RECIPE_SYSROOT}/usr/share/syslinux/$m ${IMAGE_ROOTFS}/syslinux
|
|
done
|
|
}
|
|
|
|
install_image_files() {
|
|
install -d ${IMAGE_ROOTFS}/images
|
|
install_resource_image "rootfs" ${CITADEL_IMAGE_VERSION_rootfs}
|
|
install_resource_image "extra" ${CITADEL_IMAGE_VERSION_extra}
|
|
install_resource_image "kernel" ${CITADEL_IMAGE_VERSION_kernel}
|
|
install ${DEPLOY_DIR_IMAGE}/base-realmfs.img ${IMAGE_ROOTFS}/images/
|
|
}
|
|
|
|
make_loader_conf() {
|
|
echo "default install"
|
|
echo "timeout 5"
|
|
}
|
|
|
|
make_install_conf() {
|
|
echo "title Install Subgraph OS (Citadel)"
|
|
echo "linux /bzImage-${CITADEL_KERNEL_VERSION}"
|
|
echo "options ${KERNEL_CMDLINE} citadel.install"
|
|
}
|
|
|
|
make_live_conf() {
|
|
echo "title Run Live Subgraph OS (Citadel)"
|
|
echo "linux /bzImage-${CITADEL_KERNEL_VERSION}"
|
|
echo "options ${KERNEL_CMDLINE} citadel.live"
|
|
}
|
|
|
|
CITADEL_KERNEL_CMDLINE = "add_efi_memmap intel_iommu=off cryptomgr.notests rcupdate.rcu_expedited=1 rcu_nocbs=0-64 tsc=reliable no_timer_check noreplace-smp i915.fastboot=1 quiet splash"
|
|
|
|
make_syslinux_conf() {
|
|
cat << EOF
|
|
UI menu.c32
|
|
PROMPT 0
|
|
|
|
MENU TITLE Boot Subgraph OS Installer (Citadel)
|
|
TIMEOUT 50
|
|
DEFAULT subgraph
|
|
|
|
LABEL subgraph
|
|
MENU LABEL Subgraph OS
|
|
LINUX ../bzImage-${CITADEL_KERNEL_VERSION}
|
|
APPEND ${KERNEL_CMDLINE} citadel.install
|
|
EOF
|
|
}
|
|
|
|
install_resource_image() {
|
|
version=$(printf "%03d" ${2})
|
|
|
|
if [ "${1}" = "kernel" ]; then
|
|
kversion=$(cat ${DEPLOY_DIR_IMAGE}/kernel.version)
|
|
src_fname="citadel-kernel-${kversion}-${CITADEL_IMAGE_CHANNEL}-${version}.img"
|
|
dst_fname="citadel-kernel-${kversion}.img"
|
|
else
|
|
src_fname="citadel-${1}-${CITADEL_IMAGE_CHANNEL}-${version}.img"
|
|
dst_fname="citadel-${1}.img"
|
|
fi
|
|
|
|
install ${DEPLOY_DIR_IMAGE}/${src_fname} -T ${IMAGE_ROOTFS}/images/${dst_fname}
|
|
}
|
|
|
|
|
|
CITADEL_BOOT_IMAGE = "${B}/boot.img"
|
|
CITADEL_INSTALLER_IMAGE = "${B}/citadel-installer.img"
|
|
do_image() {
|
|
write_boot_image ${CITADEL_BOOT_IMAGE}
|
|
write_installer_image ${CITADEL_INSTALLER_IMAGE} ${CITADEL_BOOT_IMAGE}
|
|
}
|
|
do_image[umask] = "022"
|
|
do_image[dirs] = "${TOPDIR}"
|
|
addtask do_image after do_rootfs before do_build
|
|
|
|
do_deploy() {
|
|
install -m 644 ${CITADEL_INSTALLER_IMAGE} ${DEPLOYDIR}
|
|
}
|
|
|
|
addtask do_deploy after do_image before do_build
|
|
|
|
#
|
|
# write_boot_image [image path]
|
|
#
|
|
write_boot_image() {
|
|
IMAGE_PATH=${1}
|
|
BLOCKS_ROOTFS=$(du -bks ${IMAGE_ROOTFS} | cut -f1)
|
|
BLOCKS_EXTRA=65536
|
|
IMAGE_SIZE=$(expr ${BLOCKS_ROOTFS} + ${BLOCKS_EXTRA})
|
|
|
|
if [ -e ${IMAGE_PATH} ]; then
|
|
rm ${IMAGE_PATH}
|
|
fi
|
|
|
|
bbdebug 1 Creating ${IMAGE_SIZE} block msdos image at ${IMAGE_PATH}
|
|
mkdosfs -n boot -C ${IMAGE_PATH} ${IMAGE_SIZE}
|
|
mcopy -i ${IMAGE_PATH} -s ${IMAGE_ROOTFS}/* ::/
|
|
|
|
syslinux --directory syslinux --install ${IMAGE_PATH}
|
|
}
|
|
|
|
write_installer_image() {
|
|
INSTALLER_IMAGE=${1}
|
|
BOOT_IMAGE=${2}
|
|
BOOT_IMAGE_SIZE=$(stat -c "%s" ${BOOT_IMAGE})
|
|
BOOT_IMAGE_SECTORS=$(expr ${BOOT_IMAGE_SIZE} / 512)
|
|
TOTAL_SECTORS=$(expr ${BOOT_IMAGE_SECTORS} + 32)
|
|
TOTAL_IMAGE_BLOCKS=$(expr ${TOTAL_SECTORS} / 2)
|
|
|
|
if [ -e ${INSTALLER_IMAGE} ]; then
|
|
rm ${INSTALLER_IMAGE}
|
|
fi
|
|
|
|
bbdebug 1 Creating ${TOTAL_IMAGE_BLOCKS} block empty image file at ${INSTALLER_IMAGE}
|
|
truncate -s ${TOTAL_IMAGE_BLOCKS}K ${INSTALLER_IMAGE}
|
|
parted -s ${INSTALLER_IMAGE} mklabel msdos
|
|
|
|
offset=32
|
|
end=$(expr ${offset} + ${BOOT_IMAGE_SECTORS} - 1)
|
|
bbdebug 1 parted -s ${INSTALLER_IMAGE} unit s mkpart fat32 ${offset} ${end}
|
|
parted -s ${INSTALLER_IMAGE} unit s mkpart primary fat32 ${offset} ${end}
|
|
parted -s ${INSTALLER_IMAGE} set 1 boot on
|
|
bbdebug 1 dd if=${BOOT_IMAGE} of=${INSTALLER_IMAGE} seek=${offset} count=${BOOT_IMAGE_SECTORS} conv=sparse,nocreat,notrunc
|
|
dd if=${BOOT_IMAGE} of=${INSTALLER_IMAGE} seek=${offset} count=${BOOT_IMAGE_SECTORS} conv=sparse,nocreat,notrunc
|
|
|
|
dd bs=440 count=1 conv=notrunc if=${RECIPE_SYSROOT}/usr/share/syslinux/mbr.bin of=${INSTALLER_IMAGE}
|
|
|
|
parted -s ${INSTALLER_IMAGE} unit s print
|
|
}
|
|
|
|
do_fetch[noexec] = "1"
|
|
do_unpack[noexec] = "1"
|
|
do_patch[noexec] = "1"
|
|
do_configure[noexec] = "1"
|
|
do_compile[noexec] = "1"
|
|
do_install[noexec] = "1"
|
|
deltask do_populate_sysroot
|
|
do_package[noexec] = "1"
|
|
deltask do_package_qa
|
|
do_packagedata[noexec] = "1"
|
|
do_package_write_deb[noexec] = "1"
|