-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_boot
67 lines (57 loc) · 1.8 KB
/
init_boot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
nodename=${1:-vagrant.localdomain}
set -x
url=http://mirror.umd.edu/fedora/linux/releases/31/Everything/x86_64/os
rm -fr bootcd
mkdir -p bootcd
lftp -c mirror $url/isolinux bootcd/isolinux
cat > bootcd/ks.cfg << EOF1
ignoredisk --only-use=sda
auth --enableshadow --passalgo=sha512
install
text
network --bootproto=dhcp --ipv6=auto --activate
network --hostname=$nodename
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
firstboot --disable
skipx
zerombr
bootloader --location=mbr --password=vagrant
clearpart --all --initlabel
autopart --type=lvm --encrypted --passphrase=vagrant
rootpw vagrant
halt
%packages
@core
-@hardware-support
rsync
%end
%post
PATH=/sbin:/usr/sbin:/bin:/usr/bin
umask 077
mkdir /root/.ssh
cat << EOF > /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
EOF
%end
%addon com_redhat_kdump --disable --reserve-mb='128'
%end
EOF1
cat > bootcd/isolinux/isolinux.cfg << EOF2
default vesamenu.c32
timeout 5
display boot.msg
menu clear
menu background splash.png
menu title Fedora 31
label linux
menu label ^Kickstart Fedora 31
kernel vmlinuz
append initrd=initrd.img inst.ks=hd:LABEL=KS:/ks.cfg inst.repo=$url console=ttyS0,19200n8 net.ifnames=0
EOF2
cd bootcd
genisoimage -J -R -V "KS" -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -v -o ../linuxboot.iso .
isohybrid ../linuxboot.iso
dd if=../linuxboot.iso of=/dev/sda
sync; echo 3 > /proc/sys/vm/drop_caches