Coder Social home page Coder Social logo

tinyramfs's Introduction

Moved to Codeberg

New projects will be hosted on Codeberg.

Existing projects will remain on GitHub for now.

tinyramfs's People

Contributors

fluorescent-haze avatar illiliti avatar loadfred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinyramfs's Issues

Another infinite loop

Debug log:

033[1;37m>>033[m preparing environment
+ prepare_initramfs
+ print 'preparing initramfs'
+ printf '%b %s\n' '033[1;37m>>033[m' 'preparing initramfs'
033[1;37m>>033[m preparing initramfs
+ mkdir -p /tmp/tinyramfs.7204/dev /tmp/tinyramfs.7204/sys /tmp/tinyramfs.7204/tmp /tmp/tinyramfs.7204/run /tmp/tinyramfs.7204/var /tmp/tinyramfs.7204/proc /tmp/tinyramfs.7204/root /tmp/tinyramfs.7204/usr/lib /tmp/tinyramfs.7204/usr/bin /tmp/tinyramfs.7204/mnt/root /tmp/tinyramfs.7204/etc/tinyramfs
+ ln -s usr/lib /tmp/tinyramfs.7204/lib
+ ln -s usr/bin /tmp/tinyramfs.7204/bin
+ ln -s usr/bin /tmp/tinyramfs.7204/sbin
+ ln -s ../run /tmp/tinyramfs.7204/var/run
+ ln -s ../run/lock /tmp/tinyramfs.7204/var/lock
+ ln -s bin /tmp/tinyramfs.7204/usr/sbin
+ for _binary in \[ sh ln env kill mkdir sleep mount printf switch_root "${srcdir}/device-helper"
+ copy_binary '['
++ command -v '['
+ binary='['
+ case "$binary" in
+ IFS=:
+ set -- /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /opt/bin /usr/lib/llvm/10/bin
+ unset IFS
+ for _dir in "$@"
+ '[' -x '/usr/local/sbin/[' ']'
+ continue
+ for _dir in "$@"
+ '[' -x '/usr/local/bin/[' ']'
+ continue
+ for _dir in "$@"
+ '[' -x '/usr/sbin/[' ']'
+ continue
+ for _dir in "$@"
+ '[' -x '/usr/bin/[' ']'
+ binary='/usr/bin/['
+ break
+ '[' -e '/tmp/tinyramfs.7204/bin/[' ']'
+ '[' -h '/usr/bin/[' ']'
+ cp '/usr/bin/[' /tmp/tinyramfs.7204/bin
+ chmod 755 '/tmp/tinyramfs.7204/bin/['
+ strip '/tmp/tinyramfs.7204/bin/['
+ ldd '/usr/bin/['
+ read -r _library
+ _library='linux-vdso.so.1 (0x00007ffddb75d000)'
+ _library=linux-vdso.so.1
+ '[' -e linux-vdso.so.1 ']'
+ continue
+ read -r _library
+ _library='/lib64/libc.so.6 (0x00007f12b4c5d000)'
+ _library=/lib64/libc.so.6
+ '[' -e /lib64/libc.so.6 ']'
+ copy_library /lib64/libc.so.6
+ library=/lib64/libc.so.6
+ '[' -e /tmp/tinyramfs.7204/lib/libc.so.6 ']'
+ '[' -h /lib64/libc.so.6 ']'
++ ls -ld /lib64/libc.so.6
+ symlink='lrwxrwxrwx 1 root root 12 Aug 28 20:51 /lib64/libc.so.6 -> libc-2.32.so'
+ cp -P /lib64/libc.so.6 /tmp/tinyramfs.7204/lib
+ library=/lib/libc-2.32.so
+ '[' -h /lib/libc-2.32.so ']'
+ cp /lib/libc-2.32.so /tmp/tinyramfs.7204/lib
+ chmod 755 /tmp/tinyramfs.7204/lib/libc-2.32.so
+ strip /tmp/tinyramfs.7204/lib/libc-2.32.so
+ read -r _library
+ _library='/lib64/ld-linux-x86-64.so.2 (0x00007f12b4e39000)'
+ _library=/lib64/ld-linux-x86-64.so.2
+ '[' -e /lib64/ld-linux-x86-64.so.2 ']'
+ copy_library /lib64/ld-linux-x86-64.so.2
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -e /tmp/tinyramfs.7204/lib/ld-linux-x86-64.so.2 ']'
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 10 Aug 28 20:51 /lib64/ld-linux-x86-64.so.2 -> ld-2.32.so'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.7204/lib
+ library=/lib/ld-2.32.so
+ '[' -h /lib/ld-2.32.so ']'
+ cp /lib/ld-2.32.so /tmp/tinyramfs.7204/lib
+ chmod 755 /tmp/tinyramfs.7204/lib/ld-2.32.so
+ strip /tmp/tinyramfs.7204/lib/ld-2.32.so
+ read -r _library
+ '[' '' ']'
+ for _binary in \[ sh ln env kill mkdir sleep mount printf switch_root "${srcdir}/device-helper"
+ copy_binary sh
++ command -v sh
+ binary=/bin/sh
+ case "$binary" in
+ '[' -e /tmp/tinyramfs.7204/bin/sh ']'
+ '[' -h /bin/sh ']'
++ ls -ld /bin/sh
+ symlink='lrwxrwxrwx 1 root root 4 Aug 26 18:04 /bin/sh -> bash'
+ cp -P /bin/sh /tmp/tinyramfs.7204/bin
+ binary=/bin/bash
+ '[' -h /bin/bash ']'
+ cp /bin/bash /tmp/tinyramfs.7204/bin
+ chmod 755 /tmp/tinyramfs.7204/bin/bash
+ strip /tmp/tinyramfs.7204/bin/bash
+ ldd /bin/bash
+ read -r _library
+ _library='linux-vdso.so.1 (0x00007ffc0b3c6000)'
+ _library=linux-vdso.so.1
+ '[' -e linux-vdso.so.1 ']'
+ continue
+ read -r _library
+ _library='/lib64/libreadline.so.8 (0x00007f64fd7a7000)'
+ _library=/lib64/libreadline.so.8
+ '[' -e /lib64/libreadline.so.8 ']'
+ copy_library /lib64/libreadline.so.8
+ library=/lib64/libreadline.so.8
+ '[' -e /tmp/tinyramfs.7204/lib/libreadline.so.8 ']'
+ '[' -h /lib64/libreadline.so.8 ']'
++ ls -ld /lib64/libreadline.so.8
+ symlink='lrwxrwxrwx 1 root root 18 Aug 29 08:33 /lib64/libreadline.so.8 -> libreadline.so.8.0'
+ cp -P /lib64/libreadline.so.8 /tmp/tinyramfs.7204/lib
+ library=/lib/libreadline.so.8.0
+ '[' -h /lib/libreadline.so.8.0 ']'
+ cp /lib/libreadline.so.8.0 /tmp/tinyramfs.7204/lib
+ chmod 755 /tmp/tinyramfs.7204/lib/libreadline.so.8.0
+ strip /tmp/tinyramfs.7204/lib/libreadline.so.8.0
+ read -r _library
+ _library='/lib64/libtinfo.so.6 (0x00007f64fd76b000)'
+ _library=/lib64/libtinfo.so.6
+ '[' -e /lib64/libtinfo.so.6 ']'
+ copy_library /lib64/libtinfo.so.6
+ library=/lib64/libtinfo.so.6
+ '[' -e /tmp/tinyramfs.7204/lib/libtinfo.so.6 ']'
+ '[' -h /lib64/libtinfo.so.6 ']'
++ ls -ld /lib64/libtinfo.so.6
+ symlink='lrwxrwxrwx 1 root root 15 May 11 16:05 /lib64/libtinfo.so.6 -> libtinfo.so.6.2'
+ cp -P /lib64/libtinfo.so.6 /tmp/tinyramfs.7204/lib
+ library=/lib/libtinfo.so.6.2
+ '[' -h /lib/libtinfo.so.6.2 ']'
+ cp /lib/libtinfo.so.6.2 /tmp/tinyramfs.7204/lib
+ chmod 755 /tmp/tinyramfs.7204/lib/libtinfo.so.6.2
+ strip /tmp/tinyramfs.7204/lib/libtinfo.so.6.2
+ read -r _library
+ _library='/lib64/libc.so.6 (0x00007f64fd5aa000)'
+ _library=/lib64/libc.so.6
+ '[' -e /lib64/libc.so.6 ']'
+ copy_library /lib64/libc.so.6
+ library=/lib64/libc.so.6
+ '[' -e /tmp/tinyramfs.7204/lib/libc.so.6 ']'
+ return 0
+ read -r _library
+ _library='/lib64/libtinfow.so.6 (0x00007f64fd56c000)'
+ _library=/lib64/libtinfow.so.6
+ '[' -e /lib64/libtinfow.so.6 ']'
+ copy_library /lib64/libtinfow.so.6
+ library=/lib64/libtinfow.so.6
+ '[' -e /tmp/tinyramfs.7204/lib/libtinfow.so.6 ']'
+ '[' -h /lib64/libtinfow.so.6 ']'
++ ls -ld /lib64/libtinfow.so.6
+ symlink='lrwxrwxrwx 1 root root 16 May 11 16:05 /lib64/libtinfow.so.6 -> libtinfow.so.6.2'
+ cp -P /lib64/libtinfow.so.6 /tmp/tinyramfs.7204/lib
+ library=/lib/libtinfow.so.6.2
+ '[' -h /lib/libtinfow.so.6.2 ']'
+ cp /lib/libtinfow.so.6.2 /tmp/tinyramfs.7204/lib
+ chmod 755 /tmp/tinyramfs.7204/lib/libtinfow.so.6.2
+ strip /tmp/tinyramfs.7204/lib/libtinfow.so.6.2
+ read -r _library
+ _library='/lib64/ld-linux-x86-64.so.2 (0x00007f64fd8dd000)'
+ _library=/lib64/ld-linux-x86-64.so.2
+ '[' -e /lib64/ld-linux-x86-64.so.2 ']'
+ copy_library /lib64/ld-linux-x86-64.so.2
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -e /tmp/tinyramfs.7204/lib/ld-linux-x86-64.so.2 ']'
+ return 0
+ read -r _library
+ '[' '' ']'
+ for _binary in \[ sh ln env kill mkdir sleep mount printf switch_root "${srcdir}/device-helper"
+ copy_binary ln
++ command -v ln
+ binary=/bin/ln
+ case "$binary" in
+ '[' -e /tmp/tinyramfs.7204/bin/ln ']'
+ '[' -h /bin/ln ']'
+ cp /bin/ln /tmp/tinyramfs.7204/bin
+ chmod 755 /tmp/tinyramfs.7204/bin/ln
+ strip /tmp/tinyramfs.7204/bin/ln
+ ldd /bin/ln
+ read -r _library
+ _library='linux-vdso.so.1 (0x00007fffdeedc000)'
+ _library=linux-vdso.so.1
+ '[' -e linux-vdso.so.1 ']'
+ continue
+ read -r _library
+ _library='/lib64/libc.so.6 (0x00007f31c792e000)'
+ _library=/lib64/libc.so.6
+ '[' -e /lib64/libc.so.6 ']'
+ copy_library /lib64/libc.so.6
+ library=/lib64/libc.so.6
+ '[' -e /tmp/tinyramfs.7204/lib/libc.so.6 ']'
+ return 0
+ read -r _library
+ _library='/lib64/ld-linux-x86-64.so.2 (0x00007f31c7b0d000)'
+ _library=/lib64/ld-linux-x86-64.so.2
+ '[' -e /lib64/ld-linux-x86-64.so.2 ']'
+ copy_library /lib64/ld-linux-x86-64.so.2
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -e /tmp/tinyramfs.7204/lib/ld-linux-x86-64.so.2 ']'
+ return 0
+ read -r _library
+ '[' '' ']'
+ for _binary in \[ sh ln env kill mkdir sleep mount printf switch_root "${srcdir}/device-helper"
+ copy_binary env
++ command -v env
+ binary=/usr/bin/env
+ case "$binary" in
+ '[' -e /tmp/tinyramfs.7204/bin/env ']'
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env
+ symlink='lrwxrwxrwx 1 root root 13 Aug 16 18:20 /usr/bin/env -> ../../bin/env'
+ cp -P /usr/bin/env /tmp/tinyramfs.7204/bin
+ binary=/usr/bin/env
+ '[' -h /usr/bin/env ']'
++ ls -ld /usr/bin/env

Too many levels of symbolic links

Hi, when I run tinyramfs -k 5.5.3 -o /boot/initrd it returns:

-> preparing the environment
-> preparing initramfs
cp: failed to access '/tmp/tinyramfs.16615/lib/ld-linux-x86-64.so.2': Too many levels of symbolic links

Any idea of what could be causing this error?

Boot Issue: Tinyramfs cannot find root partition after init initramfs step.

Hey there!
I'm having some trouble getting my machine to boot. I've gotten to the point where grub tries to load the initramfs and then it fails to find the root partition. I'm executing tinyramfs with:
tinyramfs -k 5.7.7 -o /boot/initramfs-linux.img (with adding -f if I'm overwriting).

I've exhausted my problem solving capabilities on this one and would love to see if someone has an idea of where I'm going wrong. :)

blkid -f

sdb
├─sdb1                    vfat        FAT16          8DE7-EBA9                               499.5M     0% /mnt/boot/efi
├─sdb2                    crypto_LUKS 1              ca8ebf4f-6e11-4fa7-93ad-af96ca49ccd7
│ └─boot                  ext2        1.0            6290cc6c-0b1a-4e83-89e8-ccad9ea304bc      1.9G     1% /mnt/boot
└─sdb3                    crypto_LUKS 2              b0008a0c-8cc3-42d7-aab2-ca2acdc1e956
  └─root                  ext4        1.0            de28ef56-90ba-4a91-a358-f5f687ada697    202.5G     1% /mnt

Here is the config for Tinyramfs:

# default - 0
# enable this if you have monolithic kernel (builtin modules)
#
monolith=0

# compression program
#
# supported - whatever you choose
# default - none
# example - compress="pigz -9"
#
compress="none"

# root file system
#
# supported - UUID, LABEL, DEVICE, PARTUUID
# example -
#   root="/dev/sda1"
#   root="/dev/dm-0"
#   root="/dev/disk/by-uuid/13bcb7cc-8fe5-4f8e-a1fe-e4b5b336f3ef"
#   root="PARTUUID=35f923c5-083a-4950-a4da-e611d0778121"
#
root="UUID=b0008a0c-8cc3-42d7-aab2-ca2acdc1e956"

# root file system type
#
# default - autodetected throught /proc/mounts
# example - root_type="btrfs"
#
root_type="ext4"

# root file system options
# example - root_opts="subvol=mysubvolume,nodatacow,defaults"
# see fstab(5) man page for more info
#
root_opts="defaults"

# device manager
# supported - udev, mdev, mdevd
#
devmgr="udev"

# hostonly mode
#
# default - 0
# dramatically reduce initramfs size
# useful only for modular kernels
#
hostonly=0

# hooks
#
# currently supported - lvm, luks
# example -
#   hooks="lvm luks" will support booting LUKS on LVM
#   hooks="luks lvm" will support booting LVM on LUKS
#   hooks="luks"     will support booting only LUKS
#   and so on...
#
hooks="luks"

# LVM options
#
# supported - tag, name, group, config, discard
# description -
#   tag - trigger lvm by tag
#   name - trigger lvm by logical volume name. group must be specified
#   group - trigger lvm by volume group name
#   config - embed host lvm config
#   discard - enable issue_discards
# example -
#   lvm_opts="tag=lvm-server"
#   lvm_opts="name=lv1,group=vg1"
#   lvm_opts="config=1,discard=1"
#   lvm_opts="discard=1"
#
#lvm_opts=""

# LUKS options
#
# supported - key, name, root, header, discard
# description -
#   key - embed key
#   name - device mapper name
#   root - encrypted root ( UUID, LABEL, DEVICE, PARTUUID )
#   header - embed header
#   discard - enable allow-discards
# example -
#   luks_opts="root=PARTUUID=35f923c5-083a-4950-a4da-e611d0778121,key=/path/to/keyfile,name=myluksroot,header=/path/to/header,discard=1"
#   luks_opts="root=PARTUUID=35f923c5-083a-4950-a4da-e611d0778121,
#              key=/path/to/keyfile,
#              name=myluksroot,
#              header=/path/to/header,
#              discard=1"
#
#   luks_opts="root=/dev/sda1,discard=1"
#
luks_opts="root=UUID=b0008a0c-8cc3-42d7-aab2-ca2acdc1e956,key=/boot/rootkeyfile.key,name=root,discard=1"

custom hooks

I'd like to use custom hooks for Apple silicon, as in https://github.com/AsahiLinux/asahi-scripts/blob/main/initcpio/hooks/asahi
It should mount the efi partition, extract a cpio file from there into the initramfs' /, and create a tmpfs (which will be forwarded to the booted kernel) where it copies the content of the archive.
I suspect this is already possible, but I'm not sure about details: roughly, what are the equivalents of run_earlyhook (I guess before udev and similar), run_latehook (after everything else) and new_root (where the initram will pivot)? are they init, init.late and /mnt/root, as in my attempt below?

hook-asahi.init:

print "asahi: unpacking vendor firmware into initramfs"
modprobe apple-mailbox
modprobe nvme-apple
mount /dev/by-UUID /run/.system-efi
( cd /; cpio -i < /run/.system-efi/firmware.cpio" )
umount /run/.system-efi
  1. how do i make sure those modules are copied to the initram?
  2. is there a better way to refer to the EFI partition, e.g. via the config file?

hook-asahi.late

print "asahi: copying vendor firmware to tmpfs under root filesystem"
mkdir -p /mnt/root/lib/firmware/vendor
mount -t tmpfs vendorfw /mnt/root/lib/firmware/vendor
cp -r /vendorfw/* /vendorfw/.vendorfw.manifest /mnt/root/lib/firmware/vendor

Thanks.

init.late hook has issue with cp -r /folder/*

as part of void-linux/void-packages#39796 i have a custom late init hook that loads firmware into a tmpfs.
the hook works fine in its current form

[ -e /vendorfw ] || return 0
print 'asahi: copying vendor firmware to tmpfs under root filesystem'
loaderdir=/mnt/root/lib/firmware/vendor
mkdir -p "$loaderdir"
mount -t tmpfs vendorfw "$loaderdir"

cp /vendorfw/manifest.txt "$loaderdir"
cp -r /vendorfw/asmedia "$loaderdir"
cp -r /vendorfw/brcm "$loaderdir"

but if I replace the three cp invocations with cp -r /vendorfw/* "$loaderdir", then the boot process hangs indefinitely.
do you know what the issue could be?

Use environment variable and parameters for init_args

The kernel parses parameters from the kernel command line up to "--"; if it doesn't recognize a parameter and it doesn't contain a '.', the parameter gets passed to init: parameters with '=' go into init's environment, others are passed as command line arguments to init. Everything after "--" is passed as an argument to init.

Currently init_args can't use any of the parameters from the left part of `--' in kernel cmdline.

For example: root=/dev/sda console=ttyS0 arg1 arg2=1 -- arg3 arg4=1:

  • arg1 and arg2 can not be passed to init programs.

We can use environment variables and initramfs arguments instead of /proc/cmdline to determine init_args.

stuck at "copying all modules"

Hello again,
I am currently running this in a KISS Linux chroot with busybox tools, cryptsetup, kmod etc ...
When I run sudo tinyramfs -o /boot/initramfs -k 5.8.3 (-k is needed because the chroot doesn't have the same kernel as the host) I'm getting this log:

>> preparing environment
>> preparing initramfs
>> running keymap hook
>> configuring keymap
>> running eudev hook
>> configuring eudev
>> running luks hook
>> configuring LUKS
>> copying all modules
cp: can't create '/tmp/tinyramfs.11288/lib/modules/5.8.3/modules.builtin': Path does not exist
cp: can't create '/tmp/tinyramfs.11288/lib/modules/5.8.3/modules.order': Path does not exist

endless loop after tinyramfs -o /boot/initramfs

Debug log

+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2
+ symlink='lrwxrwxrwx 1 root root 27 Aug 19 09:24 /lib64/ld-linux-x86-64.so.2 -> ../lib/ld-linux-x86-64.so.2'
+ cp -P /lib64/ld-linux-x86-64.so.2 /tmp/tinyramfs.25167/lib
+ library=/lib64/ld-linux-x86-64.so.2
+ '[' -h /lib64/ld-linux-x86-64.so.2 ']'
++ ls -ld /lib64/ld-linux-x86-64.so.2

and so on an so on...

Setting keyboard layout

Hello, I am currently using this for a basic encrypted kiss partition. I can actually boot the encrypted partition and I'm asked to enter my passphrase, but ... the entry is set to qwerty, and I have a different keyboard. I don't know much about disk encryption, I just know that on Arch Linux setting the keyboard layout is set by modifying /etc/mkinitcpio.conf, meaning that is it handled by the initramfs. Is it possible to do that with tinyramfs ?

Device not found when booting from encrypted LVM on LUKS

I have this setup, on KISS Linux:

# lsblk 
NAME              MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0               7:0    0   2.8G  1 loop  
nvme0n1           259:0    0 953.9G  0 disk  
├─nvme0n1p1       259:1    0   512M  0 part  /boot
└─nvme0n1p2       259:2    0 953.4G  0 part  
  └─cryptroot     253:0    0 953.4G  0 crypt 
    ├─laptop-swap 253:1    0    32G  0 lvm   [SWAP]
    ├─laptop-root 253:2    0   100G  0 lvm   /
    └─laptop-home 253:3    0 821.4G  0 lvm   /home

Here's my config, with uuid's redacted:

# cat /etc/tinyramfs/config 
luks_root=UUID=<...>
luks_name=cryptroot

lvm_group="laptop"

root=UUID=<...>
root_type="ext4"
compress="zstd -22 --ultra -T0"
hostonly=true
hooks="mdev,luks,lvm"

and whenever I try to boot I get hit by a message that the device cannot be found, it is after entering LUKS password, and I checked that device it specified was existing and correct, but after trying to mount it manually in a shell that initrd dropped me to it also said that device could not be found.

Cant stat '/lib//usr/lib/libc.so'

Hello! This is my first time messing around with the initramfs on my personal machine. When running it with lvm and luks enabled I get that error. I also get the following two errors.

cp: can't create '/tmp/initramfs.31940/lib/modules/5.4.33-gnu/modules.builtin': Path does not exist

And

cp: can't create '/tmp/initramfs.31940/lib/modules/5.4.33-gnu/modules.dep': Path does not exist

EDIT: Last two errors were my mistake due to a monolithic kernel.

Hostonly mode

I thought about how to properly implement hostonly mode(install only needed drivers). This is list of my ideas:

  • implement modular system (like in dracut)
  • hardcode needed drivers
  • install current loaded modules (/proc/modules)
  • perform autodetection of drivers via /sys
  • leave this task to user ($drivers variable)

Too many levels of symbolic links

When I run the command to install (tinyramfs -o "/boot/initramfs-$(uname -r)"), I get this error.

cp: failed to access '/tmp/tinyramfs.5121/bin/env': Too many levels of symbolic links

TODO

  • Cleanup/remove dirty code
    • Rework trap_helper()
  • Proper docs, man pages (scdoc)
  • Event-based initramfs impossible without sacrificing portability
  • TPM LUKS
  • LUKS dm-verify/dm-integrity
  • LUKS external key/header on block device/file system
  • CPU microcode
  • Hooks
  • Firmware can be managed via hooks
  • Keymaps
  • ZFS
  • TPM ZFS (openzfs/zfs#9852)
  • RAID (dmraid, mdraid)
  • Suspend/hibernate
  • Kernel command line parameters
  • Live USB integration
  • Mode without device manager using deprecated /proc/sys/kernel/hotplug (i'm still looking for better way to drop device managers)
  • Fix remaining bugs (open an issue if you found something)

Suggestions are welcome

could not open modules.builtin.modinfo & cannot unlock LUKS

on Void Linux, using void-linux/void-packages#43061 and

$ lsblk 
NAME                 MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
nvme0n1              259:0    0 476.9G  0 disk  
├─nvme0n1p1          259:1    0   512M  0 part  /boot
└─nvme0n1p2          259:2    0 476.4G  0 part  
  └─cryptroot        254:0    0 476.4G  0 crypt 
    ├─cryptroot-root 254:1    0    15G  0 lvm   /
    └─cryptroot-home 254:2    0 461.4G  0 lvm   /home

the config (dots are replaced by actual value of blkid /dev/nvme0n1p2)

$ cat /etc/tinyramfs/config 
compress="gzip -9"
hooks="eudev,luks,lvm"
luks_root="UUID=..."
luks_name=cryptroot 
luks_discard=yes
lvm_group=cryptroot 
lvm_name=root

produces

$ doas xbps-reconfigure -f linux6.1 
linux6.1: configuring ...
Executing post-install kernel hook: 20-initramfs ...
>> creating ramfs structure
>> copying hook: eudev.init
>> copying hook: eudev.init.late
>> evaluating hook: eudev
>> copying hook: luks.init
>> evaluating hook: luks
>> copying hook: lvm.init
>> evaluating hook: lvm
>> copying all modules
depmod: WARNING: could not open modules.builtin.modinfo at /tmp/tinyramfs.11858/lib/modules/6.1.21_1: No such file or directory
>> generating initramfs image
+> done: boot/initramfs-6.1.21_1.img
Executing post-install kernel hook: 50-efibootmgr ...
linux6.1: configured successfully.

and then the boot is stuck at

Enter passphrase for /dev/disk/by-uuid/...:
device-mapper: table: 254:0 crypt: unknown target type
device-mapper: ioctl: error adding target to table
device-mapper: reload ioctl on cryptroot (254:0) failed: Invalid argument
!> failed to unlock LUKS

Is this related to the patch mentioned for kmod? or something else?
Thanks.

Could not mount: No such device (EXT4)

Hello, I am having problems with tinyramfs. Whenever I boot, it shows this:

mount: mounting /dev/disk/by-uuid/* on /mnt/root failed: No such device
!> failed to mount rootfs: /dev/disk/by-uuid/*
sh: can't access tty: job control turned off

Picture of error:
image


Kernel config:

Here

Tinyramfs config:

monolith=0
compress=gzip
root="UUID=14875d4-b8f0-4678-b370-8b873bc67fff"
root_type=ext4
hooks="mdev"

/etc/fstab:

# /dev/sda3
UUID=1487e5d4-b8f0-467f-b370-8b873bc67fff	/         	ext4      	rw,relatime	0 1

# /dev/sda1
UUID=15CD-CDD1      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/sda2
UUID=e1c71adb-fa31-4b08-958b-61a8c79ffd85	none      	swap      	defaults  	0 0

Hardware:

CPU:Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz (Skylake)
GPU:
    VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
    3D controller: NVIDIA Corporation GM108M [GeForce 940M] (rev a2)
RAM: 4GB DDR3
Wireless: 
    Dual Band Wireless-AC 3165 Plus Bluetooth
    Vendor: Intel Corporation
Disk: Model: LITEON CV1-DB256

I have looked up these issues:

  • #22
    • Ext4 is in external modules, and the image was built with monolith=0, but the issue still appears.
  • #9
    • Checked hooks, I have mdev, but I can't find the ext4 hook. I created the ext4 hook manually, according to the instructions, but when I tried to make the image, it says that the hook is not found even I put it in hooks.d.
  • #25
    • Not using LUKS or LVM.

If you need more information, I will provide them as soon as I can.

Project Name

Hello! Firstly let me start by saying I absolutely love this project however I believe we could consider changing the name to make it easier to find and package. I have some ideas possibly if you would be willing to change it. Maybe lilinitramfs? or posinitramfs just something to give it a unique name. I understand if you would not like to change it at all just an idea.

EDIT: I may be stupid is tinyinitramfs the name if so should you change the repo name to that?

Hanging

Unfortunately after typing my passphrase it appears to hang. Any help would be appeciated. My system is fully updated. I only use luks no lvm.

Can't boot LVM

Hi there! I'm trying to use this to get Kiss Linux working with an LVM root partition. However, when attempting to boot, the kernel panics, as the root=UUID=... kernel parameter is set to the UUID of the LVM partition (which I think it should be), but the kernel can't seem to find the LV. My kernel parameters (in refind_linux.conf) are: rw root=UUID=[LVM UUID] initrd=EFI\kiss\initramfs-linux59. A screenshot of the kernel panic (from my VM) is attached. Also provided is my /etc/tinyramfs/config file.
screenshot

compress=xz

root=UUID=2b24bf94-d23c-4dd5-9a61-5501c3f1accc
root_type=ext4

hooks="eudev lvm"

lvm_config=1
lvm_discard=1
lvm_name=root
lvm_group=KissLV

I'm probably missing something obvious, but I've never used this tool before. Thank you for any help in advance!
Note: The kernel panic is basically identical as booting without the initramfs at all.

Can't create a file

Hi!

Config:

monolith=0
hostonly=1
compress=gzip
root=/dev/mapper/cryptroot
hooks="luks eudev"
luks_name=cryptroot
luks_root=/dev/nvme0n1p2
luks_discard=1

Output:

~ # tinyramfs -o "/boot/initramfs-$(uname -r)"
>> preparing environment
>> preparing initramfs
>> running luks hook

/boot/ is empty

device-helper blocking

Hello creator!

First of all, let me thank you for this project. I'm new to kernel DIYing, and the whole initramfs thing was almost incomprehensible because of all of the convoluted things mainstream distros do, almost too scary to dabble in. It's been nice to have this system you can look at and tinker with yourself.

While setting it up for myself, I found a blocking bug in the device-helper script along with a potential false failure in the init.

How to reproduce: have a CD drive in your system

Procedure: After running for about one or two minutes, the init script got an EXIT signal (the panic message was unexpected error) and it dropped me into an interactive shell. I played around a bit and used the cmdline breakpoints to figure out that it was failing somewhere in setup_devmgr. Played around some more, entered the commands in the init script by hand and saw that device-helper was going into a infinite waiting loop on /dev/sr0. It never got a successful blkid read on it, which is expected, it doesn't even give one on booted systems.

Solution: added a special case exit in device-helper for sr*dev_name (probably a very dirty hack)

Also worth looking into is the EXIT signal init was getting about 2 minutes after boot. While no (working) boot process should ever last this long, it may be symptomatic of another problem. All I could figure out was that at the time I was thrown into the interactive shell, device-helper for sr0 was still running, and some time later, udevadm got tired of it and killed it itself.

Thanks and good luck!

Root device not found or unavailable (LUKS/LVM)

I am pretty new to KISS but I wanted to try it out.
I encrypt all my installs due to me being on a laptop
The kernel compiled fine.
Grub was a different story as the only thing that worked was to grub-install on the live-usb i was using and not the chroot.
Now the issue I am facing is Trying to get LUKS LVM working.

When the system boots up, it will simply stop at 'Device not found or unavailable' and it will say LUKS decryption has failed.
I go into recovery mode and it seems to stop at blkid. It seems to be finding the UUID of the root partition but just can't.

I have tried:

  • Defining both the root and and crypt root as a UUID and as /dev/by/uuid
  • Defining root in GRUB
  • Changing mdev to eudev
  • Reinstalling GRUB
  • Changing the compress to add --check-crc32
  • Defining root as a PART-UUID
  • Putting the lvm hook before luks

I cannot seem to get anything to work. It does seem to be a problem with detecting the root partition.
The kernel does have Twofish and sha512 embedded into it (as I use that to encrypt my system).
I also checked blkid in the emergency shell that it kicked me into when I try to boot and it shows the encrypted partition.
It shows as /dev/sdb3 with the same UUID i specified in the tinyramfs config (/dev/sda below is /dev/sdb when it boots up which is why I use UUID).

Here is the way I encrypted it (this is shown in the liveusb chrooted)

NAME              FSTYPE      FSVER            LABEL        UUID                                   FSAVAIL FSUSE% MOUNTPOINT
sda                                                                                                               
├─sda1                                                                                                            
├─sda2            ext4        1.0                           298b044e-2eb9-41d1-b84c-6c6cb78bb226      1.3G     2% /mnt/boot
└─sda3            crypto_LUKS 2                             1c2c7634-12c5-42a7-94b7-c2cf6ba87787                  
  └─kisslvm       LVM2_member LVM2 001                      5A4NCD-n650-RmyN-UC04-2ZM1-y09p-2WTw5o                
    ├─MaoMao-swap swap        1                             f7860e16-871c-4c69-a384-9a961a586ebc                  
    ├─MaoMao-root ext4        1.0                           25efb88a-ba14-4084-a3be-96c28827dd3b    138.5G     0% /mnt
    └─MaoMao-home ext4        1.0                           e7026ea4-dfe7-4c9b-94a5-ebdd864774a1    275.1G     1% /mnt/home

This is the tinyramfs config:

compress="xz --check=crc32"
hooks="eudev luks lvm"

luks_discard=1
luks_root=UUID=1c2c7634-12c5-42a7-94b7-c2cf6ba87787


lvm_config=1
lvm_discard=1
lvm_name=root
lvm_group=MaoMao

root=UUID=25efb88a-ba14-4084-a3be-96c28827dd3b

Grub

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="KISS"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet dolvm crypt_root=PARTUUID=bfc72ec0-3e5b-4e0a-8078-724636c4ec14"

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y


I am pretty stumped at this issue as it should just boot up fine. Hopefully I can get some help with this.
I am using a KNOPPIX live usb.
I am using coreboot with seabios (All other OS's work so I do not think this could be the issue).
Grub was installed using the live usb onto the kiss installation by mounting /mnt/boot as /boot
The grub config was generated inside the chroot.
Grub boots up fine but the initramfs cannot decrypt the root partition ( as it cannot find one ).

I do suspect it is something to do with the luks hooks as that is the part that fails.

I'll try to get an image of the error if I can.
Thanks!

cp: cannot stat 'module option': No such file or directory

With the following

$ cat /etc/modprobe.d/modprobe.conf 
options snd-hda-intel model=tpt460

I do get an error, and the image is not created:

$ doas xbps-reconfigure -f linux6.3
linux6.3: configuring ...
Executing post-install kernel hook: 20-initramfs ...
>> creating ramfs structure
>> copying hook: eudev.init
>> copying hook: eudev.init.late
>> evaluating hook: eudev
>> copying hook: luks.init
>> evaluating hook: luks
>> copying hook: lvm.init
>> evaluating hook: lvm
>> copying hostonly modules
cp: cannot stat '/lib/modules/6.3.3_1/kernel/sound/pci/hda/snd-hda-intel.ko.zst model=tpt460': No such file or directory
Executing post-install kernel hook: 50-efibootmgr ...
linux6.3: configured successfully.

It seems that tinyramfs is incorrectly parsing my modprobe.d configuration.

No output

I'm not sure if this is due to clang or a config error so I will leave 3 files here my config, an strace(why I think it may be clang can't find libgcc), and the output of --debug.

strace
--debug
config

tinyramfs doesn't respect LIBDIR

Tinyramfs always assumes its scripts and hooks are in /lib/tinyramfs, regardless of what you set LIBDIR to when doing a make install. This works in KISS Linux, because of the /lib -> /usr/lib symlink, but breaks on many other distributions.

Generate initramfs for live ISO

Hey there,

I am trying to use tinyramfs to generate an initramfs for a custom distribution I am working on that uses musl, toybox, mdevd and libudev-zero.

Does tinyramfs support hardware detection at boot (not at initramfs generation time), as this will be a distribution initramfs that should be able to detect and load accordingly?

Are their any pointers or guides to get this working as intended?

Thanks in advance!

Mount fails with no such device error.

I am trying to run Kiss from a BTRFS partition on an LVM logical volume. I get dropped into an emergency shell, with the error that the device being mounted doesn't exist. I can see the device in /dev. From the emergency shell, I get the same error if I try to mount the root partition manually, though this doesn't happen to the non-lvm, non-btrfs, EFI partition (that mounts fine).

My config is:

compress="xz --check=crc32"

root="UUID=042f9fb5-6657-47d9-b81a-cebd86e9b94f"
root_type=btrfs

hooks="eudev lvm"

lvm_config=1
lvm_name=kissroot
lvm_group=kissvg

The output of blkid | grep kissroot is

/dev/mapper/kissvg-kissroot: UUID="042f9fb5-6657-47d9-b81a-cebd86e9b94f" UUID_SUB="895e196c-be51-44f5-ad78-7bca26325cec" BLOCK_SIZE="4096" TYPE="btrfs"

Version

I am working on packaging this for KISS linux and sumbiting it to the community repo. However I cannot find what version it is on could we add that to the Readme or a seperate version file?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.