2017-01-24 00:25:47 -06:00
|
|
|
#!/bin/sh
|
|
|
|
#Part of the code is revised based on initramfs-tools/hooks/fsck and initramfs-tool is under GPL v2.
|
|
|
|
|
|
|
|
PREREQ=""
|
|
|
|
|
|
|
|
prereqs()
|
|
|
|
{
|
|
|
|
echo "$PREREQ"
|
|
|
|
}
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
prereqs)
|
|
|
|
prereqs
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
. /usr/share/initramfs-tools/hook-functions
|
|
|
|
|
2020-02-07 13:43:57 -06:00
|
|
|
copy_exec /usr/sbin/mke2fs /usr/local/sbin/
|
2017-01-24 00:25:47 -06:00
|
|
|
copy_exec /sbin/sfdisk
|
|
|
|
copy_exec /sbin/fdisk
|
2018-02-07 08:07:01 -06:00
|
|
|
copy_exec /sbin/resize2fs
|
2022-04-12 21:59:24 -05:00
|
|
|
copy_exec /sbin/tune2fs
|
2018-02-07 08:07:01 -06:00
|
|
|
copy_exec /sbin/findfs
|
2017-01-24 00:25:47 -06:00
|
|
|
|
2018-01-16 12:50:43 -06:00
|
|
|
fstypes="ext4 ext3"
|
2017-01-24 00:25:47 -06:00
|
|
|
|
|
|
|
for type in $fstypes; do
|
|
|
|
prog="/sbin/mkfs.${type}"
|
|
|
|
if [ -h "$prog" ]; then
|
|
|
|
link=$(readlink -f "$prog")
|
|
|
|
copy_exec "$link"
|
2020-02-07 13:43:57 -06:00
|
|
|
ln -s "/usr/local/sbin/$(basename $link)" "${DESTDIR}/$prog"
|
2017-01-24 00:25:47 -06:00
|
|
|
elif [ -x "$prog" ] ; then
|
|
|
|
copy_exec "$prog"
|
|
|
|
else
|
|
|
|
echo "Warning: /sbin/mkfs.${type} doesn't exist, can't install to initramfs, ignoring."
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
for type in $fstypes; do
|
|
|
|
prog="/sbin/fsck.${type}"
|
|
|
|
if [ -h "$prog" ]; then
|
|
|
|
link=$(readlink -f "$prog")
|
|
|
|
copy_exec "$link"
|
|
|
|
ln -s "$link" "${DESTDIR}/$prog"
|
|
|
|
elif [ -x "$prog" ] ; then
|
|
|
|
copy_exec "$prog"
|
|
|
|
else
|
|
|
|
echo "Warning: /sbin/fsck.${type} doesn't exist, can't install to initramfs, ignoring."
|
|
|
|
fi
|
|
|
|
done
|