Commit Graph

18 Commits

Author SHA1 Message Date
Oliver Smith 6f6a3b0408
Happy new year 2022! 2022-01-02 22:39:14 +01:00
Newbyte 2d23849aa3
pmb, test: remove redundant commas (MR 2115) 2021-09-26 17:58:40 +02:00
Shubham Naik 87c7859b40
Enforce E501: Limit the line length to 79 for files in pmb/install (MR 2031)
Made changes to limit the line length in following files for #1986,
 - pmb/install/_install.py
 - pmb/install/blockdevice.py
 - pmb/install/losetup.py
 - pmb/install/partition.py

Added the above files in E501 flake8 command list.
Substitute f-string for string concatenation.
2021-03-30 14:51:53 +02:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
Daniele Debernardi d3dc3b2c98
pmb.chroot.shutdown: losetup with auto_init=False (MR 1912)
Do not go through the pmb.chroot.init() code path when running
pmb.install.losetup.umount() inside pmb.chroot.shutdown(). This is not
necessary, as pmb.install.losetup.umount() only gets called if the
chroot is already initialized and /dev/loop-control is mounted inside
the chroot.

Not going through this code path is important for the upcoming workdir
migration patch. Without this fix, it will fail with the following if
running "pmbootstrap install" before the work migration:

ERROR: Could not figure out on which release channel the 'native' chroot is
2020-05-17 08:08:45 +02:00
Oliver Smith f21c216a26
Cosmetic: use SPDX license header (!1877)
While at it, also remove unnecessary "#!/usr/bin/env python3" in files
that only get imported, and adjust other empty/comment lines in the
beginnings of the files for consistency.

This makes files easier to read, and makes the pmbootstrap codebase more
consistent with the build.postmarketos.org codebase.
2020-02-24 03:11:10 +03:00
Minecrell f43d552039
pmb.helpers.mount: Rename bind_blockdevice() to bind_file() (!1861)
bind_blockdevice() can be also used to mount --bind files,
rename it to bind_file().
2020-01-26 19:47:28 +01:00
Oliver Smith 948e3f931f
Change copyright to 2020 2020-01-06 02:43:00 +01:00
Oliver Smith f16bdaf0ca
Update copyright to 2019
Happy new year \o/
2019-01-02 09:31:20 +01:00
Zhuowei Zhang 1efe288fe2
losetup: support building rootfs images with 4096 byte sector sizes (!1725)
Adds an optional deviceinfo variable, `deviceinfo_rootfs_image_sector_size`,
which specifies the logical sector size of the device's storage.

Some devices made after 2016 with UFS storage uses 4096 byte sectors
instead of the normal 512 bytes. The partition table in our rootfs
must match, otherwise the root filesystem won't mount on the device.

This change passes the sector size to `losetup` when creating the image
if the deviceinfo specifies it, so the image will have the correct
sector size.

If the deviceinfo doesn't specify the new option, the behaviour
is the same as previous versions of pmbootstrap.

Note that the sector size option only works on Linux 4.14 and above,
so pmbootstrap should be run on a >4.14 computer when installing to
devices with non-standard sector size.

To find if a device needs this parameter, run `fdisk -l` on the device.
If the output shows

`Note: sector size is 4096 (not 512)`

then add `deviceinfo_rootfs_image_sector_size="4096"` to the deviceinfo.

This is needed by the Pixel 3 XL (google-crosshatch) port.

See https://gitlab.com/postmarketOS/pmbootstrap/issues/1696.
2018-12-11 09:08:12 +01:00
Oliver Smith d53550cdc6 pmb: give loop module time to initialize 2018-08-27 21:14:48 +00:00
Oliver Smith 8268dc0e3d pmbootstrap: kill process if silent for 5 minutes (rewrite logging) 2018-07-14 01:13:28 +00:00
Oliver Smith 7750c1dd40
Happy new year! (update copyright to 2018) 2018-01-04 04:53:35 +01:00
clayton craft 4204a86992 Fix #673: Only load loop module if it is not already loaded in the kernel (#675)
This checks for /sys/modules/loop before modprobing the loop module. My
understanding is that if this module is built into the kernel, that this
directory is still created. For a kernel without loop built in,
losetup.py will try to load the module using modprobe.
2017-10-02 21:53:01 +00:00
Brian Otto 41d6a002dd Fix #501: Always load the loop module so losetup can access the img file (#528) 2017-09-07 17:07:52 +00:00
clayton craft 3800cd09f4 Do not modprobe loop if /dev/loop* exists (#391) 2017-08-15 18:10:04 +00:00
cmdr2 2afe205243 Ignore directories while searching for loop devices (#235)
Thanks, cmdr2! Here's the text from his PR:

Fixes an issue on alpine-vanilla, where `/dev/loop` is a directory (containing `/dev/loop/0`, `/dev/loop/1` ..etc), and causes `./pmbootstrap install` to fail.

Ignoring the `/dev/loop` directory works because `/dev/` also contains files named `/dev/loop0`, `/dev/loop1` ..etc, which the new code will still pick up.

The `install` command passes after this fix on my alpine-vanilla.
2017-07-23 12:24:56 +00:00
Oliver Smith ae950fb9f7
Hello, there! 2017-05-26 22:08:45 +02:00