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
d08ef4c3
Verified
Commit
d08ef4c3
authored
Aug 15, 2020
by
Sven-Hendrik Haase
Browse files
Some refactoring
parent
39102348
Changes
3
Hide whitespace changes
Inline
Side-by-side
cloud.json
View file @
d08ef4c3
...
...
@@ -47,13 +47,6 @@
"provision/cleanup.sh"
],
"execute_command"
:
"echo 'arch'|sudo -S sh '{{.Path}}'"
},
{
"type"
:
"shell"
,
"scripts"
:
[
"provision/write_zeroes.sh"
],
"execute_command"
:
"echo 'arch'|sudo -S sh '{{.Path}}'"
}
],
"post-processors"
:
[
...
...
http/install.sh
View file @
d08ef4c3
...
...
@@ -13,21 +13,19 @@ else
fi
export
device
memory_size_in_kilobytes
=
$(
free |
awk
'/^Mem:/ { print $2 }'
)
swap_size_in_kilobytes
=
$((
memory_size_in_kilobytes
*
2
))
sfdisk
"
$device
"
<<
EOF
label: dos
size=
${
swap_size_in_kilobytes
}
KiB, type=82
type=83, bootable
EOF
memory_size_in_mebibytes
=
$(
free
-m
|
awk
'/^Mem:/ { print $2 }'
)
swap_size_in_mebibytes
=
$((
memory_size_in_mebibytes
*
2
))
mkswap
"
${
device
}
1"
mkfs.btrfs
-L
"rootfs"
"
${
device
}
2"
mount
-o
compress-force
=
zstd
"
${
device
}
2"
/mnt
sgdisk
-g
--clear
-n
1:0:+10M
$device
-c
1:boot
-t
1:ef02
sgdisk
-n
2:0:+
${
swap_size_in_mebibytes
}
M
$device
-c
2:swap
-t
2:8200
sgdisk
-n
3:0:0
$device
-c
3:root
sync
mkswap /dev/disk/by-partlabel/swap
mkfs.btrfs /dev/disk/by-partlabel/root
mount
-o
compress-force
=
zstd
PARTLABEL
=
root /mnt
echo
"Server =
${
MIRROR
}
"
>
/etc/pacman.d/mirrorlist
pacman-key
--init
pacman-key
--populate
archlinux
pacstrap /mnt base linux grub openssh
sudo
polkit haveged netctl python
pacstrap /mnt base linux grub openssh
sudo
polkit haveged netctl python btrfs-progs
arch-chroot /mnt /bin/bash
provision/write_zeroes.sh
deleted
100644 → 0
View file @
39102348
#!/bin/bash
set
-e
set
-x
sync
btrfs filesystem defrag
-r
-czstd
/
sync
exit
0
# Make sure unwritten data has been flushed beforehand
sync
# Write zeros to improve virtual disk compaction.
zerofile
=
$(
/usr/bin/mktemp /zerofile.XXXXX
)
dd
if
=
/dev/zero
of
=
"
$zerofile
"
bs
=
1M
||
true
rm
-f
"
$zerofile
"
sync
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