File: create-rootfs.sh

package info (click to toggle)
ben 1.15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 676 kB
  • sloc: ml: 4,125; sh: 345; javascript: 78; ansic: 39; makefile: 29; python: 18
file content (31 lines) | stat: -rwxr-xr-x 753 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

set -e

BASE="$PWD"

. ben/env.sh

cat > ben/rebuilt.list <<EOF
deb [trusted=yes] file:///rebuilt ./
EOF

cat > ben/rebuilt.pref <<EOF
Package: *
Pin: release a=$SUITE
Pin-Priority: 1000
EOF

cat > ben/sbuild.conf <<EOF
\$chroot_mode = 'unshare';
\$chroot = '$BASE/ben/rootfs.tar.zst';
\$unshare_bind_mounts = [ { directory => "$BASE/pool", mountpoint => "/rebuilt" } ];
\$run_lintian = 0;
EOF

mmdebstrap --variant=buildd "$BASE_SUITE" \
  --components="main contrib non-free non-free-firmware" \
  --customize-hook='chroot "$1" mkdir /rebuilt' \
  --customize-hook="copy-in $BASE/ben/rebuilt.list /etc/apt/sources.list.d" \
  --customize-hook="copy-in $BASE/ben/rebuilt.pref /etc/apt/preferences.d" \
  "$BASE/ben/rootfs.tar.zst" "$MIRROR"