]> git.pld-linux.org Git - projects/geninitrd.git/blob - mod-blkid.sh
Timeout here is not a good idea. rootfs cannot be mounted and kernel oopses due to...
[projects/geninitrd.git] / mod-blkid.sh
1 #!/bin/sh
2 # geninitrd mod: blkid
3 USE_BLKID=${USE_BLKID:-yes}
4
5 # true if we should parse UUID= or LABEL= for root parameter
6
7 # setup geninitrd module
8 # @access       public
9 setup_mod_blkid() {
10         blkid=$(find_tool $initrd_dir/blkid /sbin/initrd-blkid)
11
12         if [ ! -x "$blkid" ]; then
13                 USE_BLKID=no
14         fi
15 }
16
17 # generate initrd fragment
18 # @access       public
19 initrd_gen_blkid() {
20         if ! is_yes "$USE_BLKID"; then
21                 return
22         fi
23         verbose "Adding BLKID support to initrd"
24
25         inst_exec $blkid /sbin/blkid
26         initrd_gen_devices
27         add_linuxrc <<-'EOF'
28                 # if built with blkid change ROOT=LABEL=something into ROOT=/dev/device parsed by blkid
29                 if [ "${ROOT##LABEL=}" != "${ROOT}" -o "${ROOT##UUID=}" != "${ROOT}" ]; then
30                         blkid="$(/sbin/blkid -t $ROOT -o device -l)"
31                         if [ -n "$blkid" ]; then
32                                 ROOT=$blkid
33                         fi
34                 fi
35         EOF
36 }
This page took 0.027068 seconds and 3 git commands to generate.