File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # From https://github.com/virt-do/kaps/blob/main/hack/mkbundle.sh
2+
3+ # The URL of a container image archive should be supplied in parameter
4+ # Example with alpine : https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-minirootfs-3.14.2-x86_64.tar.gz
5+ if [[ $# -ne 1 ]]; then
6+ echo " Missing container image URL"
7+ exit 1
8+ fi
9+
10+ DEST=" ctr-bundle"
11+ IMAGE_ARCHIVE_URL=$1
12+ IMAGE_ARCHIVE_NAME=" imageArchive"
13+
14+ rm -rf $DEST $IMAGE_ARCHIVE_NAME && mkdir -p " $DEST " /rootfs
15+
16+ # Download and untar the image
17+ curl -sSL $IMAGE_ARCHIVE_URL -o $IMAGE_ARCHIVE_NAME
18+ tar xf $IMAGE_ARCHIVE_NAME -C " $DEST " /rootfs
19+ rm $IMAGE_ARCHIVE_NAME
20+
21+ pushd " $DEST " > /dev/null
22+ # Generate a runtime spec
23+ runc spec --rootless
24+ popd > /dev/null
Original file line number Diff line number Diff line change 99 git clone --depth 1 " https://github.com/cloud-hypervisor/linux.git" -b " ch-5.14" $LINUX_REPO
1010fi
1111
12- pushd $LINUX_REPO
12+ pushd $LINUX_REPO > /dev/null
1313pwd
1414wget -qO .config $CONFIG_URL
1515make bzImage -j ` nproc`
16- popd
16+ popd > /dev/null
Original file line number Diff line number Diff line change 1+ # From https://github.com/virt-do/lumper/blob/main/rootfs/mkrootfs.sh
2+
3+ DEST=" alpine-minirootfs"
4+ IMAGE_ARCHIVE_URL=" https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-minirootfs-3.14.2-x86_64.tar.gz"
5+ IMAGE_ARCHIVE_NAME=" imageArchive"
6+
7+ rm -rf $DEST $IMAGE_ARCHIVE_NAME && mkdir $DEST
8+
9+ # Download and untar the image
10+ curl -sSL $IMAGE_ARCHIVE_URL -o $IMAGE_ARCHIVE_NAME
11+ tar xf $IMAGE_ARCHIVE_NAME -C $DEST
12+ rm $IMAGE_ARCHIVE_NAME
13+
14+ pushd " $DEST " > /dev/null
15+ # Create an init file in the rootfs
16+ cat > init << EOF
17+ #! /bin/sh
18+ #
19+ # /init executable file in the initramfs
20+ #
21+ mount -t devtmpfs dev /dev
22+ mount -t proc proc /proc
23+ mount -t sysfs sysfs /sys
24+ ip link set up dev lo
25+
26+ exec /opt/kaps run --bundle /ctr-bundle
27+ poweroff -f
28+ EOF
29+
30+ chmod +x init
31+
32+ popd > /dev/null
33+
34+ # Here we do not create the rootfs image because we need to add some files in it later
You can’t perform that action at this time.
0 commit comments