1 line
3.1 KiB
Plaintext
1 line
3.1 KiB
Plaintext
<!-- SC_OFF --><div class="md"><p>I was trying to minimise initramfs to optimise booting following <a href="https://wiki.archlinux.org/title/Mkinitcpio/Minimal_initramfs">https://wiki.archlinux.org/title/Mkinitcpio/Minimal_initramfs</a></p> <p>But failed to boot not detecting root which is a btrfs partitions,</p> <p>Then I found this <a href="https://stackoverflow.com/questions/43001223/how-to-ensure-that-there-is-a-delay-before-a-service-is-started-in-systemd">https://stackoverflow.com/questions/43001223/how-to-ensure-that-there-is-a-delay-before-a-service-is-started-in-systemd</a></p> <p>I created those two files, still fails to detect the root.</p> <p>Anybody has succeeded in doing this?</p> <p>Thank you</p> <p>Files: <code>/etc/mkinitcpio.d/linux-xanmod-anbox.preset</code> ```</p> <h1>mkinitcpio preset file for the 'linux-xanmod-anbox' package</h1> <p>ALL_config="/etc/mkinitcpio.conf" ALL_kver="/boot/vmlinuz-linux-xanmod-anbox"</p> <p>PRESETS=('default' 'fallback')</p> <h1>default_config="/etc/mkinitcpio.conf"</h1> <p>default_image="/boot/initramfs-linux-xanmod-anbox.img"</p> <h1>fallback_config="/etc/mkinitcpio.conf"</h1> <p>fallback_image="/boot/initramfs-linux-xanmod-anbox-fallback.img" fallback_options="-S autodetect" <code> `/usr/lib/initcpio/hooks/without-udev` </code></p> <h1>!/bin/ash</h1> <h1>Minimal initramfs files are created without udev.</h1> <h1>This hooks provides a polling disk mount replacement for udev.</h1> <h1>Udev hook can be removed, resulting in smaller initramfs files.</h1> <p>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</p> <pre><code>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 </code></pre> <p>} <code> `/usr/lib/initcpio/install/without-udev` </code></p> <h1>!/bin/bash</h1> <p>build() { add_runscript }</p> <p>help() { cat <<HELPEOF This hook provides support for booting without the "udev" hook, including support for UUID, LABEL, PARTUUID, PARTLABEL. HELPEOF } ```</p> <p>Also a line in /etc/mkinitcpio.conf <code>BINARIES="fsck fsck.btrfs btrfsck"</code></p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/mishab_mizzunet"> /u/mishab_mizzunet </a> <br/> <span><a href="https://www.reddit.com/r/archlinux/comments/rceqfs/minimising_initramfs_fails_to_detect_btrfs_root/">[link]</a></span>   <span><a href="https://www.reddit.com/r/archlinux/comments/rceqfs/minimising_initramfs_fails_to_detect_btrfs_root/">[comments]</a></span> |