1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
raspberrypi-build/stage0/prerun.sh

17 lines
464 B
Bash
Raw Normal View History

2016-04-11 07:29:41 +01:00
#!/bin/bash -e
2017-07-02 12:51:19 +00:00
if [ ! -d "$ROOTFS_DIR" ]; then
ARCH="$(dpkg --print-architecture)"
2017-07-02 12:47:15 +00:00
if [ "$ARCH" != 'armhf' ]; then
2017-07-02 12:51:19 +00:00
BOOTSTRAP_CMD='qemu-debootstrap'
2017-07-02 12:44:47 +00:00
else
2017-07-02 12:51:19 +00:00
BOOTSTRAP_CMD='debootstrap'
2017-07-02 12:44:47 +00:00
fi
2017-07-02 12:47:15 +00:00
capsh --drop=cap_setfcap -- -c "$BOOTSTRAP_CMD --components=main,contrib,non-free \
2017-07-02 12:44:47 +00:00
--arch armhf \
2017-07-02 12:51:19 +00:00
--keyring $STAGE_DIR/files/raspberrypi.gpg \
jessie $ROOTFS_DIR http://mirrordirector.raspbian.org/raspbian/" || rmdir "$ROOTFS_DIR/debootstrap"
2016-04-11 07:29:41 +01:00
fi