Revision 5a31f7ef snf-image-host/snf-image-update-helper.in
b/snf-image-host/snf-image-update-helper.in | ||
---|---|---|
65 | 65 |
else |
66 | 66 |
echo "not found" |
67 | 67 |
echo "Debootstraping to create a new root filesystem:" |
68 |
|
|
69 |
# Create a policy-rc.d file to deny init script execution |
|
70 |
mkdir -p "$target/usr/sbin" |
|
71 |
cat > "$target/usr/sbin/policy-rc.d" <<EOF |
|
72 |
#!/bin/sh |
|
73 |
exit 101 |
|
74 |
EOF |
|
75 |
chmod +x "$target/usr/sbin/policy-rc.d" |
|
76 |
|
|
68 | 77 |
debootstrap --arch amd64 --include "$HELPER_EXTRA_PKGS" \ |
69 |
--variant=minbase stable "$target" 2>&1 | sed -e 's/^/DEBOOTSTRAP: /g' |
|
78 |
--variant=minbase stable "$target" "$HELPER_MIRROR" 2>&1 | sed -e 's/^/DEBOOTSTRAP: /g'
|
|
70 | 79 |
|
80 |
rm "$target/usr/sbin/policy-rc.d" |
|
81 |
|
|
71 | 82 |
# remove the downloaded debs, as they are no longer needed |
72 | 83 |
find "$target/var/cache/apt/archives" -type f -name '*.deb' -print0 | \ |
73 | 84 |
xargs -r0 rm -f |
74 | 85 |
|
75 | 86 |
tmp_cache=$(mktemp "$HELPER_CACHE_FILE.XXXXXX") |
76 |
tar cf "$tmp_cache" -C "$target" . || { rm "$tmp_cache"; false; } |
|
87 |
tar cf "$tmp_cache" --one-file-system -C "$target" . || { rm "$tmp_cache"; false; }
|
|
77 | 88 |
mv -f "$tmp_cache" "$HELPER_CACHE_FILE" |
78 | 89 |
fi |
79 | 90 |
|
Also available in: Unified diff