akon68
Goto Top

Problem mit Install-CD in Preseed-Datei mit Setzen des Hostnamens und Verwendung von late-commad

Hallo, ich hoffe hier kann mir jemand weiterhelfen.

<Anmerkung>
Ich habe diese Frage auch im deutschen Debianforum gestellt.
</Anmerkung>

Ich habe 4 Rechner die jeder eine eigene, angepasste Installations-CD bekommen sollen.
Die Installation soll komplett, nach Start von der jeweiligen CD und Betätigung der ENTER-Taste, komplett automatisch ablaufen.
Ich wollte erstmal klein anfangen und außer einem Minimalsystem noch nichts weiter installieren.
Die einzige HDD soll ruhig komplett in einer einzigen Prtition genutzt werden.
Nur Tastatur, IP-Adresse, Gateway und Hostname sollen gesetzt werden. Dann wollte ich weitersehen...

Nachdem ich die (offenbar hochmotivierte weil immerwiederkehrende) Abfrage nach der Tatatur erfolgreich unterbinden konnte (dank erfolgreicher Nutzung einer bekannten Suchmaschine) war ich auch wirklich Guter Dinge.

Beim Hostnamen scheitere ich aber bereits wieder. face-sad Es gelingt mir nicht mittels der preseed Datei den Hostnamen zu setzen.
Folgende Einträge habe ich getestet:

    d-i   netcfg/get_hostname   string   cartman


    d-i   netcfg/hostname      string   cartman



Ich versuchte dann den Hostnamen mittels late_command zu setzen:
    d-i   preseed/late_command   string   in-target  echo cartman > /etc/hostname


Das hat nicht funktioniert. Nach dem Start der (vorerst virtuellen) Maschine stand nur localhost in /etc/hostname.
Ich versuchte noch (das hatte ich bei der Internetrecherche gefunden):

    d-i   preseed/late_command   string   cp -a /cdrom/sethostname.sh /target/root/sethostname.sh; chmod +x /target/root/sethostname.sh; ln -s /target/root/sethostname.sh /target/etc/rc2.d/S100myhostname


In sethostname.sh stand auch nur

    echo cartman > /etc/hostname


zuletzt versuchte ich noch ob ich überhaupt etwas in die neue Maschine laden kann:

    d-i   preseed/late_command   string   in-target wget http://192.168.1.254/hallo.txt

Auch das war erfolglos.

Wenn ich die Virtuelle Maschine starte und anschliessend

    wget http://192.168.1.254/hallo.txt

ausführe wird die Datei problemlos heruntergeladen.

Wie bekomme ich beim automatischen installieren den hostnamen ins System?
Wie bekomme ich es hin, dass ich mit late_command noch Befehle ausführen kann?


Das System auf welchem ich derzeit arbeite (Erstellung der CD, hier läuf auch Virtualbox 4.2.16):
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux.
Das ist auch die Version die ich installieren will.

meine isolinux.cfg:

schnipp<========================================================
    default vesamenu.c32
    prompt 0

    menu background splash.png

    menu title Cartman install cd
    menu color border   0   #ffffffff #00000000
    menu color sel      7   #ff000000 #ffffCA31
    menu color title   0   #ffffffff #00000000
    menu color tabmsg   0   #ffffffff #00000000
    menu color unsel   0   #ffffffff #00000000
    menu color hotsel   0   #ff000000 #ffffffff
    menu color hotkey   7   #ffffffff #ff000000
    menu color timeout_msg   0   #ffffffff #00000000
    menu color timeout   0   #ffffffff #00000000
    menu color cmdline   0   #ffffffff #00000000
    prompt 0

    # install-cd starten
    label START INSTALLATION
       kernel linux
       #append auto loc/de initrd=initrd.gz preseed/file=/preseed.cfg debian-installer/locale=de_DE console-setup/layoutcode=de localechooser/translation/warn-light=true localechooser/translation/warn-severe=true ramdisk_size=11198 root=/dev/ram debconf/priority=critical debian-installer/framebuffer=false rw --
       #append initrd=initrd.gz auto=true language=german locale=de_DE preseed=/preseed.cfg keymap=de priority=critical
       append initrd=initrd.gz keymap=de locale=de_DE interface=auto priority=critical
    #timeout 300
>schnapp-------------------------------------------------------------------------------------------------------------


meine preseed:
schnipp<========================================================
    ####################################################################
    #   PRESEED - Created Tue Aug 19 12:50:00 2013
    ####################################################################

    # Wiki: http://wiki.debian.org/DebianInstaller/Preseed
    # Great work!   Thanks for preseed and the d-i installer


    ####################################################################
    # Installation Sources
    ####################################################################

    # Where are we pulling bits from?
    #
    # Note:   To use your own local repository, this is what you want
    # to edit.
    #
    # It should look like this:
    #d-i   mirror/http/hostname   string   (IP Address of your local server)
    #d-i   mirror/http/directory   string   (HTTP Path to your Repository - like /natty )

    d-i   mirror/http/hostname   string   debian.tu-bs.de
    d-i   mirror/http/directory   string   /debian/
    d-i   mirror/suite      string

    # Post install APT setup
    d-i   apt-setup/uri_type   select   d-i
    d-i   apt-setup/hostname   string   debian.tu-bs.de
    d-i   apt-setup/directory   string   /debian/
    d-i   apt-setup/another   boolean   false
    d-i   apt-setup/security-updates   boolean   false
    d-i   finish-install/reboot_in_progress   note
    d-i   prebaseconfig/reboot_in_progress   note

    d-i   apt-setup/non-free   boolean   true
    d-i   apt-setup/contrib   boolean   true

    ####################################################################
    # Networking
    ####################################################################

    # Network Configuration
    d-i   netcfg/disable_dhcp   boolean   true
    #d-i   netcfg/get_hostname   string   cartman
    d-i   netcfg/hostname      string   cartman
    d-i   netcfg/get_domain   string   southpark
    d-i   netcfg/get_nameservers   string   192.168.1.2
    d-i   netcfg/get_ipaddress   string   192.168.1.253
    d-i   netcfg/get_netmask   string   255.255.255.0
    d-i   netcfg/get_gateway   string   192.168.1.2
    d-i   netcfg/confirm_static   boolean   true
    d-i   mirror/http/proxy   string   
    d-i   netcfg/choose_interface   select   eth0
    d-i   netcfg/wireless_wep   string

    ####################################################################
    # Disk Partitioning/Boot loader
    ####################################################################

    d-i   partman-auto/disk   string   /dev/sda
    d-i   partman-auto/method   string   regular

    # This makes partman automatically partition without confirmation.
    d-i   partman/confirm   boolean   true
    d-i   partman-partitioning/confirm_write_new_label   boolean   true
    d-i   partman/choose_partition   select   finish
    d-i   partman/confirm_nooverwrite   boolean   true


    # This one makes grub-installer install to the MBR even if finds some other OS
    # too, which is less safe as it might not be able to boot that other OS.
    d-i   grub-installer/with_other_os   boolean   true

    ####################################################################
    # Localizations
    ####################################################################

    # Install Time
    d-i   console-tools/archs string skip-config
    d-i    debian-installer/locale string de_DE
    d-i    console-keymaps-at/keymap select de


    # Timezone
    d-i   tzconfig/gmt         boolean false
    d-i   tzconfig/choose_country_zone/Europe select Berlin
    d-i   tzconfig/choose_country_zone_single boolean true
    d-i   time/zone   select   Europe/Berlin
    d-i   clock-setup/utc   boolean   true

    #d-i   languagechooser/language-name-fb      select German
    #d-i   debian-installer/locale          select de_DE.UTF-8
    #d-i   kbd-chooser/method   select   American English
    #d-i   keyboard-configuration/xkb-keymap   select   de
    #d-i   keymap   select   de
    d-i   keymap   select   skip-config
    #d-i   keyboard-configuration/variant   select   Deutsch

    d-i   mirror/country   string   manual
    d-i   clock-setup/ntp boolean   true
    d-i   clock-setup/ntp-server   string   ptbtime1.ptb.de

    # X11 config
    xserver-xorg   xserver-xorg/autodetect_monitor   boolean   true
    xserver-xorg   xserver-xorg/config/monitor/selection-method   select   medium
    xserver-xorg   xserver-xorg/config/monitor/mode-list   select   1024x768 @ 60 Hz
    xserver-xorg   xserver-xorg/config/display/modes   multiselect   1024x768, 800x600

    ####################################################################
    # User Creation
    ####################################################################

    # Root User
    d-i   passwd/root-password   passwd 123456

    # Mortal User
    d-i   passwd/user-fullname   string Benutzer Name
    d-i   passwd/username      string bnutzer
    d-i   passwd/user-password   passwd 123456

    ####################################################################
    # Software Selections
    ####################################################################

    #tasksel   tasksel/first   multiselect   standard
    d-i   pkgsel/include string   openssh-server

    ####################################################################
    # Additional preseed entries (from data/debconf)
    ####################################################################

    exim4-config exim4/no_config boolean true

    ####################################################################
    # preseed late command (in-target)
    ####################################################################
    d-i   preseed/late_command   string   in-target wget http://192.168.1.254/hallo.txt
>schnapp-------------------------------------------------------------------------------------------------------------


Ich hoffe auf Eure freundliche Unterstützung und verbleibe

mit ehrfürchtigen Grüßen
Onkel Akon

P.S.
Rechtsschreibfehler dürft Ihr korrigieren.
P.P.S
2008 habe ich das ganze schon mal gemacht und da hat alles funktioniert... face-sad

Content-Key: 215189

Url: https://administrator.de/contentid/215189

Printed on: April 24, 2024 at 14:04 o'clock