Commit Graph

9 Commits

Author SHA1 Message Date
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