2025-02-24 15:01:03 +01:00
|
|
|
set -ex -p pipefail
|
|
|
|
echo "Building initram disk"
|
|
|
|
mkdir -p $out/root
|
|
|
|
pushd $out/root
|
|
|
|
|
|
|
|
### copy rootfs
|
|
|
|
cp -prP $rootfs/* .
|
|
|
|
find . -type d -exec chmod 755 {} \;
|
2025-02-25 21:02:35 +01:00
|
|
|
mkdir sysroot
|
2025-02-24 15:01:03 +01:00
|
|
|
|
|
|
|
### create directories
|
|
|
|
ln -sf ../usr/lib/systemd/systemd init
|
|
|
|
|
|
|
|
### Create needed files
|
|
|
|
echo patos > ./etc/hostname
|
2025-02-25 11:40:34 +01:00
|
|
|
|
|
|
|
ln -sf /etc/os-release ./etc/initrd-release
|
2025-02-24 15:01:03 +01:00
|
|
|
|
|
|
|
# gen initrd
|
|
|
|
find . -print0 | cpio --null --owner=root:root -o --format=newc | xz -9 --check=crc32 > ../initrd.xz
|
|
|
|
|
|
|
|
popd
|
|
|
|
rm -rf $out/root
|