Skip to content
Snippets Groups Projects
Commit fdc2f773 authored by Bourdel Laurent's avatar Bourdel Laurent
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
*.o
*.o.cmd
*.o.d
.ko
*~
zImage
u-boot
u-boot.bin
u-boot-spl
u-boot-spl.bin
*.depend
README.md 0 → 100644
Source Package for Embedded Linux Lab
Command line instructions
1/ Create your GitLab INSA account
https://gitlab.insa-rennes.fr/
Ask Teacher to add you member of group EmbeddedLinux_UDOO-NEO with Maintainer rights
2/ Create your Repo on GitLab INSA
"New Project" button
Choose group "EmbeddedLinux_Group" (drop down menu Project path)
Name Project like "4CDTI-P2020-<YourName>-LabUdooNeo"
Add your co-worker as developer role (Settings/Menbers)
3/ Create SSH keys for rights access on GitLab INSA account
Open terminal windows on your VM
cmdline : ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
Display your public key : cat ~/.ssh/id_rsa.pub
Copy text and paste it to GitLAB INSA (Profile/Settings/SSH keys)
Zip .ssh folder and send by mail yours keys for future use
4/ Config your git ID
git config --global user.name "Name SurName"
git config --global user.email "surname.name@insa-rennes.fr"
(info stored in ~/.gitconfig)
5/ Clone Teacher Repo
In terminal window, clone repo in your home
git clone ssh://git@gitlab.insa-rennes.fr:16022/EmbeddedLinux_Group/EmbeddedLinux_UDOO-NEO.git
Go inside folder created : cd EmbeddedLinux_UDOO-NEO
8/ Config origin & remote repo
...
9/ Check modification on your local repo (cd /H/STM32_Peripheral_LAB/MyGitWorkingRepo/)
git status
10/ Submit your LAB codes (cd /H/STM32_Peripheral_LAB/MyGitWorkingFolder)
git add .
git status
11/ Commit your modification when needed
git commit -a -m "message to explain commit content"
or git commit -a
(vim command : 'i' to insert, 'ESC' to leave edit mode, ':wq' to save commit message)
12/ Config & Push your modification on GitLab server
git remote -v
git remote add origin (votre_repo)
git push origin master
13/ Check on GitLab server "new activity"
14/ If Teacher updated repo,
get modification's historical from remote repo : git fetch origin master
check modifications by : git diff --name-only master origin/master
update (merge) modif by : git pull origin master
!!! Well Done !!!
Command line instructions
Git global setup
git config --global user.name "Bourdel Laurent"
git config --global user.email "laurent.bourdel@insa-rennes.fr"
Create a new repository
git clone ssh://git@gitlab.insa-rennes.fr:16022/Laurent.Bourdel/EmbeddedLinux_UDOO-NEO.git
cd EmbeddedLinux_UDOO-NEO
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Existing folder
cd existing_folder
git init
git remote add origin ssh://git@gitlab.insa-rennes.fr:16022/Laurent.Bourdel/EmbeddedLinux_UDOO-NEO.git
git add .
git commit -m "Initial commit"
git push -u origin master
Existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin ssh://git@gitlab.insa-rennes.fr:16022/Laurent.Bourdel/EmbeddedLinux_UDOO-NEO.git
git push -u origin --all
git push -u origin --tags
CC_ARM=arm-linux-gnueabihf-gcc
CC_INTEL=gcc
CFLAGS_ARM=-Wall -pedantic -I /home/user/UdooSept2018/dev/2-CompressTool/zlib-1.2.3
LDFLAGS_ARM=-dynamic -lz
CFLAGS_INTEL=-Wall
LDFLAGS_INTEL=-dynamic -lz
EXEC=zlib_util
EXEC_ARM=arm-$(EXEC)
EXEC_INTEL=i386-$(EXEC)
all: $(EXEC_INTEL) $(EXEC_ARM)
$(EXEC_ARM): $(EXEC)_arm.o
$(CC_ARM) $^ -o $@ $(LDFLAGS_ARM)
$(EXEC_INTEL): $(EXEC)_i386.o
$(CC_INTEL) $^ -o $@ $(LDFLAGS_INTEL)
%_arm.o: %.c
$(CC_ARM) -c $(CFLAGS_ARM) $< -o $@
%_i386.o: %.c
$(CC_INTEL) -c $(CFLAGS_INTEL) $< -o $@
clean :
rm -f *.o *~ *.s
rm -f $(EXEC_ARM) $(EXEC_INTEL)
File added
File added
File added
#include <stdio.h>
/* For "exit". */
#include <stdlib.h>
/* For "strerror". */
#include <string.h>
/* For "errno". */
#include <errno.h>
#include <zlib.h>
/* CHUNK is the size of the memory chunk used by the zlib routines. */
#define CHUNK 0x4000
/* The following macro calls a zlib routine and checks the return
value. If the return value ("status") is not OK, it prints an error
message and exits the program. Zlib's error statuses are all less
than zero. */
#define CALL_ZLIB(x) { \
int status; \
status = x; \
if (status < 0) { \
fprintf (stderr, \
"%s:%d: %s returned a bad status of %d.\n", \
__FILE__, __LINE__, #x, status); \
exit (EXIT_FAILURE); \
} \
}
/* if "test" is true, print an error message and halt execution. */
#define FAIL(test,message) { \
if (test) { \
inflateEnd (& strm); \
fprintf (stderr, "%s:%d: " message \
" file '%s' failed: %s\n", \
__FILE__, __LINE__, file_name, \
strerror (errno)); \
exit (EXIT_FAILURE); \
} \
}
/* These are parameters to inflateInit2. See
http://zlib.net/manual.html for the exact meanings. */
#define windowBits 15
#define ENABLE_ZLIB_GZIP 32
int main ()
{
const char * file_name = "test.gz";
FILE * file;
z_stream strm = {0};
unsigned char in[CHUNK];
unsigned char out[CHUNK];
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.next_in = in;
strm.avail_in = 0;
CALL_ZLIB (inflateInit2 (& strm, windowBits | ENABLE_ZLIB_GZIP));
/* Open the file. */
file = fopen (file_name, "rb");
FAIL (! file, "open");
while (1) {
int bytes_read;
int zlib_status;
bytes_read = fread (in, sizeof (char), sizeof (in), file);
FAIL (ferror (file), "read");
strm.avail_in = bytes_read;
strm.next_in = in;
do {
unsigned have;
strm.avail_out = CHUNK;
strm.next_out = out;
zlib_status = inflate (& strm, Z_NO_FLUSH);
switch (zlib_status) {
case Z_OK:
case Z_STREAM_END:
case Z_BUF_ERROR:
break;
default:
inflateEnd (& strm);
fprintf (stderr, "Gzip error %d in '%s'.\n",
zlib_status, file_name);
return -1;
}
have = CHUNK - strm.avail_out;
fwrite (out, sizeof (unsigned char), have, stdout);
}
while (strm.avail_out == 0);
if (feof (file)) {
inflateEnd (& strm);
break;
}
}
FAIL (fclose (file), "close");
return 0;
}
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment