Add options for;

- disk to be created (blank disk given to live-bootstrap) (default)
- disk to already exist but sources downloaded within live-bootstrap
- sources to be downloaded outside live-bootstrap (non-blank disk given
  to live-bootstrap)

Also migrate sysb to use sys_transfer in QEMU mode also.

Note that this means copy_sysc is now irrelevant. sysc is *always*
sourced from sysa.
This commit is contained in:
fosslinux 2022-05-22 10:03:21 +10:00
parent 6ea1b8e295
commit 0ce50a6393
9 changed files with 219 additions and 51 deletions

View file

@ -412,6 +412,7 @@ populate_device_nodes() {
sys_transfer() {
local dest=$1
local sys_sources=$2
mkdir -p "${dest}/${PREFIX}/bin" "${dest}/${PREFIX}/src"
@ -419,11 +420,13 @@ sys_transfer() {
cp "${PREFIX}/bin/bash" "${PREFIX}/bin/tar" "${PREFIX}/bin/bzip2" "${dest}${PREFIX}/bin/"
# Transfer misc files
cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "${dest}/"
cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "${dest}/${PREFIX}/src"
cp -r "${PREFIX}/src/" "${dest}${PREFIX}/"
cp -r "${sys_sources}/*" "${dest}/${PREFIX}/src"
cp -f "${sys_sources}/init" "${dest}/"
cp -r "${PREFIX}/src/repo" "${dest}/${PREFIX}/src"
shift
shift 2
# Copy additional binaries
set -- "${@/#/${PREFIX}/bin/}"
cp "$@" "${dest}${PREFIX}/bin/"

View file

@ -22,16 +22,11 @@ export SRCDIR="${srcdir}"
create_sysb() {
# Copy everything in
echo "Creating sysb rootfs"
mkdir -p "/sysb${PREFIX}"
for d in bin include lib libexec share src; do
# Minimise RAM (storage) use - use hard links
cp -rl "${PREFIX}/${d}" "/sysb${PREFIX}/${d}"
done
cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "/sysb/${SRCDIR}"
populate_device_nodes /sysb
sys_transfer /sysb_image /sysb
cp -rl /sysc /sysb/sysc_src
echo "Creating sysb initramfs"
gen_initramfs_list.sh -o "${PREFIX}/boot/initramfs-sysb.cpio.gz" /sysb
rm -rf /sysb # Cleanup
rm -rf /sysb /sysb_image # Cleanup
}
go_sysb() {
@ -256,6 +251,6 @@ if [ "${CHROOT}" = False ]; then
fi
# In chroot mode transition directly into System C.
SYSC=/sysc
sys_transfer "${SYSC}" gzip patch
SYSC=/sysc_image
sys_transfer "${SYSC}" /sysc gzip patch
exec chroot "${SYSC}" /init