Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bobMinimumVersion: "1.1"
bobMinimumVersion: "1.2"
layers:
- name: basement
scm: git
Expand Down
5 changes: 4 additions & 1 deletion recipes/amd64.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
inherit: [ "basement::rootrecipe" ]
inherit: [ "basement::rootrecipe", "sbom-deploy" ]

environment:
LINUX_CUSTOM_CONFIG: x86_64.defconfig
Expand All @@ -8,6 +8,9 @@ packageScript: |
cp ${BOB_DEP_PATHS[rootfs]}/rootfs.img .
cp ${BOB_DEP_PATHS[kernel::linux-image]}/bzImage .

sbomDeploy -n rootfs.img ${BOB_DEP_PATHS[rootfs]}
sbomDeploy -n bzImage ${BOB_DEP_PATHS[kernel::linux-image]}

multiPackage:
glibc:
multiPackage:
Expand Down
282 changes: 147 additions & 135 deletions recipes/rootfs.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
inherit: ["rootfs::ext4"]

environment:
MESA3D_PLATFORM: "${BLUEPRINT_GRAPHICS_PLATFORM:-none}"
CONFIG_ROOT_PW: "root"
UTIL_LINUX_SU: "1"
SYSTEMD_LOGIND: "1"

# The 'Config' entries are parsed *after* 'environment'
Config:
CONFIG_INIT:
Expand All @@ -24,130 +16,150 @@ Config:
none:
default: none

depends:
- tools:
target-toolchain: host-compat-toolchain
use: [tools]
depends:
- graphics::xorg::mkfontscale

- core::rootfs-skel
- core::dbus

- if: "$(eq,$CONFIG_INIT,sysvinit/busybox)"
depends:
- core::busybox
- core::eudev

- if: "$(eq,$CONFIG_INIT,systemd)"
depends:
- core::coreutils
#- core::shadow
- core::systemd
- core::util-linux
- kernel::kmod
- utils::bc
- utils::bzip2
- utils::findutils
- utils::gawk
- utils::grep
- utils::gzip
- utils::sed

- if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" == "x11"
depends:
- graphics::xorg::xserver
- graphics::xorg::xf86-input-evdev
- graphics::xorg::xf86-video-fbdev

- graphics::xorg::setxkbmap
- graphics::xorg::xauth
- graphics::xorg::xinit
- graphics::xorg::xrdb
- graphics::xorg::xeyes
- graphics::xorg::xset
- graphics::xorg::xsetroot
- graphics::xorg::xterm
- graphics::xorg::twm

- graphics::xorg::xcursor-themes

# Usually taken from util-linux
- name: graphics::xorg::mcookie
if: "$(eq,$CONFIG_INIT,sysvinit/busybox)"

- if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" == "wayland"
depends:
- graphics::wayland::weston

- if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" != "none"
depends:
- graphics::fonts::dejavu
- graphics::fonts::unicode
- graphics::glmark2

- utils::file
- utils::bash
- utils::rsync
- utils::strace

- libs::libc-bin
- libs::libc-tgt
- libs::libc-stdc++-tgt

- kernel::linux-modules

privateEnvironment:
TARGET_ARCH: '$(get-tool-env,target-toolchain,ARCH,$ARCH)'

checkoutSCM:
scm: import
url: rootfs
recipeRelative: True

buildTools:
- name: mkfontdir
if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" == "x11"
buildVars: [TARGET_ARCH, CONFIG_INIT, BLUEPRINT_GRAPHICS_PLATFORM]
buildScript: |
rm -rf install

SRC=( "$1/common" )
if [[ -d "$1/$CONFIG_INIT" ]] ; then
SRC+=( "$1/$CONFIG_INIT" )
fi
SRC+=( "${@:2}" )

rootfsCopy "$PWD/install" "${SRC[@]}"
rootfsPrepare "$PWD/install" "${SRC[@]}"

pushd install

if [[ ! -e bin/sh ]] ; then
ln -sf bash bin/sh
fi

# Enable serial console login by default
if [[ $TARGET_ARCH == x86_64 ]] ; then
if [[ $CONFIG_INIT == systemd ]] ; then
mkdir -p etc/systemd/system/getty.target.wants
ln -s /usr/lib/systemd/system/getty@.service etc/systemd/system/getty.target.wants/getty@ttyS0.service
else
echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> etc/inittab
fi
fi

if [[ "$BLUEPRINT_GRAPHICS_PLATFORM" == x11 ]] ; then
mkfontdir usr/share/fonts/X11/misc/
fi

popd

rootfsExt4CreateImage "$PWD/install" "rootfs" "2.50%"

packageScript: |
cp $1/rootfs.img .
multiPackage:
files:
inherit: [sbom]

checkoutSCM:
scm: import
url: rootfs
recipeRelative: True
buildVars: [CONFIG_INIT]
buildScript: |
ln -snf $1/common
if [[ -d "$1/$CONFIG_INIT" ]] ; then
ln -snf $1/$CONFIG_INIT
fi
packageScript: |
rsync -aHK $1/common/ .
if [[ -e "$1/$(basename $CONFIG_INIT)" ]] ; then
rsync -aHK $1/$(basename ${CONFIG_INIT})/ .
fi

"":
inherit: ["rootfs::ext4", sbom]

environment:
MESA3D_PLATFORM: "${BLUEPRINT_GRAPHICS_PLATFORM:-none}"
CONFIG_ROOT_PW: "root"
UTIL_LINUX_SU: "1"
SYSTEMD_LOGIND: "1"

privateEnvironment:
TARGET_ARCH: '$(get-tool-env,target-toolchain,ARCH,$ARCH)'

depends:

- tools:
target-toolchain: host-compat-toolchain
use: [tools]
depends:
- graphics::xorg::mkfontscale

- core::rootfs-skel
- core::dbus

- if: "$(eq,$CONFIG_INIT,sysvinit/busybox)"
depends:
- core::busybox
- core::eudev

- if: "$(eq,$CONFIG_INIT,systemd)"
depends:
- core::coreutils
#- core::shadow
- core::systemd
- core::util-linux
- kernel::kmod
- utils::bc
- utils::bzip2
- utils::findutils
- utils::gawk
- utils::grep
- utils::gzip
- utils::sed

- if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" == "x11"
depends:
- graphics::xorg::xserver
- graphics::xorg::xf86-input-evdev
- graphics::xorg::xf86-video-fbdev

- graphics::xorg::setxkbmap
- graphics::xorg::xauth
- graphics::xorg::xinit
- graphics::xorg::xrdb
- graphics::xorg::xeyes
- graphics::xorg::xset
- graphics::xorg::xsetroot
- graphics::xorg::xterm
- graphics::xorg::twm

- graphics::xorg::xcursor-themes

# Usually taken from util-linux
- name: graphics::xorg::mcookie
if: "$(eq,$CONFIG_INIT,sysvinit/busybox)"

- if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" == "wayland"
depends:
- graphics::wayland::weston

- if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" != "none"
depends:
- graphics::fonts::dejavu
- graphics::fonts::unicode
- graphics::glmark2

- utils::file
- utils::bash
- utils::rsync
- utils::strace

- libs::libc-bin
- libs::libc-tgt
- libs::libc-stdc++-tgt

- kernel::linux-modules

- rootfs-files
buildTools:
- name: mkfontdir
if: !expr |
"$BLUEPRINT_GRAPHICS_PLATFORM" == "x11"
buildVars: [TARGET_ARCH, CONFIG_INIT, BLUEPRINT_GRAPHICS_PLATFORM]
buildScript: |
rm -rf install

rootfsCopy "$PWD/install" "${@:2}"
rootfsPrepare "$PWD/install" "${@:2}"

pushd install

if [[ ! -e bin/sh ]] ; then
ln -sf bash bin/sh
fi

# Enable serial console login by default
if [[ $TARGET_ARCH == x86_64 ]] ; then
if [[ $CONFIG_INIT == systemd ]] ; then
mkdir -p etc/systemd/system/getty.target.wants
ln -s /usr/lib/systemd/system/getty@.service etc/systemd/system/getty.target.wants/getty@ttyS0.service
else
echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> etc/inittab
fi
fi

if [[ "$BLUEPRINT_GRAPHICS_PLATFORM" == x11 ]] ; then
mkfontdir usr/share/fonts/X11/misc/
fi

popd

rootfsExt4CreateImage "$PWD/install" "rootfs" "2.50%"

packageScript: |
cp $1/rootfs.img .