Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Thursday, September 05, 2024

Debian 12.7 Release

Debian 12.7 Release

New release of Debian 12.7 at the end of August 2024. It says there are some security improvement.

Do I need to reinstall to upgrade? No, just update will do.

Do I need to dist-upgrade? No, just update will do.

You can use apt-get, aptitude or nala or any other debian software package manager.

eg.
$ sudo apt update && sudo apt upgrade

Check your version:

$ cat /etc/debian_version
12.7

Thursday, August 15, 2024

Why I use Debian Linux

Why I use Debian Linux

There are so many Linux distributions, you can choose the one which suits you most.

I have tried so many Linux distributions before, from Red Hat to Ubuntu. Finally I settled down with Debian. Ubuntu is based on Debian, Raspberry Pi Desktop is based on Debian, the Chrome OS Linux VM is a Debian.

I am already getting used to Debian. Debian has a lot of pre-compiled packages, available in many architecture platforms like x86 32 bits, 64 bits and ARM. Even Docker provides an easy way to install on Debian.

The installation process is easy as well. For commercial usage, user may choose Red Hat or Ubuntu, but for beginners, I will recommend Debian.

Thursday, July 11, 2024

Easy Install Docker On Debian 64 bit

Easy Install Docker On Debian 64 bit

This is using command line.

Easy way (Debian)

I found an easy way to install Docker on Debian 64 bit (arm64 and amd64). I just tested on Debian 12 Bookworm, didn't try on Arm platform. If you fail, may be Docker didn't provide the binary of your platform, for example Debian 32 bit.

$ apt update
$ apt upgrade
## need curl and apt-utils
$ curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
$ docker -v
⇒ version 27

Test Docker
$ sudo docker run hello-world ## docker need root
⇒ Hello from Docker!
If you see the Hello message, it is working.

macOS (Homebrew + Docker Desktop)

Homebrew only install the docker (client), you need a Docker daemon). Docker Desktop can start the Docker daemon. Docker Desktop is available for download, available in macOS, Windows and Linux platform.

$ brew install docker docker-compose
$ sudo docker run hello-world ## to test

You can use Colima (lima) + qemu to replace the Docker Desktop, it works.

Friday, June 21, 2024

Docker is good for ...

Docker is good for testing and production

Docker is a lightweight container, is small, fast and secure. Docker is easy to use (should be easy to setup as well).

Docker is good for testing and deploying. For sample, you want to test your application on Red Hat Linux. You don't want to install another machine, so your test it on Docker. For sure I prefer to test it on Alpine than Red Hat.

Friday, October 06, 2023

Upgrade Raspberry Pi Desktop 2022 to Debian 12

Upgrade Raspberry Pi Desktop 2022 to Debian 12



Much older Rpi Desktop

The reason I want to upgrade the Raspberry Pi Desktop to Debian 12 Bookworm is just to try out the new Linux kernel 6. The older kernel 5, released in 2019, is about 3-4 years old.

The upgrade takes me around 4 hours on my (older) machine. After upgrading, a lot of the Raspberry Pi Desktop settings were changed, and seems slower at the first glance. My advice is not to upgrade until the official release is out for Raspberry Pi Desktop OS.

How to upgrade?

Change the APT source from Bullseye (version 11) to Bookworm (12). Bullseye and bookworm are the code name for the Debian OS version.

  
# edit /etc/apt/sources.list /etc/apt/sources.list.d/raspi.list
eg. deb http://deb.debian.org/debian bookworm main contrib non-free

Wednesday, May 16, 2018

Compile Raspberry Pi Desktop Linux Kernel

Compile Raspberry Pi Desktop Linux Kernel



What is Raspberry Pi Desktop? Raspberry Pi Desktop is Raspbian OS, a Debian Linux specially made for Raspberry Pi. The desktop version is a port on x86, made it a lightweight desktop OS. (Note: RPi is an ARM platform)

Since RPi Desktop is Linux. This is a simple tutorial on how to compile Linux kernel.
There are many reasons why you need to recompile the linux kernel, but before you compile, you should know that recompile kernel need a lot of hard disk space (10Gb) and long waiting time (4 hours, depends on the machines).

1. Prerequisites to compile kernel
1b. Update firmware
2. Download the source
3. Kernel configuration
4. compile
5. install

Prerequisites



# apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc


Update firmware



# rpi-update (update firmware and kernel source?)


Download kernel source


Original Linux kernel from http://kernel.org/, Raspbian kernel source can be git clone from git://github.com/raspberrypi/linux.git. The clone size (with history) is quite large (about 3-4Gb), to save time and disk space use shallow clone (git 1.7 or above).

$ cd /usr/src
# git clone --depth 1 git://github.com/raspberrypi/linux.git (about 1.5Gb)
(The version I get 4.14.37.)
# cd linux; make nconfig
(or you can use the old # make menuconfig)

Configuration


The is the most difficult part, different machine, different user may need different configuration. The configuration will be save as .config file. There is a copy of the kernel config in /boot/config-. Can use it as a reference.
There are few thousands of items to be configured, I don't know all of them.
Compile
After configuration.

# make bzImage
# make modules
# make modules_install

(This will take a long time, may be 2-6 hours)

Installation


# make install

This will copy the kernel image to /boot directory, create the initrd image and update grub bootloader.
After this you can reboot, see if you can boot the new kernel successfully.

Saturday, March 08, 2014

Tutorial Simple makefile and automake

This tutorial is to help beginners a quick start on Makefile and automake.

Introduction

Before we started using makefile, this is how we compile program every time after we changed the program:

$ vi hello.c
#include
int main()
{
printf("Hello, world!\n");
return 0;
}

$ cc hello.c -o hello

If you have more than 1 source file:

$ cc hello.c foo.c bar.c -o hello

If you have some compiler parameter:

$ gcc -Wall -g -O2 hello.c foo.c bar.c -o hello

You get what I mean. Even with the help of readline (with doskey like) function, compilation will be a pain. When your project is getting complicated, you need makefile to help you to do the job.

Makefile

This is how a simple Makefile looks like:

$ vi Makefile
# This is a simple makefile

Program = hello

all: $(Program)

hello:
    cc hello.c -o hello

$ make [-f Makefile]

cc hello.c -o hello

Makefile is collection of rules. The rule looks like this:

target: dependencies
[tab] system command

The white space before the command is tab. If you encounter error *** missing separator. Stop. Change the white space to tab before the command.

When you type make command. The make program look for all: target, which depends on hello. If the file hello is not there or out dated, the command for target hello will be executed.

Note:
There are more features for Makefile like implicit rules and internal macros, but not cover here.

Automake

Different unix system may use a different C compile, different parameter option for the compiler. For example, gcc has a -Wall option but Sun Workshop C compiler don't have -Wall option.

The Free Software Foundation (FSF) created an automake software tools to generated Makefile on different unix system. The configure script which will detect the system setting and generate the Makefile accordingly.

How to generate configure script?

Step 1:
Crete these 2 files:
1. configure.ac
2. Makefile.am

To generate configure.ac
autoscan -> configure.scan -> configure.ac

$ autoscan; mv -i configure.scan configure.ac
$ vi configure.ac
AC_INIT([helloworld], [1.0.0])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([hello.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

Note:
If you are using configure.in, it is old. The new version use configure.ac.
If system complain no config.h.in. Just create 1. $ touch config.h.in

$ vi Makefile.am
bin_PROGRAMS = hello
hello_SOURCES = hello.c

Step 2:
Before you continue further, make sure you have automake and autoconf software installed.

$ aclocal
$ autoconf
$ automake --add-missing --copy --include-deps

Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found


The software should install the missing files. If it still complains some missing files, just create it manually. You might want to have your own COPYING and INSTALL file.

$ touch AUTHORS ChangeLog
$ automake --add-missing --copy --include-deps

$ ./configure

checking for a BSD-compatible install... /usr/local/bin/ginstall -c
...
config.status: creating Makefile


$ make

gcc -g -O2 -o hello hello.o


Automake is much more powerful that what I have shown you here. This is just to show you a very simple way to quick start a Makefile or automaker.

Monday, June 28, 2010

Nokia retire Symbian and prefer MeeGo

According to CNet, Nokia will dump Symbian and use MeeGo to compete with Apple iPhone and other smartphones.

Symbian is a smartphone OS, the symbian is back up by few major mobile player include Sony Ericsson and Nokia. Nokia acquired Symbian in year 2008 and release the Symbian OS as an open source platform.

As a user and a developer, I am worried on Nokia strategy. Is just 2 years time, Nokia has change from a strong supporter of Symbian, to abandon Symbian.

MeeGo is a Linux-base OS. It is a join effort of Nokia Maemo and Intel Moblin project. Nokia has explored on Linux since at least 5 years ago (the Nokia Internet Tablet 770). I am in doubt with Nokia Linux strategy too, how long it will last and how well it will be supported.

OpenHand (acquired by Intel), Maemo, Moblin, MeeGo are all Linux-base platform, the application may not be compatible on all these platform. Software developer may know how to port the application from one platform to the other, but as a user how easy I upgrade my mobile device to the later software platform?

May be the Nokia smartphone or internet table platform will became a hacker's only platform.