2021-04-30 18:23:21 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
#
|
|
|
|
# List the soft prerequisites here. This is a space separated list of
|
|
|
|
# names, of scripts that are in the same directory as this one, that
|
|
|
|
# must be run before this one can be.
|
|
|
|
#
|
|
|
|
PREREQS=""
|
|
|
|
case $1 in
|
|
|
|
prereqs) echo "$PREREQS"; exit 0;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
. /usr/share/initramfs-tools/hook-functions
|
|
|
|
|
2022-11-06 19:17:27 +00:00
|
|
|
# List ALL the programs we need, because we explicitly call them
|
|
|
|
# Don't *assume* it will be included!
|
|
|
|
# The update-initramfs script will figure out any dependencies
|
|
|
|
# that also need to be included, so lets not do that
|
|
|
|
#
|
|
|
|
# Find the path as used by the package itself; usrmerge may not be used
|
|
|
|
|
|
|
|
# from coreutils
|
|
|
|
copy_exec /usr/bin/realpath
|
|
|
|
copy_exec /usr/bin/tail
|
|
|
|
copy_exec /usr/bin/test
|
|
|
|
|
Explicitly copy 'fsck*' into the initramfs
While fsck.ext4 and fsck.vfat are part of the initramfs, it turns out
that fsck itself isn't!
While it normally gets included in the initramfs, for some reason that
doesn't happen with our image creation, so it isn't available on first
boot, so explicitly copy 'fsck' so that it will be included.
For that to work, 'logsave' is needed too, so include that as well.
During boot up, initramfs wants to check the filesystems and it does so
via `fsck`, which then (presumably) checks the filesystem being used
and calls the appropriate fsck.* to do the actual checking.
But when `fsck` itself isn't available you get the following warning:
"Warning: fsck not present, so skipping root file system"
When it is available, you'll get a message like this:
"Begin: Will now check root file system ... fsck from util-linux 2.38.1"
Let's also follow our own advise and not *assume* the needed fsck
programs are present in initramfs, but add them explicitly.
Now we can start the resize operations while knowing the current
filesystem is in a proper/clean state.
2022-11-06 22:06:05 +00:00
|
|
|
# from dosfstools
|
|
|
|
copy_exec /sbin/fsck.vfat
|
|
|
|
|
2022-11-06 19:17:27 +00:00
|
|
|
# from e2fsprogs
|
|
|
|
copy_exec /sbin/resize2fs
|
Explicitly copy 'fsck*' into the initramfs
While fsck.ext4 and fsck.vfat are part of the initramfs, it turns out
that fsck itself isn't!
While it normally gets included in the initramfs, for some reason that
doesn't happen with our image creation, so it isn't available on first
boot, so explicitly copy 'fsck' so that it will be included.
For that to work, 'logsave' is needed too, so include that as well.
During boot up, initramfs wants to check the filesystems and it does so
via `fsck`, which then (presumably) checks the filesystem being used
and calls the appropriate fsck.* to do the actual checking.
But when `fsck` itself isn't available you get the following warning:
"Warning: fsck not present, so skipping root file system"
When it is available, you'll get a message like this:
"Begin: Will now check root file system ... fsck from util-linux 2.38.1"
Let's also follow our own advise and not *assume* the needed fsck
programs are present in initramfs, but add them explicitly.
Now we can start the resize operations while knowing the current
filesystem is in a proper/clean state.
2022-11-06 22:06:05 +00:00
|
|
|
copy_exec /sbin/fsck.ext4
|
2022-11-06 19:17:27 +00:00
|
|
|
|
|
|
|
# from grep
|
|
|
|
copy_exec /bin/grep
|
|
|
|
|
Explicitly copy 'fsck*' into the initramfs
While fsck.ext4 and fsck.vfat are part of the initramfs, it turns out
that fsck itself isn't!
While it normally gets included in the initramfs, for some reason that
doesn't happen with our image creation, so it isn't available on first
boot, so explicitly copy 'fsck' so that it will be included.
For that to work, 'logsave' is needed too, so include that as well.
During boot up, initramfs wants to check the filesystems and it does so
via `fsck`, which then (presumably) checks the filesystem being used
and calls the appropriate fsck.* to do the actual checking.
But when `fsck` itself isn't available you get the following warning:
"Warning: fsck not present, so skipping root file system"
When it is available, you'll get a message like this:
"Begin: Will now check root file system ... fsck from util-linux 2.38.1"
Let's also follow our own advise and not *assume* the needed fsck
programs are present in initramfs, but add them explicitly.
Now we can start the resize operations while knowing the current
filesystem is in a proper/clean state.
2022-11-06 22:06:05 +00:00
|
|
|
# from logsave
|
|
|
|
copy_exec /sbin/logsave
|
|
|
|
|
2022-11-06 19:17:27 +00:00
|
|
|
# from mount
|
|
|
|
copy_exec /bin/mount
|
|
|
|
copy_exec /bin/umount
|
|
|
|
|
|
|
|
# from parted
|
2021-07-02 02:54:29 +01:00
|
|
|
copy_exec /sbin/parted
|
2021-04-30 18:23:21 +01:00
|
|
|
copy_exec /sbin/partprobe
|
2022-11-06 19:17:27 +00:00
|
|
|
|
|
|
|
# from util-linux
|
|
|
|
copy_exec /bin/lsblk
|
|
|
|
copy_exec /sbin/blkid
|
Explicitly copy 'fsck*' into the initramfs
While fsck.ext4 and fsck.vfat are part of the initramfs, it turns out
that fsck itself isn't!
While it normally gets included in the initramfs, for some reason that
doesn't happen with our image creation, so it isn't available on first
boot, so explicitly copy 'fsck' so that it will be included.
For that to work, 'logsave' is needed too, so include that as well.
During boot up, initramfs wants to check the filesystems and it does so
via `fsck`, which then (presumably) checks the filesystem being used
and calls the appropriate fsck.* to do the actual checking.
But when `fsck` itself isn't available you get the following warning:
"Warning: fsck not present, so skipping root file system"
When it is available, you'll get a message like this:
"Begin: Will now check root file system ... fsck from util-linux 2.38.1"
Let's also follow our own advise and not *assume* the needed fsck
programs are present in initramfs, but add them explicitly.
Now we can start the resize operations while knowing the current
filesystem is in a proper/clean state.
2022-11-06 22:06:05 +00:00
|
|
|
copy_exec /sbin/fsck
|