Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Install Debian via PXE from local iso

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
oxedions
Posts: 5
Joined: 2019-07-21 13:47

Install Debian via PXE from local iso

#1 Post by oxedions »

Hello,

I am working on implementing Debian in the BlueBanquise stack (https://github.com/bluebanquise/bluebanquise).

The most tricky part, like with every other distributions, is the network deployment (PXE).
Debian is based on preseed, and while I succeed deploying Debian 11.3 via PXE using an external mirror, I fail to do that using a local repository based on DVD 1 iso. Note that I need to have a fully automated deployment, no user interaction.

If someone have some knowledge on that, I would be really grateful :D

Here are the steps to reproduce what I do.

--- 1. First, grab DVD 1, and netboot. Kernel inside MUST match perfectly.
--- 1.1. Extract initrd from both, and inject disks kernel modules from DVD initrd to netboot initrd (this include all SCSI, NVME, etc, so that installer can see our sata disks).
--- 1.2. Build final initrd from our updated netboot initrd.

--- 2. Install all needed on server side: dhcp, http and tftp requirements. I also start my PXE process using an iPXE rom.

--- 3. Create preseed file. I am using that one:

Code: Select all

d-i debian-installer/locale string en_US
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i localechooser/supported-locales multiselect en_US.UTF-8, fr_FR.UTF-8

d-i keyboard-configuration/xkb-keymap select fr

d-i netcfg/choose_interface select auto
d-i netcfg/use_dhcp string true
d-i netcfg/link_wait_timeout string 10
d-i netcfg/dhcp_timeout string 60
d-i netcfg/dhcp_failed note
d-i netcfg/wireless_wep string
d-i netcfg/get_hostname unassigned-hostname
d-i netcfg/get_domain unassigned-domain
d-i netcfg/get_hostname seen true
d-i netcfg/get_domain seen true

d-i mirror/country string manual
d-i mirror/http/hostname string 10.10.0.1
d-i mirror/http/directory string /deb11
d-i mirror/http/proxy string
d-i pkgsel/install-language-support boolean false
d-i debian-installer/allow_unauthenticated boolean true

d-i passwd/make-user boolean false
d-i passwd/root-password-crypted password $6$k.RYFFx8joDk.azd$Z9GOaX2TvXbYHLRyfFHGAyqiSeOTgmzU/X2VbnoFNeTj3W7p0hGnN/wzABxfGZ928DDnmeWAsZOK/cCkYeEXp/

d-i clock-setup/utc boolean true
d-i time/zone string Europe/Paris

d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-partitioning/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

d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/init_automatically_partition select Guided - use entire disk

d-i pkgsel/upgrade select none
d-i pkgsel/updatedb boolean false
d-i pkgsel/update-policy select none
d-i apt-setup/restricted boolean false
d-i apt-setup/universe boolean false
d-i apt-setup/backports boolean false
d-i apt-setup/proposed boolean false

d-i grub-installer/only_debian boolean true
d-i grub-installer/bootdev  string default

d-i finish-install/reboot_in_progress note
This file is at /preseed.cfg of my http server on 10.10.0.1 ip.

--- 4. Mount DVD 1 iso at /deb11 on http server on 10.10.0.1 ip.

--- 5. Create ipxe file to load kernel/initrd and start kernel:

Code: Select all

kernel http://10.10.0.1/deb11/install.amd/vmlinuz initrd=initrd.gz auto=true priority=critical locale=en_US.UTF-8 console-setup/charmap=UTF-8 console-keymaps-at/keymaps=pc105 console-setup/layoutcode=us console-setup/ask_detect=false preseed/url=http://10.10.0.1/preseed.cfg debian-installer/allow_unauthenticated=true
initrd http://10.10.0.1/initrd.gz
sleep 4
boot
--- 6. Then I boot my server on PXE. All goes well, ipxe starts, grabs kernel and initrd, starts installer, etc. Partitioning pass ok, it installs base system, but then fails when considering additional packages:

Image

So I probably miss a point.

On server side, I can see these logs on http server before the crash:

Code: Select all

10.10.0.10 - - [:13:01:30 +0000] "GET /deb11/pool/main/k/kbd/kbd_2.3.0-3_amd64.deb HTTP/1.1" 200 320933 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:01:30 +0000] "GET /deb11/pool/main/c/console-setup/console-setup-linux_1.205_all.deb HTTP/1.1" 200 1872683 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:01:30 +0000] "GET /deb11/pool/main/x/xkeyboard-config/xkb-data_2.29-2_all.deb HTTP/1.1" 200 655401 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:01:30 +0000] "GET /deb11/pool/main/c/console-setup/console-setup_1.205_all.deb HTTP/1.1" 200 100305 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:01:40 +0000] "GET /deb11/dists/bullseye/InRelease HTTP/1.1" 404 432 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:01:40 +0000] "GET /deb11/dists/bullseye/Release HTTP/1.1" 304 126 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:01:40 +0000] "GET /deb11/dists/bullseye/Release.gpg HTTP/1.1" 404 432 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:04:59 +0000] "GET /deb11/dists/bullseye/InRelease HTTP/1.1" 404 432 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:04:59 +0000] "GET /deb11/dists/bullseye/Release HTTP/1.1" 304 126 "-" "Debian APT-HTTP/1.3 (2.2.4)"
10.10.0.10 - - [:13:04:59 +0000] "GET /deb11/dists/bullseye/Release.gpg HTTP/1.1" 404 432 "-" "Debian APT-HTTP/1.3 (2.2.4)"
As you can see on final lines, each time I press Retry, installer try to grab Release.gpg (which is a 404 since it is the basic iso) and then fail.
But I am not even sure it is this Release.gpg 404 that is the issue, as it did the same when grabbing repositories for first part, and it did not complain.

Maybe DVD 1 does not contain all the necessary packages ? I am not sure, since you can install Debian in offline mode with a DVD, there must be a way to reproduce that. If someone already played with PXE on Debian, using local mirrors, I would be very interested by some notes on that :D

With my best regards

Ox

jmgibson1981
Posts: 296
Joined: 2015-06-07 14:38
Has thanked: 11 times
Been thanked: 32 times

Re: Install Debian via PXE from local iso

#2 Post by jmgibson1981 »

You need a proper mirror I believe. Not just mounting the installer dvd. Said mirror would need to have a Packages.gz file at minimum which is what any apt gets its list from. I may be wrong on the terminology. It needs that file.

oxedions
Posts: 5
Joined: 2019-07-21 13:47

Re: Install Debian via PXE from local iso

#3 Post by oxedions »

Dear @jmgibson1981

Thanks a lot for this reply :-)

Yes, I guess I will not be able to bootstrap system with a single DVD. I will try to configure a Squid proxy to prevent external mirrors intense usage when multiple servers grab the same packages.

jmgibson1981
Posts: 296
Joined: 2015-06-07 14:38
Has thanked: 11 times
Been thanked: 32 times

Re: Install Debian via PXE from local iso

#4 Post by jmgibson1981 »

You could theoretically create your own mirror from the files though I think. Copy all the .deb files to somewhere in your web server then create the Packages file yourself. This would allow you to use the packages from the disk only while still giving you a local mirror you can use.

https://linuxopsys.com/topics/create-yo ... -on-debian

Squid is the better choice I agree though. Then you still have the current updates with patches and such while minimizing your bandwidth usage. I keep a squid server on my lan strictly for that purpose.

oxedions
Posts: 5
Joined: 2019-07-21 13:47

Re: Install Debian via PXE from local iso

#5 Post by oxedions »

Dear @jmgibson1981
Apologies for the delay of my answer.

This is what I will suggest in the documentation :)
I am adding Debian right now to the stack, and I expect to be able to provide it before end of this year.

Thanks a lot for your help :D

Post Reply