mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-14 15:25:23 +01:00
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:
parent
6ea1b8e295
commit
0ce50a6393
9 changed files with 219 additions and 51 deletions
20
sysb/run.sh
20
sysb/run.sh
|
|
@ -34,10 +34,15 @@ create_hdx
|
|||
ask_disk() {
|
||||
echo
|
||||
echo "What disk would you like to use for live-bootstrap?"
|
||||
echo "(live-bootstrap assumes you have pre-prepared the disk)."
|
||||
echo "Please provide in format sdxx (as you would find under /dev)."
|
||||
echo "This disk may have pre-prepared sources on it."
|
||||
echo "If there is no partition we will make one".
|
||||
echo "Please provide in format sdxx (as you would find under /dev),"
|
||||
echo "or sdx if it is a blank disk. An ext4 partition is expected on"
|
||||
echo "existing disks."
|
||||
echo "You can type 'list' to get a list of disks to help you figure"
|
||||
echo "out which is the right disk."
|
||||
echo "NO WARRANTY IS PROVIDED FOR BUGGY BEHAVIOUR, INCLUDING THAT"
|
||||
echo "REGARDING DISKS & DATA."
|
||||
echo
|
||||
read -r DISK
|
||||
|
||||
|
|
@ -57,6 +62,15 @@ 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"
|
||||
fi
|
||||
|
||||
echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg
|
||||
|
||||
PREFIX=/usr
|
||||
SOURCES="${PREFIX}/src"
|
||||
SYSC=/sysc
|
||||
|
|
@ -68,7 +82,7 @@ mount -t ext4 "/dev/${DISK}" /sysc
|
|||
|
||||
# Copy over appropriate data
|
||||
echo "Copying data into sysc"
|
||||
sys_transfer "${SYSC}" gzip patch
|
||||
sys_transfer "${SYSC}" /sysc_src gzip patch
|
||||
sync
|
||||
|
||||
# switch_root into sysc 1. for simplicity 2. to avoid kexecing again
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue