mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-06 11:10:24 +00:00
parent
a13dee8d19
commit
921a99bb9b
@ -56,6 +56,14 @@ proc generate_tftp_config { } {
|
|||||||
|
|
||||||
if {[string length $tftp_base_dir] > 0 && [string length $tftp_offset_dir] > 0} {
|
if {[string length $tftp_base_dir] > 0 && [string length $tftp_offset_dir] > 0} {
|
||||||
|
|
||||||
|
set tftp_base ""
|
||||||
|
if {[load_tftp_use_absolute]} {
|
||||||
|
set tftp_base $tftp_base_dir
|
||||||
|
}
|
||||||
|
|
||||||
|
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 the link target exists as directory this leads to bad behavior
|
||||||
if {[file exists $tftp_base_dir$tftp_offset_dir] &&
|
if {[file exists $tftp_base_dir$tftp_offset_dir] &&
|
||||||
[string compare [file type $tftp_base_dir$tftp_offset_dir] "directory"] == 0} {
|
[string compare [file type $tftp_base_dir$tftp_offset_dir] "directory"] == 0} {
|
||||||
@ -63,17 +71,14 @@ proc generate_tftp_config { } {
|
|||||||
puts stderr "Error: TFTP symlink target $tftp_base_dir$tftp_offset_dir is a directory"
|
puts stderr "Error: TFTP symlink target $tftp_base_dir$tftp_offset_dir is a directory"
|
||||||
exit -1
|
exit -1
|
||||||
}
|
}
|
||||||
exec ln -nfs "[pwd]" "$tftp_base_dir$tftp_offset_dir"
|
|
||||||
|
|
||||||
set tftp_base ""
|
exec ln -nfs "[pwd]" "$tftp_base_dir$tftp_offset_dir"
|
||||||
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"]
|
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 " root $tftp_base$tftp_offset_dir/[run_dir]"
|
||||||
puts $fh " config config-52-54-00-12-34-56"
|
puts $fh " config config-52-54-00-12-34-56"
|
||||||
close $fh
|
close $fh
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
puts "Warning, TFTP base directory or TFTP offset directory not set."
|
puts "Warning, TFTP base directory or TFTP offset directory not set."
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user