Terminate implementation of metadata in fickit
This commit is contained in:
parent
a5699b6cce
commit
89d687cd94
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
mkdir -p /boot/imgs
|
mkdir -p /boot/imgs
|
||||||
|
|
||||||
for img in fickit-kernel fickit-metadata fickit-boot-initrd.img fickit-frontend-squashfs.img fickit-backend-squashfs.img fickit-update-initrd.img
|
for img in fickit-kernel fickit-metadata.iso fickit-boot-initrd.img fickit-frontend-squashfs.img fickit-backend-squashfs.img fickit-update-initrd.img
|
||||||
do
|
do
|
||||||
wget -O "/boot/imgs/${img}" "$1/${img}"
|
wget -O "/boot/imgs/${img}" "$1/${img}"
|
||||||
done
|
done
|
||||||
|
@ -23,23 +23,19 @@ onboot:
|
|||||||
- /etc/sysctl.d/01-fic.conf:/etc/sysctl.d/01-fic.conf:ro
|
- /etc/sysctl.d/01-fic.conf:/etc/sysctl.d/01-fic.conf:ro
|
||||||
|
|
||||||
# Metadata
|
# Metadata
|
||||||
- name: metadata-mount
|
|
||||||
image: linuxkit/mount:f671cb94a8999a65e33b3fe79f3def58e3d58b07
|
|
||||||
command: ["/usr/bin/mountie", "-device", "/dev/sda1", "/boot" ]
|
|
||||||
- name: metadata
|
- name: metadata
|
||||||
image: linuxkit/metadata:501144d47215671e77b9cac44748a04f21236195
|
image: linuxkit/metadata:501144d47215671e77b9cac44748a04f21236195
|
||||||
command: ["/usr/bin/metadata", "-v", "file=/fickit-metadata"]
|
command: ["/usr/bin/metadata", "-v"]
|
||||||
binds:
|
|
||||||
- /boot/fickit-metadata:/fickit-metadata:ro
|
|
||||||
|
|
||||||
# Filesystem
|
# Filesystem
|
||||||
- name: swap
|
- name: swap
|
||||||
image: linuxkit/swap:d17a7f1c26ff768c26b3c206ccf3aa72349568df
|
image: linuxkit/swap:d17a7f1c26ff768c26b3c206ccf3aa72349568df
|
||||||
command: ["/sbin/swapon", "/dev/sda2"]
|
command: ["/sbin/swapon", "/dev/sda3"]
|
||||||
- name: dm-crypt
|
- name: dm-crypt
|
||||||
image: linuxkit/dm-crypt:526d32351c8246431be8e1a168cb514ff3c365af
|
image: linuxkit/dm-crypt:526d32351c8246431be8e1a168cb514ff3c365af
|
||||||
command: ["/usr/bin/crypto", "-l", "crypt_fic", "/dev/sda3"]
|
command: ["/usr/bin/crypto", "-l", "crypt_fic", "/dev/sda4"]
|
||||||
binds:
|
binds:
|
||||||
|
- /dev:/dev
|
||||||
- /run/config/dm-crypt:/etc/dm-crypt
|
- /run/config/dm-crypt:/etc/dm-crypt
|
||||||
- name: mount
|
- name: mount
|
||||||
image: linuxkit/mount:f671cb94a8999a65e33b3fe79f3def58e3d58b07
|
image: linuxkit/mount:f671cb94a8999a65e33b3fe79f3def58e3d58b07
|
||||||
|
@ -22,23 +22,19 @@ onboot:
|
|||||||
image: linuxkit/sysctl:a88a50c104d538b58da5e1441f6f0b4b738f76a6
|
image: linuxkit/sysctl:a88a50c104d538b58da5e1441f6f0b4b738f76a6
|
||||||
|
|
||||||
# Metadata
|
# Metadata
|
||||||
- name: metadata-mount
|
|
||||||
image: linuxkit/mount:f671cb94a8999a65e33b3fe79f3def58e3d58b07
|
|
||||||
command: ["/usr/bin/mountie", "-device", "/dev/sda1", "/boot" ]
|
|
||||||
- name: metadata
|
- name: metadata
|
||||||
image: linuxkit/metadata:501144d47215671e77b9cac44748a04f21236195
|
image: linuxkit/metadata:501144d47215671e77b9cac44748a04f21236195
|
||||||
command: ["/usr/bin/metadata", "-v", "file=/fickit-metadata"]
|
command: ["/usr/bin/metadata", "-v"]
|
||||||
binds:
|
|
||||||
- /boot/fickit-metadata:/fickit-metadata:ro
|
|
||||||
|
|
||||||
# Filesystem
|
# Filesystem
|
||||||
- name: swap
|
- name: swap
|
||||||
image: linuxkit/swap:d17a7f1c26ff768c26b3c206ccf3aa72349568df
|
image: linuxkit/swap:d17a7f1c26ff768c26b3c206ccf3aa72349568df
|
||||||
command: ["/sbin/swapon", "/dev/sda2"]
|
command: ["/sbin/swapon", "/dev/sda3"]
|
||||||
- name: dm-crypt
|
- name: dm-crypt
|
||||||
image: linuxkit/dm-crypt:526d32351c8246431be8e1a168cb514ff3c365af
|
image: linuxkit/dm-crypt:526d32351c8246431be8e1a168cb514ff3c365af
|
||||||
command: ["/usr/bin/crypto", "-l", "crypt_fic", "/dev/sda3"]
|
command: ["/usr/bin/crypto", "-l", "crypt_fic", "/dev/sda4"]
|
||||||
binds:
|
binds:
|
||||||
|
- /dev:/dev
|
||||||
- /run/config/dm-crypt:/etc/dm-crypt
|
- /run/config/dm-crypt:/etc/dm-crypt
|
||||||
- name: mount
|
- name: mount
|
||||||
image: linuxkit/mount:f671cb94a8999a65e33b3fe79f3def58e3d58b07
|
image: linuxkit/mount:f671cb94a8999a65e33b3fe79f3def58e3d58b07
|
||||||
@ -225,7 +221,7 @@ services:
|
|||||||
binds:
|
binds:
|
||||||
- /etc/hosts:/etc/hosts:ro
|
- /etc/hosts:/etc/hosts:ro
|
||||||
- /var/lib/fic/ssh:/etc/ssh:ro
|
- /var/lib/fic/ssh:/etc/ssh:ro
|
||||||
- /run/config/ssh/authorized_keys:/root/.ssh/authorized_keys:ro
|
- /run/config/synchro/id_ed25519.pub:/root/.ssh/authorized_keys:ro
|
||||||
- /var/lib/fic/files:/srv/FILES
|
- /var/lib/fic/files:/srv/FILES
|
||||||
- /var/lib/fic/pki:/srv/PKI
|
- /var/lib/fic/pki:/srv/PKI
|
||||||
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST
|
- /var/lib/fic/settingsdist:/srv/SETTINGSDIST
|
||||||
|
@ -37,14 +37,16 @@ files:
|
|||||||
if [ -b /dev/sdb ]; then
|
if [ -b /dev/sdb ]; then
|
||||||
DISKS="/dev/sda /dev/sdb"
|
DISKS="/dev/sda /dev/sdb"
|
||||||
BOOT_PART=/dev/md2
|
BOOT_PART=/dev/md2
|
||||||
|
META_PART=/dev/md3
|
||||||
SWAP_PART=/dev/md1
|
SWAP_PART=/dev/md1
|
||||||
ROOT_PART=/dev/md0
|
ROOT_PART=/dev/md0
|
||||||
RAID=1
|
RAID=1
|
||||||
else
|
else
|
||||||
DISKS="/dev/sda"
|
DISKS="/dev/sda"
|
||||||
BOOT_PART=/dev/sda1
|
BOOT_PART=/dev/sda1
|
||||||
SWAP_PART=/dev/sda2
|
META_PART=/dev/sda2
|
||||||
ROOT_PART=/dev/sda3
|
SWAP_PART=/dev/sda3
|
||||||
|
ROOT_PART=/dev/sda4
|
||||||
RAID=0
|
RAID=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -52,8 +54,9 @@ files:
|
|||||||
udhcpc -i eth0
|
udhcpc -i eth0
|
||||||
|
|
||||||
# Retrieve metadata
|
# Retrieve metadata
|
||||||
wget -O /tmp/metadata.json "$(ip r | grep default | awk '{ print $3 }')/fickit-metadata"
|
wget -O /tmp/metadata.iso "$(ip r | grep default | awk '{ print $3 }')/fickit-metadata.iso"
|
||||||
/usr/bin/metadata -v file=/tmp/metadata.json
|
mount /tmp/metadata.iso /mnt
|
||||||
|
/usr/bin/metadata -v file=/mnt/user-data
|
||||||
|
|
||||||
# Try to detect backend/frontend setup
|
# Try to detect backend/frontend setup
|
||||||
if ip l | grep eth3 > /dev/null
|
if ip l | grep eth3 > /dev/null
|
||||||
@ -90,8 +93,9 @@ files:
|
|||||||
# Create RAID arrays
|
# Create RAID arrays
|
||||||
if [ "${RAID}" -eq 1 ]; then
|
if [ "${RAID}" -eq 1 ]; then
|
||||||
/sbin/mdadm --create "${BOOT_PART}" --run --level=1 --metadata=1.0 --raid-devices=2 /dev/sda1 /dev/sdb1
|
/sbin/mdadm --create "${BOOT_PART}" --run --level=1 --metadata=1.0 --raid-devices=2 /dev/sda1 /dev/sdb1
|
||||||
/sbin/mdadm --create "${SWAP_PART}" --run --level=1 --metadata=1.1 --raid-devices=2 /dev/sda2 /dev/sdb2
|
/sbin/mdadm --create "${META_PART}" --run --level=1 --metadata=1.1 --raid-devices=2 /dev/sda2 /dev/sdb2
|
||||||
/sbin/mdadm --create "${ROOT_PART}" --run --level=1 --metadata=0 --raid-devices=2 /dev/sda3 /dev/sdb3
|
/sbin/mdadm --create "${SWAP_PART}" --run --level=1 --metadata=1.1 --raid-devices=2 /dev/sda3 /dev/sdb3
|
||||||
|
/sbin/mdadm --create "${ROOT_PART}" --run --level=1 --metadata=0 --raid-devices=2 /dev/sda4 /dev/sdb4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Format partitions
|
# Format partitions
|
||||||
@ -111,6 +115,7 @@ files:
|
|||||||
/root/install_grub ${DEFAULT_BOOT} "${DISK}"
|
/root/install_grub ${DEFAULT_BOOT} "${DISK}"
|
||||||
done
|
done
|
||||||
/root/update_imgs "$(ip r | grep default | awk '{ print $3 }')"
|
/root/update_imgs "$(ip r | grep default | awk '{ print $3 }')"
|
||||||
|
dd if=/boot/imgs/fickit-metadata.iso of=${META_PART}
|
||||||
} ||
|
} ||
|
||||||
/bin/ash
|
/bin/ash
|
||||||
|
|
||||||
@ -217,6 +222,7 @@ files:
|
|||||||
- path: etc/sfdisk_schema
|
- path: etc/sfdisk_schema
|
||||||
contents: |
|
contents: |
|
||||||
,500M,U,*
|
,500M,U,*
|
||||||
|
,10M,L,-
|
||||||
,4M,S,-
|
,4M,S,-
|
||||||
,+,R,-
|
,+,R,-
|
||||||
mode: "0440"
|
mode: "0440"
|
||||||
|
Loading…
Reference in New Issue
Block a user