человечность 14.04 preseed/late_command

Я настраиваю автоматическую установку Ubuntu 14.04, с помощью предварительного семени. Я протестировал это использование виртуальной машины (virtualBox машина). Все устанавливает прекрасный без любых вопросов, но я не могу вполне выяснить, как использовать late_command в конце файла перед семенем.

То, что я хочу сделать в первый раз, должно запустить start.sh скрипт.

Я попробовал несколько попыток:

Вот Код:

d-i preseed/late_command string cp /cdrom/start.sh /target/home/user; in-target chmod 700 /home/user/start.sh; /home/user/start.sh

Также:

d-i preseed/late_command string chroot /target; cp -f /cdrom/start.sh /home/user; chmod 700 /home/user/start.sh;

Третья попытка:

 d-i preseed/late_command string cp -f /cdrom/start.sh /home/user; in-target chmod +x /home/user/start.sh; in-target sh start.sh

сценарий start.sh определяет одну команду:

#! /bin/sh 
echo "bonjour" > /home/user/bonjour_file

Я попытался также создать файл после установки в новой машине:

d-i preseed/late_command string in-target touch /etc/postinst_user.done

preseed preseed/late_command string in-target touch /etc/postinst_user.done

Но это просто зависло в самом конце установки. Установка была функциональна, но сценарий не работал вообще, и файл "postinst_user.done" не создал.

Недавно установленная файловая система смонтирована под целью/? И какова среда как в этой точке в установке. Каков был бы корректный способ сделать это?

Вот целый файл перед семенем, названный "ubuntu.seed":

# Enable extras.ubuntu.com.
d-i apt-setup/extras    boolean true
# Install the Ubuntu desktop.
tasksel tasksel/first   multiselect ubuntu-desktop
# On live DVDs, don't spend huge amounts of time removing substantial
# application packages pulled in by language packs. Given that we clearly
# have the space to include them on the DVD, they're useful and we might as
# well keep them installed.
ubiquity    ubiquity/keep-installed string icedtea6-plugin openoffice.org
d-i  base-installer/kernel/altmeta   string lts-xenial
####################################################################
# General
####################################################################
# Once installation is complete, automatically power off.
# d-i finish-install/reboot_in_progress note
#d-i debian-installer/exit/poweroff boolean true
#d-i ubiquity/summary note
#ubiquity ubiquity/reboot boolean true
#ubiquity ubiquity/poweroff boolean true
# Once installation is complete, automatically power off.
# d-i finish-install/reboot_in_progress note
#d-i debian-installer/exit/poweroff boolean true
#d-i ubiquity/summary note
#ubiquity ubiquity/reboot boolean true
#ubiquity ubiquity/poweroff boolean true
####################################################################
# Partitioning
####################################################################
# Configure auto partitioner
#ubiquity partman-auto/init_automatically_partition select Guided - use entire disk
#ubiquity partman-auto/disk string /dev/sda
#ubiquity partman-auto/method string regular
#ubiquity partman-auto/choose_recipe select All files in one partition (recommended for new users)
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
####################################################################
# Locale
####################################################################
d-i debian-installer/locale string en_US
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string fr
# Optionally specify additional locales to be generated
d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8
###################################################################
# Localizations / Timezone
####################################################################
### Keyboard selection ###
d-i keyboard-configuration/layoutcode string fr
d-i keyboard-configuration/variantcode string
### Clock and Timezone ###
#see the contents of /usr/share/zoneinfo/ for valid values
d-i time/zone select Europe/Paris
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true
# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean false

####################################################################
# User Creation
####################################################################
d-i passwd/user-fullname string user
d-i passwd/username string user
d-i passwd/user-password password xxxxxx
d-i passwd/user-password-again password xxxxx
#d-i passwd/user-default-groups string adm audio cdrom dip lpadmin sudo plugdev sambashare video
#d-i passwd/root-login boolean true
#d-i passwd/root-password-crypted password hPdFxI2FOMtZk
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
#d-i passwd/auto-login boolean false
####################################################################
#Network Configuration
####################################################################
#d-i netcfg/enable boolean false
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
###################################################################
# Installation Sources: Packages, Mirrors, Image
####################################################################
d-i mirror/country string manual
d-i mirror/http/hostname  string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu/
d-i apt-setup/use_mirror boolean true
d-i apt-setup/mirror/error select Change mirror
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i apt-setup/partner boolean true
####################################################################
# Grub
####################################################################
#d-i grub-installer/grub2_instead_of_grub_legacy boolean true
#d-i grub-installer/only_debian boolean true
#d-i finish-install/reboot_in_progress note
d-i grub-installer/only_debian boolean true 
d-i grub-installer/with_other_os boolean true

# finish installation   
d-i finish-install/reboot_in_progress note  
d-i finish-install/keep-consoles boolean false  
d-i cdrom-detect/eject boolean true 
d-i debian-installer/exit/halt boolean false    
d-i debian-installer/exit/poweroff boolean false
####################################################################
# Customization 
####################################################################
#first attempt
d-i preseed/late_command string cp /cdrom/start.sh /target/home/user; in-target chmod 700 /home/user/start.sh; /home/user/start.sh
#second attempt
d-i preseed/late_command string chroot /target; cp -f /cdrom/start.sh /home/user; chmod 700 /home/user/start.sh;    
#Third attempt
d-i preseed/late_command string cp -f /cdrom/start.sh /home/user; in-target chmod +x /home/user/start.sh; in-target sh start.sh
#file creation
d-i preseed/late_command string in-target touch /etc/postinst_user.done
preseed preseed/late_command string in-target touch /etc/postinst_user.done

И я редактирую txt.cfg (в соответствии с каталогом изо-Linux) файл, обеспеченный ниже. Я редактирую exaclty эта строка append file=/cdrom/preseed/ubuntu.seed keyboard configuration/layoutcode=fr boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet

default live
label live
menu label ^Try Ubuntu Automated version By Emila
  kernel /casper/vmlinuz
  append  file=/cdrom/preseed/ubuntu.seed keyboard
configuration/layoutcode=fr boot=casper automatic-ubiquity initrd=/casper/initrd.lz quiet
label live-install
menu label ^Install Ubuntu
kernel /casper/vmlinuz
append  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.lz quiet splash ---
label check
 menu label ^Check disc for defects
kernel /casper/vmlinuz
append  boot=casper integrity-check initrd=/casper/initrd.lz quiet splash ---
label memtest
 menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80

Заранее спасибо,

0
задан 18 April 2017 в 04:32

0 ответов

Другие вопросы по тегам:

Похожие вопросы: