Add lftp, test partitioning

This commit is contained in:
jalr 2018-02-11 18:08:19 +01:00
parent a2f98a5e68
commit adc20fe055
2 changed files with 49 additions and 1 deletions

View file

@ -3,7 +3,10 @@ FROM debian:stretch
RUN apt-get update \
&& apt-get -y install \
initramfs-tools \
linux-image-amd64
linux-image-amd64 \
lftp
COPY imagesync.sh /etc/initramfs-tools/scripts/local-premount/
RUN echo 'RESUME=none' > /etc/initramfs-tools/conf.d/resume \
&& mkinitramfs -o /tmp/initrd.gz $(find /boot -name 'vmlinuz-*' -printf '%f\n' | sed 's/^vmlinuz-//')

45
imagesync.sh Executable file
View file

@ -0,0 +1,45 @@
#!/bin/sh
PREREQ=""
prereqs()
{
echo "$PREREQ"
. /usr/share/initramfs-tools/hook-functions
copy_exec /usr/bin/lftp
copy_exec /usr/sbin/sfdisk
copy_exec /usr/sbin/mke2fs
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
disk=/dev/sda
sfdisk -J /dev/sda << PARTTABLE
{
"partitiontable": {
"label": "dos",
"id": "0x2708bc46",
"device": "/dev/sda",
"unit": "sectors",
"partitions": [
{"node": "/dev/sda1", "start": 2048, "size": 497664, "type": "83", "bootable": true},
]
}
}
PARTTABLE
mke2fs -t ext4 ${disk}1
mount ${disk}1 /root
/usr/bin/lftp --help
ls /usr/bin
sleep 3600