mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Gracefully exit when no MFS signature is found in the kernel.
Add support for a new "import_files" option (see manpage for details).
This commit is contained in:
parent
565ab9395f
commit
0a0f4967e0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=92853
@ -641,6 +641,16 @@ __EOF
|
|||||||
log "Fixing permissions"
|
log "Fixing permissions"
|
||||||
(cd ${dst}; chown -R root . )
|
(cd ${dst}; chown -R root . )
|
||||||
|
|
||||||
|
if [ -n "${import_files}" ] ; then
|
||||||
|
log "importing ${import_files} into mfs"
|
||||||
|
# We do it in a chroot environment on the target so
|
||||||
|
# symlinks are followed correctly.
|
||||||
|
cp `which tar` ${dst}/my_copy_of_tar
|
||||||
|
(cd ${l_usrtree}/.. ; tar cf - ${import_files} ) | \
|
||||||
|
(chroot ${dst} /my_copy_of_tar xf - )
|
||||||
|
rm ${dst}/my_copy_of_tar
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${early_mfs_mount}" != "1" ] ; then
|
if [ "${early_mfs_mount}" != "1" ] ; then
|
||||||
create_mfs
|
create_mfs
|
||||||
log "Copy mfs tree into file"
|
log "Copy mfs tree into file"
|
||||||
@ -707,6 +717,9 @@ fail() {
|
|||||||
no_space)
|
no_space)
|
||||||
echo "Error: no space left on device (${where})"
|
echo "Error: no space left on device (${where})"
|
||||||
;;
|
;;
|
||||||
|
no_mfs)
|
||||||
|
echo "Error: while writing MFS into the kernel."
|
||||||
|
;;
|
||||||
"")
|
"")
|
||||||
echo "User break"
|
echo "User break"
|
||||||
errcode="userbreak"
|
errcode="userbreak"
|
||||||
@ -787,7 +800,7 @@ if [ true ] ; then
|
|||||||
else
|
else
|
||||||
cc -o wmk ${PICO_TREE}/../write_mfs_in_kernel.c
|
cc -o wmk ${PICO_TREE}/../write_mfs_in_kernel.c
|
||||||
fi
|
fi
|
||||||
./wmk kernel ${c_fs}
|
./wmk kernel ${c_fs} || fail $? no_mfs
|
||||||
rm wmk
|
rm wmk
|
||||||
else # not working yet, just a reminder
|
else # not working yet, just a reminder
|
||||||
objdump -h kernel
|
objdump -h kernel
|
||||||
|
Loading…
Reference in New Issue
Block a user