dmsquash-live: add dmsquash-generator
[dracut.git] / test / TEST-03-USR-MOUNT / create-root.sh
blob66907e8b97857703e7aee263d72537248bf7bcf3
1 #!/bin/sh
2 # don't let udev and this script step on eachother's toes
3 for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
4 > "/etc/udev/rules.d/$x"
5 done
6 rm -f -- /etc/lvm/lvm.conf
7 udevadm control --reload
8 set -e
9 # save a partition at the beginning for future flagging purposes
10 sfdisk /dev/sda <<EOF
11 ,1M
13 EOF
15 sfdisk /dev/sdb <<EOF
16 ,1M
18 EOF
20 udevadm settle
21 modprobe btrfs
22 mkfs.btrfs -L dracut /dev/sda2
23 mkfs.btrfs -L dracutusr /dev/sdb2
24 btrfs device scan /dev/sda2
25 btrfs device scan /dev/sdb2
26 mkdir -p /root
27 mount -t btrfs /dev/sda2 /root
28 [ -d /root/usr ] || mkdir /root/usr
29 mount -t btrfs /dev/sdb2 /root/usr
30 btrfs subvolume create /root/usr/usr
31 umount /root/usr
32 mount -t btrfs -o subvol=usr /dev/sdb2 /root/usr
33 cp -a -t /root /source/*
34 mkdir -p /root/run
35 umount /root/usr
36 umount /root
37 echo "dracut-root-block-created" >/dev/sda1
38 sync
39 poweroff -f