% Remember to use the lgrind style \Head{} \File{report}{2001}{Feb}{15}{23:44}{8302} \L{\LB{\C{}\#!_\1bin\1sh}} \CE{}\L{\LB{}} \L{\LB{\C{}\#_Nick_Urbanik_\}} \CE{}\L{\LB{\C{}\#_report_information_about_the_computer,_reading_from_proc_file_system}} \CE{}\L{\LB{\C{}\#_and_Linux_hard_disk_partition_(if_any)_and_storing_the_result_in}} \CE{}\L{\LB{\C{}\#_a_directory_that_may_be_on_a_floppy_disk.}} \CE{}\L{\LB{}} \L{\LB{\C{}\#_Designed_to_work_with_tomsrtbt_or_from_a_hard_disk.}} \CE{}\L{\LB{}} \L{\LB{\C{}\#_Here_is_my_attempt_to_find_out_whether_the_root_device_is_a_hard_disk}} \CE{}\L{\LB{\C{}\#_or_a_RAM_disk.}} \CE{}\L{\LB{\C{}\#_Now_what_devices_are_hard_disks?}} \CE{}\L{\LB{\C{}\#_could_be_a_label_(if_read_fstab,_but_not_output_of_mount)}} \CE{}\L{\LB{\C{}\#_could_be_[hs]d[a-z][1-9][0-9]\*}} \CE{}\L{\LB{\C{}\#_could_be_md[0-9]+}} \CE{}\L{\LB{\C{}\#_return_0_if_root_partition_is_a_hard_disk}} \CE{}\L{\LB{\C{}\#_return_1_otherwise}} \CE{}\L{\LB{\V{mounted\_on\_hd}()_\{}} \L{\LB{____\K{for}_\V{line}_\K{in}_\S{}\3{`}mount_\|_grep_\4[_\2t]\1[_\2t]\4{`}\3\SE{}}} \L{\LB{____\K{do}}} \L{\LB{________\V{mount\_point}={`}\V{echo}_\N{\$$\ell$ine}_\|_\V{awk}_\S{}\4\{print_\$3\}\4\SE{}{`}}} \L{\LB{________\K{if}_[_\S{}\3\$mount\_point\3\SE{}_=_\S{}\3\1\3\SE{}_];}} \L{\LB{________\K{then}}} \L{\LB{____________\V{device}=\S{}\3{`}echo_\$line_\|_awk_\4\{print_\$1\}\4{`}\3\SE{}}} \L{\LB{____________\V{is\_hd}={`}\V{echo}_\N{\$device}_\|}} \L{\LB{____________________\V{awk}_\S{}\4\1\5\2\1dev\2\1[hs]d[a\-z][1\-9][0\-9]\*\$\1_\{print_0;_next\}}} \L{\LB{_________________________\1\5\2\1dev\2\1md[0\-9]+\1_\{print_0;_next\}}} \L{\LB{_________________________\{print_1\}\4\SE{}{`}}} \L{\LB{____________\K{return}_\N{\$is}\V{\_hd}}} \L{\LB{________\K{fi};}} \L{\LB{____\K{done}}} \L{\LB{____\K{return}_\N{1};}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_A_utility_subroutine_used_by_other_subroutines}} \CE{}\L{\LB{\C{}\#_checks_that_the_directory_\$INFODIR_exists.}} \CE{}\L{\LB{\V{ensure\_INFODIR\_exists}()_\{}} \L{\LB{____\V{subroutine}=\N{\$1}}} \L{\LB{____\K{if}_[_\-\V{z}_\S{}\3\$INFODIR\3\SE{}_\-\V{o}_!_\-\V{d}_\S{}\3\$INFODIR\3\SE{}_]}} \L{\LB{____\K{then}}} \L{\LB{________\V{echo}_\N{\$prog}:_\N{\$subroutine}_\V{called}_\V{without}_\V{initialised}_\2\N{\$INFODIR}}} \L{\LB{________\K{exit}_\N{1}}} \L{\LB{____\K{fi}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_A_utility_subroutine_used_by_other_subroutines}} \CE{}\L{\LB{\C{}\#_checks_that_the_directory_\$c_exists.}} \CE{}\L{\LB{\V{ensure\_hd\_mountpoint\_exists}()_\{}} \L{\LB{____\V{subroutine}=\N{\$1}}} \L{\LB{____\K{if}_[_\-\V{z}_\S{}\3\$c\3\SE{}_\-\V{o}_!_\-\V{d}_\S{}\3\$c\3\SE{}_]}} \L{\LB{____\K{then}}} \L{\LB{________\V{echo}_\N{\$prog}:_\N{\$subroutine}_\V{called}_\V{without}_\V{initialised}_\V{mount}_\V{point}_\2\N{\$c}}} \L{\LB{________\K{exit}_\N{1}}} \L{\LB{____\K{fi}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_reads_the_output_of_fdisk,_and_dmesg,}} \CE{}\L{\LB{\C{}\#_and_copies_the_content_of_a_number_of_files_in_the_\1proc_file_system.}} \CE{}\L{\LB{\C{}\#_Assume_that_\$INFODIR_exists}} \CE{}\L{\LB{\V{report\_generic\_info}()_\{}} \L{\LB{____\V{ensure\_INFODIR\_exists}_\S{}\3report\_generic\_info\3\SE{}}} \L{\LB{}} \L{\LB{____\V{fdisk}_\-\V{l}_\>_\N{\$INFODIR}\1\V{fdisk}_\N{2}\>\&\N{1}}} \L{\LB{____\C{}\#_print_plenty_of_stuff_from_proc:}} \CE{}\L{\LB{____\K{for}_\V{f}_\K{in}_{`}\V{ls}_\-\N{1}_\1\V{proc}\|\V{grep}_\-\V{v}_\V{kcore}\|\V{grep}_\-\V{v}_\V{ksyms}\|\V{grep}_\-\V{v}_\V{kmsg}\|\V{grep}_\-\V{v}_\S{}\4[0\-9].\*\4\SE{}{`}}} \L{\LB{____\K{do}}} \L{\LB{________\K{if}_[_!_\-\V{d}_\1\V{proc}\1\N{\$f}_];_\K{then}}} \L{\LB{____________\V{echo}_\N{\$f}:}} \L{\LB{____________\V{cat}_\1\V{proc}\1\N{\$f}}} \L{\LB{____________\V{echo}_\S{}\4_\4\SE{}}} \L{\LB{________\K{fi}}} \L{\LB{____\K{done}_\>_\N{\$INFODIR}\1\V{proc}}} \L{\LB{____\K{for}_\V{f}_\K{in}_\1\V{proc}\1\V{sys}\1\V{kernel}\1\*}} \L{\LB{____\K{do}}} \L{\LB{________\K{if}_[_!_\-\V{d}_\N{\$f}_];_\K{then}}} \L{\LB{____________\V{echo}_\N{\$f}:}} \L{\LB{____________\V{cat}_\N{\$f}}} \L{\LB{____________\V{echo}_\S{}\4_\4\SE{}}} \L{\LB{________\K{fi}}} \L{\LB{____\K{done}_\>_\N{\$INFODIR}\1\V{proc}\-\V{kernel}}} \L{\LB{____\V{dmesg}_\>_\N{\$INFODIR}\1\V{dmesg}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_print_the_device_names_of_all_partitions_that_fdisk}} \CE{}\L{\LB{\C{}\#_reported_as_having_the_parition_type_Linux}} \CE{}\L{\LB{\V{print\_linux\_partition\_devices}()_\{}} \L{\LB{____\K{if}_[_\-\V{f}_\N{\$INFODIR}\1\V{fdisk}_];_\K{then}}} \L{\LB{________\V{grep}_\S{}\483_\*Linux\4\SE{}_\N{\$INFODIR}\1\V{fdisk}_\|_\V{awk}_\S{}\4\{print_\$1\}\4\SE{}}} \L{\LB{____\K{else}}} \L{\LB{________\V{fdisk}_\-\V{l}_\N{2}\>_\1\V{dev}\1\V{null}\|\V{grep}_\S{}\483_\*Linux\4\SE{}_\|_\V{awk}_\S{}\4\{print_\$1\}\4\SE{}}} \L{\LB{____\K{fi}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_print_the_name_of_the_root_partition_device_on_standard_output_if_find_it.}} \CE{}\L{\LB{\C{}\#_Assume_the_root_partition_on_the_hard_disk_is_not_mounted}} \CE{}\L{\LB{\C{}\#_Assume_\$c_exists_and_is_a_directory:}} \CE{}\L{\LB{\V{guess\_root\_partition}()_\{}} \L{\LB{____\V{ensure\_hd\_mountpoint\_exists}_\S{}\3guess\_root\_partition\3\SE{}}} \L{\LB{____\V{ensure\_INFODIR\_exists}_______\S{}\3guess\_root\_partition\3\SE{}}} \L{\LB{}} \L{\LB{____\C{}\#_Oh_dear,_this_assumes_non-raid.}} \CE{}\L{\LB{____\C{}\#_problems_detecting_raid,_journalling_file_systems}} \CE{}\L{\LB{____\C{}\#_1._tomsrtbt_won\4t_handle_raid}} \CE{}\L{\LB{____\C{}\#_2._How_determine_what_raid_devices_exist?}} \CE{}\L{\LB{}} \L{\LB{____\K{for}_\V{d}_\K{in}_{`}\V{print\_linux\_partition\_devices}{`}}} \L{\LB{____\K{do}}} \L{\LB{________\V{mount}_\N{\$d}_\N{\$c}}} \L{\LB{________\K{if}_[_\-\V{f}_\N{\$c}\1\V{etc}\1\V{fstab}_]}} \L{\LB{________\K{then}}} \L{\LB{____________\V{echo}_\N{\$d}}} \L{\LB{____________\V{umount}_\N{\$c}}} \L{\LB{____________\K{return}}} \L{\LB{________\K{fi}}} \L{\LB{________\V{umount}_\N{\$c}}} \L{\LB{____\K{done}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_takes_one_parameter,_the_partition_device_file.}} \CE{}\L{\LB{\C{}\#_mount_the_device_on_\$c}} \CE{}\L{\LB{\V{mount\_root\_partition}()_\{}} \L{\LB{____\V{device}=\N{\$1}}} \L{\LB{____\K{if}_\V{mount}_\|_\V{grep}_\N{\$device}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}} \L{\LB{____\K{then}}} \L{\LB{}\Tab{8}{\C{}\#_false}} \CE{}\L{\LB{________\K{return}_\N{1}}} \L{\LB{____\K{fi}}} \L{\LB{____\V{ensure\_hd\_mountpoint\_exists}_\S{}\3mount\_root\_partition\3\SE{}}} \L{\LB{}} \L{\LB{____\K{if}_\V{mount}_\N{\$device}_\N{\$c}}} \L{\LB{____\K{then}}} \L{\LB{________\C{}\#_true}} \CE{}\L{\LB{________\K{return}_\N{0}}} \L{\LB{____\K{else}}} \L{\LB{________\V{echo}_\N{\$prog}:_\V{unable}_\V{to}_\V{mount}_\N{\$device}_\V{on}_\N{\$c}\2;_\V{giving}_\V{up}}} \L{\LB{________\K{exit}_\N{1}}} \L{\LB{____\K{fi}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_if_we_have_something_mounted_on_\$c,_read_plenty_of_Linux_system_configuration}} \CE{}\L{\LB{\C{}\#_files_from_it.__We_could_do_the_same_for_windows,_but_I_don\4t_know}} \CE{}\L{\LB{\C{}\#_enough_about_the_registry.}} \CE{}\L{\LB{}} \L{\LB{\V{copy\_config\_from\_root\_partition}()_\{}} \L{\LB{____\K{if}_\V{mount}_\|_\V{grep}_\N{\$c}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}} \L{\LB{____\K{then}}} \L{\LB{}\Tab{8}{:}} \L{\LB{____\K{else}}} \L{\LB{________\V{echo}_\N{\$prog}:_\V{nothing}_\V{mounted}_\V{on}_\N{\$c}\2;_\V{giving}_\V{up}}} \L{\LB{________\K{exit}}} \L{\LB{____\K{fi}}} \L{\LB{____\K{if}_\N{\$use}\V{\_floppy};_\K{then}}} \L{\LB{________\K{if}_\V{mount}_\|_\V{grep}_\N{\$a}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}} \L{\LB{________\K{then}}} \L{\LB{____________:}} \L{\LB{________\K{else}}} \L{\LB{____________\V{echo}_\N{\$prog}:_\V{no}_\V{floppy}_\V{mounted}_\V{on}_\N{\$a}\2;_\V{giving}_\V{up}}} \L{\LB{____________\K{exit}}} \L{\LB{________\K{fi}}} \L{\LB{____\K{fi}}} \L{\LB{____\V{ensure\_INFODIR\_exists}_\S{}\3copy\_config\_from\_root\_partition\3\SE{}}} \L{\LB{____}} \L{\LB{____\K{for}_\V{i}_\K{in}_\V{fstab}_\V{lilo}.\V{conf}_\V{conf}.\V{modules}_\V{modules}.\V{conf}_\2}} \L{\LB{_____________\V{sysconfig}\1\V{network}_\V{issue}_\V{resolv}.\V{conf}_\V{hosts}_\V{profile}_\V{bashrc}_\2}} \L{\LB{_____________\V{inittab}_\V{auto}.\V{conf}}} \L{\LB{____\K{do}}} \L{\LB{________\V{cp}_\-\V{p}_\N{\$c}\1\V{etc}\1\N{\$i}_\N{\$INFODIR}\1\N{\$d}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}_}} \L{\LB{____\K{done}}} \L{\LB{____\K{if}_[_\-\V{d}_\N{\$c}\1\V{etc}\1\V{rc}.\V{d}_]}} \L{\LB{____\K{then}}} \L{\LB{________\V{tar}_\V{cf}_\-_\N{\$c}\1\V{etc}\1\V{rc}.\V{d}_\N{2}\>_\1\V{dev}\1\V{null}_\|_\V{bzip2}_\-\N{9}_\>_\N{\$INFODIR}\1\V{rc}\-\V{d}.\V{tar}.\V{bz2}}} \L{\LB{____\K{fi}}} \L{\LB{____\K{if}_[_\-\V{d}_\S{}\3\$c\1etc\1sysconfig\3\SE{}_]}} \L{\LB{____\K{then}}} \L{\LB{}\Tab{8}{\V{tar}_\V{cf}_\-_\N{\$c}\1\V{etc}\1\V{sysconfig}_\N{2}\>_\1\V{dev}\1\V{null}_\|_\V{bzip2}_\-\N{9}_\>_\N{\$INFODIR}\1\V{sysconfig}.\V{tar}.\V{bz2}}} \L{\LB{____\K{fi}}} \L{\LB{____\K{if}_[_\-\V{f}_\S{}\3\$c\1var\1log\1messages\3\SE{}_]}} \L{\LB{____\K{then}}} \L{\LB{}\Tab{8}{\C{}\#_bzip2_-9c_\$c\1var\1log\1messages_\>_\$INFODIR\1messages.bz2}} \CE{}\L{\LB{________\V{tail}_\-\N{30000}_\N{\$c}\1\V{var}\1\V{log}\1\V{messages}_\|_\V{bzip2}_\-\N{9}_\>_\N{\$INFODIR}\1\V{messages}.\V{bz2}}} \L{\LB{____\K{fi}}} \L{\LB{____\V{df}_\>_\N{\$INFODIR}\1\V{df}}} \L{\LB{____\V{mount}_\>_\N{\$INFODIR}\1\V{mount}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_This_subroutine_is_called_automatically_whenever_the_program_exits,}} \CE{}\L{\LB{\C{}\#_either_because_exit_was_called_(signal_zero),_or_an_interrupt,_hangup}} \CE{}\L{\LB{\C{}\#_or_terminate_signal_were_sent_to_this_script.}} \CE{}\L{\LB{}} \L{\LB{\V{clean\_up}()_\{}} \L{\LB{____\V{echo}_\V{cleaning}_\V{up}.\,.\,.}} \L{\LB{____\V{rmdir}_\N{\$a}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}} \L{\LB{____\K{if}_\N{\$use}\V{\_floppy}}} \L{\LB{____\K{then}}} \L{\LB{________\V{umount}_\N{\$FD}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}} \L{\LB{____\K{fi}}} \L{\LB{____\K{if}_[_\S{}\3\$c\3\SE{}_=_\S{}\3\1tmp\1c\3\SE{}_]}} \L{\LB{____\K{then}}} \L{\LB{________\V{umount}_\N{\$c}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}} \L{\LB{________\V{rmdir}_\N{\$c}}} \L{\LB{____\K{fi}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_tomsrtbt_doesn\4t_have_a_basename.}} \CE{}\L{\LB{\C{}\#_given_a_file_name_like_\3\1this\1directory\1name\1contains\1a\1file\3,}} \CE{}\L{\LB{\C{}\#_will_print_\3file\3}} \CE{}\L{\LB{\V{basen}()_\{}} \L{\LB{____\V{dir}=\N{\$1};}} \L{\LB{____\V{echo}_\N{\$dir}_\|_\V{awk}_\S{}\4BEGIN\{FS=\3\1\3\}\{print_\$NF\}\4\SE{}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_find_the_first_part_of_the_hostname_without_the_domain_name_part.}} \CE{}\L{\LB{\C{}\#_for_example,_if_hostname_gives_\3nickpc.tycm.vtc.edu.hk\3,_will_print}} \CE{}\L{\LB{\C{}\#_\3nickpc\3}} \CE{}\L{\LB{\C{}\#_hostname_-s_doesnt_work_on_tomsrtbt}} \CE{}\L{\LB{\V{hostname\_short}()_\{}} \L{\LB{____\V{hostname}_\|_\V{awk}_\S{}\4\{_sub(_\3\2\2.\,.\*\$\3,_\3\3_)_\}\{_printf_\$0_\}\4\SE{}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\C{}\#_tomsrtbt_doesn\4t_have_tr,_so_can\4t_use:}} \CE{}\L{\LB{\C{}\#_INFODIR=\$a\1{`}date_\|_tr_\4_:\4_\4-\4{`}}} \CE{}\L{\LB{\C{}\#_take_output_from_the_date_command_(which_looks_like:}} \CE{}\L{\LB{\C{}\#_Thu_Feb_15_11:55:49_HKT_2001}} \CE{}\L{\LB{\C{}\#_and_replace_all_spaces_and_colons_by_hyphens,_so_it_looks_like_this:}} \CE{}\L{\LB{\C{}\#_Thu-Feb-15-11-55-49-HKT-2001}} \CE{}\L{\LB{\C{}\#_Windows_is_not_happy_about_the_colons_as_a_file_name.}} \CE{}\L{\LB{\V{date\_to\_dir\_name}()_\{}} \L{\LB{____\V{date}_\|_\V{awk}_\S{}\4\{_gsub(_\3[_:]\3,_\3\-\3_);_printf_\$0_\}\4\SE{}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{\V{usage}()_\{}} \L{\LB{____\V{cat}_\<\!\!\<\V{EOF}}} \L{\LB{\V{Usage}:_\N{\$prog}_[\V{OPTIONS}]}} \L{\LB{\V{Read}_\V{information}_\V{from}_\1\V{proc}_\V{and}_\V{other}_\V{sources}_\V{about}_\V{the}_\V{computer}}} \L{\LB{\V{and}_\V{write}_\V{it}_\V{into}_\V{files}_\K{in}_\V{a}_\V{directory}.}} \L{\LB{\V{Will}_\V{search}_\K{for}_\V{a}_\V{standard}_\V{Linux}_\V{root}_\V{partition}_\V{and}_\K{read}_\V{configuration}}} \L{\LB{\V{files}_\V{from}_\V{it}_\K{if}_\V{found}.}} \L{\LB{\V{Options}:}} \L{\LB{____\-\V{f},_\-\-\V{floppy}}\Tab{24}{\V{Put}_\V{reports}_\V{into}_\V{a}_\V{FAT}_\V{floppy}_\V{instead}_\V{of}_\1\V{tmp}\1\V{reports}}} \L{\LB{____\-\V{h},_\-\-\V{help}}\Tab{24}{\V{Show}_\V{this}_\V{help}_\V{and}_\K{exit}}} \L{\LB{____\-\V{o}_\V{dir},_\-\V{odir}}\Tab{24}{\V{put}_\V{output}_\V{into}_\V{dir}_\V{instead}_\V{of}_\1\V{tmp}\1\V{reports}}} \L{\LB{____\-\V{d},_\-\-\V{debug}}\Tab{24}{\V{Show}_\V{all}_\V{commands}_\V{as}_\V{they}_\V{are}_\V{executed}}} \L{\LB{\V{EOF}}} \L{\LB{____\K{exit}_\N{\$1}}} \L{\LB{\}}} \L{\LB{}} \L{\LB{}} \L{\LB{\V{prog}={`}\V{basen}_\N{\$0}{`}}} \L{\LB{\V{a}=\1\V{tmp}\1\V{reports}}} \L{\LB{\V{c}=\1\V{tmp}\1\V{c}}} \L{\LB{\V{INFODIR}=\N{\$a}\1{`}\V{date\_to\_dir\_name}{`}\-{`}\V{hostname\_short}{`}}} \L{\LB{}} \L{\LB{\V{use\_floppy}=\V{false}}} \L{\LB{\K{while}_[_\N{\$}\C{}\#_-ne_0_]_\#_loop_over_arguments}} \CE{}\L{\LB{\K{do}}} \L{\LB{____\K{case}_\N{\$1}_\K{in}}} \L{\LB{____\-\-)}} \L{\LB{________\K{shift}}} \L{\LB{________\K{break}}} \L{\LB{____;;}} \L{\LB{}} \L{\LB{____\-\V{f}\|\-\-\V{floppy})}} \L{\LB{________\V{use\_floppy}=\V{true}________}} \L{\LB{____;;}} \L{\LB{}} \L{\LB{____\-\V{d}\|\-\-\V{debug})}} \L{\LB{________\K{set}_\-\V{x}}} \L{\LB{____;;}} \L{\LB{}} \L{\LB{____\-\V{h}\|\-\-\V{help})}} \L{\LB{________\V{usage}_\N{0}_\N{1}\>\&\N{2}}} \L{\LB{____;;}} \L{\LB{}} \L{\LB{____\-\V{o})}} \L{\LB{________\V{use\_floppy}=\V{false}}} \L{\LB{________\V{INFODIR}=\S{}\3\$2\3\SE{}}} \L{\LB{________\K{shift}}} \L{\LB{____;;}} \L{\LB{}} \L{\LB{____\-\V{o}\*)}} \L{\LB{________\V{use\_floppy}=\V{false}}} \L{\LB{________\V{INFODIR}={`}\V{echo}_\S{}\3\$1\3\SE{}_\|_\V{sed}_\S{}\4s\1\-o\1\1\4\SE{}{`}}} \L{\LB{____;;}} \L{\LB{}} \L{\LB{____\*)}} \L{\LB{________\V{echo}_\V{unknown}_\V{option}_\N{\$1}}} \L{\LB{________\V{usage}_\N{1}_\N{1}\>\&\N{2}}} \L{\LB{____;;}} \L{\LB{____\K{esac}}} \L{\LB{____\K{shift}}} \L{\LB{\K{done}}} \L{\LB{}} \L{\LB{\V{mkdir}_\N{\$c}}} \L{\LB{\V{mkdir}_\N{\$a}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}} \L{\LB{\K{if}_\N{\$use}\V{\_floppy};_\K{then}}} \L{\LB{____\V{echo}_\S{}\3Getting_basic_info_about_this_computer.\,.\,.\3\SE{}}} \L{\LB{____\V{echo}_\V{insert}_\V{a}_\V{formatted}_\V{floppy}_\V{with}_\V{some}_\V{disk}_\V{space},_\V{any}_\V{key}_\V{to}_\K{continue}.\,.\,.}} \L{\LB{____\K{read}_\V{anykey}}} \L{\LB{____\V{FD}=\1\V{dev}\1\V{fd0}}} \L{\LB{____\K{if}_\V{mount}_\-\V{t}_\V{vfat}_\N{\$FD}_\N{\$a}}} \L{\LB{____\K{then}}} \L{\LB{________:}} \L{\LB{____\K{else}}} \L{\LB{________\V{echo}_\N{\$prog}:_\V{cannot}_\V{mount}_\V{floppy}_\V{on}_\N{\$a}\2;_\V{giving}_\V{up}}} \L{\LB{________\K{exit}_\N{1}}} \L{\LB{____\K{fi}}} \L{\LB{\K{fi}}} \L{\LB{\C{}\#_cleanup_on_exit,_hangup,_interrupt,_quit,_termination}} \CE{}\L{\LB{\K{trap}_\V{clean\_up}_\N{0}_\N{1}_\N{2}_\N{3}_\N{15}_}} \L{\LB{\V{mkdir}_\N{\$INFODIR}}} \L{\LB{\V{report\_generic\_info}}} \L{\LB{}} \L{\LB{\K{if}_\V{mounted\_on\_hd}}} \L{\LB{\K{then}}} \L{\LB{____\V{c}=\1}} \L{\LB{____\V{copy\_config\_from\_root\_partition}}} \L{\LB{\K{else}}} \L{\LB{____\V{device}={`}\V{guess\_root\_partition}{`}}} \L{\LB{____\V{echo}_\V{your}_\V{root}_\V{partition}_\V{seems}_\V{to}_\V{be}_\N{\$device.}}} \L{\LB{____\V{mount\_root\_partition}_\N{\$device}}} \L{\LB{____\V{copy\_config\_from\_root\_partition}}} \L{\LB{____\V{umount}_\N{\$device}}} \L{\LB{\K{fi}}} \L{\LB{\N{\$use}\V{\_floppy}_\&\&_\V{umount}_\N{\$a}}} \L{\LB{\V{rmdir}_\N{\$a}_\>_\1\V{dev}\1\V{null}_\N{2}\>\&\N{1}}}