mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
parent
a13dee8d19
commit
921a99bb9b
@ -56,24 +56,29 @@ proc generate_tftp_config { } {
|
||||
|
||||
if {[string length $tftp_base_dir] > 0 && [string length $tftp_offset_dir] > 0} {
|
||||
|
||||
# if the link target exists as directory this leads to bad behavior
|
||||
if {[file exists $tftp_base_dir$tftp_offset_dir] &&
|
||||
[string compare [file type $tftp_base_dir$tftp_offset_dir] "directory"] == 0} {
|
||||
|
||||
puts stderr "Error: TFTP symlink target $tftp_base_dir$tftp_offset_dir is a directory"
|
||||
exit -1
|
||||
}
|
||||
exec ln -nfs "[pwd]" "$tftp_base_dir$tftp_offset_dir"
|
||||
|
||||
set tftp_base ""
|
||||
if {[load_tftp_use_absolute]} {
|
||||
set tftp_base $tftp_base_dir
|
||||
}
|
||||
|
||||
set fh [open "$tftp_base_dir$tftp_offset_dir/config-00-00-00-00-00-00" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " root $tftp_base$tftp_offset_dir/[run_dir]"
|
||||
puts $fh " config config-52-54-00-12-34-56"
|
||||
close $fh
|
||||
if {[load_tftp_copy_files]} {
|
||||
exec cp -r --dereference "[pwd]/[run_dir]/." $tftp_base_dir$tftp_offset_dir/.
|
||||
} else {
|
||||
# if the link target exists as directory this leads to bad behavior
|
||||
if {[file exists $tftp_base_dir$tftp_offset_dir] &&
|
||||
[string compare [file type $tftp_base_dir$tftp_offset_dir] "directory"] == 0} {
|
||||
|
||||
puts stderr "Error: TFTP symlink target $tftp_base_dir$tftp_offset_dir is a directory"
|
||||
exit -1
|
||||
}
|
||||
|
||||
exec ln -nfs "[pwd]" "$tftp_base_dir$tftp_offset_dir"
|
||||
|
||||
set fh [open "$tftp_base_dir$tftp_offset_dir/config-00-00-00-00-00-00" "WRONLY CREAT TRUNC"]
|
||||
puts $fh " root $tftp_base$tftp_offset_dir/[run_dir]"
|
||||
puts $fh " config config-52-54-00-12-34-56"
|
||||
close $fh
|
||||
}
|
||||
} else {
|
||||
puts "Warning, TFTP base directory or TFTP offset directory not set."
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user