Compare commits
1 commit
25a2258149
...
aa1f1d397b
Author | SHA1 | Date | |
---|---|---|---|
aa1f1d397b |
2 changed files with 16 additions and 16 deletions
29
flake.nix
29
flake.nix
|
@ -42,7 +42,7 @@
|
|||
cp -r ${self.packages.${system}.systemd.out}/* out/
|
||||
pushd out
|
||||
|
||||
chmod 755 etc usr/lib usr/bin
|
||||
find . -type d -exec chmod 755 {} \;
|
||||
|
||||
mkdir -p dev proc sys tmp root
|
||||
ln -sf usr/bin bin
|
||||
|
@ -51,15 +51,12 @@
|
|||
ln -sf usr/lib lib64
|
||||
|
||||
ln -sf ../proc/self/mounts etc/mtab
|
||||
ln -sf usr/lib/systemd/systemd init
|
||||
|
||||
ln -sf systemd/libsystemd-core-257.so usr/lib/
|
||||
ln -sf systemd/libsystemd-shared-257.so usr/lib/
|
||||
ln -sf ../usr/lib/systemd/systemd init
|
||||
|
||||
echo patos > ./etc/hostname
|
||||
cat <<EOF > ./etc/os-release
|
||||
NAME="Patos"
|
||||
PRETTY_NAME="Patos Platform"
|
||||
NAME="PatOS"
|
||||
PRETTY_NAME="PatOS Platform"
|
||||
ID=patos
|
||||
EOF
|
||||
|
||||
|
@ -116,20 +113,22 @@
|
|||
chmod 644 ./etc/group
|
||||
|
||||
# install busybox
|
||||
cp ${pkgs.busybox.out}/bin/busybox ./usr/bin/
|
||||
./usr/bin/busybox --list | while read f; do
|
||||
ln -sf busybox ./usr/bin/$f
|
||||
done
|
||||
cp ${pkgs.busybox.out}/bin/busybox usr/bin/
|
||||
usr/bin/busybox --list | xargs -I {} ln -sf busybox usr/bin/{}
|
||||
|
||||
# get shared libs
|
||||
find . -type f -executable | xargs ldd 2> /dev/null | awk '{print $3}' | grep -v systemd | sort -u | xargs cp -t usr/lib
|
||||
find . -type f -executable | xargs chmod 755
|
||||
|
||||
# FIXME: hacky patch elf patching. Is there a better way????????
|
||||
find . -type f -executable -print | xargs -I {} ${pkgs.lib.getExe pkgs.patchelf} --set-rpath /lib {} 2> /dev/null
|
||||
# FIXME: hacky(?) ELF patching. Is there a better way????????
|
||||
find . -type f -executable -print | xargs -I {} ${pkgs.lib.getExe pkgs.patchelf} --set-rpath /lib:/usr/lib:/usr/lib/systemd {} 2> /dev/null
|
||||
find . -type f -executable -print | xargs -I {} ${pkgs.lib.getExe pkgs.patchelf} --set-interpreter /lib/ld-linux-x86-64.so.2 {} 2> /dev/null
|
||||
cp ${self.packages.${system}.glibc.out}/lib/ld-linux-x86-64.so.2 lib/
|
||||
${pkgs.lib.getExe pkgs.patchelf} --remove-rpath lib/ld-linux-x86-64.so.2
|
||||
cp ${
|
||||
self.packages.${system}.glibc.out
|
||||
}/lib/ld-linux-x86-64.so.2 lib/ && ${pkgs.lib.getExe pkgs.patchelf} --remove-rpath lib/ld-linux-x86-64.so.2
|
||||
|
||||
# strip binaries
|
||||
find . -type f -executable | xargs strip 2> /dev/null
|
||||
|
||||
# gen initrd
|
||||
find . -print0 | ${pkgs.lib.getExe pkgs.cpio} --null --owner=root:root -o --format=newc | ${pkgs.lib.getExe pkgs.gzip} -9 > ../initrd.gz
|
||||
|
|
|
@ -188,13 +188,14 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
(lib.mesonOption "tty-gid" "3") # tty in NixOS has gid 3
|
||||
|
||||
(lib.mesonOption "kmod-path" "/bin/kmod")
|
||||
(lib.mesonOption "debug-shell" "/bin/bash")
|
||||
(lib.mesonOption "debug-shell" "/bin/sh")
|
||||
(lib.mesonOption "pamconfdir" "/etc/pam.d")
|
||||
(lib.mesonOption "shellprofiledir" "/etc/profile.d")
|
||||
(lib.mesonOption "dbuspolicydir" "/usr/share/dbus-1/system.d")
|
||||
(lib.mesonOption "dbussessionservicedir" "/usr/share/dbus-1/services")
|
||||
(lib.mesonOption "dbussystemservicedir" "/usr/share/dbus-1/system-services")
|
||||
(lib.mesonOption "setfont-path" "/bin/setfont")
|
||||
(lib.mesonOption "loadkeys-path" "/bin/loadkeys")
|
||||
(lib.mesonOption "sulogin-path" "/bin/sulogin")
|
||||
(lib.mesonOption "nologin-path" "/bin/nologin")
|
||||
(lib.mesonOption "mount-path" "/bin/mount")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue