]> git.pld-linux.org Git - projects/geninitrd.git/blob - mod-blkid.sh
truncate the date to cut out locale formats
[projects/geninitrd.git] / mod-blkid.sh
1 #!/bin/sh
2 RCSID='$Revision$ $Date::                            $'
3
4 # geninitrd mod: blkid
5 USE_BLKID=${USE_BLKID:-yes}
6
7 # true if we should parse UUID= or LABEL= for root parameter
8
9 # setup geninitrd module
10 # @access       public
11 setup_mod_blkid() {
12         blkid=$(find_tool $initrd_dir/blkid /sbin/initrd-blkid)
13
14         if [ ! -x "$blkid" ]; then
15                 USE_BLKID=no
16         fi
17 }
18
19 # generate initrd fragment
20 # @access       public
21 initrd_gen_blkid() {
22         if ! is_yes "$USE_BLKID"; then
23                 return
24         fi
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 }
This page took 0.056029 seconds and 4 git commands to generate.