]>
Commit | Line | Data |
---|---|---|
8351ab8d ER |
1 | #!/bin/sh |
2 | # | |
3 | # geninitrd mod: blkid | |
6e49b0b1 | 4 | USE_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 | |
10 | setup_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 | |
20 | initrd_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 | } |