From 6ea379fd89103d1dbd0fec50ab6cee29aa070d0d Mon Sep 17 00:00:00 2001 From: illiliti Date: Sat, 11 Jan 2020 04:58:18 +0300 Subject: [PATCH] get rid of gnu ln --- generate | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/generate b/generate index 3b584fd..54f0bb8 100755 --- a/generate +++ b/generate @@ -33,12 +33,17 @@ for d in dev etc usr/lib usr/bin mnt/root proc root sys; do mkdir -p "$tmpdir/$d" done -# make libraries and binaries happy -ln -rs "$tmpdir/usr/lib" "$tmpdir/lib" -ln -rs "$tmpdir/usr/lib" "$tmpdir/lib64" -ln -rs "$tmpdir/usr/lib" "$tmpdir/lib32" -ln -rs "$tmpdir/usr/bin" "$tmpdir/bin" -ln -rs "$tmpdir/usr/bin" "$tmpdir/sbin" +# symlinks +for s in lib lib64 bin sbin; do + case "$s" in + lib*) + ( cd "$tmpdir" && ln -s "usr/lib" "$s" ) + ;; + *bin) + ( cd "$tmpdir" && ln -s "usr/bin" "$s" ) + ;; + esac +done # TODO parse fstab | crypttab #while [ "$use_fstab" -eq 1 ] && read fs dir type opts; do thing; done < /etc/fstab @@ -98,6 +103,7 @@ if ! ( cd "$tmpdir" && find . | cpio --create --verbose --format=newc | gzip --b exit 1 fi +# remove tmpdir rm -rf "$tmpdir" echo "done! check out initramfs-$kernel.img.gz"