Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preseed configuration #10

Open
adamkrawczyk opened this issue Oct 30, 2020 · 1 comment
Open

Add preseed configuration #10

adamkrawczyk opened this issue Oct 30, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@adamkrawczyk
Copy link

Hi,

It would be great to see here instructions on how to use preseed.cfg file to install image with provided username and password.

Best,
Adam

@mvallim mvallim self-assigned this Nov 4, 2020
@mvallim mvallim added the enhancement New feature or request label Nov 4, 2020
@asharrem
Copy link

asharrem commented Oct 2, 2022

My solution was in function build_iso() : add after # create diskdefines

  # create preseed
cat <<EOF > image/preseed/nxos.seed
# Users
d-i passwd/user-fullname string MyUser
d-i passwd/username string myuser
d-i passwd/auto-login boolean true
d-i passwd/user-password password Passw0rd1!
d-i passwd/user-password-again password Passw0rd1!

# Custom Commands
# Must show slideshow to avoid installer crash
#
ubiquity ubiquity/success_command string \
  in-target dpkg -i /etc/skel/Downloads/nxwitness-client*.deb; \
  in-target rm /etc/lightdm/lightdm.conf; \
  in-target apt install -y avahi-discover; \
  in-target touch /opt/nxos/new_install;

EOF

and add the preseed path to build_iso()
automatic-ubiquity is critcal to the preseed call

function build_iso() {
    echo "=====> running build_iso ..."
    rm -rf image
    mkdir -p image/{casper,isolinux,install,preseed}
   
    # copy kernel files
    sudo cp chroot/boot/vmlinuz-**-**-generic image/casper/vmlinuz
    sudo cp chroot/boot/initrd.img-**-**-generic image/casper/initrd

    # grub
    touch image/ubuntu
    cat <<EOF > image/isolinux/grub.cfg
search --set=root --file /ubuntu
insmod all_video
set default="0"
set timeout=30
menuentry "${GRUB_INSTALL_LABEL}" {
  linux /casper/vmlinuz file=/cdrom/preseed/nxos.seed boot=casper automatic-ubiquity ---
  initrd /casper/initrd
}
menuentry "${GRUB_LIVEBOOT_LABEL}" {
  linux /casper/vmlinuz file=/cdrom/preseed/nxos.seed boot=casper nopersistent toram ---
  initrd /casper/initrd
}
menuentry "Check disc for defects" {
  linux /casper/vmlinuz boot=casper integrity-check quiet splash ---
  initrd /casper/initrd
}
EOF

@mvallim mvallim pinned this issue Oct 4, 2022
@mvallim mvallim unpinned this issue Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants