Various fixes from rebase

This took a while so a bunch of stuff got broken in rebase.
This commit is contained in:
fosslinux 2022-05-23 15:56:18 +10:00
parent b614b3021d
commit 25f37ba926
28 changed files with 196 additions and 90 deletions

View file

@ -1,19 +1,20 @@
#!/usr/bin/bash
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e
. /usr/src/helpers.sh
export PATH=/usr/bin
export PREFIX=/usr
export SOURCES=/usr/src
echo
# shellcheck source=sysa/helpers.sh
. /usr/src/helpers.sh
echo
echo "Installing packages into sysb"
install_tar() {

View file

@ -28,7 +28,7 @@ create_hdx() {
# All the various structures that don't exist but needed to mount
mkdir -p /etc /dev
populate_device_nodes ""
populate_device_nodes
create_hdx
ask_disk() {
@ -62,13 +62,16 @@ if [ -z "${DISK}" ] || ! [ -e "/dev/${DISK}" ]; then
echo "DISK=${DISK}" >> /usr/src/bootstrap.cfg
fi
if [ -z "$(fdisk -l "/dev/${DISK}" | grep -E "${DISK}p?[0-9]")" ]; then
echo "Creating partition table and partition"
echo ";" | sfdisk "/dev/${DISK}"
mkfs.ext4 "/dev/${DISK}1"
DISK="${DISK}1"
# Is it a full disk, and not a partition
# shellcheck disable=SC2012
if [ $(($(ls -l "/dev/${DISK}" | sed "s/.*, *//" | sed "s/ .*//") % 8)) -eq 0 ]; then
if ! fdisk -l "/dev/${DISK}" | grep -qE "${DISK}p?[0-9]" ; then
echo "Creating partition table and partition"
echo ";" | sfdisk "/dev/${DISK}"
mkfs.ext4 "/dev/${DISK}1"
DISK="${DISK}1"
fi
fi
echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg
PREFIX=/usr