Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
arch-boxes
Commits
c6b1d3fb
Verified
Commit
c6b1d3fb
authored
Aug 13, 2020
by
Sven-Hendrik Haase
Browse files
Make builds work more consistently
parent
cc6dee0a
Changes
5
Show whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
c6b1d3fb
...
...
@@ -34,7 +34,7 @@ build:cloud-qemu:
before_script
:
-
pacman -Syu --needed --noconfirm packer qemu-headless
script
:
-
packer build
-parallel-builds=1
-var 'write_zeroes=yes' -except=sign cloud.json
-
packer build -var 'write_zeroes=yes' -except=sign cloud.json
artifacts
:
name
:
"
cloud-qemu"
paths
:
...
...
@@ -46,7 +46,7 @@ build:vagrant-qemu:
before_script
:
-
pacman -Syu --needed --noconfirm packer qemu-headless
script
:
-
packer build
-parallel-builds=1
-var 'write_zeroes=yes' -only=qemu local.json
-
packer build -var 'write_zeroes=yes' -only=qemu local.json
publish
:
stage
:
publish
...
...
cloud.json
View file @
c6b1d3fb
...
...
@@ -9,7 +9,7 @@
"write_zeroes"
:
""
,
"boot_wait"
:
"60s"
,
"accelerator"
:
""
,
"mirror"
:
""
"mirror"
:
"
https://mirror.pkgbuild.com/$repo/os/$arch
"
},
"builders"
:
[
{
...
...
http/install-common.sh
View file @
c6b1d3fb
...
...
@@ -38,60 +38,25 @@ Name=eth0
DHCP=ipv4
EOF
# Setup pacman-init.service for clean pacman keyring initialization
cat
<<
EOF
>/etc/systemd/system/pacman-init.service
[Unit]
Description=Initializes Pacman keyring
Wants=haveged.service
After=haveged.service
Before=sshd.service
ConditionFirstBoot=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/pacman-key --init
ExecStart=/usr/bin/pacman-key --populate archlinux
[Install]
WantedBy=multi-user.target
EOF
# Add service for running reflector on first boot
cat
<<
EOF
>/etc/systemd/system/reflector-init.service
[Unit]
Description=Initializes mirrors for the VM
After=network-online.target
Wants=network-online.target
Before=sshd.service
ConditionFirstBoot=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=reflector --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
[Install]
WantedBy=multi-user.target
EOF
# enabling important services
systemctl daemon-reload
systemctl
enable
sshd
systemctl
enable
haveged
systemctl
enable
systemd-networkd
systemctl
enable
systemd-resolved
systemctl
enable
pacman-init.service
systemctl
enable
reflector-init.service
pacman-key
--init
pacman-key
--populate
archlinux
if
[
-b
"/dev/sda"
]
;
then
grub-install /dev/sda
elif
[
-b
"/dev/vda"
]
;
then
grub-install /dev/vda
fi
sed
-i
-e
's/^GRUB_TIMEOUT=.*$/GRUB_TIMEOUT=1/'
/etc/default/grub
sed
-i
's/^GRUB_TIMEOUT=.*$/GRUB_TIMEOUT=1/'
/etc/default/grub
# setup unpredictable kernel names
sed
-i
-e
's/^GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX="net.ifnames=0"/'
/etc/default/grub
sed
-i
's/^GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX="net.ifnames=0"/'
/etc/default/grub
sed
-i
's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"rootflags=compress-force=zstd\"/'
/mnt/etc/default/grub
grub-mkconfig
-o
/boot/grub/grub.cfg
# lock root account
...
...
http/install.sh
View file @
c6b1d3fb
...
...
@@ -22,19 +22,10 @@ size=${swap_size_in_kilobytes}KiB, type=82
EOF
mkswap
"
${
device
}
1"
mkfs.
ext4
-L
"rootfs"
"
${
device
}
2"
mount
"
${
device
}
2"
/mnt
mkfs.
btrfs
-L
"rootfs"
"
${
device
}
2"
mount
-o
compress-force
=
zstd
"
${
device
}
2"
/mnt
if
[
-n
"
${
MIRROR
}
"
]
;
then
echo
"Server =
${
MIRROR
}
"
>
/etc/pacman.d/mirrorlist
else
pacman
-Sy
--noconfirm
reflector
reflector
--age
12
--protocol
https
--sort
rate
--save
/etc/pacman.d/mirrorlist
fi
pacstrap
-M
/mnt base linux grub openssh
sudo
polkit haveged netctl python reflector
swapon
"
${
device
}
1"
genfstab
-pU
/mnt
>>
/mnt/etc/fstab
swapoff
"
${
device
}
1"
echo
"Server =
${
MIRROR
}
"
>
/etc/pacman.d/mirrorlist
pacstrap
-M
/mnt base linux grub openssh
sudo
polkit haveged netctl python
arch-chroot /mnt /usr/bin/sed
-i
's/^#Server/Server/'
/etc/pacman.d/mirrorlist
arch-chroot /mnt /bin/bash
local.json
View file @
c6b1d3fb
...
...
@@ -10,7 +10,7 @@
"write_zeroes"
:
""
,
"boot_wait"
:
"60s"
,
"accelerator"
:
""
,
"mirror"
:
""
"mirror"
:
"
https://mirror.pkgbuild.com/$repo/os/$arch
"
},
"builders"
:
[
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment