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