Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Add Ubuntu Base support, minimal python, python-scapy workaround#3

Open
adelva1984 wants to merge 3 commits intojoelagnel:masterfrom
adelva1984:master
Open

Add Ubuntu Base support, minimal python, python-scapy workaround#3
adelva1984 wants to merge 3 commits intojoelagnel:masterfrom
adelva1984:master

Conversation

@adelva1984
Copy link

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.

MIRROR=http://archive.ubuntu.com/ubuntu/
else
MIRROR=http://ports.ubuntu.com/; fi ;;
*) echo "Unusupported distro ($DISTRO)"; ;;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change to "Warning: Untested distro ($DISTRO)" ?

amd64) ;;
arm64) ;;
armhf) ;;
*) echo "Unsupported arch ($ARCH)"; ;;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@joelagnel joelagnel force-pushed the master branch 2 times, most recently from b42fa75 to ab376b8 Compare May 29, 2018 19:36
@joelagnel
Copy link
Owner

Could you take a look at the comments and rebase on tip?

Alistair Strachan added 3 commits July 17, 2018 12:49
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>
@joelagnel
Copy link
Owner

This is a bit obsoleted now, things have changed much. Would it be possible for you to rebase if Ubuntu support is still needed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants