]> git.pld-linux.org Git - projects/geninitrd.git/blame - mod-blkid.sh
root dev finding: fallback to calculating based on initrd /dev file
[projects/geninitrd.git] / mod-blkid.sh
CommitLineData
8351ab8d
ER
1#!/bin/sh
2#
3# geninitrd mod: blkid
6e49b0b1 4USE_BLKID=${USE_BLKID:-yes}
8351ab8d
ER
5
6# true if we should parse UUID= or LABEL= for root parameter
8351ab8d 7
c124d0cf
ER
8# setup geninitrd module
9# @access public
10setup_mod_blkid() {
11 blkid=$(find_tool $initrd_dir/blkid /sbin/initrd-blkid)
6e49b0b1
ER
12
13 if [ ! -x "$blkid" ]; then
c124d0cf
ER
14 USE_BLKID=no
15 fi
16}
8351ab8d
ER
17
18# generate initrd fragment
19# @access public
20initrd_gen_blkid() {
1b481849
ER
21 if ! is_yes "$USE_BLKID"; then
22 return
23 fi
8351ab8d
ER
24 debug "Adding BLKID support to initrd"
25
26 inst_exec $blkid /bin/blkid
27 initrd_gen_devices
28 add_linuxrc <<-'EOF'
29 # if built with blkid change ROOT=LABEL=something into ROOT=/dev/somethingelse -
30 # parsed by blkid
31 if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then
32 ROOT="$(/bin/blkid -t $ROOT -o device -l)"
33 fi
34 EOF
35}
This page took 0.027227 seconds and 4 git commands to generate.