make blkid optional
This commit is contained in:
parent
8f3b68dd38
commit
888cf4d878
@ -11,7 +11,7 @@ Features
|
||||
- Easy to use configuration
|
||||
- Build time and init time hooks
|
||||
- LUKS (detached header, key), LVM
|
||||
- mdev, mdevd, eudev
|
||||
- mdev, mdevd, eudev, systemd-udevd
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
@ -20,10 +20,11 @@ Dependencies
|
||||
* POSIX shell
|
||||
* `switch_root`
|
||||
* `mount`
|
||||
* `blkid`
|
||||
* `cpio`
|
||||
* POSIX SD `strip`
|
||||
* `strip`
|
||||
- Optional
|
||||
* `blkid`
|
||||
- Required for UUID, LABEL, PARTUUID support
|
||||
* `mdev` OR `mdevd` OR `eudev` OR `systemd-udevd`
|
||||
- systemd-udevd not tested
|
||||
* `lvm2`
|
||||
|
@ -18,6 +18,13 @@ create_symlink()
|
||||
{
|
||||
[ -b "/dev/${dev_name=${DEVPATH##*/}}" ] || exit 1
|
||||
|
||||
read -r dm_name < "/sys/block/${dev_name}/dm/name" && {
|
||||
mkdir -p /dev/mapper
|
||||
ln -sf "../${dev_name}" "/dev/mapper/${dm_name:?}"
|
||||
}
|
||||
|
||||
command -v blkid || exit 0
|
||||
|
||||
# prevent race condition
|
||||
blkid "/dev/${dev_name}" || sleep 2
|
||||
|
||||
@ -26,9 +33,4 @@ create_symlink()
|
||||
LABEL) create_symlink /dev/disk/by-label "${line##*=}" ;;
|
||||
PARTUUID) create_symlink /dev/disk/by-partuuid "${line##*=}" ;;
|
||||
esac; done
|
||||
|
||||
read -r dm_name < "/sys/block/${dev_name}/dm/name" && {
|
||||
mkdir -p /dev/mapper
|
||||
ln -sf "../${dev_name}" "/dev/mapper/${dm_name:?}"
|
||||
}
|
||||
} > /dev/null 2>&1
|
||||
|
12
tinyramfs
12
tinyramfs
@ -126,16 +126,20 @@ prepare_initramfs()
|
||||
ln -s ../run/lock "${tmpdir}/var/lock"
|
||||
ln -s bin "${tmpdir}/usr/sbin"
|
||||
|
||||
# TODO make blkid optional
|
||||
# copy required binaries
|
||||
for _binary in \
|
||||
\[ sh ln env kill mkdir \
|
||||
blkid sleep mount printf \
|
||||
switch_root "${srcdir}/device-helper"
|
||||
\[ sh ln env kill mkdir sleep mount \
|
||||
printf switch_root "${srcdir}/device-helper"
|
||||
do
|
||||
copy_binary "$_binary"
|
||||
done
|
||||
|
||||
if command -v blkid; then
|
||||
copy_binary blkid
|
||||
else
|
||||
print "blkid not found. you will unable to use UUID, LABEL, PARTUUID"
|
||||
fi
|
||||
|
||||
# copy init
|
||||
cp "${srcdir}/init" "${tmpdir}/init"
|
||||
chmod 755 "${tmpdir}/init"
|
||||
|
Loading…
Reference in New Issue
Block a user