]>
git.ipfire.org Git - thirdparty/dracut.git/blob - test/TEST-16-DMSQUASH/create-root.sh
3 trap 'poweroff -f' EXIT
5 # don't let udev and this script step on eachother's toes
6 for x
in 64-lvm.rules
70-mdadm.rules
99-mount-rules; do
7 : > "/etc/udev/rules.d/$x"
9 rm -f -- /etc
/lvm
/lvm.conf
10 udevadm control
--reload
15 # create a single partition using 50% of the capacity of the image file created by test_setup() in test.sh
16 sfdisk
/dev
/disk
/by-id
/ata-disk_root
<< EOF
22 mkfs.ext4
-q -L dracut
/dev
/disk
/by-id
/ata-disk_root-part1
24 mount
-t ext4
/dev
/disk
/by-id
/ata-disk_root-part1
/root
25 mkdir
-p /root
/run
/root
/testdir
26 cp -a -t /root
/source
/*
27 echo "Creating squashfs"
28 mksquashfs
/source /root
/testdir
/rootfs.img
-quiet
30 # Copy rootfs.img to the NTFS drive if exists
31 if [ -e "/dev/disk/by-id/ata-disk_root_ntfs" ]; then
32 mkfs.ntfs
-F -L dracut_ntfs
/dev
/disk
/by-id
/ata-disk_root_ntfs
34 mount
-t ntfs3
/dev
/disk
/by-id
/ata-disk_root_ntfs
/root_ntfs
35 mkdir
-p /root_ntfs
/run
/root_ntfs
/testdir
36 cp /root
/testdir
/rootfs.img
/root_ntfs
/testdir
/rootfs.img
40 echo "dracut-root-block-created" |
dd oflag
=direct
,dsync of
=/dev
/disk
/by-id
/ata-disk_marker