Add Ubuntu Base support, minimal python, python-scapy workaround#3
Add Ubuntu Base support, minimal python, python-scapy workaround#3adelva1984 wants to merge 3 commits intojoelagnel:masterfrom
Conversation
| MIRROR=http://archive.ubuntu.com/ubuntu/ | ||
| else | ||
| MIRROR=http://ports.ubuntu.com/; fi ;; | ||
| *) echo "Unusupported distro ($DISTRO)"; ;; |
There was a problem hiding this comment.
Could you change to "Warning: Untested distro ($DISTRO)" ?
| amd64) ;; | ||
| arm64) ;; | ||
| armhf) ;; | ||
| *) echo "Unsupported arch ($ARCH)"; ;; |
There was a problem hiding this comment.
Could you change to "Warning: untested arch ($ARCH)" ?
buildstrap
Outdated
| mkdir $OUT_TMP/dev; fi; fi | ||
|
|
||
| if [ $EUID -ne 0 ]; then echo "The next stage runs as sudo, please enter password if asked."; fi | ||
| if [ ! -f $OUT_TMP/etc/debian_version ]; then |
There was a problem hiding this comment.
Above, you are using "non-empty DISTRO_VERSION is Ubuntu" but here, you're relying on debian_version for the same. Lets keep it consistent?
Also, can we instead do something like "check for the word ubuntu in the $MIRROR", and if so then its ubuntu? That's much less fragile to me than the other methods. What do you think?
| # Some reason debootstrap leaves these mounted | ||
| $root umount $OUT_TMP/proc/sys/fs/binfmt_misc || true | ||
| $root umount $OUT_TMP/proc || true | ||
| else |
There was a problem hiding this comment.
Since these if/else blocks are so huge, I suggest split them into 2 different functions. Maybe do_debian and do_ubuntu and then call them from the if/else.
buildstrap
Outdated
| FILE=pool/universe/s/scapy/python-scapy_2.4.0-1_all.deb | ||
| echo "Fetching ${MIRROR}${FILE}..."; echo "" | ||
| curl -L ${MIRROR}${FILE} --output $TDIR/`basename $FILE` | ||
| $root dpkg-deb -x $TDIR/`basename $FILE` $OUT_TMP; fi |
There was a problem hiding this comment.
I prefer package specific changes/scripts go into their package files into the packages/ directory. Probably they can be functions that are called and that follow a naming convention like do_<package-name>_post() ? So the python specific one would be called, do_python2_post(). If they are undefined for a package, then we do nothing.
I really don't want package specific things in buildstrap.
b42fa75 to
ab376b8
Compare
|
Could you take a look at the comments and rebase on tip? |
Support Ubuntu 18.04 "Bionic" in addition to Debian Buster. Add support for armhf, amd64 and i386 architectures. Signed-off-by: Alistair Strachan <astrachan@google.com>
Instead of running the whole buildstrap script with sudo, have each command requiring sudo rights run with the $root prefix. This is preparatory work for introducing support for 'fakeroot'. Signed-off-by: Alistair Strachan <astrachan@google.com>
Support using 'debootstrap --foreign' instead of qemu-debootstrap and eliminate all use of sudo. Use fakeroot to preserve permissions in the output filesystem. The finalization of the debootstrap is done on the device side. This change enables the use of distributions which are not compatible with the distribution debootstrap is being run on (normally not a supported configuration by debootstrap without --foreign), including alternative architecture and, more importantly, different glibc versions. Signed-off-by: Alistair Strachan <astrachan@google.com>
|
This is a bit obsoleted now, things have changed much. Would it be possible for you to rebase if Ubuntu support is still needed? |
The first three changes are probably useful, the fourth change is just fyi, the fifth change needs a bit of work. The whole series lets me build an androdeb installation based on Ubuntu Bionic for amd64, pushed to a cuttlefish x86 build, running the AOSP kernel/tests net_tests.