|
a |
|
b/trunk/wharfie/qemu/Wharfile |
|
|
1 |
# Copyright 2018 Ingo Hornberger <ingo_@gmx.net> |
|
|
2 |
# |
|
|
3 |
# This software is licensed under the MIT License |
|
|
4 |
# |
|
|
5 |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this |
|
|
6 |
# software and associated documentation files (the "Software"), to deal in the Software |
|
|
7 |
# without restriction, including without limitation the rights to use, copy, modify, |
|
|
8 |
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to |
|
|
9 |
# permit persons to whom the Software is furnished to do so, subject to the following |
|
|
10 |
# conditions: |
|
|
11 |
# |
|
|
12 |
# The above copyright notice and this permission notice shall be included in all copies |
|
|
13 |
# or substantial portions of the Software. |
|
|
14 |
# |
|
|
15 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
|
|
16 |
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
|
|
17 |
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
|
|
18 |
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
|
19 |
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
|
|
20 |
# OR OTHER DEALINGS IN THE SOFTWARE. |
|
|
21 |
# |
|
|
22 |
################################################################################ |
|
|
23 |
# |
|
|
24 |
# This Wharfile builds a Qemu image which is able to build any Wharfile w/o |
|
|
25 |
# special dependencies on the host. The goal is, that we can build on linux |
|
|
26 |
# as an ordinary user (w/o root priviledges) and that we are at all able to |
|
|
27 |
# build on windows. |
|
|
28 |
# |
|
|
29 |
# Why should one build an embedded root filesystem under windows? |
|
|
30 |
# |
|
|
31 |
# You should ask this question half of the Raspberry Pi users. They all want |
|
|
32 |
# to build special images (With Game Emulators, as a NAS, as a media server, ...), |
|
|
33 |
# but only few of them have a linux system at home to do this. So they are |
|
|
34 |
# usually configuring everything live on their Pi. Which is fun, but: |
|
|
35 |
# - messy |
|
|
36 |
# - not reproducable |
|
|
37 |
# - critical in legal terms |
|
|
38 |
# - an anoying task when parts of the system need to be updated |
|
|
39 |
# |
|
|
40 |
################################################################################ |
|
|
41 |
|
|
|
42 |
FROM debian_amd64_jessie |
|
|
43 |
|
|
|
44 |
RUN apt-get install -y sudo make binfmt-support qemu-user-static debootstrap kpartx tar bzip2 systemd-sysv net-tools isc-dhcp-client linux-image-amd64 wamerican psmisc |
|
|
45 |
|
|
|
46 |
# Add user 'wharfie' with password 'wharfie' for interactive login |
|
|
47 |
RUN useradd -ms /bin/bash wharfie; \ |
|
|
48 |
echo "wharfie:wharfie" | chpasswd; \ |
|
|
49 |
echo "root:root" | chpasswd; |
|
|
50 |
|
|
|
51 |
ADD files/wharfie.service /etc/systemd/system/wharfie.service |
|
|
52 |
ADD files/qemu_autorun.sh /usr/local/wharfie/qemu_autorun.sh |
|
|
53 |
RUN systemctl enable wharfie.service; \ |
|
|
54 |
systemctl set-default multi-user.target; |
|
|
55 |
|
|
|
56 |
RUN HOST cp -pR boot ../ |
|
|
57 |
|
|
|
58 |
RUN HOST ../qcow.sh ../qwharfie.qcow |