Talk:PXE boot: Difference between revisions

From Alpine Linux
(Created page with " == Cannot set it up == I'm trying to setup a PXE_boot setup full AL to boot from network as it was usb KEYs...<br/> I'm following the pxelinux.cfg/default path (not the gPXE...")
 
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:


== Cannot set it up ==
== Details for generating pxerd ==


I'm trying to setup a PXE_boot setup full AL to boot from network as it was usb KEYs...<br/>
This is how I do it to prepare a PXEboot for qemu machines from a ''run-from-ram-from-cdrom'' <pre>
I'm following the pxelinux.cfg/default path (not the gPXE one).<br/>
setup-interfaces
but I'm stuck... see [[User_talk:Jch#PXEboot]]<br/>
/etc/init.d/networking start
--[[User:Jch|Jch]] ([[User talk:Jch|talk]]) 08:30, 17 February 2015 (UTC)
setup-proxy
. /etc/profile.d/proxy.sh
setup-apkrepos
apk update
apk add mkinitfs openssh-client
cd /etc/mkinitfs/features.d/
echo "kernel/drivers/net/virtio_net.ko" >> network.modules
echo "/usr/share/udhcpc/default.script" > dhcp.files
echo "kernel/net/packet/af_packet.ko" > dhcp.modules
echo "kernel/fs/nfs/*" > nfs.modules
cd /etc/mkinitfs/
echo 'features="ata base bootchart cdrom cramfs ext2 ext3 ext4 xfs floppy keymap kms raid scsi usb virtio squashfs network dhcp nfs"' > mkinitfs.conf
mkinitfs -o /root/pxerd
scp /root/pxerd $TFTPSERVER:$TFTPPATH
scp /media/cdrom/boot/vmlinuz-grsec $TFTPSERVER:$TFTPPATH
scp -r /media/cdrom/* $NFSSERVER:$NFSPATH
</pre>
 
For your specific setup, adjust the network.modules with needed kernel drivers.
 
--[[User:Jch|Jch]] ([[User talk:Jch|talk]]) 09:00, 16 March 2015 (UTC)
 
== Packages not in the initial ISO ==
 
Be sure to have a local repo on the LAN with all needed package and to specify (alpine_repo=http://...) it the APPEND line of the pxelinux.cfg/config_file!
 
== Running Alpine PXE server in sys mode ==
 
<pre>
pxeal:~# cat /etc/apk/world
acct
alpine-base
dnsmasq
e2fsprogs
iptables
lighttpd
linux-hardened
nfs-utils
openssh
syslinux
</pre>
 
<pre>
pxeal:~# lbu ls
etc/fstab
etc/conf.d/keymaps
etc/mkinitfs/mkinitfs.conf
etc/mkinitfs/features.d/dhcp.files
etc/mkinitfs/features.d/dhcp.modules
etc/mkinitfs/features.d/network.modules
etc/mkinitfs/features.d/nfs.modules
etc/runlevels/shutdown/savecache
etc/runlevels/shutdown/killprocs
etc/runlevels/shutdown/mount-ro
etc/runlevels/sysinit/hwdrivers
etc/runlevels/sysinit/mdev
etc/runlevels/sysinit/dmesg
etc/runlevels/sysinit/devfs
etc/runlevels/default/lighttpd
etc/runlevels/default/sshd
etc/runlevels/default/iptables
etc/runlevels/default/nfs
etc/runlevels/default/crond
etc/runlevels/default/dnsmasq
etc/runlevels/default/acpid
etc/runlevels/boot/keymaps
etc/runlevels/boot/sysctl
etc/runlevels/boot/bootmisc
etc/runlevels/boot/syslog
etc/runlevels/boot/modules
etc/runlevels/boot/swap
etc/runlevels/boot/networking
etc/runlevels/boot/urandom
etc/runlevels/boot/hostname
etc/runlevels/boot/hwclock
etc/resolv.conf
etc/update-extlinux.conf
etc/iptables/rules-save
etc/shadow
etc/network/interfaces
etc/keymap/
etc/keymap/be.bmap.gz
etc/dnsmasq.d/pxeboot.conf
etc/passwd-
etc/group-
etc/hosts
etc/sysctl.d/01-manufacture.conf
etc/shadow-
etc/group
etc/passwd
etc/ssh/ssh_host_ed25519_key
etc/ssh/ssh_host_rsa_key.pub
etc/ssh/ssh_host_ecdsa_key.pub
etc/ssh/ssh_host_dsa_key.pub
etc/ssh/ssh_host_rsa_key
etc/ssh/ssh_host_ed25519_key.pub
etc/ssh/ssh_host_dsa_key
etc/ssh/ssh_host_ecdsa_key
etc/fstab.old
etc/apk/arch
etc/apk/protected_paths.d/lbu.list
etc/apk/keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
etc/apk/keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
etc/apk/repositories
etc/apk/world
etc/zoneinfo/
etc/zoneinfo/Europe/
etc/zoneinfo/Europe/Zurich
etc/localtime
etc/hostname
etc/exports
var/www/localhost/htdocs/pxe-default.apkovl.tar.gz
var/www/localhost/htdocs/modloop-hardened
var/lib/tftpboot/pxelinux/pxelinux.cfg/default
var/lib/tftpboot/pxelinux/pxelinux.0
var/lib/tftpboot/pxelinux/initramfs-hardened
var/lib/tftpboot/pxelinux/ldlinux.c32
var/lib/tftpboot/pxelinux/vmlinuz-hardened
root/.ssh/authorized_keys
</pre > 114.8M '''pxeal.apkovl.tar.gz'''
 
with custom made initramfs along first note.

Latest revision as of 16:16, 18 September 2017

Details for generating pxerd

This is how I do it to prepare a PXEboot for qemu machines from a run-from-ram-from-cdrom

setup-interfaces
/etc/init.d/networking start
setup-proxy 
. /etc/profile.d/proxy.sh
setup-apkrepos
apk update
apk add mkinitfs openssh-client
cd /etc/mkinitfs/features.d/
echo "kernel/drivers/net/virtio_net.ko" >> network.modules
echo "/usr/share/udhcpc/default.script" > dhcp.files
echo "kernel/net/packet/af_packet.ko" > dhcp.modules
echo "kernel/fs/nfs/*" > nfs.modules
cd /etc/mkinitfs/
echo 'features="ata base bootchart cdrom cramfs ext2 ext3 ext4 xfs floppy keymap kms raid scsi usb virtio squashfs network dhcp nfs"' > mkinitfs.conf
mkinitfs -o /root/pxerd
scp /root/pxerd $TFTPSERVER:$TFTPPATH
scp /media/cdrom/boot/vmlinuz-grsec $TFTPSERVER:$TFTPPATH
scp -r /media/cdrom/* $NFSSERVER:$NFSPATH

For your specific setup, adjust the network.modules with needed kernel drivers.

--Jch (talk) 09:00, 16 March 2015 (UTC)

Packages not in the initial ISO

Be sure to have a local repo on the LAN with all needed package and to specify (alpine_repo=http://...) it the APPEND line of the pxelinux.cfg/config_file!

Running Alpine PXE server in sys mode

pxeal:~# cat /etc/apk/world 
acct
alpine-base
dnsmasq
e2fsprogs
iptables
lighttpd
linux-hardened
nfs-utils
openssh
syslinux
pxeal:~# lbu ls
etc/fstab
etc/conf.d/keymaps
etc/mkinitfs/mkinitfs.conf
etc/mkinitfs/features.d/dhcp.files
etc/mkinitfs/features.d/dhcp.modules
etc/mkinitfs/features.d/network.modules
etc/mkinitfs/features.d/nfs.modules
etc/runlevels/shutdown/savecache
etc/runlevels/shutdown/killprocs
etc/runlevels/shutdown/mount-ro
etc/runlevels/sysinit/hwdrivers
etc/runlevels/sysinit/mdev
etc/runlevels/sysinit/dmesg
etc/runlevels/sysinit/devfs
etc/runlevels/default/lighttpd
etc/runlevels/default/sshd
etc/runlevels/default/iptables
etc/runlevels/default/nfs
etc/runlevels/default/crond
etc/runlevels/default/dnsmasq
etc/runlevels/default/acpid
etc/runlevels/boot/keymaps
etc/runlevels/boot/sysctl
etc/runlevels/boot/bootmisc
etc/runlevels/boot/syslog
etc/runlevels/boot/modules
etc/runlevels/boot/swap
etc/runlevels/boot/networking
etc/runlevels/boot/urandom
etc/runlevels/boot/hostname
etc/runlevels/boot/hwclock
etc/resolv.conf
etc/update-extlinux.conf
etc/iptables/rules-save
etc/shadow
etc/network/interfaces
etc/keymap/
etc/keymap/be.bmap.gz
etc/dnsmasq.d/pxeboot.conf
etc/passwd-
etc/group-
etc/hosts
etc/sysctl.d/01-manufacture.conf
etc/shadow-
etc/group
etc/passwd
etc/ssh/ssh_host_ed25519_key
etc/ssh/ssh_host_rsa_key.pub
etc/ssh/ssh_host_ecdsa_key.pub
etc/ssh/ssh_host_dsa_key.pub
etc/ssh/ssh_host_rsa_key
etc/ssh/ssh_host_ed25519_key.pub
etc/ssh/ssh_host_dsa_key
etc/ssh/ssh_host_ecdsa_key
etc/fstab.old
etc/apk/arch
etc/apk/protected_paths.d/lbu.list
etc/apk/keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
etc/apk/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
etc/apk/keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
etc/apk/repositories
etc/apk/world
etc/zoneinfo/
etc/zoneinfo/Europe/
etc/zoneinfo/Europe/Zurich
etc/localtime
etc/hostname
etc/exports
var/www/localhost/htdocs/pxe-default.apkovl.tar.gz
var/www/localhost/htdocs/modloop-hardened
var/lib/tftpboot/pxelinux/pxelinux.cfg/default
var/lib/tftpboot/pxelinux/pxelinux.0
var/lib/tftpboot/pxelinux/initramfs-hardened
var/lib/tftpboot/pxelinux/ldlinux.c32
var/lib/tftpboot/pxelinux/vmlinuz-hardened
root/.ssh/authorized_keys

114.8M pxeal.apkovl.tar.gz

with custom made initramfs along first note.