Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/create_stage4_cdrom.sh
blob: 4e599cdda60adf53028e09c9b2387fa22f426482 (plain)
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
#!/bin/sh

# shellcheck source=./default.conf
. "./default.conf"

# build the standard Archlinux 32 ISO with stage 4 packages, Check
# if it works as NBD block device after bootig via (i)PXE and TFTP.
# For machine with little RAM, no CD-ROM drive or just a 1.44MB floppy.
# (requires 64 MB minimal currently)

sudo rm -rf $STAGE4_ISOLINUX

# copy chroot to ISOlinux dir
mkdir $STAGE4_ISOLINUX

# TODO: change to ISOLINUX dir

DOLLAR='\$'
ssh -i $CROSS_HOME/.ssh/id_rsa root@$STAGE1_MACHINE_IP bash -l -c "'		
	cat >/etc/pacman.d/mirrorlist32 <<EOF
Server = http://archlinux32.andreasbaumann.cc/${DOLLAR}arch/${DOLLAR}repo
EOF
'"

exit 0


sudo cp -a $STAGE4_CHROOT/{bin,boot,dev,etc,home,lib,mnt,opt,proc,root,run,sbin,srv,sys,tmp,usr,var} $STAGE4_ISOLINUX/.
sudo chown -R cross:cross $STAGE4_ISOLINUX/.
cd $STAGE4_ISOLINUX || exit 1

# on the TFTP server (e. g. as pxelinux.cfg/default)
mkdir boot/isolinux
cat >boot/isolinux/isolinux.cfg <<EOF
default menu.c32
prompt 0
timeout 20
ontimeout linux

label linux
initrd initramfs-linux.img
linux vmlinuz-linux
append rw ip=:::::eth0:dhcp nbd_host=192.168.1.12 nomodeset init=/lib/systemd/systemd nbd_name=archiso root=/dev/nbd0 console=tty0
EOF
sudo chown cross:cross boot/isolinux/isolinux.cfg

sudo chown -R root:root .
sudo chmod 0775 etc/init/boot
sudo cp /usr/lib/syslinux/bios/ldlinux.c32 boot/isolinux/.
sudo cp /usr/lib/syslinux/bios/menu.c32 boot/isolinux/.
sudo cp /usr/lib/syslinux/bios/libutil.c32 boot/isolinux/.
sudo cp /usr/lib/syslinux/bios/isolinux.bin boot/isolinux/.
sudo genisoimage -J -r -o ../arch486-stage4.iso -b boot/isolinux/isolinux.bin \
	-c boot/isolinux/boot.cat -input-charset UTF-8 -no-emul-boot \
	-boot-load-size 4 -boot-info-table -joliet-long .
cd .. || exit 1