s/system partition/rootfs: fix remaining mentions
Follow-up to !1373, where `pmbootstrap flasher flash_system` was replaced with `pmbootstrap flasher flash_rootfs`. We still had used terms like "system partition" in a lot of places. This commit replaces it everywhere, so it's clear that we're talking about the pmOS rootfs (which may or may not be installed to Android's system partition).
This commit is contained in:
parent
cca5c9aa30
commit
0d7802d7ef
|
@ -89,8 +89,8 @@ Edit a kernel config:
|
|||
$ pmbootstrap kconfig edit --arch=armhf postmarketos-mainline
|
||||
```
|
||||
|
||||
### System Image
|
||||
Build the system image:
|
||||
### Root File System
|
||||
Build the rootfs:
|
||||
```
|
||||
$ pmbootstrap install
|
||||
```
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
pkgname=postmarketos-mkinitfs
|
||||
pkgver=0.6.6
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Tool to generate initramfs images for postmarketOS"
|
||||
url="https://postmarketos.org"
|
||||
# multipath-tools: kpartx
|
||||
|
@ -24,5 +24,5 @@ package() {
|
|||
mkdir -p "$pkgdir/etc/postmarketos-mkinitfs/hooks/"
|
||||
}
|
||||
sha512sums="d5abfe9a1298069e6722555c6e16223b09b36af65d879feb64d540aa6cbc009a3aa7f00528bcf656370ec37cc64f925c72ebb77813961cd6ebf22107b57ea029 init.sh.in
|
||||
dfd07a3ac1aa8a2bd999b5e06cbba12f44675989cdd54da8e5a0b27740d21d66a0543887bd15b4b2359a84fe980d65fc954e3494cfe1043b33094c30a0bb082e init_functions.sh
|
||||
3ecdf70c61fa862990b3afbec872f0498e0246017502aa22106782f8c5ef361902ad05473d6c2121db359f4f1d7e7a83da322e0d9f243825c4d1144358447164 mkinitfs.sh"
|
||||
40beaa5e1e8f539b5c5ab1bb213fef95dd944ce808e99a9d36439a0f94d350b9a36e6760189a6c262eb64e73b14341e0833da2e2a19f390cfab2385a2493c2bd init_functions.sh
|
||||
9773dd1ca2cff54c09353388153a765d47f7affeb085f93c06c081bb597c156e6481f38d2cfbd9df450a51228126aa2d0a884542f5406d1fdf141cb07ca12216 mkinitfs.sh"
|
||||
|
|
|
@ -121,8 +121,8 @@ extract_initramfs_extra() {
|
|||
|
||||
wait_root_partition() {
|
||||
while [ -z "$(find_root_partition)" ]; do
|
||||
show_splash /splash-nosystem.ppm.gz
|
||||
echo "Could not find the root partition."
|
||||
show_splash /splash-norootfs.ppm.gz
|
||||
echo "Could not find the rootfs."
|
||||
echo "Maybe you need to insert the sdcard, if your device has"
|
||||
echo "any? Trying again in one second..."
|
||||
sleep 1
|
||||
|
|
|
@ -299,7 +299,7 @@ generate_splash_screens()
|
|||
set -- "splash-loading" "Loading..." "--center" \
|
||||
"splash-noboot" "boot partition not found\\nhttps://postmarketos.org/troubleshooting" "--center" \
|
||||
"splash-noinitramfsextra" "initramfs-extra not found\\nhttps://postmarketos.org/troubleshooting" "--center" \
|
||||
"splash-nosystem" "system partition not found\\nhttps://postmarketos.org/troubleshooting" "--center" \
|
||||
"splash-norootfs" "rootfs not found\\nhttps://postmarketos.org/troubleshooting" "--center" \
|
||||
"splash-mounterror" "unable to mount root partition\\nhttps://postmarketos.org/troubleshooting" "--center" \
|
||||
"splash-debug-shell" "WARNING\\ndebug-shell is active\\nhttps://postmarketos.org/debug-shell" "--center"
|
||||
|
||||
|
|
|
@ -311,8 +311,8 @@ Flasher abstraction. Allowed variables:
|
|||
|
||||
$BOOT: Path to the /boot partition
|
||||
$FLAVOR: Kernel flavor
|
||||
$IMAGE: Path to the system partition image
|
||||
$PARTITION_SYSTEM: Partition to flash the system image
|
||||
$IMAGE: Path to the rootfs image
|
||||
$PARTITION_SYSTEM: Partition to flash the rootfs to
|
||||
|
||||
Fastboot specific: $KERNEL_CMDLINE, $VENDOR_ID
|
||||
Heimdall specific: $PARTITION_KERNEL, $PARTITION_INITFS
|
||||
|
|
|
@ -29,7 +29,7 @@ import pmb.helpers.file
|
|||
|
||||
def symlinks(args, flavor, folder):
|
||||
"""
|
||||
Create convenience symlinks to the system image and boot files.
|
||||
Create convenience symlinks to the rootfs and boot files.
|
||||
"""
|
||||
|
||||
# File descriptions
|
||||
|
|
|
@ -60,11 +60,11 @@ def list_flavors(args):
|
|||
|
||||
|
||||
def rootfs(args):
|
||||
# Generate system image, install flasher
|
||||
# Generate rootfs, install flasher
|
||||
img_path = "/home/pmos/rootfs/" + args.device + ".img"
|
||||
if not os.path.exists(args.work + "/chroot_native" + img_path):
|
||||
raise RuntimeError("The system image has not been generated yet,"
|
||||
" please run 'pmbootstrap install' first.")
|
||||
raise RuntimeError("The rootfs has not been generated yet, please run"
|
||||
" 'pmbootstrap install' first.")
|
||||
|
||||
# Do not flash if using fastboot & image is too large
|
||||
method = args.flash_method or args.deviceinfo["flash_method"]
|
||||
|
@ -72,8 +72,8 @@ def rootfs(args):
|
|||
img_size = os.path.getsize(args.work + "/chroot_native" + img_path) / 1024**2
|
||||
max_size = int(args.deviceinfo["flash_fastboot_max_size"])
|
||||
if img_size > max_size:
|
||||
raise RuntimeError("The system image is too large for fastboot"
|
||||
" to flash.")
|
||||
raise RuntimeError("The rootfs is too large for fastboot to"
|
||||
" flash.")
|
||||
|
||||
# Run the flasher
|
||||
logging.info("(native) flash rootfs image")
|
||||
|
|
|
@ -313,9 +313,9 @@ def install_system_image(args):
|
|||
copy_ssh_keys(args)
|
||||
pmb.chroot.shutdown(args, True)
|
||||
|
||||
# Convert system image to sparse using img2simg
|
||||
# Convert rootfs to sparse using img2simg
|
||||
if args.deviceinfo["flash_sparse"] == "true" and not args.split:
|
||||
logging.info("(native) make sparse system image")
|
||||
logging.info("(native) make sparse rootfs")
|
||||
pmb.chroot.apk.install(args, ["libsparse"])
|
||||
sys_image = args.device + ".img"
|
||||
sys_image_sparse = args.device + "-sparse.img"
|
||||
|
|
|
@ -108,7 +108,7 @@ def arguments_qemu(subparser):
|
|||
help="emulate a different architecture")
|
||||
ret.add_argument("--cmdline", help="override kernel commandline")
|
||||
ret.add_argument(
|
||||
"--image-size", help="set system image size (e.g. 2048M or 2G)")
|
||||
"--image-size", help="set rootfs size (e.g. 2048M or 2G)")
|
||||
ret.add_argument("-m", "--memory", type=int, default=1024,
|
||||
help="guest RAM (default: 1024)")
|
||||
ret.add_argument("-p", "--port", type=int, default=2222,
|
||||
|
@ -375,7 +375,7 @@ def arguments():
|
|||
install.add_argument("--rsync", help="update the sdcard using rsync,"
|
||||
" only works with --no-fde", action="store_true")
|
||||
install.add_argument("--cipher", help="cryptsetup cipher used to"
|
||||
" encrypt the system partition, eg. aes-xts-plain64")
|
||||
" encrypt the rootfs, eg. aes-xts-plain64")
|
||||
install.add_argument("--iter-time", help="cryptsetup iteration time (in"
|
||||
" miliseconds) to use when encrypting the system"
|
||||
" partiton")
|
||||
|
|
|
@ -36,17 +36,17 @@ import pmb.parse.arch
|
|||
|
||||
def system_image(args, device):
|
||||
"""
|
||||
Returns path to system image for specified device. In case that it doesn't
|
||||
Returns path to rootfs for specified device. In case that it doesn't
|
||||
exist, raise and exception explaining how to generate it.
|
||||
"""
|
||||
path = args.work + "/chroot_native/home/pmos/rootfs/" + device + ".img"
|
||||
if not os.path.exists(path):
|
||||
logging.debug("Could not find system image: " + path)
|
||||
logging.debug("Could not find rootfs: " + path)
|
||||
img_command = "pmbootstrap install"
|
||||
if device != args.device:
|
||||
img_command = ("pmbootstrap config device " + device +
|
||||
"' and '" + img_command)
|
||||
message = "The system image '{0}' has not been generated yet, please" \
|
||||
message = "The rootfs '{0}' has not been generated yet, please" \
|
||||
" run '{1}' first.".format(device, img_command)
|
||||
raise RuntimeError(message)
|
||||
return path
|
||||
|
@ -204,11 +204,11 @@ def command_qemu(args, arch, device, img_path, spice_enabled):
|
|||
|
||||
def resize_image(args, img_size_new, img_path):
|
||||
"""
|
||||
Truncates the system image to a specific size. The value must be larger than the
|
||||
Truncates the rootfs to a specific size. The value must be larger than the
|
||||
current image size, and it must be specified in MiB or GiB units (powers of 1024).
|
||||
|
||||
:param img_size_new: new image size in M or G
|
||||
:param img_path: the path to the system image
|
||||
:param img_path: the path to the rootfs
|
||||
"""
|
||||
# Current image size in bytes
|
||||
img_size = os.path.getsize(img_path)
|
||||
|
@ -216,7 +216,7 @@ def resize_image(args, img_size_new, img_path):
|
|||
# Make sure we have at least 1 integer followed by either M or G
|
||||
pattern = re.compile("^[0-9]+[M|G]$")
|
||||
if not pattern.match(img_size_new):
|
||||
raise RuntimeError("You must specify the system image size in [M]iB or [G]iB, e.g. 2048M or 2G")
|
||||
raise RuntimeError("You must specify the rootfs size in [M]iB or [G]iB, e.g. 2048M or 2G")
|
||||
|
||||
# Remove M or G and convert to bytes
|
||||
img_size_new_bytes = int(img_size_new[:-1]) * 1024 * 1024
|
||||
|
@ -226,7 +226,7 @@ def resize_image(args, img_size_new, img_path):
|
|||
img_size_new_bytes = img_size_new_bytes * 1024
|
||||
|
||||
if (img_size_new_bytes >= img_size):
|
||||
logging.info("Setting the system image size to " + img_size_new)
|
||||
logging.info("Setting the rootfs size to " + img_size_new)
|
||||
pmb.helpers.run.root(args, ["truncate", "-s", img_size_new, img_path])
|
||||
else:
|
||||
# Convert to human-readable format
|
||||
|
@ -236,7 +236,7 @@ def resize_image(args, img_size_new, img_path):
|
|||
# this example, they would need to use a size greater then 1280M instead.
|
||||
img_size_str = str(round(img_size / 1024 / 1024)) + "M"
|
||||
|
||||
raise RuntimeError("The system image size must be " + img_size_str + " or greater")
|
||||
raise RuntimeError("The rootfs size must be " + img_size_str + " or greater")
|
||||
|
||||
|
||||
def sigterm_handler(number, frame):
|
||||
|
@ -274,16 +274,16 @@ def run(args):
|
|||
qemu, env = command_qemu(args, arch, device, img_path, spice_enabled)
|
||||
|
||||
# Workaround: Qemu runs as local user and needs write permissions in the
|
||||
# system image, which is owned by root
|
||||
# rootfs, which is owned by root
|
||||
if not os.access(img_path, os.W_OK):
|
||||
pmb.helpers.run.root(args, ["chmod", "666", img_path])
|
||||
|
||||
# Resize the system image (or show hint)
|
||||
# Resize the rootfs (or show hint)
|
||||
if args.image_size:
|
||||
resize_image(args, args.image_size, img_path)
|
||||
else:
|
||||
logging.info("NOTE: Run 'pmbootstrap qemu --image-size 2G' to set"
|
||||
" the system image size when you run out of space!")
|
||||
" the rootfs size when you run out of space!")
|
||||
|
||||
# SSH/telnet hints
|
||||
logging.info("Connect to the VM (telnet requires 'pmbootstrap initfs"
|
||||
|
|
|
@ -108,7 +108,7 @@ class Qemu(object):
|
|||
pmb.chroot.apk.install(args, ["openssh-client"])
|
||||
ssh_create_askpass_script(args)
|
||||
|
||||
# Create and run system image
|
||||
# Create and run rootfs
|
||||
pmbootstrap_yes(args, config, ["install", "--no-fde"])
|
||||
self.process = pmbootstrap_run(args, config, ["qemu", "--display",
|
||||
"none"], "background")
|
||||
|
|
Loading…
Reference in New Issue