From 0d7802d7ef95e464dfe0fcef8fde23b48dd0376d Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 15 Jul 2018 23:41:31 +0200 Subject: [PATCH] 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). --- README.md | 4 ++-- aports/main/postmarketos-mkinitfs/APKBUILD | 6 ++--- .../postmarketos-mkinitfs/init_functions.sh | 4 ++-- aports/main/postmarketos-mkinitfs/mkinitfs.sh | 2 +- pmb/config/__init__.py | 4 ++-- pmb/export/symlinks.py | 2 +- pmb/flasher/frontend.py | 10 ++++----- pmb/install/_install.py | 4 ++-- pmb/parse/arguments.py | 4 ++-- pmb/qemu/run.py | 22 +++++++++---------- test/test_qemu_running_processes.py | 2 +- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 452c3a59..777e0d3c 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/aports/main/postmarketos-mkinitfs/APKBUILD b/aports/main/postmarketos-mkinitfs/APKBUILD index 7e2ec86d..a55b7d4c 100644 --- a/aports/main/postmarketos-mkinitfs/APKBUILD +++ b/aports/main/postmarketos-mkinitfs/APKBUILD @@ -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" diff --git a/aports/main/postmarketos-mkinitfs/init_functions.sh b/aports/main/postmarketos-mkinitfs/init_functions.sh index 909a6b45..2c7ab3be 100644 --- a/aports/main/postmarketos-mkinitfs/init_functions.sh +++ b/aports/main/postmarketos-mkinitfs/init_functions.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 diff --git a/aports/main/postmarketos-mkinitfs/mkinitfs.sh b/aports/main/postmarketos-mkinitfs/mkinitfs.sh index fc85b22e..61c8ee97 100644 --- a/aports/main/postmarketos-mkinitfs/mkinitfs.sh +++ b/aports/main/postmarketos-mkinitfs/mkinitfs.sh @@ -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" diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 53f3ba25..3e4818ef 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -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 diff --git a/pmb/export/symlinks.py b/pmb/export/symlinks.py index 4da6a157..0e93495b 100644 --- a/pmb/export/symlinks.py +++ b/pmb/export/symlinks.py @@ -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 diff --git a/pmb/flasher/frontend.py b/pmb/flasher/frontend.py index b2917121..65e47790 100644 --- a/pmb/flasher/frontend.py +++ b/pmb/flasher/frontend.py @@ -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") diff --git a/pmb/install/_install.py b/pmb/install/_install.py index b0d9c264..9b29fdef 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -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" diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index e96a450c..19225625 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -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") diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index e793a77a..a8639557 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -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" diff --git a/test/test_qemu_running_processes.py b/test/test_qemu_running_processes.py index fa4d04dd..011eb3ac 100644 --- a/test/test_qemu_running_processes.py +++ b/test/test_qemu_running_processes.py @@ -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")