~bzoltan/ubuntu-sdk-api-15.04/trunk

« back to all changes in this revision

Viewing changes to sdk-api-tool

  • Committer: Zoltán Balogh
  • Date: 2015-09-01 10:49:53 UTC
  • Revision ID: zoltan@bakter.hu-20150901104953-hnawkhe09r2kakt0
final fixes before test release

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        mkdir -p ${DIRECTORY}/${STATIC_CHROOT_NAME}/run/shm
77
77
        mount -o bind /run/shm ${DIRECTORY}/${STATIC_CHROOT_NAME}/run/shm
78
78
        pushd "${DIRECTORY}/${STATIC_CHROOT_NAME}/etc" 1>&2>/dev/null
79
 
                mv passwd passwd- 2&>1 >/dev/null
 
79
                mv passwd passwd- 2&>1>/dev/null
80
80
                cp /etc/passwd ./
81
 
                mv shadow shadow- 2&>1 >/dev/null
 
81
                mv shadow shadow- 2&>1>/dev/null
82
82
                cp /etc/shadow ./
83
 
                mv group group- 2&>1 >/dev/null
 
83
                mv group group- 2&>1>/dev/null
84
84
                cp /etc/group ./
85
 
                mv gshadow gshadow- 2&>1 >/dev/null
 
85
                mv gshadow gshadow- 2&>1>/dev/null
86
86
                cp /etc/gshadow ./
87
 
                mv services  services- 2&>1 >/dev/null
 
87
                mv services  services- 2&>1>/dev/null
88
88
                cp /etc/services ./
89
 
                mv protocols protocols- 2&>1 >/dev/null
 
89
                mv protocols protocols- 2&>1>/dev/null
90
90
                cp /etc/protocols ./
91
 
                mv networks networks- 2&>1 >/dev/null
 
91
                mv networks networks- 2&>1>/dev/null
92
92
                cp /etc/networks ./
93
 
                mv hosts hosts- 2&>1 >/dev/null
 
93
                mv hosts hosts- 2&>1>/dev/null
94
94
                cp /etc/hosts ./
95
 
                mv resolv.conf resolv.conf- 2&>1 >/dev/null
 
95
                mv resolv.conf resolv.conf- 2&>1>/dev/null
96
96
                cp /etc/resolv.conf ./
97
 
                mv etc/apt/apt.conf etc/apt/apt.conf-  2&>1 >/dev/null
 
97
                mv etc/apt/apt.conf etc/apt/apt.conf-  2&>1>/dev/null
98
98
                if [[ ! -z $HTTP_PROXY_HOST ]]; then
99
99
                echo $HTTP_PROXY_HOST:$HTTP_PROXY_PORT
100
100
                        sudo tee -a /etc/apt/apt.conf <<EOF
101
101
Acquire::http::proxy "http://$HTTP_PROXY_HOST:$HTTP_PROXY_PORT/";
102
102
EOF
103
103
        fi
104
 
        popd >/dev/null
 
104
        popd 2&>1>/dev/null
105
105
}
106
106
 
107
107
# Umount the mount points of the chroot and restore the default syste files
109
109
        echo_log "Decouple the ${STATIC_CHROOT_NAME} chroot from the host system"
110
110
        for MOUNT_POINT in $(mount|egrep ${STATIC_CHROOT_NAME}|awk '{print $3}')
111
111
        do 
112
 
                umount -fl $MOUNT_POINT  2> /dev/null
 
112
                umount -fl $MOUNT_POINT  2>/dev/null
113
113
        done
114
 
        pushd "${DIRECTORY}/${STATIC_CHROOT_NAME}/etc" 2>/dev/null
115
 
                mv passwd- passwd 2>/dev/null
116
 
                mv shadow- shadow 2>/dev/null
117
 
                mv group- group 2>/dev/null
118
 
                mv gshadow- gshadow 2>/dev/null
119
 
                mv services-  services 2>/dev/null
120
 
                mv protocols- protocols 2>/dev/null
121
 
                mv networks- networks 2>/dev/null
122
 
                mv hosts- hosts 2>/dev/null
123
 
                mv resolv.conf- resolv.conf 2>/dev/null
124
 
                mv /etc/apt/apt.conf- /etc/apt/apt.conf 2>/dev/null
125
 
        popd 2>/dev/null
 
114
        pushd "${DIRECTORY}/${STATIC_CHROOT_NAME}/etc" 1>&2>/dev/null
 
115
                mv passwd- passwd 1>&2>/dev/null
 
116
                mv shadow- shadow 1>&2>/dev/null
 
117
                mv group- group 1>&2>/dev/null
 
118
                mv gshadow- gshadow 1>&2>/dev/null
 
119
                mv services-  services 1>&2>/dev/null
 
120
                mv protocols- protocols 1>&2>/dev/null
 
121
                mv networks- networks 1>&2>/dev/null
 
122
                mv hosts- hosts 1>&2>/dev/null
 
123
                mv resolv.conf- resolv.conf 1>&2>/dev/null
 
124
                mv /etc/apt/apt.conf- /etc/apt/apt.conf 1>&2>/dev/null
 
125
        popd 1>&2>/dev/null
126
126
}
127
127
 
128
128
# Install the SDK packages to the core chroot and enable development
214
214
                mv ${SCHROOT_CHROOT_PATH}/${STATIC_CHROOT_NAME} ${SCHROOT_CHROOT_PATH}/backup-`date +"%Y%m%d%H%M%S"`-${STATIC_CHROOT_NAME}
215
215
                rm /etc/schroot/chroot.d/${STATIC_CHROOT_NAME}
216
216
        else
217
 
                fatal_failure "Removing ${STATIC_CHROOT_NAME}"
 
217
                echo_log "${SCHROOT_CHROOT_PATH}/${STATIC_CHROOT_NAME} does not exist"
218
218
        fi
219
219
        exit 0
220
220
}
283
283
STATIC_CHROOT_NAME="click-${FRAMEWORK}-${TARGET_ARCH}"
284
284
 
285
285
echo_log "\e[0m-- Settings -- "
286
 
echo_log " Create image:\t \e[31m${CREATE_STATIC_IMAGE}\e[0m"
287
286
echo_log " Framework:\t \e[31m${FRAMEWORK}\e[0m"
288
287
echo_log " Target arch:\t \e[31m${TARGET_ARCH}\e[0m"
289
288
echo_log " Local arch:\t \e[31m${ARCH_TYPE}\e[0m"
 
289
echo_log " Create image:\t \e[31m${CREATE_STATIC_IMAGE}\e[0m"
290
290
echo_log " Downloading:\t \e[31m${DOWNLOAD_IMAGE}\e[0m"
291
291
echo_log " Use image:\t \e[31m${USE_READY_IMAGE}\e[0m"
 
292
echo_log " Remove chroot:\t \e[31m${REMOVE_TARGET}\e[0m"
292
293
echo_log " Chroot name:\t \e[31m${STATIC_CHROOT_NAME}\e[0m"
293
294
echo_log " Chroot path:\t \e[31m${SCHROOT_CHROOT_PATH}\e[0m"
294
295
echo_log "------------- "
295
296
 
296
 
 
297
297
if [[ ${REMOVE_TARGET} == true ]]; then
298
298
        remove_schroot
299
299
        exit 0