pmbootstrap chroot --install-blockdev: new option (MR 1946)
Create /dev/install inside the chroot from a block device, just like done during the installation. This is useful for testing the Calamares installer.
This commit is contained in:
parent
00691a56ee
commit
63fc2b621a
|
@ -25,6 +25,7 @@ import pmb.helpers.run
|
||||||
import pmb.helpers.aportupgrade
|
import pmb.helpers.aportupgrade
|
||||||
import pmb.helpers.status
|
import pmb.helpers.status
|
||||||
import pmb.install
|
import pmb.install
|
||||||
|
import pmb.install.blockdevice
|
||||||
import pmb.parse
|
import pmb.parse
|
||||||
import pmb.qemu
|
import pmb.qemu
|
||||||
|
|
||||||
|
@ -132,6 +133,13 @@ def chroot(args):
|
||||||
env["DISPLAY"] = os.environ.get("DISPLAY")
|
env["DISPLAY"] = os.environ.get("DISPLAY")
|
||||||
env["XAUTHORITY"] = "/home/pmos/.Xauthority"
|
env["XAUTHORITY"] = "/home/pmos/.Xauthority"
|
||||||
|
|
||||||
|
# Install blockdevice
|
||||||
|
if args.install_blockdev:
|
||||||
|
size_boot = 128 * 1024 * 1024 # 128 MiB
|
||||||
|
size_root = 4096 * 1024 * 1024 # 4 GiB
|
||||||
|
pmb.install.blockdevice.create_and_mount_image(args, size_boot,
|
||||||
|
size_root)
|
||||||
|
|
||||||
# Run the command as user/root
|
# Run the command as user/root
|
||||||
if args.user:
|
if args.user:
|
||||||
logging.info("(" + suffix + ") % su pmos -c '" +
|
logging.info("(" + suffix + ") % su pmos -c '" +
|
||||||
|
|
|
@ -497,6 +497,10 @@ def arguments():
|
||||||
help="Copy .Xauthority and set environment variables,"
|
help="Copy .Xauthority and set environment variables,"
|
||||||
" so X11 applications can be started (native"
|
" so X11 applications can be started (native"
|
||||||
" chroot only)")
|
" chroot only)")
|
||||||
|
chroot.add_argument("-i", "--install-blockdev", action="store_true",
|
||||||
|
help="Create a sparse image file and mount it as"
|
||||||
|
" /dev/install, just like during the"
|
||||||
|
" installation process.")
|
||||||
for action in [build_init, chroot]:
|
for action in [build_init, chroot]:
|
||||||
suffix = action.add_mutually_exclusive_group()
|
suffix = action.add_mutually_exclusive_group()
|
||||||
if action == chroot:
|
if action == chroot:
|
||||||
|
|
Loading…
Reference in New Issue