Coder Social home page Coder Social logo

tiny-initramfs's People

Contributors

chris-se avatar jwilk 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tiny-initramfs's Issues

How to add root= details to the tiny-initrd.img?

I am using Debian 9 on QNAP TS-409 pro.

As initramfs-tools and dracut are giving result files too large (must be smaller than 4MB), I am trying to use tiny-initramfs.

For TS-409pro, there is no boot loader.

kernel is flash to /dev/mtdblock1
initrd is flashed to/dev/mtdblock2

So I need to include the root= parameter to the initrd.img file.

How can I do that?

Build fails with `devices.c:(.text+0x520): undefined reference to `major'`

Under Debian sid/unstable with gcc (Debian 10.2.1-1) 10.2.1 20201207, make fails with error below,

$ ./autogen.sh
$ ./configure
$ LANG=C make -j4
make  all-am
make[1]: Entering directory '/home/joey/src/tiny-initramfs'
  CC       tiny_initramfs-tiny_initramfs.o
  CC       tiny_initramfs-io.o
  CC       tiny_initramfs-fstab.o
  CC       tiny_initramfs-mount.o
  CC       tiny_initramfs-log.o
  CC       tiny_initramfs-devices.o
  CC       tiny_initramfs-util.o
devices.c: In function 'scan_devices':
devices.c:290:15: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
  290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
      |               ^~~~~
devices.c:290:33: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
      |                                 ^~
devices.c:290:43: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration]
  290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
      |                                           ^~~~~
devices.c:290:61: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  290 |           if (major(st.st_rdev) == maj && minor(st.st_rdev) == min) {
      |                                                             ^~
  CCLD     tiny_initramfs
/usr/bin/ld: tiny_initramfs-devices.o: in function `scan_devices':
devices.c:(.text+0x520): undefined reference to `major'
/usr/bin/ld: devices.c:(.text+0x539): undefined reference to `minor'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:398: tiny_initramfs] Error 1
make[1]: Leaving directory '/home/joey/src/tiny-initramfs'
make: *** [Makefile:301: all] Error 2

please virtiofs support

initramfs: Parameter root=root unsupported (only /dev/, 0xMAJMIN and UUID= are  supported)

Module crc32-generic not added for F2FS

Using Debian sid/unstable with tiny-initramfs 0.1-5, on an old Acer TravelMate 5735Z/BA51_MV, BIOS V1.14 07/26/2011, with Intel Pentium T4500 and an F2FS root partition, F2FS fails to load as no crc32 routines can be loaded. The problem is, that the module crc32-generic is not added to the initrd, but only the optimized version using PCLMUL instruction, not present on the old processor.

$ /sbin/modinfo f2fs
filename:       /lib/modules/5.10.0-trunk-amd64/kernel/fs/f2fs/f2fs.ko
softdep:        pre: crypto-crc32
license:        GPL
description:    Flash Friendly File System
author:         Samsung Electronics's Praesto Team
alias:          fs-f2fs
depends:        
retpoline:      Y
intree:         Y
name:           f2fs
vermagic:       5.10.0-trunk-amd64 SMP mod_unload modversions 
parm:           num_compress_pages:Number of intermediate compress pages to preallocate (uint)

To work around it, add crc32-generic to the module list in /etc/tiny-initramfs/tiny-initramfs.conf.

zstd support

please add support for zstd or other compressors

Add run_hook for root LABEL using blkid (without udev)

Hi Chris,

Any chance that booting with root LABEL can be added to run_hook() in /usr/share/tiny-initramfs/functions?

Here is a quite robust method using blkid (no udev involved).

https://unix.stackexchange.com/questions/352381/how-to-boot-into-root-btrfs-file-system-with-minimal-initramfs-without-udev-hook/352932#answer-352932

run_hook () {
    local dev timeout sleepval device=$root
    # if udev is running then exit
    [ "$udevd_running" -eq 1 ] && return
    # try for (timeout * sleepval =) 10 seconds to handle slow (USB) devices
    timeout=1000
    sleepval=0.01

    case $device in
        # label to resolve, when resolved the kernel block device also exists
        UUID=*|LABEL=*|PARTUUID=*|PARTLABEL=*)
            while [ $timeout -gt 0 ]; do
                timeout=$((timeout - 1))
                dev=$(blkid -lt "$device" -o device)
                [ -n "$dev" ] && timeout=0 || sleep $sleepval
            done
            ;;
        # kernel named block device, poll for existence
        /dev/*)
            while [ $timeout -gt 0 ]; do
                timeout=$((timeout -1))
                if [ -b "$device" ]; then
                    dev=$device
                    timeout=0
                else
                    sleep $sleepval
                fi
            done
            ;;
    esac
}

Thanks,
bodhi

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.