Verified Commit 7da735e2 authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Merge branch 'mr-origin-138' into master

parents e0414adb c8b8e667
Pipeline #2165 passed with stages
in 30 minutes and 14 seconds
...@@ -136,7 +136,7 @@ function main() { ...@@ -136,7 +136,7 @@ function main() {
expect "# " expect "# "
## Start build and copy output to local disk ## Start build and copy output to local disk
send "bash -x ./build-inside-vm.sh ${BUILD_VERSION}\n" send "bash -x ./build-inside-vm.sh ${BUILD_VERSION:-}\n"
expect "# " 240 # qemu-img convert can take a long time expect "# " 240 # qemu-img convert can take a long time
send "cp -r --preserve=mode,timestamps output /mnt/arch-boxes/tmp/$(basename "${TMPDIR}")/\n" send "cp -r --preserve=mode,timestamps output /mnt/arch-boxes/tmp/$(basename "${TMPDIR}")/\n"
expect "# " 60 expect "# " 60
......
...@@ -89,8 +89,9 @@ function postinstall() { ...@@ -89,8 +89,9 @@ function postinstall() {
echo "COMPRESSION=\"xz\"" >>"${MOUNT}/etc/mkinitcpio.conf" echo "COMPRESSION=\"xz\"" >>"${MOUNT}/etc/mkinitcpio.conf"
arch-chroot "${MOUNT}" /usr/bin/mkinitcpio -p linux arch-chroot "${MOUNT}" /usr/bin/mkinitcpio -p linux
echo "archlinux" >"${MOUNT}/etc/hostname" sed -i -e 's/^#\(en_US.UTF-8\)/\1/' "${MOUNT}/etc/locale.gen"
echo "KEYMAP=us" >"${MOUNT}/etc/vconsole.conf" arch-chroot "${MOUNT}" /usr/bin/locale-gen
arch-chroot "${MOUNT}" /usr/bin/systemd-firstboot --locale=en_US.UTF-8 --timezone=UTC --hostname=archlinux --keymap=us
ln -sf /var/run/systemd/resolve/resolv.conf "${MOUNT}/etc/resolv.conf" ln -sf /var/run/systemd/resolve/resolv.conf "${MOUNT}/etc/resolv.conf"
} }
...@@ -147,17 +148,17 @@ function mv_to_output() { ...@@ -147,17 +148,17 @@ function mv_to_output() {
} }
# Helper function: create a new image from the "base" image # Helper function: create a new image from the "base" image
# ${1} - new image file # ${1} - final file
# ${2} - final file # ${2} - pre
# ${3} - pre # ${3} - post
# ${4} - post
function create_image() { function create_image() {
copy_and_mount_image "${1}" local tmp_image="$(basename "$(mktemp -u)")"
"${3}" copy_and_mount_image "${tmp_image}"
"${2}"
image_cleanup image_cleanup
unmount_image unmount_image
"${4}" "${1}" "${2}" "${3}" "${tmp_image}" "${1}"
mv_to_output "${2}" mv_to_output "${1}"
} }
function cloud_image() { function cloud_image() {
...@@ -250,8 +251,8 @@ function main() { ...@@ -250,8 +251,8 @@ function main() {
else else
build_version="${1}" build_version="${1}"
fi fi
create_image "cloud-img.img" "Arch-Linux-x86_64-cloudimg-${build_version}.qcow2" cloud_image cloud_image_post create_image "Arch-Linux-x86_64-cloudimg-${build_version}.qcow2" cloud_image cloud_image_post
create_image "vagrant-qemu.img" "Arch-Linux-x86_64-libvirt-${build_version}.box" vagrant_qemu vagrant_qemu_post create_image "Arch-Linux-x86_64-libvirt-${build_version}.box" vagrant_qemu vagrant_qemu_post
create_image "vagrant-virtualbox.img" "Arch-Linux-x86_64-virtualbox-${build_version}.box" vagrant_qemu vagrant_virtualbox_post create_image "Arch-Linux-x86_64-virtualbox-${build_version}.box" vagrant_virtualbox vagrant_virtualbox_post
} }
main "$@" main "$@"
...@@ -3,13 +3,7 @@ ...@@ -3,13 +3,7 @@
set -e set -e
set -x set -x
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
sed -i -e 's/^#\(en_US.UTF-8\)/\1/' /etc/locale.gen
locale-gen
echo 'LANG=en_US.UTF-8' >/etc/locale.conf
# setting the user credentials # setting the user credentials
echo -e "${NEWUSER}\n${NEWUSER}" | passwd
useradd -m -U "${NEWUSER}" useradd -m -U "${NEWUSER}"
echo -e "${NEWUSER}\n${NEWUSER}" | passwd "${NEWUSER}" echo -e "${NEWUSER}\n${NEWUSER}" | passwd "${NEWUSER}"
...@@ -90,9 +84,6 @@ sed -i 's/^GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX="net.ifnames=0"/' /etc/defa ...@@ -90,9 +84,6 @@ sed -i 's/^GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX="net.ifnames=0"/' /etc/defa
sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"rootflags=compress-force=zstd\"/' /etc/default/grub sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"rootflags=compress-force=zstd\"/' /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
# lock root account
usermod -p "*" root
if declare -f post >/dev/null; then if declare -f post >/dev/null; then
post post
fi fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment