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