This repository was archived by the owner on Feb 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed
Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ section.
4040
4141Host:
4242A machine running recent Ubuntu or Debian, with 4GB of memory and 4GB free space.
43- Host needs the debootstrap and qemu-user-static packages. To install
44- these, run ` sudo apt-get install debootstrap qemu-user-static ` .
43+ Host needs the debootstrap, fakeroot and qemu-user-static packages. To install
44+ these, run ` sudo apt-get install debootstrap fakeroot qemu-user-static ` .
4545Other distributions may work but they are not tested.
4646
4747Quick Start Instructions
@@ -157,5 +157,9 @@ example for x86_64 architecture, run:
157157```
158158adeb prepare --build --arch amd64 --bcc --kernelsrc /path/to/kernel-source/
159159```
160+ Normally you want to use --foreign too, especially if your distro's glibc
161+ version does not match the --distro option. This mode eliminates the need
162+ for root (chroot) or qemu-debootstrap, but it does cause more setup to be
163+ done on the device side the first time you enter adeb.
160164Note: The --download option ignores the --arch flag. This is because we only
161165provide pre-built filesystems for ARM64 at the moment.
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ FULL=0 # Default to a minimal install
1717DOWNLOAD=1 # Default to downloading from web
1818SKIP_DEVICE=0 # Skip device preparation
1919INSTALL_BCC=0 # Decide if BCC is to be installed
20+ FOREIGN=0 # Use debootstrap --foreign mode
2021
2122# Default packages
2223PACKAGES=" "
@@ -52,6 +53,7 @@ case $key in
5253 --full) FULL=1; config_full_build; shift || true ; ;;
5354 --arch) ARCH=$2 ; shift || true ; shift || true ; ;;
5455 --distro) DISTRO=" $2 " ; shift || true ; shift || true ; ;;
56+ --foreign) FOREIGN=1; shift || true ; ;;
5557 --archive) TARF=$2 ; shift || true ; shift || true ; ;;
5658 --bcc) source $spath /packages/bcc; shift || true ; ;;
5759 --kernelsrc) KERNELSRC=" $2 " ; shift || true ; shift || true ; ;;
@@ -301,7 +303,7 @@ c_info "Using temporary directory: $TDIR"
301303ex_files=$( mktemp) ; echo $EXTRA_FILES > $ex_files
302304
303305$spath /buildstrap $ARCH $DISTRO $TDIR $OUT_TMP " $PACKAGES " \
304- $ex_files $INSTALL_BCC $SKIP_DEVICE $MIRROR
306+ $ex_files $INSTALL_BCC $SKIP_DEVICE $MIRROR $FOREIGN
305307rm $ex_files
306308
307309# If we only wanted to prepare a rootfs and don't have
Original file line number Diff line number Diff line change @@ -13,14 +13,20 @@ EXTRA_FILES="$(cat $6)"
1313INSTALL_BCC=$7
1414SKIP_DEVICE=$8 # Skip any device-specific stages
1515MIRROR=$9
16+ shift
17+ FOREIGN=$9
1618VARIANT=" --variant=minbase"
1719
18- root=sudo
19-
20- if [ $EUID -ne 0 ]; then echo " The next stage runs as sudo, please enter password if asked." ; fi
20+ if [ $FOREIGN -eq 1 ]; then
21+ debootstrap=" debootstrap --foreign"
22+ root=fakeroot
23+ else
24+ if [ $EUID -ne 0 ]; then echo " The next stage runs as sudo, please enter password if asked." ; fi
25+ debootstrap=qemu-debootstrap
26+ root=sudo
27+ fi
2128
22- # It's easier to just really be root for debootstrap
23- time $root qemu-debootstrap --arch $ARCH --include=$PACKAGES $VARIANT \
29+ time $root $debootstrap --arch $ARCH --include=$PACKAGES $VARIANT \
2430 $DISTRO $OUT_TMP $MIRROR
2531
2632# Some reason debootstrap leaves these mounted
6369fi
6470
6571# Add a default DNS server
66- $root tee -a $OUT_TMP /etc/resolv.conf > /dev/null << EOF
72+ $root tee $OUT_TMP /etc/resolv.conf > /dev/null << EOF
6773nameserver 4.2.2.2
6874EOF
6975
You can’t perform that action at this time.
0 commit comments