Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build image from Archlinux #6

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 66 additions & 9 deletions scripts/prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ then
fi

sane=true
archlinuxsane=false

distributor_id_sane="^Ubuntu$"
archlinux_id_sane="^Arch$"
release_sane="^14.04$"
codename_sane="^trusty$"
arch_sane="^amd64$"
Expand All @@ -75,10 +77,17 @@ case "${check_sanity}" in
distributor_id=`/usr/bin/lsb_release -s -i`
release=`/usr/bin/lsb_release -s -r`
codename=`/usr/bin/lsb_release -s -c`

if ! echo "${distributor_id}" | egrep -q "${distributor_id_sane}"; then
echo "WARNING: Distributor ID reported by lsb_release '${distributor_id}' not in '${distributor_id_sane}'" 1>&2
sane=false
sane=false
echo "Check if it is Archlinux"
if echo "${distributor_id}" | egrep -q "${archlinux_id_sane}"; then
echo "Distributor ID reported by lsb_release '${distributor_id}' in '${archlinux_id_sane}'" 1>&2
archlinuxsane=true
else
echo "Distributor not Arch" 1>&2
fi
fi

if ! echo "${release}" | egrep -q "${release_sane}"; then
Expand Down Expand Up @@ -114,7 +123,15 @@ case "${check_sanity}" in
false) ;;
esac

apt-get update
case "${archlinuxsane}" in
true)
echo 'pacman -Syu'
sudo pacman -Syu
;;
false)
apt-get update
;;
esac

# These are essential to pass OE sanity test
# locales, because utf8 is needed with newer bitbake which uses python3
Expand All @@ -135,6 +152,22 @@ essential="\
wget \
"

archlinux_essential="\
base-devel \
chrpath \
cpio \
diffstat \
gawk \
git \
iputils \
lsb-release \
python \
python2 \
python3 \
texinfo \
wget \
"

# bzip2, gzip, tar, zip are used by our scripts/build.sh
archivers="\
bzip2 \
Expand All @@ -151,11 +184,35 @@ extras="\
time \
"

apt-get install --yes \
${essential} \
${extras} \
${archivers} \
archlinux_extras="\
multilib-devel \
time \
"

locale-gen en_US.utf8
case "${archlinuxsane}" in
true)
sudo pacman -Syu \
${archlinux_essential} \
${archlinux_extras} \
${archivers} \

echo 'WARNING: Make sure that locale en_US.utf8 is generated. Link: https://wiki.archlinux.org/index.php/locale#Generating_locales' 1>&2
echo 'WARNING: Make sure that you are using Python2: sudo ln -sf /bin/python2 /bin/python' 1>&2
;;
false)
apt-get install --yes \
${essential} \
${extras} \
${archivers} \
locale-gen en_US.utf8
;;
esac

echo $version > $statusfile
case "${archlinuxsane}" in
true)
sudo sh -c "echo $version > $statusfile"
;;
false)
echo $version > $statusfile
;;
esac