23 lines
471 B
Bash
23 lines
471 B
Bash
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 {} \;
|
|
mkdir sysroot
|
|
|
|
### create directories
|
|
ln -sf ../usr/lib/systemd/systemd init
|
|
|
|
### Create needed files
|
|
echo patos > ./etc/hostname
|
|
|
|
ln -sf /etc/os-release ./etc/initrd-release
|
|
|
|
# gen initrd
|
|
find . -print0 | cpio --null --owner=root:root -o --format=newc | xz -9 --check=crc32 > ../initrd.xz
|
|
|
|
popd
|
|
rm -rf $out/root
|