silly uki image with the systemd-ukify tooling
Some checks are pending
ci/woodpecker/pr/ci Pipeline is pending

This commit is contained in:
Lars Sjöström 2025-02-17 15:15:24 +01:00
parent 52986e7e70
commit a8692f8546
No known key found for this signature in database
2 changed files with 20 additions and 2 deletions

View file

@ -21,10 +21,28 @@
packages = {
default = self.packages.${system}.image;
image = pkgs.writeShellScriptBin "image" ''
echo "make image here..."
echo "make UKI..."
${self.packages.${system}.systemd.out}/bin/ukify build \
--linux ${self.packages.${system}.kernel.kernel}/bzImage \
--initrd ./out/initrd.gz \
--cmdline "console=ttyS0" \
-o patos.uki
'';
kernel = pkgs.callPackage ./kernel { };
initrd = pkgs.writeShellScriptBin "mkinitrd" ''
echo "make initrd..."
mkdir -p out/lib
# copy systemd
cp -r ${self.packages.${system}.systemd.out}/* out/
# get shared libs
pushd out
find . -type f -executable | xargs ldd | awk '{print $3}' | grep -v systemd | sort -u | xargs cp -t lib
# gen initrd
find . -print0 | ${pkgs.lib.getExe pkgs.cpio} --null --owner=root:root -o --format=newc | ${pkgs.lib.getExe pkgs.gzip} -9 > initrd.gz
'';
systemd = pkgs.callPackage ./systemd { };
};

View file

@ -150,7 +150,7 @@ stdenv.mkDerivation (finalAttrs: {
"'${targetPackages.stdenv.cc.bintools.targetPrefix}readelf'" \
--replace \
"/usr/lib/systemd/boot/efi" \
"$out/lib/systemd/boot/efi"
"$out/usr/lib/systemd/boot/efi"
''
# Finally, patch shebangs in scripts used at build time. This must not patch
# scripts that will end up in the output, to avoid build platform references