]>
Commit | Line | Data |
---|---|---|
8351ab8d | 1 | #!/bin/sh |
c34c6a69 | 2 | BLKID_RCSID='$Revision$ $Date:: $' |
05c474b5 | 3 | |
8351ab8d | 4 | # geninitrd mod: blkid |
6e49b0b1 | 5 | USE_BLKID=${USE_BLKID:-yes} |
8351ab8d ER |
6 | |
7 | # true if we should parse UUID= or LABEL= for root parameter | |
8351ab8d | 8 | |
c124d0cf ER |
9 | # setup geninitrd module |
10 | # @access public | |
11 | setup_mod_blkid() { | |
12 | blkid=$(find_tool $initrd_dir/blkid /sbin/initrd-blkid) | |
6e49b0b1 ER |
13 | |
14 | if [ ! -x "$blkid" ]; then | |
c124d0cf ER |
15 | USE_BLKID=no |
16 | fi | |
17 | } | |
8351ab8d ER |
18 | |
19 | # generate initrd fragment | |
20 | # @access public | |
21 | initrd_gen_blkid() { | |
1b481849 ER |
22 | if ! is_yes "$USE_BLKID"; then |
23 | return | |
24 | fi | |
8351ab8d ER |
25 | debug "Adding BLKID support to initrd" |
26 | ||
27 | inst_exec $blkid /bin/blkid | |
28 | initrd_gen_devices | |
29 | add_linuxrc <<-'EOF' | |
30 | # if built with blkid change ROOT=LABEL=something into ROOT=/dev/somethingelse - | |
31 | # parsed by blkid | |
32 | if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then | |
33 | ROOT="$(/bin/blkid -t $ROOT -o device -l)" | |
34 | fi | |
35 | EOF | |
36 | } |