forked from systemd/systemd
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
homework: support creating a home for a specified partition
This commit enable homework-luks to create a user home partition on an existing partition. This allows us to have multiple user home partitions on a single disk, or share user home partitions with the system partitions. This commit address systemd#15273 for "vanilla" partitions Partitions on LVM have not been tested. This works by getting the parent block device of the selected partition, and if it has a GPT partition table, edit the partition table entry and format the partition as a per-user home partition. Testing: ``` $ sudo mkosi --force build [...] $ truncate -s 16G ./mkosi.output/arch~rolling/image.raw && sfdisk -a ./mkosi.output/arch~rolling/image.raw <<EOF label: gpt device: /dev/sda unit: sectors sector-size: 512 /dev/sda3 : size=8G, uuid=$(systemd-id128 new -u), name=test EOF $ sudo mkosi qemu [...] [root@archlinux ~]# NEWPASSWORD=APassword111 homectl create user1 --storage=luks --image-path=/dev/sda3 --fs-type=ext4 # Testing with ext4 because of systemd#22255 [root@archlinux ~]# homectl activate user1 [root@archlinux ~]# su user1 [user1@archlinux root]$ cd [user1@archlinux ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 16G 0 disk ├─sda1 8:1 0 256M 0 part ├─sda2 8:2 0 3G 0 part / └─sda3 8:3 0 8G 0 part └─home-user1 254:0 0 8G 0 crypt /home/user1 ```
- Loading branch information
Showing
2 changed files
with
116 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters